{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-link/src/autolink.js","webpack:///./node_modules/@ckeditor/ckeditor5-link/src/link.js"],"names":["MIN_LINK_LENGTH_WITH_SPACE_AT_END","URL_REG_EXP","RegExp","URL_GROUP_IN_MATCH","AutoLink","_this","this","editor","selection","model","document","on","isEnabled","anchor","parent","is","_enableTypingHandling","_enableEnterHandling","_enableShiftEnterHandling","_this2","watcher","TextWatcher","text","isSingleSpaceAtTheEnd","url","getUrlAtTextEnd","substr","length","input","plugins","get","evt","data","batch","range","isInput","linkEnd","end","getShiftedBy","linkStart","linkRange","createRange","_applyAutoLink","bind","to","_this3","enterCommand","commands","position","getFirstPosition","previousSibling","rangeToCheck","createRangeIn","_checkAndApplyAutoLinkOnRange","_this4","shiftEnterCommand","createPositionAt","_getLastTextLine","getLastTextLine","link","_this5","isLinkAllowedOnRange","enqueueChange","writer","defaultProtocol","config","parsedUrl","addLinkProtocolIfApplicable","setAttribute","Plugin","match","exec","schema","checkAttributeInSelection","createSelection","Link","LinkEditing","LinkUI"],"mappings":"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","file":"js/chunk-2d0dd0b0.71069c1b.js","sourcesContent":["/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module link/autolink\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { TextWatcher, getLastTextLine } from 'ckeditor5/src/typing';\n\nimport { addLinkProtocolIfApplicable } from './utils';\n\nconst MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: \"t.co \" (length 5).\n\n// This was a tweak from https://gist.github.com/dperini/729294.\nconst URL_REG_EXP = new RegExp(\n\t// Group 1: Line start or after a space.\n\t'(^|\\\\s)' +\n\t// Group 2: Detected URL (or e-mail).\n\t'(' +\n\t\t// Protocol identifier or short syntax \"//\"\n\t\t// a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar\n\t\t'(' +\n\t\t\t'(?:(?:(?:https?|ftp):)?\\\\/\\\\/)' +\n\t\t\t// BasicAuth using user:pass (optional)\n\t\t\t'(?:\\\\S+(?::\\\\S*)?@)?' +\n\t\t\t'(?:' +\n\t\t\t\t// IP address dotted notation octets\n\t\t\t\t// excludes loopback network 0.0.0.0\n\t\t\t\t// excludes reserved space >= 224.0.0.0\n\t\t\t\t// excludes network & broadcast addresses\n\t\t\t\t// (first & last IP address of each class)\n\t\t\t\t'(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])' +\n\t\t\t\t'(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}' +\n\t\t\t\t'(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))' +\n\t\t\t\t'|' +\n\t\t\t\t'(' +\n\t\t\t\t\t// Do not allow `www.foo` - see https://github.com/ckeditor/ckeditor5/issues/8050.\n\t\t\t\t\t'((?!www\\\\.)|(www\\\\.))' +\n\t\t\t\t\t// Host & domain names.\n\t\t\t\t\t'(?![-_])(?:[-_a-z0-9\\\\u00a1-\\\\uffff]{1,63}\\\\.)+' +\n\t\t\t\t\t// TLD identifier name.\n\t\t\t\t\t'(?:[a-z\\\\u00a1-\\\\uffff]{2,63})' +\n\t\t\t\t')' +\n\t\t\t')' +\n\t\t\t// port number (optional)\n\t\t\t'(?::\\\\d{2,5})?' +\n\t\t\t// resource path (optional)\n\t\t\t'(?:[/?#]\\\\S*)?' +\n\t\t')' +\n\t\t'|' +\n\t\t// b. Short form (either www.example.com or example@example.com)\n\t\t'(' +\n\t\t\t'(www.|(\\\\S+@))' +\n\t\t\t// Host & domain names.\n\t\t\t'((?![-_])(?:[-_a-z0-9\\\\u00a1-\\\\uffff]{1,63}\\\\.))+' +\n\t\t\t// TLD identifier name.\n\t\t\t'(?:[a-z\\\\u00a1-\\\\uffff]{2,63})' +\n\t\t')' +\n\t')$', 'i' );\n\nconst URL_GROUP_IN_MATCH = 2;\n\n/**\n * The autolink plugin.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class AutoLink extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'AutoLink';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst selection = editor.model.document.selection;\n\n\t\tselection.on( 'change:range', () => {\n\t\t\t// Disable plugin when selection is inside a code block.\n\t\t\tthis.isEnabled = !selection.anchor.parent.is( 'element', 'codeBlock' );\n\t\t} );\n\n\t\tthis._enableTypingHandling();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tafterInit() {\n\t\tthis._enableEnterHandling();\n\t\tthis._enableShiftEnterHandling();\n\t}\n\n\t/**\n\t * Enables autolinking on typing.\n\t *\n\t * @private\n\t */\n\t_enableTypingHandling() {\n\t\tconst editor = this.editor;\n\n\t\tconst watcher = new TextWatcher( editor.model, text => {\n\t\t\t// 1. Detect Space after a text with a potential link.\n\t\t\tif ( !isSingleSpaceAtTheEnd( text ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// 2. Check text before last typed Space.\n\t\t\tconst url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );\n\n\t\t\tif ( url ) {\n\t\t\t\treturn { url };\n\t\t\t}\n\t\t} );\n\n\t\tconst input = editor.plugins.get( 'Input' );\n\n\t\twatcher.on( 'matched:data', ( evt, data ) => {\n\t\t\tconst { batch, range, url } = data;\n\n\t\t\tif ( !input.isInput( batch ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst linkEnd = range.end.getShiftedBy( -1 ); // Executed after a space character.\n\t\t\tconst linkStart = linkEnd.getShiftedBy( -url.length );\n\n\t\t\tconst linkRange = editor.model.createRange( linkStart, linkEnd );\n\n\t\t\tthis._applyAutoLink( url, linkRange );\n\t\t} );\n\n\t\twatcher.bind( 'isEnabled' ).to( this );\n\t}\n\n\t/**\n\t * Enables autolinking on the Enter key.\n\t *\n\t * @private\n\t */\n\t_enableEnterHandling() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\t\tconst enterCommand = editor.commands.get( 'enter' );\n\n\t\tif ( !enterCommand ) {\n\t\t\treturn;\n\t\t}\n\n\t\tenterCommand.on( 'execute', () => {\n\t\t\tconst position = model.document.selection.getFirstPosition();\n\n\t\t\tif ( !position.parent.previousSibling ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rangeToCheck = model.createRangeIn( position.parent.previousSibling );\n\n\t\t\tthis._checkAndApplyAutoLinkOnRange( rangeToCheck );\n\t\t} );\n\t}\n\n\t/**\n\t * Enables autolinking on the Shift+Enter keyboard shortcut.\n\t *\n\t * @private\n\t */\n\t_enableShiftEnterHandling() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\n\t\tconst shiftEnterCommand = editor.commands.get( 'shiftEnter' );\n\n\t\tif ( !shiftEnterCommand ) {\n\t\t\treturn;\n\t\t}\n\n\t\tshiftEnterCommand.on( 'execute', () => {\n\t\t\tconst position = model.document.selection.getFirstPosition();\n\n\t\t\tconst rangeToCheck = model.createRange(\n\t\t\t\tmodel.createPositionAt( position.parent, 0 ),\n\t\t\t\tposition.getShiftedBy( -1 )\n\t\t\t);\n\n\t\t\tthis._checkAndApplyAutoLinkOnRange( rangeToCheck );\n\t\t} );\n\t}\n\n\t/**\n\t * Checks if the passed range contains a linkable text.\n\t *\n\t * @param {module:engine/model/range~Range} rangeToCheck\n\t * @private\n\t */\n\t_checkAndApplyAutoLinkOnRange( rangeToCheck ) {\n\t\tconst model = this.editor.model;\n\t\tconst { text, range } = getLastTextLine( rangeToCheck, model );\n\n\t\tconst url = getUrlAtTextEnd( text );\n\n\t\tif ( url ) {\n\t\t\tconst linkRange = model.createRange(\n\t\t\t\trange.end.getShiftedBy( -url.length ),\n\t\t\t\trange.end\n\t\t\t);\n\n\t\t\tthis._applyAutoLink( url, linkRange );\n\t\t}\n\t}\n\n\t/**\n\t * Applies a link on a given range.\n\t *\n\t * @param {String} url The URL to link.\n\t * @param {module:engine/model/range~Range} range The text range to apply the link attribute to.\n\t * @private\n\t */\n\t_applyAutoLink( link, range ) {\n\t\tconst model = this.editor.model;\n\n\t\tif ( !this.isEnabled || !isLinkAllowedOnRange( range, model ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Enqueue change to make undo step.\n\t\tmodel.enqueueChange( writer => {\n\t\t\tconst defaultProtocol = this.editor.config.get( 'link.defaultProtocol' );\n\t\t\tconst parsedUrl = addLinkProtocolIfApplicable( link, defaultProtocol );\n\t\t\twriter.setAttribute( 'linkHref', parsedUrl, range );\n\t\t} );\n\t}\n}\n\n// Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.\nfunction isSingleSpaceAtTheEnd( text ) {\n\treturn text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[ text.length - 1 ] === ' ' && text[ text.length - 2 ] !== ' ';\n}\n\nfunction getUrlAtTextEnd( text ) {\n\tconst match = URL_REG_EXP.exec( text );\n\n\treturn match ? match[ URL_GROUP_IN_MATCH ] : null;\n}\n\nfunction isLinkAllowedOnRange( range, model ) {\n\treturn model.schema.checkAttributeInSelection( model.createSelection( range ), 'linkHref' );\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module link/link\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport LinkEditing from './linkediting';\nimport LinkUI from './linkui';\nimport AutoLink from './autolink';\n\n/**\n * The link plugin.\n *\n * This is a \"glue\" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}\n * and {@link module:link/linkui~LinkUI link UI feature}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Link extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ LinkEditing, LinkUI, AutoLink ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'Link';\n\t}\n}\n\n/**\n * The configuration of the {@link module:link/link~Link} feature.\n *\n * Read more in {@link module:link/link~LinkConfig}.\n *\n * @member {module:link/link~LinkConfig} module:core/editor/editorconfig~EditorConfig#link\n */\n\n/**\n * The configuration of the {@link module:link/link~Link link feature}.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n * \t\t\t\tlink: ... // Link feature configuration.\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.\n * @interface LinkConfig\n */\n\n/**\n * When set, the editor will add the given protocol to the link when the user creates a link without one.\n * For example, when the user is creating a link and types `ckeditor.com` in the link form input, during link submission\n * the editor will automatically add the `http://` protocol, so the link will look as follows: `http://ckeditor.com`.\n *\n * The feature also provides email address auto-detection. When you submit `hello@example.com`,\n * the plugin will automatically change it to `mailto:hello@example.com`.\n *\n * \t\tClassicEditor\n *\t\t\t.create( editorElement, {\n * \t\t\t\tlink: {\n * \t\t\t\t\tdefaultProtocol: 'http://'\n * \t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * **NOTE:** If no configuration is provided, the editor will not auto-fix the links.\n *\n * @member {String} module:link/link~LinkConfig#defaultProtocol\n */\n\n/**\n * When set to `true`, the `target=\"blank\"` and `rel=\"noopener noreferrer\"` attributes are automatically added to all external links\n * in the editor. \"External links\" are all links in the editor content starting with `http`, `https`, or `//`.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\tlink: {\n *\t\t\t\t\taddTargetToExternalLinks: true\n *\t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator}\n * that extends all external links with the `target` and `rel` attributes.\n *\n * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated\n * {@link module:link/link~LinkDecoratorManualDefinition manual} decorator must be defined in the\n * {@link module:link/link~LinkConfig#decorators `config.link.decorators`} array. In such scenario,\n * the `config.link.addTargetToExternalLinks` option should remain `undefined` or `false` to not interfere with the manual decorator.\n *\n * It is possible to add other {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}\n * or {@link module:link/link~LinkDecoratorManualDefinition manual} link decorators when this option is active.\n *\n * More information about decorators can be found in the {@link module:link/link~LinkConfig#decorators decorators configuration}\n * reference.\n *\n * @default false\n * @member {Boolean} module:link/link~LinkConfig#addTargetToExternalLinks\n */\n\n/**\n * Decorators provide an easy way to configure and manage additional link attributes in the editor content. There are\n * two types of link decorators:\n *\n * * {@link module:link/link~LinkDecoratorAutomaticDefinition Automatic} – They match links against pre–defined rules and\n * manage their attributes based on the results.\n * * {@link module:link/link~LinkDecoratorManualDefinition Manual} – They allow users to control link attributes individually,\n * using the editor UI.\n *\n * Link decorators are defined as objects with key-value pairs, where the key is the name provided for a given decorator and the\n * value is the decorator definition.\n *\n * The name of the decorator also corresponds to the {@glink framework/guides/architecture/editing-engine#text-attributes text attribute}\n * in the model. For instance, the `isExternal` decorator below is represented as a `linkIsExternal` attribute in the model.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\tlink: {\n *\t\t\t\t\tdecorators: {\n *\t\t\t\t\t\tisExternal: {\n *\t\t\t\t\t\t\tmode: 'automatic',\n *\t\t\t\t\t\t\tcallback: url => url.startsWith( 'http://' ),\n *\t\t\t\t\t\t\tattributes: {\n *\t\t\t\t\t\t\t\ttarget: '_blank',\n *\t\t\t\t\t\t\t\trel: 'noopener noreferrer'\n *\t\t\t\t\t\t\t}\n *\t\t\t\t\t\t},\n *\t\t\t\t\t\tisDownloadable: {\n *\t\t\t\t\t\t\tmode: 'manual',\n *\t\t\t\t\t\t\tlabel: 'Downloadable',\n *\t\t\t\t\t\t\tattributes: {\n *\t\t\t\t\t\t\t\tdownload: 'file.png',\n *\t\t\t\t\t\t\t}\n *\t\t\t\t\t\t},\n *\t\t\t\t\t\t// ...\n *\t\t\t\t\t}\n *\t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * To learn more about the configuration syntax, check out the {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}\n * and {@link module:link/link~LinkDecoratorManualDefinition manual} decorator option reference.\n *\n * **Warning:** Currently, link decorators work independently of one another and no conflict resolution mechanism exists.\n * For example, configuring the `target` attribute using both an automatic and a manual decorator at the same time could end up with\n * quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute.\n *\n * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator\n * dedicated for that purpose which can be enabled by turning a single option on. Check out the\n * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}\n * configuration description to learn more.\n *\n * See also the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.\n *\n * @member {Object.} module:link/link~LinkConfig#decorators\n */\n\n/**\n * A link decorator definition. Two types implement this defition:\n *\n * * {@link module:link/link~LinkDecoratorManualDefinition}\n * * {@link module:link/link~LinkDecoratorAutomaticDefinition}\n *\n * Refer to their document for more information about available options or to the\n * {@glink features/link#custom-link-attributes-decorators link feature guide} for general information.\n *\n * @interface LinkDecoratorDefinition\n */\n\n/**\n * Link decorator type.\n *\n * Check out the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.\n *\n * @member {'manual'|'automatic'} module:link/link~LinkDecoratorDefinition#mode\n */\n\n/**\n * Describes an automatic {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type matches\n * all links in the editor content against a function that decides whether the link should receive a pre–defined set of attributes.\n *\n * It takes an object with key-value pairs of attributes and a callback function that must return a Boolean value based on the link's\n * `href` (URL). When the callback returns `true`, attributes are applied to the link.\n *\n * For example, to add the `target=\"_blank\"` attribute to all links in the editor starting with `http://`, the\n * configuration could look like this:\n *\n *\t\t{\n *\t\t\tmode: 'automatic',\n *\t\t\tcallback: url => url.startsWith( 'http://' ),\n *\t\t\tattributes: {\n *\t\t\t\ttarget: '_blank'\n *\t\t\t}\n *\t\t}\n *\n * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator\n * dedicated for that purpose that can be enabled by turning a single option on. Check out the\n * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}\n * configuration description to learn more.\n *\n * @typedef {Object} module:link/link~LinkDecoratorAutomaticDefinition\n * @property {'automatic'} mode Link decorator type. It is `'automatic'` for all automatic decorators.\n * @property {Function} callback Takes a `url` as a parameter and returns `true` if the `attributes` should be applied to the link.\n * @property {Object} [attributes] Key-value pairs used as link attributes added to the output during the\n * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.\n * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.\n * @property {Object} [styles] Key-value pairs used as link styles added to the output during the\n * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.\n * Styles should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.\n * @property {String|Array.} [classes] Class names used as link classes added to the output during the\n * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.\n * Classes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.\n */\n\n/**\n * Describes a manual {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type is represented in\n * the link feature's {@link module:link/linkui user interface} as a switch that the user can use to control the presence\n * of a predefined set of attributes.\n *\n * For instance, to allow the users to manually control the presence of the `target=\"_blank\"` and\n * `rel=\"noopener noreferrer\"` attributes on specific links, the decorator could look as follows:\n *\n *\t\t{\n *\t\t\tmode: 'manual',\n *\t\t\tlabel: 'Open in a new tab',\n *\t\t\tdefaultValue: true,\n *\t\t\tattributes: {\n *\t\t\t\ttarget: '_blank',\n *\t\t\t\trel: 'noopener noreferrer'\n *\t\t\t}\n *\t\t}\n *\n * @typedef {Object} module:link/link~LinkDecoratorManualDefinition\n * @property {'manual'} mode Link decorator type. It is `'manual'` for all manual decorators.\n * @property {String} label The label of the UI button that the user can use to control the presence of link attributes.\n * @property {Object} [attributes] Key-value pairs used as link attributes added to the output during the\n * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.\n * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.\n * @property {Object} [styles] Key-value pairs used as link styles added to the output during the\n * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.\n * Styles should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.\n * @property {String|Array.} [classes] Class names used as link classes added to the output during the\n * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.\n * Classes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.\n * @property {Boolean} [defaultValue] Controls whether the decorator is \"on\" by default.\n */\n"],"sourceRoot":""}