{"version":3,"file":"ckeditor.js","sources":["webpack://ClassicEditor/ckeditor.js"],"sourcesContent":["/*!\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n(function(t){const e=t[\"zh\"]=t[\"zh\"]||{};e.dictionary=Object.assign(e.dictionary||{},{\"%0 of %1\":\"%0/%1\",\"Align cell text to the bottom\":\"向下對齊\",\"Align cell text to the center\":\"置中對齊\",\"Align cell text to the left\":\"靠左對齊\",\"Align cell text to the middle\":\"置中對齊\",\"Align cell text to the right\":\"靠右對齊\",\"Align cell text to the top\":\"向上對齊\",\"Align center\":\"置中對齊\",\"Align left\":\"靠左對齊\",\"Align right\":\"靠右對齊\",\"Align table to the left\":\"靠左對齊\",\"Align table to the right\":\"靠右對齊\",Alignment:\"對齊\",Aquamarine:\"淺綠色\",\"Austral sign\":\"\",\"back with leftwards arrow above\":\"\",Background:\"背景顏色\",Big:\"大\",\"Bitcoin sign\":\"\",Black:\"黑色\",\"Block quote\":\"段落引用\",Blue:\"藍色\",\"Blue marker\":\"藍色標記\",Bold:\"粗體\",Border:\"邊框\",\"Break text\":\"\",\"Bulleted List\":\"符號清單\",\"Bulleted list styles toolbar\":\"\",Cancel:\"取消\",\"Cedi sign\":\"\",\"Cell properties\":\"儲存格屬性\",\"Cent sign\":\"\",\"Center table\":\"置中對齊\",\"Centered image\":\"置中圖片\",\"Change image text alternative\":\"修改圖片的替代文字\",\"Character categories\":\"\",\"Choose heading\":\"選取標題\",Circle:\"\",\"Colon sign\":\"\",Color:\"文字顏色\",\"Color picker\":\"顏色選擇\",Column:\"欄\",\"Copyright sign\":\"\",\"Cruzeiro sign\":\"\",\"Currency sign\":\"\",Dashed:\"虛線\",Decimal:\"\",\"Decimal with leading zero\":\"\",\"Decrease indent\":\"減少縮排\",Default:\"預設\",\"Delete column\":\"刪除欄\",\"Delete row\":\"刪除列\",\"Dim grey\":\"淡灰色\",Dimensions:\"尺寸\",Disc:\"\",\"Document colors\":\"文件顏色\",\"Dollar sign\":\"\",\"Dong sign\":\"\",Dotted:\"點線\",Double:\"雙線\",\"Double dagger\":\"\",\"Double exclamation mark\":\"\",\"Double low-9 quotation mark\":\"\",\"Double question mark\":\"\",Downloadable:\"可下載\",\"downwards arrow to bar\":\"向下停止箭頭\",\"downwards dashed arrow\":\"向下虛線箭頭\",\"downwards double arrow\":\"向下雙箭頭\",\"Drachma sign\":\"\",\"Dropdown toolbar\":\"下拉選單\",\"Edit block\":\"編輯區塊\",\"Edit link\":\"編輯連結\",\"Editor toolbar\":\"編輯器工具\",\"end with leftwards arrow above\":\"\",\"Enter image caption\":\"輸入圖片說明\",\"Enter table caption\":\"\",\"Euro sign\":\"\",\"Euro-currency sign\":\"\",\"Exclamation question mark\":\"\",\"Font Background Color\":\"前景顏色\",\"Font Color\":\"字體顏色\",\"Font Family\":\"字型\",\"Font Size\":\"字體大小\",\"French franc sign\":\"\",\"Full size image\":\"完整尺寸圖片\",\"German penny sign\":\"\",Green:\"綠色\",\"Green marker\":\"綠色標記\",\"Green pen\":\"綠色筆\",Grey:\"灰色\",Groove:\"內凹線\",\"Guarani sign\":\"\",\"Header column\":\"標題欄\",\"Header row\":\"標題列\",Heading:\"標題\",\"Heading 1\":\"標題 1\",\"Heading 2\":\"標題 2\",\"Heading 3\":\"標題 3\",\"Heading 4\":\"標題 4\",\"Heading 5\":\"標題 5\",\"Heading 6\":\"標題 6\",Height:\"高度\",Highlight:\"高亮\",\"Horizontal ellipsis\":\"\",\"Horizontal line\":\"水平線\",\"Horizontal text alignment toolbar\":\"水平對齊\",\"Hryvnia sign\":\"\",Huge:\"特大\",\"Image resize list\":\"圖片縮放清單\",\"Image toolbar\":\"圖片工具\",\"image widget\":\"圖片小工具\",\"In line\":\"\",\"Increase indent\":\"增加縮排\",\"Indian rupee sign\":\"\",\"Insert column left\":\"插入左方欄\",\"Insert column right\":\"插入右方欄\",\"Insert image\":\"插入圖片\",\"Insert media\":\"插入影音\",\"Insert paragraph after block\":\"在這個區塊後面插入一個段落\",\"Insert paragraph before block\":\"在這個區塊前面插入一個段落\",\"Insert row above\":\"插入上方列\",\"Insert row below\":\"插入下方列\",\"Insert table\":\"插入表格\",Inset:\"內邊線\",\"Inverted exclamation mark\":\"\",\"Inverted question mark\":\"\",Italic:\"斜體\",Justify:\"左右對齊\",\"Justify cell text\":\"分散對齊\",\"Kip sign\":\"\",\"Left aligned image\":\"向左對齊圖片\",\"Left double quotation mark\":\"\",\"Left single quotation mark\":\"\",\"Left-pointing double angle quotation mark\":\"\",\"leftwards arrow to bar\":\"向左停止箭頭\",\"leftwards dashed arrow\":\"向左虛線箭頭\",\"leftwards double arrow\":\"向左雙箭頭\",\"Light blue\":\"亮藍色\",\"Light green\":\"亮綠色\",\"Light grey\":\"亮灰色\",Link:\"連結\",\"Link image\":\"圖片連結\",\"Link URL\":\"連結˙ URL\",\"Lira sign\":\"\",\"Livre tournois sign\":\"\",\"Lower-latin\":\"\",\"Lower–roman\":\"\",\"Manat sign\":\"\",\"Media toolbar\":\"影音工具\",\"Media URL\":\"影音網址\",\"media widget\":\"影音小工具\",\"Merge cell down\":\"合併下方儲存格\",\"Merge cell left\":\"合併左方儲存格\",\"Merge cell right\":\"合併右方儲存格\",\"Merge cell up\":\"合併上方儲存格\",\"Merge cells\":\"合併儲存格\",\"Mill sign\":\"\",\"Naira sign\":\"\",\"New sheqel sign\":\"\",Next:\"下一\",None:\"無\",\"Nordic mark sign\":\"\",\"Numbered List\":\"有序清單\",\"Numbered list styles toolbar\":\"\",\"on with exclamation mark with left right arrow above\":\"\",\"Open in a new tab\":\"在新視窗開啟\",\"Open link in new tab\":\"在新視窗開啟連結\",Orange:\"橘色\",Original:\"原始圖片\",Outset:\"外框線\",Padding:\"儲存格留白\",Paragraph:\"段落\",\"Paragraph sign\":\"\",\"Paste the media URL in the input.\":\"在輸入框貼上影音網址。\",\"Per mille sign\":\"\",\"Per ten thousand sign\":\"\",\"Peseta sign\":\"\",\"Peso sign\":\"\",\"Pink marker\":\"粉色標記\",\"Pound sign\":\"\",Previous:\"上一\",Purple:\"紫色\",\"Question exclamation mark\":\"\",Red:\"紅色\",\"Red pen\":\"紅色筆\",Redo:\"重做\",\"Registered sign\":\"\",\"Remove color\":\"移除顏色\",\"Remove highlight\":\"清除高亮\",\"Resize image\":\"縮放圖片\",\"Resize image to %0\":\"縮放圖片到 %0\",\"Resize image to the original size\":\"縮放圖片到原始尺寸\",\"Restore default\":\"\",\"Reversed paragraph sign\":\"\",\"Rich Text Editor\":\"豐富文字編輯器\",\"Rich Text Editor, %0\":\"豐富文字編輯器,%0\",Ridge:\"凸起線\",\"Right aligned image\":\"向右對齊圖片\",\"Right double quotation mark\":\"\",\"Right single quotation mark\":\"\",\"Right-pointing double angle quotation mark\":\"\",\"rightwards arrow to bar\":\"向右停止箭頭\",\"rightwards dashed arrow\":\"向右虛線箭頭\",\"rightwards double arrow\":\"向右雙箭頭\",Row:\"列\",\"Ruble sign\":\"\",\"Rupee sign\":\"\",Save:\"儲存\",\"Section sign\":\"\",\"Select all\":\"選取全部\",\"Select column\":\"選擇欄\",\"Select row\":\"選擇列\",\"Show more items\":\"顯示更多\",\"Side image\":\"側邊圖片\",\"Single left-pointing angle quotation mark\":\"\",\"Single low-9 quotation mark\":\"\",\"Single right-pointing angle quotation mark\":\"\",Small:\"小\",Solid:\"實線\",\"soon with rightwards arrow above\":\"\",\"Special characters\":\"特殊字元\",\"Spesmilo sign\":\"\",\"Split cell horizontally\":\"水平分割儲存格\",\"Split cell vertically\":\"垂直分割儲存格\",Square:\"\",Style:\"樣式\",\"Table alignment toolbar\":\"表格對齊\",\"Table cell text alignment\":\"儲存格文字對齊\",\"Table properties\":\"表格屬性\",\"Table toolbar\":\"表格工具\",\"Tenge sign\":\"\",\"Text alignment\":\"文字對齊\",\"Text alignment toolbar\":\"文字對齊\",\"Text alternative\":\"替代文字\",\"Text highlight toolbar\":\"高亮\",'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".':'顏色代碼錯誤。試試看 \"#FF0000\" 或 \"rgb(255, 0, 0)\" 或 \"red\"。',\"The URL must not be empty.\":\"網址不能空白。\",'The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".':'尺寸代碼錯誤。試試看 \"10px\" 或 \"2em\" 或簡單寫 \"2\"。',\"This link has no URL\":\"連結沒有URL\",\"This media URL is not supported.\":\"不支援此影音網址。\",Tiny:\"特小\",\"Tip: Paste the URL into the content to embed faster.\":\"提示:在內容貼上網址更快崁入。\",\"Toggle caption off\":\"\",\"Toggle caption on\":\"\",\"Toggle the circle list style\":\"\",\"Toggle the decimal list style\":\"\",\"Toggle the decimal with leading zero list style\":\"\",\"Toggle the disc list style\":\"\",\"Toggle the lower–latin list style\":\"\",\"Toggle the lower–roman list style\":\"\",\"Toggle the square list style\":\"\",\"Toggle the upper–latin list style\":\"\",\"Toggle the upper–roman list style\":\"\",\"top with upwards arrow above\":\"\",\"Trade mark sign\":\"\",\"Tugrik sign\":\"\",\"Turkish lira sign\":\"\",Turquoise:\"藍綠色\",\"Two dot leader\":\"\",Underline:\"底線\",Undo:\"取消\",Unlink:\"移除連結\",\"up down arrow with base\":\"\",\"Upload failed\":\"上傳失敗\",\"Upload in progress\":\"正在上傳\",\"Upper-latin\":\"\",\"Upper-roman\":\"\",\"upwards arrow to bar\":\"向上停止箭頭\",\"upwards dashed arrow\":\"向上虛線箭頭\",\"upwards double arrow\":\"向上雙箭頭\",\"Vertical text alignment toolbar\":\"垂直對齊\",White:\"白色\",\"Widget toolbar\":\"小工具\",Width:\"寬度\",\"Won sign\":\"\",\"Wrap text\":\"\",Yellow:\"黃色\",\"Yellow marker\":\"黃色標記\",\"Yen sign\":\"\"});e.getPluralForm=function(t){return 0}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function t(e,n){if(typeof exports===\"object\"&&typeof module===\"object\")module.exports=n();else if(typeof define===\"function\"&&define.amd)define([],n);else if(typeof exports===\"object\")exports[\"ClassicEditor\"]=n();else e[\"ClassicEditor\"]=n()})(window,(function(){return function(t){var e={};function n(o){if(e[o]){return e[o].exports}var i=e[o]={i:o,l:false,exports:{}};t[o].call(i.exports,i,i.exports,n);i.l=true;return i.exports}n.m=t;n.c=e;n.d=function(t,e,o){if(!n.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:o})}};n.r=function(t){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(t,\"__esModule\",{value:true})};n.t=function(t,e){if(e&1)t=n(t);if(e&8)return t;if(e&4&&typeof t===\"object\"&&t&&t.__esModule)return t;var o=Object.create(null);n.r(o);Object.defineProperty(o,\"default\",{enumerable:true,value:t});if(e&2&&typeof t!=\"string\")for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o};n.n=function(t){var e=t&&t.__esModule?function e(){return t[\"default\"]}:function e(){return t};n.d(e,\"a\",e);return e};n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};n.p=\"\";return n(n.s=80)}([function(t,e,n){\"use strict\";n.d(e,\"a\",(function(){return i}));n.d(e,\"b\",(function(){return r}));const o=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class i extends Error{constructor(t,e,n){const o=`${t}${n?` ${JSON.stringify(n)}`:\"\"}${a(t)}`;super(o);this.name=\"CKEditorError\";this.context=e;this.data=n}is(t){return t===\"CKEditorError\"}static rethrowUnexpectedError(t,e){if(t.is&&t.is(\"CKEditorError\")){throw t}const n=new i(t.message,e);n.stack=t.stack;throw n}}function r(t,e){console.warn(...c(t,e))}function s(t,e){console.error(...c(t,e))}function a(t){return`\\nRead more: ${o}#error-${t}`}function c(t,e){const n=a(t);return e?[t,e,n]:[t,n]}},function(t,e,n){\"use strict\";var o=function t(){var e;return function t(){if(typeof e===\"undefined\"){e=Boolean(window&&document&&document.all&&!window.atob)}return e}}();var i=function t(){var e={};return function t(n){if(typeof e[n]===\"undefined\"){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement){try{o=o.contentDocument.head}catch(t){o=null}}e[n]=o}return e[n]}}();var r=[];function s(t){var e=-1;for(var n=0;n0){if(++e>=Wt){return arguments[0]}}else{e=0}return t.apply(undefined,arguments)}}var Yt=Kt;var $t=Yt(Ut);var Qt=$t;function Zt(t,e){return Qt(jt(t,e,zt),t+\"\")}var Jt=Zt;var Xt=9007199254740991;function te(t){return typeof t==\"number\"&&t>-1&&t%1==0&&t<=Xt}var ee=te;function ne(t){return t!=null&&ee(t.length)&&!J(t)}var oe=ne;var ie=9007199254740991;var re=/^(?:0|[1-9]\\d*)$/;function se(t,e){var n=typeof t;e=e==null?ie:e;return!!e&&(n==\"number\"||n!=\"symbol\"&&re.test(t))&&(t>-1&&t%1==0&&t
\").replace(/\\r?\\n/g,\"
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \");if(t.includes(\"
\")||t.includes(\"
\")){t=`
${t}
`}return t}function dy(t){return t.replace(/(\\s+)<\\/span>/g,((t,e)=>{if(e.length==1){return\" \"}return e}))}const uy=[\"figcaption\",\"li\"];function hy(t){let e=\"\";if(t.is(\"$text\")||t.is(\"$textProxy\")){e=t.data}else if(t.is(\"element\",\"img\")&&t.hasAttribute(\"alt\")){e=t.getAttribute(\"alt\")}else if(t.is(\"element\",\"br\")){e=\"\\n\"}else{let n=null;for(const o of t.getChildren()){const t=hy(o);if(n&&(n.is(\"containerElement\")||o.is(\"containerElement\"))){if(uy.includes(n.name)||uy.includes(o.name)){e+=\"\\n\"}else{e+=\"\\n\\n\"}}e+=t;n=o}}return e}class gy extends Hn{static get pluginName(){return\"ClipboardPipeline\"}init(){const t=this.editor;const e=t.editing.view;e.addObserver(ay);this._setupPasteDrop();this._setupCopyCut()}_setupPasteDrop(){const t=this.editor;const e=t.model;const n=t.editing.view;const o=n.document;this.listenTo(o,\"clipboardInput\",(e=>{if(t.isReadOnly){e.stop()}}),{priority:\"highest\"});this.listenTo(o,\"clipboardInput\",((t,e)=>{const o=e.dataTransfer;let i=e.content||\"\";if(!i){if(o.getData(\"text/html\")){i=dy(o.getData(\"text/html\"))}else if(o.getData(\"text/plain\")){i=ly(o.getData(\"text/plain\"))}i=this.editor.data.htmlProcessor.toView(i)}const s=new r(this,\"inputTransformation\");this.fire(s,{content:i,dataTransfer:o,targetRanges:e.targetRanges,method:e.method});if(s.stop.called){t.stop()}n.scrollToTheSelection()}),{priority:\"low\"});this.listenTo(this,\"inputTransformation\",((t,n)=>{if(n.content.isEmpty){return}const o=this.editor.data;const i=o.toModel(n.content,\"$clipboardHolder\");if(i.childCount==0){return}t.stop();e.change((()=>{this.fire(\"contentInsertion\",{content:i,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))}),{priority:\"low\"});this.listenTo(this,\"contentInsertion\",((t,n)=>{n.resultRange=e.insertContent(n.content)}),{priority:\"low\"})}_setupCopyCut(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const o=n.document;function i(n,i){const r=i.dataTransfer;i.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));o.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:n.name})}this.listenTo(o,\"copy\",i,{priority:\"low\"});this.listenTo(o,\"cut\",((e,n)=>{if(t.isReadOnly){n.preventDefault()}else{i(e,n)}}),{priority:\"low\"});this.listenTo(o,\"clipboardOutput\",((n,o)=>{if(!o.content.isEmpty){o.dataTransfer.setData(\"text/html\",this.editor.data.htmlProcessor.toData(o.content));o.dataTransfer.setData(\"text/plain\",hy(o.content))}if(o.method==\"cut\"){t.model.deleteContent(e.selection)}}),{priority:\"low\"})}}function*my(t,e){for(const n of e){if(n&&t.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class fy extends Wn{execute(){const t=this.editor.model;const e=t.document;t.change((n=>{py(this.editor.model,n,e.selection,t.schema);this.fire(\"afterExecute\",{writer:n})}))}}function py(t,e,n,o){const i=n.isCollapsed;const r=n.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(o.isLimit(s)||o.isLimit(a)){if(!i&&s==a){t.deleteContent(n)}return}if(i){const t=my(e.model.schema,n.getAttributes());ky(e,r.start);e.setSelectionAttribute(t)}else{const o=!(r.start.isAtStart&&r.end.isAtEnd);const i=s==a;t.deleteContent(n,{leaveUnmerged:o});if(o){if(i){ky(e,n.focus)}else{e.setSelection(a,0)}}}}function ky(t,e){t.split(e);t.setSelection(e.parent.nextSibling,0)}class by extends Du{constructor(t){super(t);const e=this.document;e.on(\"keydown\",((t,n)=>{if(this.isEnabled&&n.keyCode==id.enter){const o=new Ml(e,\"enter\",e.selection.getFirstRange());e.fire(o,new Th(e,n.domEvent,{isSoft:n.shiftKey}));if(o.stop.called){t.stop()}}}))}observe(){}}class wy extends Hn{static get pluginName(){return\"Enter\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(by);t.commands.add(\"enter\",new fy(t));this.listenTo(n,\"enter\",((n,o)=>{o.preventDefault();if(o.isSoft){return}t.execute(\"enter\");e.scrollToTheSelection()}),{priority:\"low\"})}}class Cy{constructor(t,e=20){this.model=t;this.size=0;this.limit=e;this.isLocked=false;this._changeCallback=(t,e)=>{if(e.type!=\"transparent\"&&e!==this._batch){this._reset(true)}};this._selectionChangeCallback=()=>{this._reset()};this.model.document.on(\"change\",this._changeCallback);this.model.document.selection.on(\"change:range\",this._selectionChangeCallback);this.model.document.selection.on(\"change:attribute\",this._selectionChangeCallback)}get batch(){if(!this._batch){this._batch=this.model.createBatch()}return this._batch}input(t){this.size+=t;if(this.size>=this.limit){this._reset(true)}}lock(){this.isLocked=true}unlock(){this.isLocked=false}destroy(){this.model.document.off(\"change\",this._changeCallback);this.model.document.selection.off(\"change:range\",this._selectionChangeCallback);this.model.document.selection.off(\"change:attribute\",this._selectionChangeCallback)}_reset(t){if(!this.isLocked||t){this._batch=null;this.size=0}}}class Ay extends Wn{constructor(t,e){super(t);this.direction=e;this._buffer=new Cy(t.model,t.config.get(\"typing.undoStep\"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model;const n=e.document;e.enqueueChange(this._buffer.batch,(o=>{this._buffer.lock();const i=o.createSelection(t.selection||n.selection);const r=t.sequence||1;const s=i.isCollapsed;if(i.isCollapsed){e.modifySelection(i,{direction:this.direction,unit:t.unit})}if(this._shouldEntireContentBeReplacedWithParagraph(r)){this._replaceEntireContentWithParagraph(o);return}if(this._shouldReplaceFirstBlockWithParagraph(i,r)){this.editor.execute(\"paragraph\",{selection:i});return}if(i.isCollapsed){return}let a=0;i.getFirstRange().getMinimalFlatRanges().forEach((t=>{a+=Tl(t.getWalker({singleCharacters:true,ignoreElementEnd:true,shallow:true}))}));e.deleteContent(i,{doNotResetEntireContent:s,direction:this.direction});this._buffer.input(a);o.setSelection(i);this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1){return false}const e=this.editor.model;const n=e.document;const o=n.selection;const i=e.schema.getLimitElement(o);const r=o.isCollapsed&&o.containsEntireContent(i);if(!r){return false}if(!e.schema.checkChild(i,\"paragraph\")){return false}const s=i.getChild(0);if(s&&s.name===\"paragraph\"){return false}return true}_replaceEntireContentWithParagraph(t){const e=this.editor.model;const n=e.document;const o=n.selection;const i=e.schema.getLimitElement(o);const r=t.createElement(\"paragraph\");t.remove(t.createRangeIn(i));t.insert(r,i);t.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||this.direction!=\"backward\"){return false}if(!t.isCollapsed){return false}const o=t.getFirstPosition();const i=n.schema.getLimitElement(o);const r=i.getChild(0);if(o.parent!=r){return false}if(!t.containsEntireContent(r)){return false}if(!n.schema.checkChild(i,\"paragraph\")){return false}if(r.name==\"paragraph\"){return false}return true}}class _y extends Du{constructor(t){super(t);const e=t.document;let n=0;e.on(\"keyup\",((t,e)=>{if(e.keyCode==id.delete||e.keyCode==id.backspace){n=0}}));e.on(\"keydown\",((t,e)=>{const i={};if(e.keyCode==id.delete){i.direction=\"forward\";i.unit=\"character\"}else if(e.keyCode==id.backspace){i.direction=\"backward\";i.unit=\"codePoint\"}else{return}const r=$l.isMac?e.altKey:e.ctrlKey;i.unit=r?\"word\":i.unit;i.sequence=++n;o(t,e.domEvent,i)}));if($l.isAndroid){e.on(\"beforeinput\",((e,n)=>{if(n.domEvent.inputType!=\"deleteContentBackward\"){return}const i={unit:\"codepoint\",direction:\"backward\",sequence:1};const r=n.domTarget.ownerDocument.defaultView.getSelection();if(r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset){i.selectionToRemove=t.domConverter.domSelectionToView(r)}o(e,n.domEvent,i)}))}function o(t,n,o){const i=new Ml(e,\"delete\",e.selection.getFirstRange());e.fire(i,new Th(e,n,o));if(i.stop.called){t.stop()}}}observe(){}}class vy extends Hn{static get pluginName(){return\"Delete\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(_y);const o=new Ay(t,\"forward\");t.commands.add(\"deleteForward\",o);t.commands.add(\"forwardDelete\",o);t.commands.add(\"delete\",new Ay(t,\"backward\"));this.listenTo(n,\"delete\",((n,o)=>{const i={unit:o.unit,sequence:o.sequence};if(o.selectionToRemove){const e=t.model.createSelection();const n=[];for(const e of o.selectionToRemove.getRanges()){n.push(t.editing.mapper.toModelRange(e))}e.setTo(n);i.selection=e}t.execute(o.direction==\"forward\"?\"deleteForward\":\"delete\",i);o.preventDefault();e.scrollToTheSelection()}),{priority:\"low\"});if($l.isAndroid){let t=null;this.listenTo(n,\"delete\",((e,n)=>{const o=n.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}}),{priority:\"lowest\"});this.listenTo(n,\"keyup\",((e,n)=>{if(t){const e=n.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset);e.extend(t.focusNode,t.focusOffset);t=null}}))}}}class yy{constructor(){this._stack=[]}add(t,e){const n=this._stack;const o=n[0];this._insertDescriptor(t);const i=n[0];if(o!==i&&!xy(o,i)){this.fire(\"change:top\",{oldDescriptor:o,newDescriptor:i,writer:e})}}remove(t,e){const n=this._stack;const o=n[0];this._removeDescriptor(t);const i=n[0];if(o!==i&&!xy(o,i)){this.fire(\"change:top\",{oldDescriptor:o,newDescriptor:i,writer:e})}}_insertDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t.id));if(xy(t,e[n])){return}if(n>-1){e.splice(n,1)}let o=0;while(e[o]&&Ey(e[o],t)){o++}e.splice(o,0,t)}_removeDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t));if(n>-1){e.splice(n,1)}}}Vn(yy,f);function xy(t,e){return t&&e&&t.priority==e.priority&&Dy(t.classes)==Dy(e.classes)}function Ey(t,e){if(t.priority>e.priority){return true}else if(t.priority