{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js"],"names":["NBSP_FILLER","domDocument","createTextNode","MARKED_NBSP_FILLER","span","createElement","dataset","ckeFiller","innerHTML","BR_FILLER","fillerBr","INLINE_FILLER_LENGTH","INLINE_FILLER","repeat","startsWithFiller","domNode","isText","data","substr","isInlineFiller","domText","length","getDataWithoutFiller","slice","injectQuirksHandling","view","document","on","jumpOverInlineFiller","priority","evt","keyCode","keyCodes","arrowleft","domSelection","domTarget","ownerDocument","defaultView","getSelection","rangeCount","getRangeAt","collapsed","domParent","startContainer","domOffset","startOffset","collapse","EmptyElement","name","attrs","children","_this","Object","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_4__","this","_super","call","_isAllowedInsideAttributeElement","getFillerOffset","type","arguments","undefined","index","nodes","Node","Array","from","CKEditorError","Element"],"mappings":"ybA6CaA,EAAc,SAAAC,GAAW,OAAIA,EAAYC,eAAgB,MAUzDC,EAAqB,SAAAF,GACjC,IAAMG,EAAOH,EAAYI,cAAe,QAIxC,OAHAD,EAAKE,QAAQC,WAAY,EACzBH,EAAKI,UAAY,IAEVJ,GAWKK,EAAY,SAAAR,GACxB,IAAMS,EAAWT,EAAYI,cAAe,MAG5C,OAFAK,EAASJ,QAAQC,WAAY,EAEtBG,GAMKC,EAAuB,EAOvBC,EAAgB,IAASC,OAAQF,GAavC,SAASG,EAAkBC,GACjC,OAAOC,eAAQD,IAAeA,EAAQE,KAAKC,OAAQ,EAAGP,KAA2BC,EAY3E,SAASO,EAAgBC,GAC/B,OAAOA,EAAQH,KAAKI,QAAUV,GAAwBG,EAAkBM,GAalE,SAASE,EAAsBF,GACrC,OAAKN,EAAkBM,GACfA,EAAQH,KAAKM,MAAOZ,GAEpBS,EAAQH,KAUV,SAASO,EAAsBC,GACrCA,EAAKC,SAASC,GAAI,WAAYC,GAAwBC,SAAU,QAIjE,SAASD,EAAsBE,EAAKb,GACnC,GAAKA,EAAKc,SAAWC,OAASC,UAAY,CACzC,IAAMC,EAAejB,EAAKkB,UAAUC,cAAcC,YAAYC,eAE9D,GAAgC,GAA3BJ,EAAaK,YAAmBL,EAAaM,WAAY,GAAIC,UAAY,CAC7E,IAAMC,EAAYR,EAAaM,WAAY,GAAIG,eACzCC,EAAYV,EAAaM,WAAY,GAAIK,YAE1C/B,EAAkB4B,IAAeE,GAAajC,GAClDuB,EAAaY,SAAUJ,EAAW;;;;OCvIjBK,6CAepB,SAAAA,EAAarB,EAAUsB,EAAMC,EAAOC,GAAW,IAAAC,EAAA,OAAAC,OAAAC,EAAA,KAAAD,CAAAE,KAAAP,GAC9CI,EAAAI,EAAAC,KAAAF,KAAO5B,EAAUsB,EAAMC,EAAOC,GAG9BC,EAAKM,kCAAmC,EAQxCN,EAAKO,gBAAkBA,EAZuBP,2CAyC/C,SAAIQ,GAAoB,IAAdX,EAAcY,UAAAvC,OAAA,QAAAwC,IAAAD,UAAA,GAAAA,UAAA,GAAP,KAChB,OAAMZ,EAMEA,IAASM,KAAKN,OACX,iBAATW,GAAoC,sBAATA,GAClB,YAATA,GAA+B,iBAATA,GAPP,iBAATA,GAAoC,sBAATA,GAExB,YAATA,GAA+B,iBAATA,GACb,SAATA,GAA4B,cAATA,8BAgBtB,SAAcG,EAAOC,GACpB,GAAKA,IAAWA,aAAiBC,QAAQC,MAAMC,KAAMH,GAAQ1C,OAAS,GAMrE,MAAM,IAAI8C,OACT,gCACEb,KAAMS,WAtF8BK,QA+F1C,SAASV,IACR,OAAO","file":"js/chunk-4af24e3c.d5a35ea6.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\nimport { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';\nimport isText from '@ckeditor/ckeditor5-utils/src/dom/istext';\n\n/**\n * Set of utilities related to handling block and inline fillers.\n *\n * Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all\n * empty elements which should be selectable with elements or characters called \"fillers\". Unfortunately there is no one\n * universal filler, this is why two types are uses:\n *\n * * Block filler is an element which fill block elements, like `

`. CKEditor uses `
` as a block filler during the editing,\n * as browsers do natively. So instead of an empty `

` there will be `


`. The advantage of block filler is that\n * it is transparent for the selection, so when the caret is before the `
` and user presses right arrow he will be\n * moved to the next paragraph, not after the `
`. The disadvantage is that it breaks a block, so it can not be used\n * in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `
` filler} can be replaced with any other\n * character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space} or\n * {@link module:engine/view/filler~MARKED_NBSP_FILLER marked non-breaking space}.\n *\n * * Inline filler is a filler which does not break a line of text, so it can be used inside the text, for instance in the empty\n * `` surrendered by text: `foobar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width\n * spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined\n * {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to\n * avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not\n * transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional\n * code is needed to handle the caret.\n *\n * Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the\n * view.\n *\n * @module engine/view/filler\n */\n\n/**\n * Non-breaking space filler creator. This function creates the ` ` text node.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~MARKED_NBSP_FILLER\n * @see module:engine/view/filler~BR_FILLER\n * @function\n */\nexport const NBSP_FILLER = domDocument => domDocument.createTextNode( '\\u00A0' );\n\n/**\n * Marked non-breaking space filler creator. This function creates the ` ` element.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~NBSP_FILLER\n * @see module:engine/view/filler~BR_FILLER\n * @function\n */\nexport const MARKED_NBSP_FILLER = domDocument => {\n\tconst span = domDocument.createElement( 'span' );\n\tspan.dataset.ckeFiller = true;\n\tspan.innerHTML = '\\u00A0';\n\n\treturn span;\n};\n\n/**\n * `
` filler creator. This function creates the `
` element.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~NBSP_FILLER\n * @see module:engine/view/filler~MARKED_NBSP_FILLER\n * @function\n */\nexport const BR_FILLER = domDocument => {\n\tconst fillerBr = domDocument.createElement( 'br' );\n\tfillerBr.dataset.ckeFiller = true;\n\n\treturn fillerBr;\n};\n\n/**\n * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.\n */\nexport const INLINE_FILLER_LENGTH = 7;\n\n/**\n * Inline filler which is a sequence of the word joiners.\n *\n * @type {String}\n */\nexport const INLINE_FILLER = '\\u2060'.repeat( INLINE_FILLER_LENGTH );\n\n/**\n * Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n *\n *\t\tstartsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true\n *\t\tstartsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true\n *\t\tstartsWithFiller( document.createTextNode( 'foo' ) ); // false\n *\t\tstartsWithFiller( document.createElement( 'p' ) ); // false\n *\n * @param {Node} domNode DOM node.\n * @returns {Boolean} True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function startsWithFiller( domNode ) {\n\treturn isText( domNode ) && ( domNode.data.substr( 0, INLINE_FILLER_LENGTH ) === INLINE_FILLER );\n}\n\n/**\n * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n *\n *\t\tisInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true\n *\t\tisInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false\n *\n * @param {Text} domText DOM text node.\n * @returns {Boolean} True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function isInlineFiller( domText ) {\n\treturn domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller( domText );\n}\n\n/**\n * Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,\n * if text node contains it.\n *\n *\t\tgetDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true\n *\t\tgetDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true\n *\n * @param {Text} domText DOM text node, possible with inline filler.\n * @returns {String} Data without filler.\n */\nexport function getDataWithoutFiller( domText ) {\n\tif ( startsWithFiller( domText ) ) {\n\t\treturn domText.data.slice( INLINE_FILLER_LENGTH );\n\t} else {\n\t\treturn domText.data;\n\t}\n}\n\n/**\n * Assign key observer which move cursor from the end of the inline filler to the beginning of it when\n * the left arrow is pressed, so the filler does not break navigation.\n *\n * @param {module:engine/view/view~View} view View controller instance we should inject quirks handling on.\n */\nexport function injectQuirksHandling( view ) {\n\tview.document.on( 'arrowKey', jumpOverInlineFiller, { priority: 'low' } );\n}\n\n// Move cursor from the end of the inline filler to the beginning of it when, so the filler does not break navigation.\nfunction jumpOverInlineFiller( evt, data ) {\n\tif ( data.keyCode == keyCodes.arrowleft ) {\n\t\tconst domSelection = data.domTarget.ownerDocument.defaultView.getSelection();\n\n\t\tif ( domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed ) {\n\t\t\tconst domParent = domSelection.getRangeAt( 0 ).startContainer;\n\t\t\tconst domOffset = domSelection.getRangeAt( 0 ).startOffset;\n\n\t\t\tif ( startsWithFiller( domParent ) && domOffset <= INLINE_FILLER_LENGTH ) {\n\t\t\t\tdomSelection.collapse( domParent, 0 );\n\t\t\t}\n\t\t}\n\t}\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 engine/view/emptyelement\n */\n\nimport Element from './element';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport Node from './node';\n\n/**\n * Empty element class. It is used to represent elements that cannot contain any child nodes (for example `` elements).\n *\n * To create a new empty element use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`} method.\n *\n * @extends module:engine/view/element~Element\n */\nexport default class EmptyElement extends Element {\n\t/**\n\t * Creates new instance of EmptyElement.\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,\n\t * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).\n\t *\n\t * @see module:engine/view/downcastwriter~DowncastWriter#createEmptyElement\n\t * @protected\n\t * @param {module:engine/view/document~Document} document The document instance to which this element belongs.\n\t * @param {String} name Node name.\n\t * @param {Object|Iterable} [attrs] Collection of attributes.\n\t * @param {module:engine/view/node~Node|Iterable.} [children]\n\t * A list of nodes to be inserted into created element.\n\t */\n\tconstructor( document, name, attrs, children ) {\n\t\tsuper( document, name, attrs, children );\n\n\t\t// Override the default of the base class.\n\t\tthis._isAllowedInsideAttributeElement = true;\n\n\t\t/**\n\t\t * Returns `null` because filler is not needed for EmptyElements.\n\t\t *\n\t\t * @method #getFillerOffset\n\t\t * @returns {null} Always returns null.\n\t\t */\n\t\tthis.getFillerOffset = getFillerOffset;\n\t}\n\n\t/**\n\t * Checks whether this object is of the given.\n\t *\n\t *\t\temptyElement.is( 'emptyElement' ); // -> true\n\t *\t\temptyElement.is( 'element' ); // -> true\n\t *\t\temptyElement.is( 'node' ); // -> true\n\t *\t\temptyElement.is( 'view:emptyElement' ); // -> true\n\t *\t\temptyElement.is( 'view:element' ); // -> true\n\t *\t\temptyElement.is( 'view:node' ); // -> true\n\t *\n\t *\t\temptyElement.is( 'model:element' ); // -> false\n\t *\t\temptyElement.is( 'documentFragment' ); // -> false\n\t *\n\t * Assuming that the object being checked is an empty element, you can also check its\n\t * {@link module:engine/view/emptyelement~EmptyElement#name name}:\n\t *\n\t *\t\temptyElement.is( 'element', 'img' ); // -> true if this is a img element\n\t *\t\temptyElement.is( 'emptyElement', 'img' ); // -> same as above\n\t *\t\ttext.is( 'element', 'img' ); -> false\n\t *\n\t * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.\n\t *\n\t * @param {String} type Type to check.\n\t * @param {String} [name] Element name.\n\t * @returns {Boolean}\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type === 'emptyElement' || type === 'view:emptyElement' ||\n\t\t\t\t// From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n\t\t\t\ttype === 'element' || type === 'view:element' ||\n\t\t\t\ttype === 'node' || type === 'view:node';\n\t\t} else {\n\t\t\treturn name === this.name && (\n\t\t\t\ttype === 'emptyElement' || type === 'view:emptyElement' ||\n\t\t\t\ttype === 'element' || type === 'view:element'\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Overrides {@link module:engine/view/element~Element#_insertChild} method.\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent\n\t * adding any child nodes to EmptyElement.\n\t *\n\t * @protected\n\t */\n\t_insertChild( index, nodes ) {\n\t\tif ( nodes && ( nodes instanceof Node || Array.from( nodes ).length > 0 ) ) {\n\t\t\t/**\n\t\t\t * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.\n\t\t\t *\n\t\t\t * @error view-emptyelement-cannot-add\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'view-emptyelement-cannot-add',\n\t\t\t\t[ this, nodes ]\n\t\t\t);\n\t\t}\n\t}\n}\n\n// Returns `null` because block filler is not needed for EmptyElements.\n//\n// @returns {null}\nfunction getFillerOffset() {\n\treturn null;\n}\n"],"sourceRoot":""}