MARIJuANA
— DIOS — NO — CREA — NADA — EN — VANO —
Linux instance-20230208-1745 6.8.0-1013-oracle #13~22.04.1-Ubuntu SMP Mon Sep 2 13:02:56 UTC 2024 x86_64
  SOFT : Apache/2.4.52 (Ubuntu) PHP : 8.1.2-1ubuntu2.19
/var/www/guajeru/html/painel/
10.0.0.135

 
[ NAME ] [ SIZE ] [ PERM ] [ DATE ] [ ACT ]
+FILE +DIR
assets dir drwxr-xr-x 2023-03-06 15:28 R D
1.62534cafb686d8ddfd72.js 749.671 KB -rw-r--r-- 2023-03-06 15:31 R E G D
1.960a9ce38facf3ebf6d7.js 749.671 KB -rw-rw-r-- 2023-03-06 17:40 R E G D
1.a08e66d1a5603bc34b53.js 750.417 KB -rw-rw-r-- 2024-01-10 12:11 R E G D
1.da415ece6de33d508cd9.js 711.983 KB -rw-r--r-- 2023-03-06 15:31 R E G D
3rdpartylicenses.txt 98.439 KB -rw-r--r-- 2024-01-10 12:11 R E G D
6.155aa9116f18b1baa246.js 1.23 MB -rw-rw-r-- 2023-09-21 11:54 R E G D
6.19d4f0e38116ec2d129e.js 1.22 MB -rw-rw-r-- 2023-08-01 11:37 R E G D
6.1dea7f42521d333d0a25.js 974.732 KB -rw-r--r-- 2023-03-06 15:31 R E G D
6.379ae3d08b879443064c.js 1.23 MB -rw-rw-r-- 2023-08-08 22:03 R E G D
6.3d9aa3c9fc8800e31a5a.js 1.17 MB -rw-rw-r-- 2023-05-05 12:35 R E G D
6.4ecc806ba60b8dd07350.js 974.728 KB -rw-r--r-- 2023-03-06 15:31 R E G D
6.71716e05c604a2549f63.js 1.23 MB -rw-rw-r-- 2023-08-07 17:11 R E G D
6.812cf41ba13997856159.js 1.23 MB -rw-rw-r-- 2023-09-29 09:33 R E G D
6.82a69a93b894b5fde741.js 966.603 KB -rw-r--r-- 2023-03-06 15:31 R E G D
6.8a051bb41714259f2f38.js 1.23 MB -rw-rw-r-- 2023-10-13 09:14 R E G D
6.8c47bec977c1749acd7f.js 1.19 MB -rw-rw-r-- 2023-05-29 16:25 R E G D
6.981fcb158428fe44dc1b.js 1.23 MB -rw-rw-r-- 2024-01-10 12:11 R E G D
6.a05a47894e3fc123a673.js 1.23 MB -rw-rw-r-- 2023-09-22 10:50 R E G D
6.a25684d147475fe6bd51.js 1.17 MB -rw-rw-r-- 2023-04-01 13:06 R E G D
6.b5168e518fbcaa4e6c6c.js 1.2 MB -rw-rw-r-- 2023-06-02 17:13 R E G D
6.d52f4386cc1cb8e8edff.js 976.789 KB -rw-rw-r-- 2023-03-06 17:40 R E G D
6.db4a4ecce23df16a8ab8.js 1.22 MB -rw-rw-r-- 2023-06-30 09:28 R E G D
6.dc2e24e52564ff6e8e17.js 1.23 MB -rw-rw-r-- 2023-08-22 15:19 R E G D
7.26beda7f142c0ff7afb5.js 764.825 KB -rw-rw-r-- 2023-05-30 16:20 R E G D
7.43637b98d52adefcc02d.js 785.189 KB -rw-rw-r-- 2023-07-17 12:13 R E G D
7.8f49b6d2dc17e2646ec2.js 764.825 KB -rw-rw-r-- 2023-05-05 12:35 R E G D
7.93660639dc5aa2bd0615.js 242.002 KB -rw-r--r-- 2023-03-06 15:31 R E G D
7.96cfd267659b2c3603fe.js 786.354 KB -rw-rw-r-- 2023-09-29 09:33 R E G D
7.9cea2a8587531319528b.js 800.521 KB -rw-rw-r-- 2023-10-13 09:14 R E G D
7.a7af2e8037ab94053d91.js 764.855 KB -rw-rw-r-- 2023-06-30 09:28 R E G D
7.bcfd6e0985966b30579c.js 800.521 KB -rw-rw-r-- 2024-01-10 12:11 R E G D
7.c742340df49b2b6bdf6c.js 192.382 KB -rw-r--r-- 2023-03-06 15:31 R E G D
7.ce024134a20ecdad0674.js 192.373 KB -rw-r--r-- 2023-03-06 15:31 R E G D
7.e39860336fdc8fab7e98.js 346.035 KB -rw-rw-r-- 2023-04-01 13:06 R E G D
7.eb1bce936795c0aff076.js 800.521 KB -rw-rw-r-- 2023-10-11 17:19 R E G D
7.ec34f097b5c457c2a39f.js 247.285 KB -rw-rw-r-- 2023-03-06 17:40 R E G D
7.f6aca4e7be3808435d76.js 241.976 KB -rw-r--r-- 2023-03-06 15:31 R E G D
default~layouts-admin-layout-admin-layout-module~transparencia-transparencia-module.js 111.742 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
default~layouts-admin-layout-admin-layout-module~transparencia-transparencia-module.js.map 114.702 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
favicon.ico 5.303 KB -rw-r--r-- 2024-01-10 12:11 R E G D
image.f11dbc75e7a09fc85e41.png 840.703 KB -rw-r--r-- 2024-01-10 12:11 R E G D
image.png 840.703 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
index.html 2.569 KB -rw-r--r-- 2024-01-10 12:11 R E G D
layouts-admin-layout-admin-layout-module.js 878.396 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
layouts-admin-layout-admin-layout-module.js.map 876.072 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
main.07b55195782607387f4c.js 1.39 MB -rw-rw-r-- 2023-06-29 18:26 R E G D
main.18acfcaeb22d55a4c981.js 1.39 MB -rw-rw-r-- 2023-06-30 09:28 R E G D
main.1b71ad0deb07e285d2b0.js 1.38 MB -rw-rw-r-- 2023-04-26 19:19 R E G D
main.20e35dc3e3118ca952ff.js 1.38 MB -rw-rw-r-- 2023-04-01 13:06 R E G D
main.237dba32369a0d71d86d.js 1.12 MB -rw-rw-r-- 2023-03-06 17:40 R E G D
main.4942b2689fb263895f9f.js 1.38 MB -rw-rw-r-- 2023-04-26 19:22 R E G D
main.54cbbdb6803f9d2e3394.js 1.09 MB -rw-r--r-- 2023-03-06 15:31 R E G D
main.5858d96e2ea1de338ff9.js 1.39 MB -rw-rw-r-- 2023-08-01 11:37 R E G D
main.67099eeb8d40adaad454.js 1.55 MB -rw-rw-r-- 2023-10-13 09:14 R E G D
main.6cd5ead1c15cea07104c.js 1.39 MB -rw-rw-r-- 2023-08-22 15:19 R E G D
main.760c28abdec3ac68fe32.js 1.55 MB -rw-rw-r-- 2023-09-28 17:48 R E G D
main.76295aa6d48359d29873.js 1.39 MB -rw-rw-r-- 2023-08-08 11:39 R E G D
main.770c2db25a66c8d0e3c2.js 1.09 MB -rw-r--r-- 2023-03-06 15:31 R E G D
main.78cc47f5dbf63ce06a87.js 1.09 MB -rw-r--r-- 2023-03-06 15:31 R E G D
main.7a2abf4e0084f54fa752.js 1.55 MB -rw-rw-r-- 2023-10-11 19:34 R E G D
main.7e6897ee33b0044becb7.js 1.09 MB -rw-r--r-- 2023-03-06 15:31 R E G D
main.8afe9bc218f1243252b8.js 1.55 MB -rw-rw-r-- 2024-01-10 12:11 R E G D
main.93f3a6e8a49d92fdd60a.js 1.55 MB -rw-rw-r-- 2023-09-29 09:33 R E G D
main.aa8549074e00980a00a5.js 1.39 MB -rw-rw-r-- 2023-05-30 16:20 R E G D
main.b47f8d30a929ec93ccbd.js 1.39 MB -rw-rw-r-- 2023-08-08 22:03 R E G D
main.b9eccda1269072ce96ee.js 1.55 MB -rw-rw-r-- 2023-09-21 11:54 R E G D
main.d9db1193431174a160b2.js 1.39 MB -rw-rw-r-- 2023-08-07 17:11 R E G D
main.ecde60f30fe0b3ec6cd1.js 1.55 MB -rw-rw-r-- 2023-09-22 10:50 R E G D
main.efa1f4392976e158f98a.js 1.39 MB -rw-rw-r-- 2023-06-02 17:13 R E G D
main.f1db7890c01ff8056949.js 1.38 MB -rw-rw-r-- 2023-05-05 12:36 R E G D
main.f442e15663795cc12fd1.js 1.39 MB -rw-rw-r-- 2023-05-29 16:25 R E G D
main.js 834.783 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
main.js.map 836.399 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
polyfills-es5.8b2e24a70255d7d09ae9.js 249.737 KB -rw-rw-r-- 2024-01-10 12:11 R E G D
polyfills-es5.a5ccebd3e224f1a26aa4.js 249.687 KB -rw-r--r-- 2023-03-06 17:40 R E G D
polyfills-es5.js 1.14 MB -rw-rw-r-- 2023-08-07 16:40 R E G D
polyfills-es5.js.map 923.377 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
polyfills.5313c1020e23c54079b9.js 166.701 KB -rw-r--r-- 2023-03-06 17:40 R E G D
polyfills.758faf18f4b2f92959a3.js 166.752 KB -rw-rw-r-- 2024-01-10 12:11 R E G D
polyfills.js 771.544 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
polyfills.js.map 659.782 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
runtime.151a3c4b23b0c096daf1.js 2.285 KB -rw-rw-r-- 2023-08-08 22:03 R E G D
runtime.15e05131a65b255d3df9.js 2.285 KB -rw-rw-r-- 2023-05-05 12:36 R E G D
runtime.178188fe78011ba42f9b.js 2.285 KB -rw-rw-r-- 2023-05-30 16:20 R E G D
runtime.23f05ccd2ce1f082692d.js 2.285 KB -rw-r--r-- 2023-03-06 15:31 R E G D
runtime.3f28dd4d986fb23ece9f.js 2.285 KB -rw-r--r-- 2023-03-06 15:31 R E G D
runtime.4bd5d0e8f4d5f0b2b272.js 2.285 KB -rw-rw-r-- 2023-08-22 15:19 R E G D
runtime.53754ade5d5becf66cf5.js 2.285 KB -rw-rw-r-- 2023-10-13 09:14 R E G D
runtime.57bbe346a9d65e0c2f14.js 2.285 KB -rw-rw-r-- 2023-09-29 09:33 R E G D
runtime.57ef4f080e8e2fda1271.js 2.285 KB -rw-rw-r-- 2023-09-21 11:54 R E G D
runtime.65f6d889b4125d11e195.js 2.285 KB -rw-r--r-- 2023-03-06 15:31 R E G D
runtime.6cb91b461276034e9ea6.js 2.285 KB -rw-rw-r-- 2023-04-01 13:06 R E G D
runtime.70f22bd855c32894a6c6.js 2.285 KB -rw-rw-r-- 2023-08-01 11:37 R E G D
runtime.7132456d1f7c1ea39d77.js 2.285 KB -rw-rw-r-- 2023-09-22 10:50 R E G D
runtime.8ac46e5dc50497425539.js 2.285 KB -rw-rw-r-- 2023-06-30 09:28 R E G D
runtime.8d7c1b24ff1115e9fd0f.js 2.285 KB -rw-rw-r-- 2023-06-02 17:13 R E G D
runtime.a06761ccf6ce754846f3.js 2.285 KB -rw-rw-r-- 2023-10-11 17:19 R E G D
runtime.a9f0b2f2ede4fefd71ef.js 2.285 KB -rw-rw-r-- 2023-08-07 17:11 R E G D
runtime.b3f34b77cba4c7ec3932.js 2.285 KB -rw-rw-r-- 2023-05-29 16:25 R E G D
runtime.ba0fa7b20ebf7b975c55.js 2.285 KB -rw-rw-r-- 2023-03-06 17:40 R E G D
runtime.ce5ac1751e0cfe116066.js 2.285 KB -rw-r--r-- 2023-03-06 15:31 R E G D
runtime.f90750ebfe17fdc0596d.js 2.285 KB -rw-rw-r-- 2023-07-17 12:13 R E G D
runtime.fa85bde788eede5d1a54.js 2.285 KB -rw-rw-r-- 2024-01-10 12:11 R E G D
runtime.js 9.29 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
runtime.js.map 9.423 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
scripts.23c891176a6fdb868027.js 302.444 KB -rw-r--r-- 2024-01-10 12:11 R E G D
scripts.js 805.319 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
scripts.js.map 986.763 KB -rw-rw-r-- 2023-08-07 16:40 R E G D
styles.4093d4faa194d286a583.css 659.542 KB -rw-rw-r-- 2023-10-13 09:14 R E G D
styles.88803303827e21610fd2.css 659.613 KB -rw-rw-r-- 2024-01-10 12:11 R E G D
styles.959b2475488bbcef438b.css 659.451 KB -rw-rw-r-- 2023-09-29 09:33 R E G D
styles.bdcf43b971e8a82cc0ab.css 659.436 KB -rw-rw-r-- 2023-05-05 12:36 R E G D
styles.dec7bcab41b9e90bf0ad.css 659.258 KB -rw-r--r-- 2023-03-06 15:31 R E G D
styles.f32803e083c13c4d76d3.css 659.242 KB -rw-r--r-- 2023-03-06 15:31 R E G D
styles.js 3.77 MB -rw-rw-r-- 2023-08-07 16:40 R E G D
styles.js.map 3.92 MB -rw-rw-r-- 2023-08-07 16:40 R E G D
transparencia-transparencia-module.js 1.43 MB -rw-rw-r-- 2023-08-07 16:40 R E G D
transparencia-transparencia-module.js.map 1.66 MB -rw-rw-r-- 2023-08-07 16:40 R E G D
vendor.js 10.27 MB -rw-rw-r-- 2023-08-07 16:40 R E G D
vendor.js.map 10.04 MB -rw-rw-r-- 2023-08-07 16:40 R E G D
REQUEST EXIT
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{KZYO:function(e,t,n){!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Big:"Big",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Circle:"Circle",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero","Decrease indent":"Decrease indent",Default:"Default","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Disc:"Disc","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Font Background Color":"Font Background Color","Font Color":"Font Color","Font Family":"Font Family","Font Size":"Font Size","Full size image":"Full size image",Green:"Green",Grey:"Grey","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6",Huge:"Huge","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Inserting image failed":"Inserting image failed",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Lower-latin":"Lower-latin","Lower\u2013roman":"Lower\u2013roman","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Paragraph:"Paragraph","Paste the media URL in the input.":"Paste the media URL in the input.",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image",Small:"Small","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Square:"Square",Strikethrough:"Strikethrough","Table toolbar":"Table toolbar","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.",Tiny:"Tiny","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower\u2013latin list style":"Toggle the lower\u2013latin list style","Toggle the lower\u2013roman list style":"Toggle the lower\u2013roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper\u2013latin list style":"Toggle the upper\u2013latin list style","Toggle the upper\u2013roman list style":"Toggle the upper\u2013roman list style",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman",White:"White","Widget toolbar":"Widget toolbar",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,(function(t){return e[t]}).bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=102)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return r}));class i extends Error{constructor(e,t,n){super(`${e}${n?" "+JSON.stringify(n):""}${s(e)}`),this.name="CKEditorError",this.context=t,this.data=n}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const n=new i(e.message,t);throw n.stack=e.stack,n}}function o(e,t){console.warn(...a(e,t))}function r(e,t){console.error(...a(e,t))}function s(e){return"\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-"+e}function a(e,t){const n=s(e);return t?[e,t,n]:[e,n]}},function(e,t,n){"use strict";var i,o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),r=[];function s(e){for(var t=-1,n=0;n:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(e,t,n){var i=n(1),o=n(21);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},function(e,t,n){var i=n(1),o=n(23);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(e,t,n){var i=n(1),o=n(25);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(e,t,n){var i=n(1),o=n(27);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(e,t,n){var i=n(1),o=n(29);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(e,t,n){var i=n(1),o=n(31);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"},function(e,t,n){var i=n(1),o=n(33);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown .ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(e,t,n){var i=n(1),o=n(35);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,n){var i=n(1),o=n(37);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(e,t,n){var i=n(1),o=n(39);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},function(e,t,n){var i=n(1),o=n(41);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(e,t,n){var i=n(1),o=n(43);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}"},function(e,t,n){var i=n(1),o=n(45);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}"},function(e,t,n){var i=n(1),o=n(47);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(e,t,n){var i=n(1),o=n(49);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}'},function(e,t,n){var i=n(1),o=n(51);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},function(e,t,n){var i=n(1),o=n(53);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(e,t,n){var i=n(1),o=n(55);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},function(e,t,n){var i=n(1),o=n(57);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},function(e,t,n){var i=n(1),o=n(59);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(e,t,n){var i=n(1),o=n(61);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},function(e,t){e.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},function(e,t,n){var i=n(1),o=n(64);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(e,t,n){var i=n(1),o=n(66);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(e,t,n){var i=n(1),o=n(68);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:50px}"},function(e,t,n){var i=n(1),o=n(70);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(e,t,n){var i=n(1),o=n(72);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(e,t,n){var i=n(1),o=n(74);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(e,t){e.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(e,t,n){var i=n(1),o=n(77);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(e,t,n){var i=n(1),o=n(79);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(e,t,n){var i=n(1),o=n(81);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(e,t,n){var i=n(1),o=n(83);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},function(e,t,n){var i=n(1),o=n(85);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}"},function(e,t,n){var i=n(1),o=n(87);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar{background:none;padding:0}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items{grid-template-columns:repeat(3,auto);row-gap:var(--ck-spacing-medium);column-gap:var(--ck-spacing-medium);padding:var(--ck-spacing-medium)}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items .ck-button{width:var(--ck-list-style-button-size);height:var(--ck-list-style-button-size);padding:0;margin:0;box-sizing:content-box}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items .ck-button .ck-icon{width:var(--ck-list-style-button-size);height:var(--ck-list-style-button-size)}"},function(e,t,n){var i=n(1),o=n(89);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(var(--ck-spacing-standard)*3);background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(e,t,n){var i=n(1),o=n(91);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}"},function(e,t,n){var i=n(1),o=n(93);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(e,t,n){var i=n(1),o=n(95);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(e,t,n){var i=n(1),o=n(97);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},function(e,t,n){var i=n(1),o=n(99);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(e,t,n){var i=n(1),o=n(101);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}"},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return pb}));var i=n(3),o=i.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,l=o?o.toStringTag:void 0,c=Object.prototype.toString,d=o?o.toStringTag:void 0,u=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":d&&d in Object(e)?function(e){var t=s.call(e,l),n=e[l];try{e[l]=void 0;var i=!0}catch(e){}var o=a.call(e);return i&&(t?e[l]=n:delete e[l]),o}(e):function(e){return c.call(e)}(e)},h=function(e,t){return function(n){return e(t(n))}},f=h(Object.getPrototypeOf,Object),m=function(e){return null!=e&&"object"==typeof e},g=Function.prototype.toString,p=Object.prototype.hasOwnProperty,b=g.call(Object),w=function(e){if(!m(e)||"[object Object]"!=u(e))return!1;var t=f(e);if(null===t)return!0;var n=p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&g.call(n)==b},k=function(e,t){return e===t||e!=e&&t!=t},_=function(e,t){for(var n=e.length;n--;)if(k(e[n][0],t))return n;return-1},v=Array.prototype.splice;function y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},y.prototype.set=function(e,t){var n=this.__data__,i=_(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var x,C=y,A=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},T=function(e){if(!A(e))return!1;var t=u(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},S=i.a["__core-js_shared__"],E=(x=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",P=Function.prototype.toString,M=function(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""},I=/^\[object .+?Constructor\]$/,N=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!A(e)||function(e){return!!E&&E in e}(e))&&(T(e)?N:I).test(M(e))}(n)?n:void 0},R=O(i.a,"Map"),L=O(Object,"create"),D=Object.prototype.hasOwnProperty,z=Object.prototype.hasOwnProperty;function V(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},se={};se["[object Float32Array]"]=se["[object Float64Array]"]=se["[object Int8Array]"]=se["[object Int16Array]"]=se["[object Int32Array]"]=se["[object Uint8Array]"]=se["[object Uint8ClampedArray]"]=se["[object Uint16Array]"]=se["[object Uint32Array]"]=!0,se["[object Arguments]"]=se["[object Array]"]=se["[object ArrayBuffer]"]=se["[object Boolean]"]=se["[object DataView]"]=se["[object Date]"]=se["[object Error]"]=se["[object Function]"]=se["[object Map]"]=se["[object Number]"]=se["[object Object]"]=se["[object RegExp]"]=se["[object Set]"]=se["[object String]"]=se["[object WeakMap]"]=!1;var ae=function(e){return function(t){return e(t)}},le=n(5),ce=le.a&&le.a.isTypedArray,de=ce?ae(ce):function(e){return m(e)&&re(e.length)&&!!se[u(e)]},ue=Object.prototype.hasOwnProperty,he=function(e,t){var n=te(e),i=!n&&ee(e),o=!n&&!i&&Object(ne.a)(e),r=!n&&!i&&!o&&de(e),s=n||i||o||r,a=s?function(e,t){for(var n=-1,i=Array(e);++n{this._setToTarget(e,i,t[i],n)})}}function lt(e){return rt(e,ct)}function ct(e){return st(e)?e:void 0}class dt{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const ut=new Array(256).fill().map((e,t)=>("0"+t.toString(16)).slice(-2));function ht(){const e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+ut[e>>0&255]+ut[e>>8&255]+ut[e>>16&255]+ut[e>>24&255]+ut[t>>0&255]+ut[t>>8&255]+ut[t>>16&255]+ut[t>>24&255]+ut[n>>0&255]+ut[n>>8&255]+ut[n>>16&255]+ut[n>>24&255]+ut[i>>0&255]+ut[i>>8&255]+ut[i>>16&255]+ut[i>>24&255]}var ft={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},mt=(n(6),n(0));const gt=Symbol("listeningTo"),pt=Symbol("emitterId");var bt={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){let i=!1;this.listenTo(this,e,(function(e,...n){i||(i=!0,e.off(),t.call(this,e,...n))}),n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,i={}){let o,r;this[gt]||(this[gt]={});const s=this[gt];kt(e)||wt(e);const a=kt(e);(o=s[a])||(o=s[a]={emitter:e,callbacks:{}}),(r=o.callbacks[t])||(r=o.callbacks[t]=[]),r.push(n),function(e,t){const n=_t(e);if(n[t])return;let i=t,o=null;const r=[];for(;""!==i&&!n[i];)n[i]={callbacks:[],childEvents:[]},r.push(n[i]),o&&n[i].childEvents.push(o),o=i,i=i.substr(0,i.lastIndexOf(":"));if(""!==i){for(const e of r)e.callbacks=n[i].callbacks.slice();n[i].childEvents.push(o)}}(e,t);const l=vt(e,t),c=ft.get(i.priority),d={callback:n,priority:c};for(const u of l){let e=!1;for(let t=0;t-1?e(t,n.substr(0,n.lastIndexOf(":"))):null}(this,i);if(n.path.push(this),o){const e=[n,...t];o=Array.from(o);for(let t=0;t{this._delegations||(this._delegations=new Map),e.forEach(e=>{const i=this._delegations.get(e);i?i.set(t,n):this._delegations.set(e,new Map([[t,n]]))})}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const n=this._delegations.get(e);n&&n.delete(t)}else this._delegations.delete(e);else this._delegations.clear()}};function wt(e,t){e[pt]||(e[pt]=t||ht())}function kt(e){return e[pt]}function _t(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function vt(e,t){const n=_t(e)[t];if(!n)return[];let i=[n.callbacks];for(let o=0;o{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype)return;const i=Object.getOwnPropertyDescriptor(t,n);i.enumerable=!1,Object.defineProperty(e.prototype,n,i)})})}class Tt{constructor(e={},t={}){const n=Ct(e);if(n||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const i of e)this._items.push(i),this._itemMap.set(this._getItemIdBeforeAdding(i),i)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new mt.a("collection-add-item-invalid-index",this);for(let n=0;n{this._setUpBindToBinding(t=>new e(t))},using:e=>{this._setUpBindToBinding("function"==typeof e?t=>e(t):t=>t[e])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(n,i,o)=>{const r=t._bindToCollection==this,s=t._bindToInternalToExternalMap.get(i);if(r&&s)this._bindToExternalToInternalMap.set(i,s),this._bindToInternalToExternalMap.set(s,i);else{const n=e(i);if(!n)return void this._skippedIndexesFromExternal.push(o);let r=o;for(const e of this._skippedIndexesFromExternal)o>e&&r--;for(const e of t._skippedIndexesFromExternal)r>=e&&r++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,r);for(let e=0;e{const i=this._bindToExternalToInternalMap.get(t);i&&this.remove(i),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(nt&&e.push(t),e),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],"string"!=typeof n)throw new mt.a("collection-add-invalid-id",this);if(this.get(n))throw new mt.a("collection-add-item-already-exists",this)}else e[t]=n=ht();return n}_remove(e){let t,n,i,o=!1;const r=this._idProperty;if("string"==typeof e?(n=e,i=this._itemMap.get(n),o=!i,i&&(t=this._items.indexOf(i))):"number"==typeof e?(t=e,i=this._items[t],o=!i,i&&(n=i[r])):(i=e,n=i[r],t=this._items.indexOf(i),o=-1==t||!this._itemMap.get(n)),o)throw new mt.a("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(s),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}At(Tt,bt);class St{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const i of t)i.pluginName&&this._availablePlugins.set(i.pluginName,i);this._contextPlugins=new Map;for(const[i,o]of n)this._contextPlugins.set(i,o),this._contextPlugins.set(o,i),i.pluginName&&this._availablePlugins.set(i.pluginName,i)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new mt.a("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const n=this,i=this._context,o=new Set,r=[],s=u(e),a=u(t),l=function(e){const t=[];for(const n of e)d(n)||t.push(n);return t.length?t:null}(e);if(l){const e="plugincollection-plugin-not-found";return Object(mt.b)(e,{plugins:l}),Promise.reject(new mt.a(e,i,{plugins:l}))}return Promise.all(s.map((function e(s){if(!a.includes(s)&&!n._plugins.has(s)&&!o.has(s))return function(s){return new Promise(a=>{o.add(s),s.requires&&s.requires.forEach(n=>{const o=d(n);if(s.isContextPlugin&&!o.isContextPlugin)throw new mt.a("plugincollection-context-required",null,{plugin:o.name,requiredBy:s.name});if(t.includes(o))throw new mt.a("plugincollection-required",i,{plugin:o.name,requiredBy:s.name});e(o)});const l=n._contextPlugins.get(s)||new s(i);n._add(s,l),r.push(l),a()})}(s).catch(e=>{throw Object(mt.b)("plugincollection-load",{plugin:s}),e})}))).then(()=>c(r,"init")).then(()=>c(r,"afterInit")).then(()=>r);function c(e,t){return e.reduce((e,i)=>i[t]?n._contextPlugins.has(i)?e:e.then(i[t].bind(i)):e,Promise.resolve())}function d(e){return"function"==typeof e?e:n._availablePlugins.get(e)}function u(e){return e.map(e=>d(e)).filter(e=>!!e)}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new mt.a("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}function Et(e){return Array.isArray(e)?e:[e]}At(St,bt),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Pt=["ar","fa","he","ku","ug"];class Mt{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=It(this.uiLanguage),this.contentLanguageDirection=It(this.contentLanguage),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){return t=Et(t),"string"==typeof e&&(e={string:e}),function(e,t){return e.replace(/%(\d+)/g,(e,n)=>n1===e?0:1);if("string"==typeof r[o])return r[o];const a=Number(s(n));return r[o][a]}(this.uiLanguage,e,e.plural?t[0]:1),t)}}function It(e){return Pt.includes(e)?"rtl":"ltr"}class Nt{constructor(e){this.config=new at(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new St(this,t);const n=this.config.get("language")||{};this.locale=new Mt({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Tt,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[];for(const t of e){if("function"!=typeof t)throw new mt.a("context-initplugins-constructor-only",null,{Plugin:t});if(!0!==t.isContextPlugin)throw new mt.a("context-initplugins-invalid-plugin",null,{Plugin:t})}return this.plugins.init(e)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new mt.a("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}function Ot(e,t){const n=Math.min(e.length,t.length);for(let i=0;ie.data.length)throw new mt.a("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new mt.a("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}function Vt(e){return Ct(e)?new Map(e):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(e)}class jt{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),t.classes&&("string"==typeof t.classes||t.classes instanceof RegExp)&&(t.classes=[t.classes]),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const n=Bt(t,e);if(n)return{element:t,pattern:e,match:n}}return null}matchAll(...e){const t=[];for(const n of e)for(const e of this._patterns){const i=Bt(n,e);i&&t.push({element:n,pattern:e,match:i})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function Bt(e,t){if("function"==typeof t)return t(e);const n={};return t.name&&(n.name=function(e,t){return e instanceof RegExp?e.test(t):e===t}(t.name,e.name),!n.name)||t.attributes&&(n.attributes=function(e,t){const n=[];for(const i in e){const o=e[i];if(!t.hasAttribute(i))return null;{const e=t.getAttribute(i);if(!0===o)n.push(i);else if(o instanceof RegExp){if(!o.test(e))return null;n.push(i)}else{if(e!==o)return null;n.push(i)}}}return n}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){const n=[];for(const i of e)if(i instanceof RegExp){const e=t.getClassNames();for(const t of e)i.test(t)&&n.push(t);if(0===n.length)return null}else{if(!t.hasClass(i))return null;n.push(i)}return n}(t.classes,e),!n.classes))&&!(t.styles&&(n.styles=function(e,t){const n=[];for(const i in e){const o=e[i];if(!t.hasStyle(i))return null;{const e=t.getStyle(i);if(o instanceof RegExp){if(!o.test(e))return null;n.push(i)}else{if(e!==o)return null;n.push(i)}}}return n}(t.styles,e),!n.styles))&&n}var Ft=function(e){return"symbol"==typeof e||m(e)&&"[object Symbol]"==u(e)},Ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ut=/^\w*$/;function qt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s)||r,s};return n.cache=new(qt.Cache||H),n}qt.Cache=H;var Wt=qt,$t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gt=/\\(\\)?/g,Yt=function(e){var t=Wt((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($t,(function(e,n,i,o){t.push(i?o.replace(Gt,"$1"):n||e)})),t}),(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}(),Qt=o?o.prototype:void 0,Kt=Qt?Qt.toString:void 0,Jt=function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(te(t))return function(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++no?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++i0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(W?function(e,t){return W(e,"toString",{configurable:!0,enumerable:!1,value:cn(t),writable:!0})}:sn),hn=function(e){return function(e,t){return un(function(e,t,n){return t=ln(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,r=ln(i.length-t,0),s=Array(r);++o1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(o--,r):void 0,s&&function(e,t,n){if(!A(n))return!1;var i=typeof t;return!!("number"==i?be(n)&&oe(t,n.length):"string"==i&&t in n)&&k(n[t],e)}(n[0],n[1],s)&&(r=o<3?void 0:r,o=1),t=Object(t);++it===e);return Array.isArray(t)}set(e,t){if(A(e))for(const[n,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=pn(e);(function(e,t){null==e||function(e,t){null==(e=function(e,t){return t.length<2?e:en(e,tn(t,0,-1))}(e,t=Zt(t,e)))||delete e[Xt(function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t))]}(e,t)})(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!A(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([t])=>t===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(){return this.isEmpty?[]:this._getStylesEntries().map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),i=nn(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class gn{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(A(t))bn(n,pn(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:o,value:r}=i(t);bn(n,o,r)}else bn(n,e,t)}getNormalized(e,t){if(!e)return fn({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if("string"==typeof n)return nn(t,n);const i=n(e,t);if(i)return i}return nn(t,pn(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return void 0===n?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function pn(e){return e.replace("-",".")}function bn(e,t,n){let i=n;A(n)&&(i=fn({},nn(e,t),n)),function(e,t,n){null==e||function(e,t,n,i){if(!A(e))return e;for(var o=-1,r=(t=Zt(t,e)).length,s=r-1,a=e;null!=a&&++o0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof wn))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new jt(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==n?"":" "+n)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){return"string"==typeof t?[new Dt(e,t)]:(Ct(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new Dt(e,t):t instanceof zt?new Dt(e,t.data):t))}(this.document,t);for(const o of i)null!==o.parent&&o._remove(),o.parent=this,o.document=this.document,this._children.splice(e,0,o),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Et(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Et(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Et(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function kn(e,t){const n=t.split(/\s+/);e.clear(),n.forEach(t=>e.add(t))}class _n extends wn{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=vn}is(e,t=null){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}}function vn(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const n of e)if(!n.is("uiElement"))return null;return this.childCount}var yn=hn((function(e,t){Q(t,_e(t),e)}));const xn=Symbol("observableProperties"),Cn=Symbol("boundObservables"),An=Symbol("boundProperties"),Tn={set(e,t){if(A(e))return void Object.keys(e).forEach(t=>{this.set(t,e[t])},this);En(this);const n=this[xn];if(e in this&&!n.has(e))throw new mt.a("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(t){const i=n.get(e);let o=this.fire("set:"+e,e,t,i);void 0===o&&(o=t),i===o&&n.has(e)||(n.set(e,o),this.fire("change:"+e,e,o,i))}}),this[e]=t},bind(...e){if(!e.length||!In(e))throw new mt.a("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new mt.a("observable-bind-duplicate-properties",this);En(this);const t=this[An];e.forEach(e=>{if(t.has(e))throw new mt.a("observable-bind-rebind",this)});const n=new Map;return e.forEach(e=>{const i={property:e,to:[]};t.set(e,i),n.set(e,i)}),{to:Pn,toMany:Mn,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!this[xn])return;const t=this[An],n=this[Cn];if(e.length){if(!In(e))throw new mt.a("observable-unbind-wrong-properties",this);e.forEach(e=>{const i=t.get(e);if(!i)return;let o,r,s,a;i.to.forEach(e=>{o=e[0],r=e[1],s=n.get(o),a=s[r],a.delete(i),a.size||delete s[r],Object.keys(s).length||(n.delete(o),this.stopListening(o,"change"))}),t.delete(e)})}else n.forEach((e,t)=>{this.stopListening(t,"change")}),n.clear(),t.clear()},decorate(e){const t=this[e];if(!t)throw new mt.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(e,n)=>{e.return=t.apply(this,n)}),this[e]=function(...t){return this.fire(e,t)}}};yn(Tn,bt);var Sn=Tn;function En(e){e[xn]||(Object.defineProperty(e,xn,{value:new Map}),Object.defineProperty(e,Cn,{value:new Map}),Object.defineProperty(e,An,{value:new Map}))}function Pn(...e){const t=function(...e){if(!e.length)throw new mt.a("observable-bind-to-parse-error",null);const t={to:[]};let n;return"function"==typeof e[e.length-1]&&(t.callback=e.pop()),e.forEach(e=>{if("string"==typeof e)n.properties.push(e);else{if("object"!=typeof e)throw new mt.a("observable-bind-to-parse-error",null);n={observable:e,properties:[]},t.to.push(n)}}),t}(...e),n=Array.from(this._bindings.keys()),i=n.length;if(!t.callback&&t.to.length>1)throw new mt.a("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new mt.a("observable-bind-to-extra-callback",this);var o;t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==i)throw new mt.a("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),o=this._observable,this._to.forEach(e=>{const t=o[Cn];let n;t.get(e.observable)||o.listenTo(e.observable,"change",(i,r)=>{n=t.get(e.observable)[r],n&&n.forEach(e=>{Nn(o,e.property)})})}),function(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(o=>{t=o.properties[n.callback?0:e._bindProperties.indexOf(i)],n.to.push([o.observable,t]),function(e,t,n,i){const o=e[Cn],r=o.get(n),s=r||{};s[i]||(s[i]=new Set),s[i].add(t),r||o.set(n,s)}(e._observable,n,o.observable,t)})})}(this),this._bindProperties.forEach(e=>{Nn(this._observable,e)})}function Mn(e,t,n){if(this._bindings.size>1)throw new mt.a("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}(e,t),n)}function In(e){return e.every(e=>"string"==typeof e)}function Nn(e,t){const n=e[An].get(t);let i;n.callback?i=n.callback.apply(e,n.to.map(e=>e[0][e[1]])):(i=n.to[0],i=i[0][i[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=i:e.set(t,i)}class On extends _n{constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",t=>t&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}destroy(){this.stopListening()}}At(On,Sn);const Rn=Symbol("rootName");class Ln extends On{constructor(e,t){super(e,t),this.rootName="main"}is(e,t=null){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}get rootName(){return this.getCustomProperty(Rn)}set rootName(e){this._setCustomProperty(Rn,e)}set _name(e){this.name=e}}class Dn{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new mt.a("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new mt.a("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,this.position=zn._createAt(e.startPosition?e.startPosition:e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,i;do{i=this.position,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let i;if(n instanceof Dt){if(e.isAtEnd)return this.position=zn._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof wn)return this.shallow?e.offset++:e=new zn(i,0),this.position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof Dt){if(this.singleCharacters)return e=new zn(i,0),this.position=e,this._next();{let n,o=i.data.length;return i==this._boundaryEndParent?(o=this.boundaries.end.offset,n=new zt(i,0,o),e=zn._createAfter(n)):(n=new zt(i,0,i.data.length),e.offset++),this.position=e,this._formatReturnValue("text",n,t,e,o)}}if("string"==typeof i){let i;i=this.singleCharacters?1:(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const o=new zt(n,e.offset,i);return e.offset+=i,this.position=e,this._formatReturnValue("text",o,t,e,i)}return e=zn._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let i;if(n instanceof Dt){if(e.isAtStart)return this.position=zn._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof wn)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new zn(i,i.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof Dt){if(this.singleCharacters)return e=new zn(i,i.data.length),this.position=e,this._previous();{let n,o=i.data.length;if(i==this._boundaryStartParent){const t=this.boundaries.start.offset;n=new zt(i,t,i.data.length-t),o=n.data.length,e=zn._createBefore(n)}else n=new zt(i,0,i.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",n,t,e,o)}}if("string"==typeof i){let i;i=this.singleCharacters?1:e.offset-(n===this._boundaryStartParent?this.boundaries.start.offset:0),e.offset-=i;const o=new zt(n,e.offset,i);return this.position=e,this._formatReturnValue("text",o,t,e,i)}return e=zn._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,o){return t instanceof zt&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=zn._createAfter(t.textNode):(i=zn._createAfter(t.textNode),this.position=i)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=zn._createBefore(t.textNode):(i=zn._createBefore(t.textNode),this.position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:o}}}}class zn{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof On);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=zn._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Dn(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return 0===i?null:t[i-1]}is(e){return"position"===e||"view:position"===e}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=Ot(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(zn._createBefore(e),t)}}function jn(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function Bn(e){let t=0;for(const n of e)t++;return t}class Fn{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=Bn(this.getRanges());if(t!=Bn(e.getRanges()))return!1;if(0==t)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let t=!1;for(let i of e.getRanges())if(i=i.getTrimmed(),n.start.isEqual(i.start)&&n.end.isEqual(i.end)){t=!0;break}if(!t)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(e,t,n){if(null===e)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof Fn||e instanceof Hn)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof Vn)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof zn)this._setRanges([new Vn(e)]),this._setFakeOptions(t);else if(e instanceof Lt){const i=!!n&&!!n.backward;let o;if(void 0===t)throw new mt.a("view-selection-setto-required-second-parameter",this);o="in"==t?Vn._createIn(e):"on"==t?Vn._createOn(e):new Vn(zn._createAt(e,t)),this._setRanges([o],i),this._setFakeOptions(n)}else{if(!Ct(e))throw new mt.a("view-selection-setto-not-selectable",this);this._setRanges(e,t&&t.backward),this._setFakeOptions(t)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new mt.a("view-selection-setfocus-no-ranges",this);const n=zn._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.pop(),"before"==n.compareWith(i)?this._addRange(new Vn(n,i),!0):this._addRange(new Vn(i,n)),this.fire("change")}is(e){return"selection"===e||"view:selection"===e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const n of e)this._addRange(n);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Vn))throw new mt.a("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new mt.a("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Vn(e.start,e.end))}}At(Fn,bt);class Hn{constructor(e=null,t,n){this._selection=new Fn,this._selection.delegate("change").to(this),this._selection.setTo(e,t,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}At(Hn,bt);class Un{constructor(e){this.selection=new Hn,this.roots=new Tt({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(t=n(e),t)break}while(t)}}At(Un,Sn);class qn extends wn{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Wn,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new mt.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(e,t=null){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function Wn(){if($n(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if($n(e)>1)return null;e=e.parent}return!e||$n(e)>1?null:this.childCount}function $n(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}qn.DEFAULT_PRIORITY=10;class Gn extends wn{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Yn}is(e,t=null){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Lt||Array.from(t).length>0))throw new mt.a("view-emptyelement-cannot-add",[this,t])}}function Yn(){return null}const Qn=navigator.userAgent.toLowerCase();var Kn=function(e){return e.indexOf("macintosh")>-1}(Qn),Jn=function(e){return!!e.match(/gecko\/\d+/)}(Qn),Zn=function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(Qn),Xn=function(e){return e.indexOf("android")>-1}(Qn);(function(e){e.indexOf("chrome/")>-1&&e.indexOf("edge/")})(Qn),function(){let e=!1;try{e=0==="\u0107".search(new RegExp("[\\p{L}]","u"))}catch(e){}}();const ei={"\u2318":"ctrl","\u21e7":"shift","\u2325":"alt"},ti={ctrl:"\u2318",shift:"\u21e7",alt:"\u2325"},ni=function(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let t=65;t<=90;t++)e[String.fromCharCode(t).toLowerCase()]=t;for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return e}();function ii(e){let t;if("string"==typeof e){if(t=ni[e.toLowerCase()],!t)throw new mt.a("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?ni.alt:0)+(e.ctrlKey?ni.ctrl:0)+(e.shiftKey?ni.shift:0);return t}function oi(e){return"string"==typeof e&&(e=ci(e)),e.map(e=>"string"==typeof e?ii(e):e).reduce((e,t)=>t+e,0)}function ri(e){return Kn?ci(e).map(e=>ti[e.toLowerCase()]||e).reduce((e,t)=>e.slice(-1)in ei?e+t:e+"+"+t):e}function si(e){return e==ni.arrowright||e==ni.arrowleft||e==ni.arrowup||e==ni.arrowdown}function ai(e,t){const n="ltr"===t;switch(e){case ni.arrowleft:return n?"left":"right";case ni.arrowright:return n?"right":"left";case ni.arrowup:return"up";case ni.arrowdown:return"down"}}function li(e,t){const n=ai(e,t);return"down"===n||"right"===n}function ci(e){return e.split(/\s*\+\s*/)}class di extends wn{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=ui}is(e,t=null){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Lt||Array.from(t).length>0))throw new mt.a("view-uielement-cannot-add",this)}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const n of this.getAttributeKeys())t.setAttribute(n,this.getAttribute(n));return t}}function ui(){return null}class hi extends wn{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=fi}is(e,t=null){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Lt||Array.from(t).length>0))throw new mt.a("view-rawelement-cannot-add",[this,t])}}function fi(){return null}class mi{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"view:documentFragment"===e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){return"string"==typeof t?[new Dt(e,t)]:(Ct(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new Dt(e,t):t instanceof zt?new Dt(e,t.data):t))}(this.document,t);for(const o of i)null!==o.parent&&o._remove(),o.parent=this,this._children.splice(e,0,o),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n{}),i}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){w(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof zn?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new mt.a("view-writer-break-non-container-element",this.document);if(!t.parent)throw new mt.a("view-writer-break-root",this.document);if(e.isAtStart)return zn._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(zn._createAfter(t),n);const i=new Vn(e,zn._createAt(t,"end")),o=new zn(n,0);this.move(i,o)}return zn._createAfter(t)}mergeAttributes(e){const t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&0===n.childCount){const e=n.parent,t=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new zn(e,t))}const i=n.getChild(t-1),o=n.getChild(t);if(!i||!o)return e;if(i.is("$text")&&o.is("$text"))return _i(i,o);if(i.is("attributeElement")&&o.is("attributeElement")&&i.isSimilar(o)){const e=i.childCount;return i._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new zn(i,e))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new mt.a("view-writer-merge-containers-invalid-position",this.document);const i=t.getChild(t.childCount-1),o=zn._createAt(i instanceof Dt?i:t,"end");return this.move(Vn._createIn(n),zn._createAt(t,"end")),this.remove(Vn._createOn(n)),o}insert(e,t){!function e(t,n){for(const i of t){if(!vi.some(e=>i instanceof e))throw new mt.a("view-writer-insert-invalid-node-type",n);i.is("$text")||e(i.getChildren(),n)}}(t=Ct(t)?[...t]:[t],this.document);const n=pi(e);if(!n)throw new mt.a("view-writer-invalid-position-container",this.document);const i=this._breakAttributes(e,!0),o=n._insertChild(i.offset,t);for(const a of t)this._addToClonedElementsGroup(a);const r=i.getShiftedBy(o),s=this.mergeAttributes(i);if(0===o)return new Vn(s,s);{s.isEqual(i)||r.offset--;const e=this.mergeAttributes(r);return new Vn(s,e)}}remove(e){const t=e instanceof Vn?e:Vn._createOn(e);if(xi(t,this.document),t.isCollapsed)return new mi(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),o=n.parent._removeChildren(n.offset,i.offset-n.offset);for(const s of o)this._removeFromClonedElementsGroup(s);const r=this.mergeAttributes(n);return t.start=r,t.end=r.clone(),new mi(this.document,o)}clear(e,t){xi(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const n=i.item;let o;if(n.is("element")&&t.isSimilar(n))o=Vn._createOn(n);else if(!i.nextPosition.isAfter(e.start)&&n.is("$textProxy")){const e=n.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));e&&(o=Vn._createIn(e))}o&&(o.end.isAfter(e.end)&&(o.end=e.end),o.start.isBefore(e.start)&&(o.start=e.start),this.remove(o))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,o=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-o}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof qn))throw new mt.a("view-writer-wrap-invalid-attribute",this.document);if(xi(e,this.document),e.isCollapsed){let n=e.start;n.parent.is("element")&&!Array.from(n.parent.getChildren()).some(e=>!e.is("uiElement"))&&(n=n.getLastMatchingPosition(e=>e.item.is("uiElement"))),n=this._wrapPosition(n,t);const i=this.document.selection;return i.isCollapsed&&i.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new Vn(n)}return this._wrapRange(e,t)}unwrap(e,t){if(!(t instanceof qn))throw new mt.a("view-writer-unwrap-invalid-attribute",this.document);if(xi(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),o=this._unwrapChildren(n.parent,n.offset,i.offset,t),r=this.mergeAttributes(o.start);r.isEqual(o.start)||o.end.offset--;const s=this.mergeAttributes(o.end);return new Vn(r,s)}rename(e,t){const n=new _n(this.document,e,t.getAttributes());return this.insert(zn._createAfter(t),n),this.move(Vn._createIn(t),zn._createAt(n,0)),this.remove(Vn._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return zn._createAt(e,t)}createPositionAfter(e){return zn._createAfter(e)}createPositionBefore(e){return zn._createBefore(e)}createRange(e,t){return new Vn(e,t)}createRangeOn(e){return Vn._createOn(e)}createRangeIn(e){return Vn._createIn(e)}createSelection(e,t,n){return new Fn(e,t,n)}_wrapChildren(e,t,n,i){let o=t;const r=[];for(;o!1,e.parent._insertChild(e.offset,n);const i=new Vn(e,e.getShiftedBy(1));this.wrap(i,t);const o=new zn(n.parent,n.index);n._remove();const r=o.nodeBefore,s=o.nodeAfter;return r instanceof Dt&&s instanceof Dt?_i(r,s):wi(o)}_wrapAttributeElement(e,t){if(!Ci(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Ci(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(xi(e,this.document),e.isCollapsed){const n=this._breakAttributes(e.start,t);return new Vn(n,n)}const o=this._breakAttributes(i,t),r=o.parent.childCount,s=this._breakAttributes(n,t);return o.offset+=o.parent.childCount-r,new Vn(s,o)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new mt.a("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new mt.a("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new mt.a("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&yi(i.parent))return e.clone();if(yi(i))return e.clone();if(i.is("$text"))return this._breakAttributes(ki(e),t);if(n==i.childCount){const e=new zn(i.parent,i.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new zn(i.parent,i.index);return this._breakAttributes(e,t)}{const e=i.index+1,o=i._clone();i.parent._insertChild(e,o),this._addToClonedElementsGroup(o);const r=i._removeChildren(n,i.childCount-n);o._appendChild(r);const s=new zn(i.parent,e);return this._breakAttributes(s,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const i of e.getChildren())this._addToClonedElementsGroup(i);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const i of e.getChildren())this._removeFromClonedElementsGroup(i);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function pi(e){let t=e.parent;for(;!yi(t);){if(!t)return;t=t.parent}return t}function bi(e,t){return e.priorityt.priority)&&e.getIdentity()e.createTextNode("\xa0"),Si=e=>{const t=e.createElement("br");return t.dataset.ckeFiller=!0,t},Ei=(()=>{let e="";for(let t=0;t<7;t++)e+="\u200b";return e})();function Pi(e){return Ai(e)&&e.data.substr(0,7)===Ei}function Mi(e){return 7==e.data.length&&Pi(e)}function Ii(e){return Pi(e)?e.data.slice(7):e.data}function Ni(e,t){if(t.keyCode==ni.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,n=e.getRangeAt(0).startOffset;Pi(t)&&n<=7&&e.collapse(t,0)}}}function Oi(e,t,n,i=!1){n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.prototype.slice.call(e)),Array.isArray(t)||(t=Array.prototype.slice.call(t));const o=function(e,t,n){const i=Ri(e,t,n);if(-1===i)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const o=Ri(Li(e,i),Li(t,i),n);return{firstIndex:i,lastIndexOld:e.length-o,lastIndexNew:t.length-o}}(e,t,n);return i?function(e,t){const{firstIndex:n,lastIndexOld:i,lastIndexNew:o}=e;if(-1===n)return Array(t).fill("equal");let r=[];return n>0&&(r=r.concat(Array(n).fill("equal"))),o-n>0&&(r=r.concat(Array(o-n).fill("insert"))),i-n>0&&(r=r.concat(Array(i-n).fill("delete"))),o0&&n.push({index:i,type:"insert",values:e.slice(i,r)}),o-i>0&&n.push({index:i+(r-i),type:"delete",howMany:o-i}),n}(t,o)}function Ri(e,t,n){for(let i=0;i200||o>200||i+o>300)return Di.fastDiff(e,t,n,!0);let r,s;if(oc?-1:1;d[i+h]&&(d[i]=d[i+h].slice(0)),d[i]||(d[i]=[]),d[i].push(o>c?r:s);let f=Math.max(o,c),m=f-i;for(;mc;f--)u[f]=h(f);u[c]=h(c),m++}while(u[c]!==l);return d[c].slice(1)}function zi(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Vi(e){const t=e.parentNode;t&&t.removeChild(e)}function ji(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}Di.fastDiff=Oi;class Bi{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new mt.a("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){let e;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(e){const t=this.domConverter.viewPositionToDom(e),n=t.parent.ownerDocument;this._inlineFiller=Pi(t.parent)?t.parent:Fi(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=this.domConverter.mapViewToDom(e).childNodes,i=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(n,i),r=this._findReplaceActions(o,n,i);if(-1!==r.indexOf("replace")){const t={equal:0,insert:0,delete:0};for(const o of r)if("replace"===o){const o=t.equal+t.insert,r=t.equal+t.delete,s=e.getChild(o);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,n[r]),Vi(i[o]),t.equal++}else t[o]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?zn._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Ai(t.parent)&&Pi(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Pi(e))throw new mt.a("view-renderer-filler-was-lost",this);Mi(e)?e.parentNode.removeChild(e):e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;return!(!this.domConverter.mapViewToDom(t.root)||!t.is("element")||!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||"true"==t.getAttribute("contenteditable")}(t)||n===t.getFillerOffset()||e.nodeBefore instanceof Dt||e.nodeAfter instanceof Dt)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),i=this.domConverter.viewToDom(e,n.ownerDocument),o=n.data;let r=i.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index&&(r=Ei+r),o!=r){const e=Oi(o,r);for(const t of e)"insert"===t.type?n.insertData(t.index,t.values.join("")):n.deleteData(t.index,t.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(e=>e.name),i=e.getAttributeKeys();for(const o of i)t.setAttribute(o,e.getAttribute(o));for(const o of n)e.hasAttribute(o)||t.removeAttribute(o)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const i=t.inlineFillerPosition,o=this.domConverter.mapViewToDom(e).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:i}));i&&i.parent===e&&Fi(n.ownerDocument,r,i.offset);const s=this._diffNodeLists(o,r);let a=0;const l=new Set;for(const c of s)"delete"===c?(l.add(o[a]),Vi(o[a])):"equal"===c&&a++;a=0;for(const c of s)"insert"===c?(zi(n,a,r[a]),a++):"equal"===c&&(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const c of l)c.parentNode||this.domConverter.unbindDomElement(c)}_diffNodeLists(e,t){return Di(e=function(e,t){const n=Array.from(e);return 0!=n.length&&t?(n[n.length-1]==t&&n.pop(),n):n}(e,this._fakeSelectionContainer),t,Ui.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let i=[],o=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of e)"insert"===a?r.push(n[s.equal+s.insert]):"delete"===a?o.push(t[s.equal+s.delete]):(i=i.concat(Di(o,r,Hi).map(e=>"equal"===e?"replace":e)),i.push("equal"),o=[],r=[]),s[a]++;return i.concat(Di(o,r,Hi).map(e=>"equal"===e?"replace":e))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent="\xa0",t}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||"\xa0";const i=t.getSelection(),o=t.createRange();i.removeAllRanges(),o.selectNodeContents(n),i.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);e.focus(),t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),Jn&&function(e,t){const n=e.parent;if(n.nodeType!=Node.ELEMENT_NODE||e.offset!=n.childNodes.length-1)return;const i=n.childNodes[e.offset];i&&"BR"==i.tagName&&t.addRange(t.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return!(t&&this.selection.isEqual(t)||!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments)if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function Fi(e,t,n){const i=t instanceof Array?t:t.childNodes,o=i[n];if(Ai(o))return o.data=Ei+o.data,o;{const o=e.createTextNode(Ei);return Array.isArray(t)?i.splice(n,0,o):zi(t,n,o),o}}function Hi(e,t){return ji(e)&&ji(t)&&!Ai(e)&&!Ai(t)&&e.nodeType!==Node.COMMENT_NODE&&t.nodeType!==Node.COMMENT_NODE&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Ui(e,t,n){return t===n||(Ai(t)&&Ai(n)?t.data===n.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(n)))}At(Bi,Sn);var qi={window:window,document:document};function Wi(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function $i(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}const Gi=Si(document);class Yi{constructor(e,t={}){this.document=e,this.blockFillerMode=t.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption","td","th"],this._blockFiller="br"==this.blockFillerMode?Si:Ti,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new jt,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Fn(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.childNodes)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is("$text")){const n=this._processDataFromViewText(e);return t.createTextNode(n)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let i;if(e.is("documentFragment"))i=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(i,e);else{if(e.is("uiElement"))return i=e.render(t),n.bind&&this.bindElements(i,e),i;i=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(i),n.bind&&this.bindElements(i,e);for(const t of e.getAttributeKeys())i.setAttribute(t,e.getAttribute(t))}if(!1!==n.withChildren)for(const o of this.viewChildrenToDom(e,t,n))i.appendChild(o);return i}}*viewChildrenToDom(e,t,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const r of e.getChildren())i===o&&(yield this._blockFiller(t)),yield this.viewToDom(r,t,n),o++;i===o&&(yield this._blockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=document.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return Pi(n)&&(i+=7),{parent:n,offset:i}}{let n,i,o;if(0===e.offset){if(n=this.mapViewToDom(t),!n)return null;o=n.childNodes[0]}else{const t=e.nodeBefore;if(i=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore),!i)return null;n=i.parentNode,o=i.nextSibling}return Ai(o)&&Pi(o)?{parent:o,offset:7}:{parent:n,offset:i?Wi(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode))return null;const n=this.getHostViewElement(e);if(n)return n;if(Ai(e)){if(Mi(e))return null;{const t=this._processDataFromDomText(e);return""===t?null:new Dt(this.document,t)}}if(this.isComment(e))return null;{if(this.mapDomToView(e))return this.mapDomToView(e);let n;if(this.isDocumentFragment(e))n=new mi(this.document),t.bind&&this.bindDocumentFragments(e,n);else{const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new wn(this.document,i),t.bind&&this.bindElements(e,n);const o=e.attributes;for(let e=o.length-1;e>=0;e--)n._setAttribute(o[e].name,o[e].value);if(!1!==t.withChildren&&this._rawContentElementMatcher.match(n))return n._setCustomProperty("$rawContent",e.innerHTML),this._encounteredRawContentDomNodes.add(e),n}if(!1!==t.withChildren)for(const i of this.domChildrenToView(e,t))n._appendChild(i);return n}}*domChildrenToView(e,t={}){for(let n=0;n{const{scrollLeft:t,scrollTop:n}=e;i.push([t,n])}),t.focus(),Ki(t,e=>{const[t,n]=i.shift();e.scrollLeft=t,e.scrollTop=n}),qi.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(Gi):!("BR"!==e.tagName||!Ji(e,this.blockElements)||1!==e.parentNode.childNodes.length)||function(e,t){return Ai(e)&&"\xa0"==e.data&&Ji(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=$i(e);for(t.pop();t.length;){const e=t.pop(),n=this._domToViewMapping.get(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return n}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_isDomSelectionPositionCorrect(e,t){if(Ai(e)&&Pi(e)&&t<7)return!1;if(this.isElement(e)&&Pi(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return t;if(" "==t.charAt(0)){const n=this._getTouchingViewTextNode(e,!1);(!n||!this._nodeEndsWithSpace(n))&&n||(t="\xa0"+t.substr(1))}if(" "==t.charAt(t.length-1)){const n=this._getTouchingViewTextNode(e,!0);" "!=t.charAt(t.length-2)&&n&&" "!=n.data.charAt(0)||(t=t.substr(0,t.length-1)+"\xa0")}return t.replace(/ {2}/g," \xa0")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(Qi(e,this.preElements))return Ii(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),o=this._checkShouldLeftTrimDomText(e,n),r=this._checkShouldRightTrimDomText(e,i);return o&&(t=t.replace(/^ /,"")),r&&(t=t.replace(/ $/,"")),t=Ii(new Text(t)),t=t.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(t)||!i||i.data&&" "==i.data.charAt(0))&&(t=t.replace(/\u00A0$/," ")),o&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||!!st(t)||!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1))}_checkShouldRightTrimDomText(e,t){return!t&&!Pi(e)}_getTouchingViewTextNode(e,t){const n=new Dn({startPosition:t?zn._createAfter(e):zn._createBefore(e),direction:t?"forward":"backward"});for(const i of n){if(i.item.is("containerElement"))return null;if(i.item.is("element","br"))return null;if(i.item.is("$textProxy"))return i.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"nextNode":"previousNode",i=e.ownerDocument,o=$i(e)[0],r=i.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:e=>Ai(e)||"BR"==e.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=e;const s=r[n]();if(null!==s){const t=function(e,t){const n=$i(e),i=$i(t);let o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1]}(e,s);if(t&&!Qi(e,this.blockElements,t)&&!Qi(s,this.blockElements,t))return s}return null}}function Qi(e,t,n){let i=$i(e);return n&&(i=i.slice(i.indexOf(n)+1)),i.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Ki(e,t){for(;e&&e!=qi.document;)t(e),e=e.parentNode}function Ji(e,t){const n=e.parentNode;return n&&n.tagName&&t.includes(n.tagName.toLowerCase())}function Zi(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}var Xi=yn({},bt,{listenTo(e,...t){if(ji(e)||Zi(e)){const n=this._getProxyEmitter(e)||new eo(e);n.attach(...t),e=n}bt.listenTo.call(this,e,...t)},stopListening(e,t,n){if(ji(e)||Zi(e)){const t=this._getProxyEmitter(e);if(!t)return;e=t}bt.stopListening.call(this,e,t,n),e instanceof eo&&e.detach(t)},_getProxyEmitter(e){return t=this,n=to(e),t[gt]&&t[gt][n]?t[gt][n].emitter:null;var t,n}});class eo{constructor(e){wt(this,to(e)),this._domNode=e}}function to(e){return e["data-ck-expando"]||(e["data-ck-expando"]=ht())}yn(eo.prototype,bt,{attach(e,t,n={}){if(this._domListeners&&this._domListeners[e])return;const i={capture:!!n.useCapture,passive:!!n.usePassive},o=this._createDomListener(e,i);this._domNode.addEventListener(e,o,i),this._domListeners||(this._domListeners={}),this._domListeners[e]=o},detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener(e,t){const n=t=>{this.fire(e,t)};return n.removeListener=()=>{this._domNode.removeEventListener(e,n,t),delete this._domListeners[e]},n}});class no{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}function io(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new H;++ta))return!1;var c=r.get(e);if(c&&r.get(t))return c==t;var d=-1,u=!0,h=2&n?new oo:void 0;for(r.set(e,t),r.set(t,e);++d{this.listenTo(e,t,(e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new wo(this.view,t,n))}}class _o extends ko{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,get keystroke(){return ii(this)}})}}var vo=function(){return i.a.Date.now()},yo=/^\s+|\s+$/g,xo=/^[-+]0x[0-9a-f]+$/i,Co=/^0b[01]+$/i,Ao=/^0o[0-7]+$/i,To=parseInt,So=function(e){if("number"==typeof e)return e;if(Ft(e))return NaN;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(yo,"");var n=Co.test(e);return n||Ao.test(e)?To(e.slice(2),n?2:8):xo.test(e)?NaN:+e},Eo=Math.max,Po=Math.min,Mo=function(e,t,n){var i,o,r,s,a,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=i,r=o;return i=o=void 0,c=t,s=e.apply(r,n)}function m(e){return c=e,a=setTimeout(p,t),d?f(e):s}function g(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=r}function p(){var e=vo();if(g(e))return b(e);a=setTimeout(p,function(e){var n=t-(e-l);return u?Po(n,r-(e-c)):n}(e))}function b(e){return a=void 0,h&&i?f(e):(i=o=void 0,s)}function w(){var e=vo(),n=g(e);if(i=arguments,o=this,l=e,n){if(void 0===a)return m(l);if(u)return clearTimeout(a),a=setTimeout(p,t),f(l)}return void 0===a&&(a=setTimeout(p,t)),s}return t=So(t)||0,A(n)&&(d=!!n.leading,r=(u="maxWait"in n)?Eo(So(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h),w.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=o=a=void 0},w.flush=function(){return void 0===a?s:b(vo())},w};class Io extends no{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Mo(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const e=this.document;e.on("keydown",(t,n)=>{e.selection.isFake&&si(n.keyCode)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new Fn(t.getRanges(),{backward:t.isBackward,fake:!1});e!=ni.arrowleft&&e!=ni.arrowup||n.setTo(n.getFirstPosition()),e!=ni.arrowright&&e!=ni.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}class No extends no{constructor(e){super(e),this.mutationObserver=e.getObserver(bo),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Mo(e=>this.document.fire("selectionChangeDone",e),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument;this._documents.has(t)||(this.listenTo(t,"selectionchange",(e,n)=>{this._handleSelectionChange(n,t)}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(0!=i.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Oo extends ko{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)}),t.on("blur",(n,i)=>{const o=t.selection.editableElement;null!==o&&o!==i.target||(t.isFocused=!1,e.forceRender())})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Ro extends ko{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class Lo extends ko{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}function Do(e){return"[object Range]"==Object.prototype.toString.apply(e)}function zo(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const Vo=["top","right","bottom","left","width","height"];class jo{constructor(e){const t=Do(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),st(e)||t)if(t){const t=jo.getDomRangeRects(e);Bo(this,jo.getBoundingRect(t))}else Bo(this,e.getBoundingClientRect());else if(Zi(e)){const{innerWidth:t,innerHeight:n}=e;Bo(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else Bo(this,e)}clone(){return new jo(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new jo(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!Fo(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!Fo(n);){const e=new jo(n),i=t.getIntersection(e);if(!i)return null;i.getArea()Jo(e,i));const s=Jo(e,i);if(Uo(i,s,t),i.parent!=i){if(o=i.frameElement,i=i.parent,!o)return}else i=null}}function Uo(e,t,n){const i=t.clone().moveBy(0,n),o=t.clone().moveBy(0,-n),r=new jo(e).excludeScrollbarsAndBorders();if(![o,i].every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;$o(o,r)?a-=r.top-t.top+n:Wo(i,r)&&(a+=t.bottom-r.bottom+n),Go(t,r)?s-=r.left-t.left+n:Yo(t,r)&&(s+=t.right-r.right+n),e.scrollTo(s,a)}}function qo(e,t){const n=Qo(e);let i,o;for(;e!=n.document.body;)o=t(),i=new jo(e).excludeScrollbarsAndBorders(),i.contains(o)||($o(o,i)?e.scrollTop-=i.top-o.top:Wo(o,i)&&(e.scrollTop+=o.bottom-i.bottom),Go(o,i)?e.scrollLeft-=i.left-o.left:Yo(o,i)&&(e.scrollLeft+=o.right-i.right)),e=e.parentNode}function Wo(e,t){return e.bottom>t.bottom}function $o(e,t){return e.topt.right}function Qo(e){return Do(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Ko(e){if(Do(e)){let t=e.commonAncestorContainer;return Ai(t)&&(t=t.parentNode),t}return e.parentNode}function Jo(e,t){const n=Qo(e),i=new jo(e);if(n===t)return i;{let e=n;for(;e!=t;){const t=new jo(e.frameElement).excludeScrollbarsAndBorders();i.moveBy(t.left,t.top),e=e.parent}}return i}Object.assign({},{scrollViewportToShowTarget:Ho,scrollAncestorsToShowTarget:function(e){qo(Ko(e),()=>new jo(e))}});class Zo{constructor(e){this.document=new Un(e),this.domConverter=new Yi(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Bi(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new gi(this.document),this.addObserver(bo),this.addObserver(No),this.addObserver(Oo),this.addObserver(_o),this.addObserver(Io),this.addObserver(Ro),Xn&&this.addObserver(Lo),this.document.on("keydown",Ni),function(e){e.document.on("keydown",(t,n)=>function(e,t,n){if(t.keyCode==ni.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),i=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(i||t.shiftKey){const t=n.domPositionToView(e.focusNode,e.focusOffset);if(null===t)return;let o=!1;const r=t.getLastMatchingPosition(e=>(e.item.is("uiElement")&&(o=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))));if(o){const t=n.viewPositionToDom(r);i?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,n,e.domConverter))}(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:r,value:s}of Array.from(e.attributes))i[r]=s,"class"===r?this._writer.addClass(s.split(" "),n):this._writer.setAttribute(r,s,n);this._initialDomRootAttributes.set(e,i);const o=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};o(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(e,t)=>this._renderer.markToSync("children",t)),n.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t)),n.on("change:text",(e,t)=>this._renderer.markToSync("text",t)),n.on("change:isReadOnly",()=>this.change(o)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const r of this._observers.values())r.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const n=this._initialDomRootAttributes.get(t);for(const i in n)t.setAttribute(i,n[i]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[n,i]of this.domRoots)t.observe(i,n);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&Ho({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new mt.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){mt.a.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return zn._createAt(e,t)}createPositionAfter(e){return zn._createAfter(e)}createPositionBefore(e){return zn._createBefore(e)}createRange(e,t){return new Vn(e,t)}createRangeOn(e){return Vn._createOn(e)}createRangeIn(e){return Vn._createIn(e)}createSelection(e,t,n){return new Fn(e,t,n)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}At(Zo,Sn);class Xo{constructor(e){this.parent=null,this._attrs=Vt(e)}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new mt.a("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new mt.a("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Ot(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i](e[t[0]]=t[1],e),{})),e}is(e){return"node"===e||"model:node"===e}_clone(){return new Xo(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Vt(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class er extends Xo{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new er(this.data,this.getAttributes())}static fromJSON(e){return new er(e.data,e.attributes)}}class tr{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new mt.a("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new mt.a("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class nr{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new mt.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&ee.toJSON())}}class ir extends Xo{constructor(e,t,n){super(t),this.name=e,this._children=new nr,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(e,t=null){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={includeSelf:!1}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(e=>e._clone(!0)):null;return new ir(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){return"string"==typeof e?[new er(e)]:(Ct(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new er(e):e instanceof tr?new er(e.data,e.getAttributes()):e))}(t);for(const i of n)null!==i.parent&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)t.push(n.name?ir.fromJSON(n):er.fromJSON(n))}return new ir(e.name,e.attributes,t)}}class or{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new mt.a("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new mt.a("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,this.position=e.startPosition?e.startPosition.clone():sr._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,i,o;do{i=this.position,o=this._visitedParent,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i,this._visitedParent=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const i=t.parent,o=ar(t,i),r=o||lr(t,i,o);if(r instanceof ir)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=r),this.position=t,rr("elementStart",r,e,t,1);if(r instanceof er){let i;if(this.singleCharacters)i=1;else{let e=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),i=t.offset-e}const o=new tr(r,t.offset-r.startOffset-i,i);return t.offset-=i,this.position=t,rr("text",o,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,rr("elementStart",n,e,t,1)}}function rr(e,t,n,i,o){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:o}}}class sr{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new mt.a("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new mt.a("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;tn.path.length){if(t.offset!==i.maxOffset)return!1;t.path=t.path.slice(0,-1),i=i.parent,t.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}is(e){return"position"===e||"model:position"===e}hasSameParentAs(e){return this.root===e.root&&"same"==Ot(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=sr._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?sr._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=sr._createAt(this);if(this.root!=e.root)return n;if("same"==Ot(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;n.offset-=t}}else if("prefix"==Ot(e.getParentPath(),this.getParentPath())){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=sr._createAt(this);if(this.root!=e.root)return n;if("same"==Ot(e.getParentPath(),this.getParentPath()))(e.offsett+1;){const t=i.maxOffset-n.offset;0!==t&&e.push(new dr(n,n.getShiftedBy(t))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const t=this.end.path[n.path.length-1],i=t-n.offset;0!==i&&e.push(new dr(n,n.getShiftedBy(i))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new or(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new or(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new or(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new dr(this.start,this.end)]}getTransformedByOperations(e){const t=[new dr(this.start,this.end)];for(const n of e)for(let e=0;e0?new this(n,i):new this(i,n)}static _createIn(e){return new this(sr._createAt(e,0),sr._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(sr._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new mt.a("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let o=n-1;e[o].end.isEqual(i.start);o++)i.start=sr._createAt(e[o].start);for(let o=n+1;o{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=sr._createAt(i,o)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);if(this._viewToModelMapping.delete(e),this._elementToMarkerNames.has(e))for(const n of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(n);this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),0==n.size&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),0==i.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new dr(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Vn(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const i of t)if(i.is("attributeElement"))for(const e of i.getElementsWithSameId())n.add(e);else n.add(i);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let i=0;for(let o=0;o1?t[0]+":"+t[1]:t[0]}class mr{constructor(e){this.conversionApi=Object.assign({dispatcher:this},e),this._reconversionEventsMapping=new Map}convertChanges(e,t,n){for(const o of e.getMarkersToRemove())this.convertMarkerRemove(o.name,o.range,n);const i=this._mapChangesWithAutomaticReconversion(e);for(const o of i)"insert"===o.type?this.convertInsert(dr._createFromPositionAndShift(o.position,o.length),n):"remove"===o.type?this.convertRemove(o.position,o.length,o.name,n):"reconvert"===o.type?this.reconvertElement(o.element,n):this.convertAttribute(o.range,o.attributeKey,o.attributeOldValue,o.attributeNewValue,n);for(const o of this.conversionApi.mapper.flushUnboundMarkerNames()){const e=t.get(o).getRange();this.convertMarkerRemove(o,e,n),this.convertMarkerAdd(o,e,n)}for(const o of e.getMarkersToAdd())this.convertMarkerAdd(o.name,o.range,n)}convertInsert(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);for(const n of Array.from(e).map(pr))this._convertInsertWithAttributes(n);this._clearConversionApi()}convertRemove(e,t,n,i){this.conversionApi.writer=i,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,n,i,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(e,"attribute:"+t);for(const r of e){const e={item:r.item,range:dr._createFromPositionAndShift(r.previousPosition,r.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire("attribute:"+t,e)}this._clearConversionApi()}reconvertElement(e,t){const n=dr._createOn(e);this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(n);const i=this.conversionApi.mapper,o=i.toViewElement(e);t.remove(o),this._convertInsertWithAttributes({item:e,range:n});const r=i.toViewElement(e);for(const s of dr._createIn(e)){const{item:e}=s,n=br(e,i);n?n.root!==r.root&&t.move(t.createRangeOn(n),i.toViewPosition(sr._createBefore(e))):this._convertInsertWithAttributes(pr(s))}i.unbindViewElement(o),this._clearConversionApi()}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,i),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const t of i){const n=t.getRange();if(!gr(e.getFirstPosition(),t,this.conversionApi.mapper))continue;const i={item:e,markerName:t.name,markerRange:n};this.conversionApi.consumable.test(e,"addMarker:"+t.name)&&this.fire("addMarker:"+t.name,i,this.conversionApi)}for(const t of e.getAttributeKeys()){const n={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.conversionApi.consumable.test(e,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(e,t,n){if(!t.root.document||"$graveyard"==t.root.rootName)return;this.conversionApi.writer=n;const i="addMarker:"+e,o=new hr;if(o.add(t,i),this.conversionApi.consumable=o,this.fire(i,{markerName:e,markerRange:t},this.conversionApi),o.test(t,i)){this.conversionApi.consumable=this._createConsumableForRange(t,i);for(const n of t.getItems()){if(!this.conversionApi.consumable.test(n,i))continue;const o={item:n,range:dr._createOn(n),markerName:e,markerRange:t};this.fire(i,o,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(e,t,n){t.root.document&&"$graveyard"!=t.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(e,t){this._reconversionEventsMapping.set(t,e)}_createInsertConsumable(e){const t=new hr;for(const n of e){const e=n.item;t.add(e,"insert");for(const n of e.getAttributeKeys())t.add(e,"attribute:"+n)}return t}_createConsumableForRange(e,t){const n=new hr;for(const i of e.getItems())n.add(i,t);return n}_createSelectionConsumable(e,t){const n=new hr;n.add(e,"selection");for(const i of t)n.add(e,"addMarker:"+i.name);for(const i of e.getAttributeKeys())n.add(e,"attribute:"+i);return n}_testAndFire(e,t){this.conversionApi.consumable.test(t.item,e)&&this.fire(function(e,t){return`${e}:${t.item.name||"$text"}`}(e,t),t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(e){this._testAndFire("insert",e);for(const t of e.item.getAttributeKeys())e.attributeKey=t,e.attributeOldValue=null,e.attributeNewValue=e.item.getAttribute(t),this._testAndFire("attribute:"+t,e)}_mapChangesWithAutomaticReconversion(e){const t=new Set,n=[];for(const i of e.getChanges()){const e=i.position||i.range.start,o=e.parent;if(ar(e,o)){n.push(i);continue}const r="attribute"===i.type?lr(e,o,null):o;if(r.is("$text")){n.push(i);continue}let s;if(s="attribute"===i.type?`attribute:${i.attributeKey}:${r.name}`:`${i.type}:${i.name}`,this._isReconvertTriggerEvent(s,r.name)){if(t.has(r))continue;t.add(r),n.push({type:"reconvert",element:r})}else n.push(i)}return n}_isReconvertTriggerEvent(e,t){return this._reconversionEventsMapping.get(e)===t}}function gr(e,t,n){const i=t.getRange(),o=Array.from(e.getAncestors());return o.shift(),o.reverse(),!o.some(e=>{if(i.containsItem(e))return!!n.toViewElement(e).getCustomProperty("addHighlight")})}function pr(e){return{item:e.item,range:dr._createFromPositionAndShift(e.previousPosition,e.length)}}function br(e,t){if(e.is("textProxy")){const n=t.toViewPosition(sr._createBefore(e)).parent;return n.is("$text")?n:null}return t.toViewElement(e)}At(mr,bt);class wr{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new dr(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new dr(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new dr(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(null===e)this._setRanges([]);else if(e instanceof wr)this._setRanges(e.getRanges(),e.isBackward);else if(e&&"function"==typeof e.getRanges)this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof dr)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof sr)this._setRanges([new dr(e)]);else if(e instanceof Xo){const i=!!n&&!!n.backward;let o;if("in"==t)o=dr._createIn(e);else if("on"==t)o=dr._createOn(e);else{if(void 0===t)throw new mt.a("model-selection-setto-required-second-parameter",[this,e]);o=new dr(sr._createAt(e,t))}this._setRanges([o],i)}else{if(!Ct(e))throw new mt.a("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(t=>{if(!(t instanceof dr))throw new mt.a("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(e=>!e.isEqual(t))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const t of e)this._pushRange(t);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(null===this.anchor)throw new mt.a("model-selection-setfocus-no-ranges",[this,e]);const n=sr._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(i)?(this._pushRange(new dr(n,i)),this._lastRangeBackward=!0):(this._pushRange(new dr(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(e){return"selection"===e||"model:selection"===e}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=vr(t.start,e);n&&yr(n,t)&&(yield n);for(const o of t.getWalker()){const n=o.item;"elementEnd"==o.type&&_r(n,e,t)&&(yield n)}const i=vr(t.end,e);i&&!t.end.isTouching(sr._createAt(i,0))&&yr(i,t)&&(yield i)}}containsEntireContent(e=this.anchor.root){const t=sr._createAt(e,0),n=sr._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new dr(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function kr(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&e.parent)}function _r(e,t,n){return kr(e,t)&&yr(e,n)}function vr(e,t){const n=e.parent.root.document.model.schema,i=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=i.find(e=>!o&&(o=n.isLimit(e),!o&&kr(e,t)));return i.forEach(e=>t.add(e)),r}function yr(e,t){const n=function(e){const t=e.root.document.model.schema;let n=e.parent;for(;n;){if(t.isBlock(n))return n;n=n.parent}}(e);return!n||!t.containsRange(dr._createOn(n),!0)}At(wr,bt);class xr extends dr{constructor(e,t){super(e,t),Cr.call(this)}detach(){this.stopListening()}is(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e}toRange(){return new dr(this.start,this.end)}static fromRange(e){return new xr(e.start,e.end)}}function Cr(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&Ar.call(this,n)},{priority:"low"})}function Ar(e){const t=this.getTransformedByOperation(e),n=dr._createFromRanges(t),i=!n.isEqual(this),o=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let r=null;if(i){"$graveyard"==n.root.rootName&&(r="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",t,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}At(xr,bt);class Tr{constructor(e){this._selection=new Sr(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}is(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return"selection:"+e}static _isStoreAttributeKey(e){return e.startsWith("selection:")}}At(Tr,bt);class Sr extends wr{constructor(e){super(),this.markers=new Tt({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&"marker"!=n.type&&"rename"!=n.type&&"noop"!=n.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new mt.a("document-selection-wrong-position",this,{range:e})}),this.listenTo(this._model.markers,"update",(e,t,n,i)=>{this._updateMarker(t,i)}),this.listenTo(this._document,"change",(e,t)=>{!function(e,t){const n=e.document.differ;for(const i of n.getChanges()){if("insert"!=i.type)continue;const n=i.position.parent;i.length===n.maxOffset&&e.enqueueChange(t,e=>{const t=Array.from(n.getAttributeKeys()).filter(e=>e.startsWith("selection:"));for(const i of t)e.removeAttribute(i,n)})}}(this._model,t)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}}),t}_updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const i of this._model.markers){const t=i.name.split(":",1)[0];if(!this._observedMarkers.has(t))continue;const n=i.getRange();for(const o of this.getRanges())n.containsRange(o,!o.isCollapsed)&&e.push(i)}const n=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const o=Array.from(this.markers),r=this.markers.has(e);if(t){let n=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){n=!0;break}n&&!r?(this.markers.add(e),i=!0):!n&&r&&(this.markers.remove(e),i=!0)}else r&&(this.markers.remove(e),i=!0);i&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(e){const t=Vt(this._getSurroundingAttributes()),n=Vt(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[o,r]of this._attributePriority)"low"==r&&(this._attrs.delete(o),this._attributePriority.delete(o));this._setAttributesTo(t);const i=[];for(const[o,r]of this.getAttributes())n.has(o)&&n.get(o)===r||i.push(o);for(const[o]of n)this.hasAttribute(o)||i.push(o);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return!("low"==n&&"normal"==this._attributePriority.get(e)||(this._attributePriority.set(e,n),!super.hasAttribute(e)||(this._attrs.delete(e),0)))}_setAttributesTo(e){const t=new Set;for(const[n,i]of this.getAttributes())e.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of e)this._setAttribute(n,i,!1)&&t.add(n);return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith("selection:")){const n=t.substr("selection:".length);yield[n,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=Er(i)),n||(n=Er(o)),!this.isGravityOverridden&&!n){let e=i;for(;e&&!t.isInline(e)&&!n;)e=e.previousSibling,n=Er(e)}if(!n){let e=o;for(;e&&!t.isInline(e)&&!n;)e=e.nextSibling,n=Er(e)}n||(n=this._getStoredAttributes())}else{const e=this.getFirstRange();for(const i of e){if(i.item.is("element")&&t.isObject(i.item))break;if("text"==i.type){n=i.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Er(e){return e instanceof tr||e instanceof er?e.getAttributes():null}class Pr{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var Mr=function(e){return ot(e,5)};class Ir extends Pr{elementToElement(e){return this.add(function(e){return(e=Mr(e)).view=Rr(e.view,"container"),t=>{var n;if(t.on("insert:"+e.model,(n=e.view,(e,t,i)=>{const o=n(t.item,i);if(!o)return;if(!i.consumable.consume(t.item,"insert"))return;const r=i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,o),i.writer.insert(r,o)}),{priority:e.converterPriority||"normal"}),e.triggerBy){if(e.triggerBy.attributes)for(const n of e.triggerBy.attributes)t._mapReconversionTriggerEvent(e.model,`attribute:${n}:${e.model}`);if(e.triggerBy.children)for(const n of e.triggerBy.children)t._mapReconversionTriggerEvent(e.model,"insert:"+n),t._mapReconversionTriggerEvent(e.model,"remove:"+n)}}}(e))}attributeToElement(e){return this.add(function(e){let t="attribute:"+((e=Mr(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values)for(const i of e.model.values)e.view[i]=Rr(e.view[i],"attribute");else e.view=Rr(e.view,"attribute");const n=Lr(e);return i=>{i.on(t,function(e){return(t,n,i)=>{const o=e(n.attributeOldValue,i),r=e(n.attributeNewValue,i);if(!o&&!r)return;if(!i.consumable.consume(n.item,t.name))return;const s=i.writer;if(n.item instanceof wr||n.item instanceof Tr)s.wrap(s.document.selection.getFirstRange(),r);else{let e=i.mapper.toViewRange(n.range);null!==n.attributeOldValue&&o&&(e=s.unwrap(e,o)),null!==n.attributeNewValue&&r&&s.wrap(e,r)}}}(n),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t="attribute:"+((e=Mr(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values)for(const i of e.model.values)e.view[i]=Dr(e.view[i]);else e.view=Dr(e.view);const n=Lr(e);return i=>{var o;i.on(t,(o=n,(e,t,n)=>{const i=o(t.attributeOldValue,n),r=o(t.attributeNewValue,n);if(!i&&!r)return;if(!n.consumable.consume(t.item,e.name))return;const s=n.mapper.toViewElement(t.item),a=n.writer;if(!s)throw new mt.a("conversion-attribute-to-attribute-on-text",[t,n]);if(null!==t.attributeOldValue&&i)if("class"==i.key){const e=Et(i.value);for(const t of e)a.removeClass(t,s)}else if("style"==i.key){const e=Object.keys(i.value);for(const t of e)a.removeStyle(t,s)}else a.removeAttribute(i.key,s);if(null!==t.attributeNewValue&&r)if("class"==r.key){const e=Et(r.value);for(const t of e)a.addClass(t,s)}else if("style"==r.key){const e=Object.keys(r.value);for(const t of e)a.setStyle(t,r.value[t],s)}else a.setAttribute(r.key,r.value,s)}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){return(e=Mr(e)).view=Rr(e.view,"ui"),t=>{var n;t.on("addMarker:"+e.model,(n=e.view,(e,t,i)=>{t.isOpening=!0;const o=n(t,i);t.isOpening=!1;const r=n(t,i);if(!o||!r)return;const s=t.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,e.name))return;for(const n of s)if(!i.consumable.consume(n.item,e.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(s.start),o),i.mapper.bindElementToMarker(o,t.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),i.mapper.bindElementToMarker(r,t.markerName)),e.stop()}),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,(e,t,n)=>{const i=n.mapper.markerNameToElements(t.markerName);if(i){for(const e of i)n.mapper.unbindElementFromMarkerName(e,t.markerName),n.writer.clear(n.writer.createRangeOn(e),e);n.writer.clearClonedElementsGroup(t.markerName),e.stop()}},{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var n;t.on("addMarker:"+e.model,(n=e.view,(e,t,i)=>{if(!t.item)return;if(!(t.item instanceof wr||t.item instanceof Tr||t.item.is("$textProxy")))return;const o=zr(n,t,i);if(!o)return;if(!i.consumable.consume(t.item,e.name))return;const r=i.writer,s=Nr(r,o),a=r.document.selection;if(t.item instanceof wr||t.item instanceof Tr)r.wrap(a.getFirstRange(),s,a);else{const e=i.mapper.toViewRange(t.range),n=r.wrap(e,s);for(const o of n.getItems())if(o.is("attributeElement")&&o.isSimilar(s)){i.mapper.bindElementToMarker(o,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{if(!n.item)return;if(!(n.item instanceof ir))return;const o=zr(e,n,i);if(!o)return;if(!i.consumable.test(n.item,t.name))return;const r=i.mapper.toViewElement(n.item);if(r&&r.getCustomProperty("addHighlight")){i.consumable.consume(n.item,t.name);for(const e of dr._createIn(n.item))i.consumable.consume(e.item,t.name);r.getCustomProperty("addHighlight")(r,o,i.writer),i.mapper.bindElementToMarker(r,n.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,function(e){return(t,n,i)=>{if(n.markerRange.isCollapsed)return;const o=zr(e,n,i);if(!o)return;const r=Nr(i.writer,o),s=i.mapper.markerNameToElements(n.markerName);if(s){for(const e of s)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(e),r):e.getCustomProperty("removeHighlight")(e,o.id,i.writer);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){const t=(e=Mr(e)).model;return e.view||(e.view=n=>({group:t,name:n.substr(e.model.length+1)})),n=>{var i;n.on("addMarker:"+t,(i=e.view,(e,t,n)=>{const o=i(t.markerName,n);if(!o)return;const r=t.markerRange;n.consumable.consume(r,e.name)&&(Or(r,!1,n,t,o),Or(r,!0,n,t,o),e.stop())}),{priority:e.converterPriority||"normal"}),n.on("removeMarker:"+t,function(e){return(t,n,i)=>{const o=e(n.markerName,i);if(!o)return;const r=i.mapper.markerNameToElements(n.markerName);if(r){for(const e of r)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("containerElement")?(s(`data-${o.group}-start-before`,e),s(`data-${o.group}-start-after`,e),s(`data-${o.group}-end-before`,e),s(`data-${o.group}-end-after`,e)):i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}function s(e,t){if(t.hasAttribute(e)){const n=new Set(t.getAttribute(e).split(","));n.delete(o.name),0==n.size?i.writer.removeAttribute(e,t):i.writer.setAttribute(e,Array.from(n).join(","),t)}}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}}function Nr(e,t){const n=e.createAttributeElement("span",t.attributes);return t.classes&&n._addClass(t.classes),t.priority&&(n._priority=t.priority),n._id=t.id,n}function Or(e,t,n,i,o){const r=t?e.start:e.end;if(n.schema.checkChild(r,"$text"))!function(e,t,n,i,o){const r=n.writer.createUIElement(`${o.group}-${t?"start":"end"}`,o.name?{name:o.name}:null);n.writer.insert(e,r),n.mapper.bindElementToMarker(r,i.markerName)}(n.mapper.toViewPosition(r),t,n,i,o);else{let e,s;t&&r.nodeAfter||!t&&!r.nodeBefore?(e=r.nodeAfter,s=!0):(e=r.nodeBefore,s=!1),function(e,t,n,i,o,r){const s=`data-${r.group}-${t?"start":"end"}-${n?"before":"after"}`,a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name),i.writer.setAttribute(s,a.join(","),e),i.mapper.bindElementToMarker(e,o.markerName)}(n.mapper.toViewElement(e),t,s,n,i,o)}}function Rr(e,t){return"function"==typeof e?e:(n,i)=>function(e,t,n){let i;"string"==typeof e&&(e={name:e});const o=t.writer,r=Object.assign({},e.attributes);if(i="container"==n?o.createContainerElement(e.name,r):"attribute"==n?o.createAttributeElement(e.name,r,{priority:e.priority||qn.DEFAULT_PRIORITY}):o.createUIElement(e.name,r),e.styles){const t=Object.keys(e.styles);for(const n of t)o.setStyle(n,e.styles[n],i)}if(e.classes){const t=e.classes;if("string"==typeof t)o.addClass(t,i);else for(const e of t)o.addClass(e,i)}return i}(e,i,t)}function Lr(e){return e.model.values?(t,n)=>{const i=e.view[t];return i?i(t,n):null}:e.view}function Dr(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function zr(e,t,n){const i="function"==typeof e?e(t,n):e;return i?(i.priority||(i.priority=10),i.id||(i.id=t.markerName),i):null}function Vr(e){const{schema:t,document:n}=e.model;for(const i of n.getRootNames()){const o=n.getRoot(i);if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0}return!1}function jr(e,t,n){const i=n.createContext(e);return!!n.checkChild(i,"paragraph")&&!!n.checkChild(i.push("paragraph"),t)}function Br(e,t){const n=t.createElement("paragraph");return t.insert(n,e),t.createPositionAt(n,0)}class Fr extends Pr{elementToElement(e){return this.add(Hr(e))}elementToAttribute(e){return this.add(function(e){Wr(e=Mr(e));const t=$r(e,!1),n=Ur(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=null;("string"==typeof(e=Mr(e)).view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let n;return n="class"==t||"style"==t?{["class"==t?"classes":"styles"]:e.view.value}:{attributes:{[t]:void 0===e.view.value?/[\s\S]*/:e.view.value}},e.view.name&&(n.name=e.view.name),e.view=n,t}(e)),Wr(e,t);const n=$r(e,!0);return t=>{t.on("element",n,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return Object(mt.c)("upcast-helpers-element-to-marker-deprecated"),this.add(function(e){return function(e){const t=e.model;e.model=(e,n)=>{const i="string"==typeof t?t:t(e,n);return n.writer.createElement("$marker",{"data-name":i})}}(e=Mr(e)),Hr(e)}(e))}dataToMarker(e){return this.add(function(e){(e=Mr(e)).model||(e.model=t=>t?e.view+":"+t:e.view);const t=qr(Gr(e,"start")),n=qr(Gr(e,"end"));return i=>{i.on("element:"+e.view+"-start",t,{priority:e.converterPriority||"normal"}),i.on("element:"+e.view+"-end",n,{priority:e.converterPriority||"normal"});const o=ft.get("low"),r=ft.get("highest"),s=ft.get(e.converterPriority)/r;i.on("element",function(e){return(t,n,i)=>{const o="data-"+e.view;function r(t,o){for(const r of o){const o=e.model(r,i),s=i.writer.createElement("$marker",{"data-name":o});i.writer.insert(s,t),n.modelCursor=n.modelCursor.isEqual(t)?n.modelCursor.getShiftedBy(1):n.modelCursor._getTransformedByInsertion(t,1),n.modelRange=n.modelRange._getTransformedByInsertion(t,1)[0]}}n.modelRange||(n=Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor))),i.consumable.consume(n.viewItem,{attributes:o+"-end-after"})&&r(n.modelRange.end,n.viewItem.getAttribute(o+"-end-after").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-start-after"})&&r(n.modelRange.end,n.viewItem.getAttribute(o+"-start-after").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-end-before"})&&r(n.modelRange.start,n.viewItem.getAttribute(o+"-end-before").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-start-before"})&&r(n.modelRange.start,n.viewItem.getAttribute(o+"-start-before").split(","))}}(e),{priority:o+s})}}(e))}}function Hr(e){const t=qr(e=Mr(e)),n=Ur(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"normal"})}}function Ur(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function qr(e){const t=new jt(e.view);return(n,i,o)=>{const r=t.match(i.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!o.consumable.test(i.viewItem,s))return;const a=function(e,t,n){return e instanceof Function?e(t,n):n.writer.createElement(e)}(e.model,i.viewItem,o);a&&o.safeInsert(a,i.modelCursor)&&(o.consumable.consume(i.viewItem,s),o.convertChildren(i.viewItem,a),o.updateConversionResult(a,i))}}function Wr(e,t=null){const n=null===t||(e=>e.getAttribute(t));e.model={key:"object"!=typeof e.model?e.model:e.model.key,value:"object"!=typeof e.model||void 0===e.model.value?n:e.model.value}}function $r(e,t){const n=new jt(e.view);return(i,o,r)=>{const s=n.match(o.viewItem);if(!s)return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(o.viewItem,r):e.model.value;null!==l&&(function(e,t){const n="function"==typeof e?e(t):e;return!("object"==typeof n&&!Ur(n)||n.classes||n.attributes||n.styles)}(e.view,o.viewItem)?s.match.name=!0:delete s.match.name,r.consumable.test(o.viewItem,s.match)&&(o.modelRange||(o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))),function(e,t,n,i){let o=!1;for(const r of Array.from(e.getItems({shallow:n})))i.schema.checkAttribute(r,t.key)&&(i.writer.setAttribute(t.key,t.value,r),o=!0);return o}(o.modelRange,{key:a,value:l},t,r)&&r.consumable.consume(o.viewItem,s.match)))}}function Gr(e,t){const n={};return n.view=e.view+"-"+t,n.model=(t,n)=>{const i=t.getAttribute("name"),o=e.model(i,n);return n.writer.createElement("$marker",{"data-name":o})},n}class Yr{constructor(e,t){this.model=e,this.view=new Zo(t),this.mapper=new ur,this.downcastDispatcher=new mr({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(n.differ,o,e),this.downcastDispatcher.convertSelection(i,o,e)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(n,i)=>{const o=i.newSelection,r=[];for(const e of o.getRanges())r.push(t.toModelRange(e));const s=e.createSelection(r,{backward:o.isBackward});s.isEqual(e.document.selection)||e.change(e=>{e.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,"insert"))return;const i=n.writer,o=n.mapper.toViewPosition(t.range.start),r=i.createText(t.item.data);i.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(e,t,n)=>{const i=n.mapper.toViewPosition(t.position),o=t.position.getShiftedBy(t.length),r=n.mapper.toViewPosition(o,{isPhantom:!0}),s=n.writer.createRange(i,r),a=n.writer.remove(s.getTrimmed());for(const l of n.writer.createRangeIn(a).getItems())n.mapper.unbindViewElement(l)},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=n.writer,o=i.document.selection;for(const r of o.getRanges())r.isCollapsed&&r.end.parent.isAttached()&&n.writer.mergeAttributes(r.start);i.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const o=[];for(const r of i.getRanges()){const e=n.mapper.toViewRange(r);o.push(e)}n.writer.setSelection(o,{backward:i.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(!i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const o=n.writer,r=i.getFirstPosition(),s=n.mapper.toViewPosition(r),a=o.breakAttributes(s);o.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if("$graveyard"==e.rootName)return null;const t=new Ln(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}}At(Yr,Sn);class Qr{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new mt.a("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class Kr{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new Jr(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return void 0===n?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);void 0!==n&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const r of n)"style"!=r&&"class"!=r&&t.attributes.push(r);const i=e.getClassNames();for(const r of i)t.classes.push(r);const o=e.getStyleNames();for(const r of o)t.styles.push(r);return t}static createFrom(e,t){if(t||(t=new Kr(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Kr.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=Kr.createFrom(n,t);return t}}class Jr{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t in this._consumables)if(t in e){const n=this._test(t,e[t]);if(!0!==n)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){const n=te(t)?t:[t],i=this._consumables[e];for(const o of n){if("attributes"===e&&("class"===o||"style"===o))throw new mt.a("viewconsumable-invalid-attribute",this);if(i.set(o,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(o))i.set(e,!0)}}_test(e,t){const n=te(t)?t:[t],i=this._consumables[e];for(const o of n)if("attributes"!==e||"class"!==o&&"style"!==o){const e=i.get(o);if(void 0===e)return null;if(!e)return!1}else{const e="class"==o?"classes":"styles",t=this._test(e,[...this._consumables[e].keys()]);if(!0!==t)return t}return!0}_consume(e,t){const n=te(t)?t:[t],i=this._consumables[e];for(const o of n)if("attributes"!==e||"class"!==o&&"style"!==o){if(i.set(o,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(o))i.set(e,!1)}else{const e="class"==o?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const n=te(t)?t:[t],i=this._consumables[e];for(const o of n)if("attributes"!==e||"class"!==o&&"style"!==o)!1===i.get(o)&&i.set(o,!0);else{const e="class"==o?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Zr{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Xr(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Xr(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new mt.a("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new mt.a("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:e.is&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!(!t||!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!(!t||!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!(!t||!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof sr){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof ir))throw new mt.a("schema-check-merge-no-element-before",this);if(!(n instanceof ir))throw new mt.a("schema-check-merge-no-element-after",this);return this.checkMerge(t,n)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const o=e(n,i);"boolean"==typeof o&&(t.stop(),t.return=o)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const o=e(n,i);"boolean"==typeof o&&(t.stop(),t.return=o)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(t=e instanceof sr?e.parent:(e instanceof dr?[e]:Array.from(e.getRanges())).reduce((e,t)=>{const n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new er("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const e of n)for(const n of e)if(this.checkAttribute(n.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new dr(e);let n,i;const o=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;"both"!=t&&"backward"!=t||(n=new or({boundaries:dr._createIn(o),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(i=new or({boundaries:dr._createIn(o),startPosition:e}));for(const r of function*(e,t){let n=!1;for(;!n;){if(n=!0,e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}}}(n,i)){const e=r.value;if(e.type==(r.walker==n?"elementEnd":"elementStart")&&this.isObject(e.item))return dr._createOn(e.item);if(this.checkChild(e.nextPosition,"$text"))return new dr(e.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))ds(this,n,t);else{const e=dr._createIn(n).getPositions();for(const n of e)ds(this,n.nodeBefore||n.parent,t)}}createContext(e){return new Xr(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=es(t[i],i);for(const i of n)ts(e,i);for(const i of n)ns(e,i);for(const i of n)is(e,i),os(e,i);for(const i of n)rs(e,i),ss(e,i);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(0==n)return!0;{const e=this.getDefinition(i);return this._checkContextMatch(e,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const o of e.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(dr._createIn(o),t)),this.checkAttribute(o,t)||(n.isEqual(i)||(yield new dr(n,i)),n=sr._createAfter(o)),i=sr._createAfter(o);n.isEqual(i)||(yield new dr(n,i))}}At(Zr,Sn);class Xr{constructor(e){if(e instanceof Xr)return e;"string"==typeof e?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),e[0]&&"string"!=typeof e[0]&&e[0].is("documentFragment")&&e.shift(),this._items=e.map(cs)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Xr([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function es(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(e,t){for(const n of e){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const i of e)t[i]=n[i]}}(e,n),as(e,n,"allowIn"),as(e,n,"allowContentOf"),as(e,n,"allowWhere"),as(e,n,"allowAttributes"),as(e,n,"allowAttributesOf"),as(e,n,"inheritTypesFrom"),function(e,t){for(const n of e){const e=n.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,n),n}function ts(e,t){for(const n of e[t].allowContentOf)e[n]&&ls(e,n).forEach(e=>{e.allowIn.push(t)});delete e[t].allowContentOf}function ns(e,t){for(const n of e[t].allowWhere){const i=e[n];i&&e[t].allowIn.push(...i.allowIn)}delete e[t].allowWhere}function is(e,t){for(const n of e[t].allowAttributesOf){const i=e[n];i&&e[t].allowAttributes.push(...i.allowAttributes)}delete e[t].allowAttributesOf}function os(e,t){const n=e[t];for(const i of n.inheritTypesFrom){const t=e[i];if(t){const e=Object.keys(t).filter(e=>e.startsWith("is"));for(const i of e)i in n||(n[i]=t[i])}}delete n.inheritTypesFrom}function rs(e,t){const n=e[t],i=n.allowIn.filter(t=>e[t]);n.allowIn=Array.from(new Set(i))}function ss(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function as(e,t,n){for(const i of e)"string"==typeof i[n]?t[n].push(i[n]):Array.isArray(i[n])&&t[n].push(...i[n])}function ls(e,t){const n=e[t];return(i=e,Object.keys(i).map(e=>i[e])).filter(e=>e.allowIn.includes(n.name));var i}function cs(e){return"string"==typeof e?{name:e,*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function ds(e,t,n){for(const i of t.getAttributeKeys())e.checkAttribute(t,i)||n.removeAttribute(i,t)}class us{constructor(e={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let n;for(const i of new Xr(e)){const e={};for(const t of i.getAttributeKeys())e[t]=i.getAttribute(t);const o=t.createElement(i.name,e);n&&t.append(o,n),n=sr._createAt(o,0)}return n}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Kr.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),o=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,o);o.markers=function(e,t){const n=new Set,i=new Map,o=dr._createIn(e).getItems();for(const r of o)"$marker"==r.name&&n.add(r);for(const r of n){const e=r.getAttribute("data-name"),n=t.createPositionBefore(r);i.has(e)?i.get(e).end=n.clone():i.set(e,new dr(n.clone())),t.remove(r)}return i}(o,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof dr))throw new mt.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:sr._createAt(t,0);const i=new dr(n);for(const o of Array.from(e.getChildren())){const e=this._convertItem(o,n);e.modelRange instanceof dr&&(i.end=e.modelRange.end,n=e.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const o=this._cursorParents.get(e);t.modelCursor=o?i.createPositionAt(o,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let o=n.findAllowedParent(t,e);if(o){if(o===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return jr(t,e,n)?{position:Br(t,i)}:null;const r=this.conversionApi.writer.split(t,o),s=[];for(const l of r.range.getWalker())if("elementEnd"==l.type)s.push(l.item);else{const e=s.pop();this._registerSplitPair(e,l.item)}const a=r.range.end.parent;return this._cursorParents.set(e,a),{position:r.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}At(us,bt);class hs{constructor(e,t){this.model=e,this.stylesProcessor=t,this.processor=void 0,this.mapper=new ur,this.downcastDispatcher=new mr({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,"insert"))return;const i=n.writer,o=n.mapper.toViewPosition(t.range.start),r=i.createText(t.item.data);i.insert(o,r)},{priority:"lowest"}),this.upcastDispatcher=new us({schema:e.schema}),this.viewDocument=new Un(t),this._viewWriter=new gi(this.viewDocument),this.upcastDispatcher.on("text",(e,t,{schema:n,consumable:i,writer:o})=>{let r=t.modelCursor;if(!i.test(t.viewItem))return;if(!n.checkChild(r,"$text")){if(!jr(r,"$text",n))return;r=Br(r,o)}i.consume(t.viewItem);const s=o.createText(t.viewItem.data);o.insert(s,r),t.modelRange=o.createRange(r,r.getShiftedBy(s.offsetSize)),t.modelCursor=t.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",Vr)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new mt.a("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return"empty"!==n||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const o=dr._createIn(e),r=new mi(n);if(this.mapper.bindElements(e,r),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(o,i),!e.is("documentFragment")){const t=function(e){const t=[],n=e.root.document;if(!n)return[];const i=dr._createIn(e);for(const o of n.model.markers){const e=i.getIntersection(o.getRange());e&&t.push([o.name,e])}return t}(e);for(const[e,n]of t)this.downcastDispatcher.convertMarkerAdd(e,n,i)}return delete this.downcastDispatcher.conversionApi.options,r}init(e){if(this.model.document.version)throw new mt.a("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new mt.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",e=>{for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.insert(this.parse(t[n],i),i,0)}}),Promise.resolve()}set(e){let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new mt.a("datacontroller-set-non-existent-root",this);this.model.enqueueChange("transparent",e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.remove(e.createRangeIn(i)),e.insert(this.parse(t[n],i),i,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}At(hs,Sn);class fs{constructor(e,t){this._helpers=new Map,this._downcast=Et(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Et(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new mt.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new mt.a("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of ms(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of ms(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of ms(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new mt.a("conversion-group-exists",this);const i=n?new Ir(t):new Fr(t);this._helpers.set(e,i)}}function*ms(e){if(e.model.values)for(const t of e.model.values){const n={key:e.model.key,value:t},i=e.view[t],o=e.upcastAlso?e.upcastAlso[t]:void 0;yield*gs(n,i,o)}else yield*gs(e.model,e.view,e.upcastAlso)}function*gs(e,t,n){if(yield{model:e,view:t},n)for(const i of Et(n))yield{model:e,view:i}}class ps{constructor(e="default"){this.operations=[],this.type=e}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class bs{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class ws{constructor(e){this.markers=new Map,this._children=new nr,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"model:documentFragment"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)t.push(n.name?ir.fromJSON(n):er.fromJSON(n));return new ws(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){return"string"==typeof e?[new er(e)]:(Ct(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new er(e):e instanceof tr?new er(e.data,e.getAttributes()):e))}(t);for(const i of n)null!==i.parent&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}}function ks(e,t){const n=(t=ys(t)).reduce((e,t)=>e+t.offsetSize,0),i=e.parent;Cs(e);const o=e.index;return i._insertChild(o,t),xs(i,o+t.length),xs(i,o),new dr(e,e.getShiftedBy(n))}function _s(e){if(!e.isFlat)throw new mt.a("operation-utils-remove-range-not-flat",this);const t=e.start.parent;Cs(e.start),Cs(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);return xs(t,e.start.index),n}function vs(e,t){if(!e.isFlat)throw new mt.a("operation-utils-move-range-not-flat",this);const n=_s(e);return ks(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),n)}function ys(e){const t=[];e instanceof Array||(e=[e]);for(let n=0;ne.maxOffset)throw new mt.a("move-operation-nodes-do-not-exist",this);if(e===t&&n=n&&this.targetPosition.path[e]e._clone(!0))),t=new Ms(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=new sr(this.position.root.document.graveyard,[0]);return new Ps(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0))),ks(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const o of e.nodes)n.push(o.name?ir.fromJSON(o):er.fromJSON(o));const i=new Ms(sr.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class Is extends bs{constructor(e,t,n,i,o,r){super(r),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=o,this._markers=i}get type(){return"marker"}clone(){return new Is(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Is(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){this._markers[this.newRange?"_set":"_remove"](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new Is(e.name,e.oldRange?dr.fromJSON(e.oldRange,t):null,e.newRange?dr.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class Ns extends bs{constructor(e,t,n,i){super(i),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new Ns(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Ns(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof ir))throw new mt.a("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new mt.a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new Ns(sr.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Os extends bs{constructor(e,t,n,i,o){super(o),this.root=e,this.key=t,this.oldValue=n,this.newValue=i}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Os(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Os(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new mt.a("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new mt.a("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new mt.a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new mt.a("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new Os(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Rs extends bs{constructor(e,t,n,i,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new sr(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new dr(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),n=new sr(this.sourcePosition.root,t)._getTransformedByMergeOperation(this),i=new Ls(e,this.howMany,this.graveyardPosition,this.baseVersion+1);return i.insertionPosition=n,i}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new mt.a("merge-operation-source-position-invalid",this);if(!t.parent)throw new mt.a("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new mt.a("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;vs(dr._createIn(e),this.targetPosition),vs(dr._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const n=sr.fromJSON(e.sourcePosition,t),i=sr.fromJSON(e.targetPosition,t),o=sr.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,i,o,e.baseVersion)}}class Ls extends bs{constructor(e,t,n,i){super(i),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=Ls.getInsertionPosition(e),this.insertionPosition.stickiness="toNone",this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new sr(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new dr(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return e.insertionPosition=this.insertionPosition,e}getReversed(){const e=new sr(this.splitPosition.root.document.graveyard,[0]);return new Rs(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent;if(!e||e.maxOffset{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof dr)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof dr))throw new mt.a("writer-move-invalid-range",this);if(!e.isFlat)throw new mt.a("writer-move-range-not-flat",this);const i=sr._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Hs(e.root,i.root))throw new mt.a("writer-move-different-document",this);const o=new Ps(e.start,e.end.offset-e.start.offset,i,e.root.document?e.root.document.version:null);this.batch.addOperation(o),this.model.applyOperation(o)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof dr?e:dr._createOn(e)).getMinimalFlatRanges().reverse();for(const n of t)this._addOperationForAffectedMarkers("move",n),Fs(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof ir))throw new mt.a("writer-merge-no-element-before",this);if(!(n instanceof ir))throw new mt.a("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(dr._createIn(n),sr._createAt(t,"end")),this.remove(n)}_merge(e){const t=sr._createAt(e.nodeBefore,"end"),n=sr._createAt(e.nodeAfter,0),i=new sr(e.root.document.graveyard,[0]),o=new Rs(n,e.nodeAfter.maxOffset,t,i,e.root.document.version);this.batch.addOperation(o),this.model.applyOperation(o)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof ir))throw new mt.a("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new Ns(sr._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,o=e.parent;if(!o.parent)throw new mt.a("writer-split-element-no-parent",this);if(t||(t=o.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new mt.a("writer-split-invalid-limit-element",this);do{const t=new Ls(e,o.maxOffset-e.offset,null,o.root.document?o.root.document.version:null);this.batch.addOperation(t),this.model.applyOperation(t),n||i||(n=o,i=e.parent.nextSibling),o=(e=this.createPositionAfter(e.parent)).parent}while(o!==t);return{position:e,range:new dr(sr._createAt(n,"end"),sr._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new mt.a("writer-wrap-range-not-flat",this);const n=t instanceof ir?t:new ir(t);if(n.childCount>0)throw new mt.a("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new mt.a("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new dr(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,sr._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new mt.a("writer-unwrap-element-no-parent",this);this.move(dr._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new mt.a("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,o=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new mt.a("writer-addmarker-marker-exists",this);if(!i)throw new mt.a("writer-addmarker-no-range",this);return n?(Bs(this,e,null,i,o),this.model.markers.get(e)):this.model.markers._set(e,i,n,o)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n="string"==typeof e?e:e.name,i=this.model.markers.get(n);if(!i)throw new mt.a("writer-updatemarker-marker-not-exists",this);if(!t)return void this.model.markers._refresh(i);const o="boolean"==typeof t.usingOperation,r="boolean"==typeof t.affectsData,s=r?t.affectsData:i.affectsData;if(!o&&!t.range&&!r)throw new mt.a("writer-updatemarker-wrong-options",this);const a=i.getRange(),l=t.range?t.range:a;o&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?Bs(this,n,null,l,s):(Bs(this,n,a,null,s),this.model.markers._set(n,l,void 0,s)):i.managedUsingOperations?Bs(this,n,a,l,s):this.model.markers._set(n,l,void 0,s)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new mt.a("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);n.managedUsingOperations?Bs(this,t,n.getRange(),null,n.affectsData):this.model.markers._remove(t)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[n,i]of Vt(e))this._setSelectionAttribute(n,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=Tr._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=Tr._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new mt.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let o=!1;if("move"===e)o=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{const e=t.nodeAfter,n=i.end.parent==e&&0==i.end.offset,r=i.end.nodeAfter==e,s=i.start.nodeAfter==e;o=i.start.parent==t.nodeBefore&&i.start.isAtEnd||n||r||s}o&&this.updateMarker(n.name,{range:i})}}}function Vs(e,t,n,i){const o=e.model,r=o.document;let s,a,l,c=i.start;for(const u of i.getWalker({shallow:!0}))l=u.item.getAttribute(t),s&&a!=l&&(a!=n&&d(),c=s),s=u.nextPosition,a=l;function d(){const i=new dr(c,s),l=new Ss(i,t,a,n,i.root.document?r.version:null);e.batch.addOperation(l),o.applyOperation(l)}s instanceof sr&&s!=c&&a!=n&&d()}function js(e,t,n,i){const o=e.model,r=o.document,s=i.getAttribute(t);let a,l;s!=n&&(i.root===i?l=new Os(i,t,s,n,i.document?r.version:null):(a=new dr(sr._createBefore(i),e.createPositionAfter(i)),l=new Ss(a,t,s,n,a.root.document?r.version:null)),e.batch.addOperation(l),o.applyOperation(l))}function Bs(e,t,n,i,o){const r=e.model,s=new Is(t,n,i,r.markers,o,r.document.version);e.batch.addOperation(s),r.applyOperation(s)}function Fs(e,t,n,i){let o;if(e.root.document){const n=i.document,r=new sr(n.graveyard,[0]);o=new Ps(e,t,r,n.version)}else o=new Es(e,t);n.addOperation(o),i.applyOperation(o)}function Hs(e,t){return e===t||e instanceof Ds&&t instanceof Ds}class Us{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize);const t=dr._createOn(e);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const e=n.getRange();this.bufferMarkerChange(n.name,e,e,n.affectsData)}this._cachedChanges=null}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=dr._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1),this._markInsert(e.graveyardPosition.parent,e.graveyardPosition.offset,1);const n=e.targetPosition.parent;this._isInInsertedElement(n)||this._markInsert(n,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,i){const o=this._changedMarkers.get(e);o?(o.newRange=n,o.affectsData=i,null==o.oldRange&&null==o.newRange&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:i})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.oldRange&&e.push({name:t,range:n.oldRange});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.newRange&&e.push({name:t,range:n.newRange});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers)if(e.affectsData)return!0;return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const t=[];for(const n of this._changesInElement.keys()){const e=this._changesInElement.get(n).sort((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamen.offset){if(i>o){const e={type:"attribute",offset:o,howMany:i-o,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offseto?(e.nodesToHandle=i-o,e.offset=o):e.nodesToHandle=0);if("remove"==n.type&&e.offsetn.offset){const o={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(o,t),t.push(o),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==n.type&&(e.offset>=n.offset&&i<=o?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=o&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:sr._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:sr._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[o,r]of t){const t=n.has(o)?n.get(o):null;t!==r&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++}),n.delete(o)}for(const[o,r]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n)for(const o of n)if("insert"==o.type&&i>=o.offset&&ii){for(let e=0;e=e&&i.baseVersion{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new mt.a("model-document-applyoperation-wrong-version",this,{operation:n})},{priority:"highest"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(e,t,n,i)=>{this.differ.bufferMarkerChange(t.name,n,i,t.affectsData),null===n&&t.on("change",(e,n)=>{this.differ.bufferMarkerChange(t.name,n,t.getRange(),t.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new mt.a("model-document-createroot-name-exists",this,{name:t});const n=new Ds(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>"$graveyard"!=e)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Rt(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return Js(e.start)&&Js(e.end)}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break}while(t)}}function Js(e){const t=e.textNode;if(t){const n=t.data,i=e.offset-t.startOffset;return!Ys(n,i)&&!Qs(n,i)}return!0}At(Ks,bt);class Zs{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const o=e instanceof Xs?e.name:e;if(o.includes(","))throw new mt.a("markercollection-incorrect-marker-name",this);const r=this._markers.get(o);if(r){const e=r.getRange();let s=!1;return e.isEqual(t)||(r._attachLiveRange(xr.fromRange(t)),s=!0),n!=r.managedUsingOperations&&(r._managedUsingOperations=n,s=!0),"boolean"==typeof i&&i!=r.affectsData&&(r._affectsData=i,s=!0),s&&this.fire("update:"+o,r,e,t),r}const s=xr.fromRange(t),a=new Xs(o,s,n,i);return this._markers.set(o,a),this.fire("update:"+o,a,null,t),a}_remove(e){const t=e instanceof Xs?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof Xs?e.name:e,n=this._markers.get(t);if(!n)throw new mt.a("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire("update:"+t,n,i,i,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}At(Zs,bt);class Xs{constructor(e,t,n,i){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new mt.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new mt.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new mt.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new mt.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new mt.a("marker-destroyed",this);return this._liveRange.toRange()}is(e){return"marker"===e||"model:marker"===e}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}At(Xs,bt);class ea extends bs{get type(){return"noop"}clone(){return new ea(this.baseVersion)}getReversed(){return new ea(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const ta={};ta[Ss.className]=Ss,ta[Ms.className]=Ms,ta[Is.className]=Is,ta[Ps.className]=Ps,ta[ea.className]=ea,ta[bs.className]=bs,ta[Ns.className]=Ns,ta[Os.className]=Os,ta[Ls.className]=Ls,ta[Rs.className]=Rs;class na extends sr{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new mt.a("model-liveposition-root-not-rootelement",e);ia.call(this)}detach(){this.stopListening()}is(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e}toPosition(){return new sr(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function ia(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&oa.call(this,n)},{priority:"low"})}function oa(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}At(na,bt);class ra{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e,t){e=Array.from(e);for(let n=0;n!0);if(r.checkChild(l,"$text"))return l}}function da(e,t){const n=sr._createAt(e.root,t?"end":0);return t?new dr(e,n):new dr(n,e)}function ua(e,t,n){return' ,.?!:;"-()'.includes(e.charAt(t+(n?0:-1)))}function ha(e,t,n){return t===(n?e.endOffset:0)}function fa(e,t){const n=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end))).forEach(e=>{n.push(e.start.parent),t.remove(e)}),n.forEach(e=>{let n=e;for(;n.parent&&n.isEmpty;){const e=t.createRangeOn(n);n=n.parent,t.remove(e)}})}function ma(e,t){return e.isCollapsed?function(e,t){const n=e.start,i=t.getNearestSelectionRange(n);if(!i)return null;if(!i.isCollapsed)return i;const o=i.start;return n.isEqual(o)?null:new dr(o)}(e,t):function(e,t){const{start:n,end:i}=e,o=t.checkChild(n,"$text"),r=t.checkChild(i,"$text"),s=t.getLimitElement(n),a=t.getLimitElement(i);if(s===a){if(o&&r)return null;if(function(e,t,n){const i=e.nodeAfter&&!n.isLimit(e.nodeAfter)||n.checkChild(e,"$text"),o=t.nodeBefore&&!n.isLimit(t.nodeBefore)||n.checkChild(t,"$text");return i||o}(n,i,t)){const e=n.nodeAfter&&t.isSelectable(n.nodeAfter)?null:t.getNearestSelectionRange(n,"forward"),o=i.nodeBefore&&t.isSelectable(i.nodeBefore)?null:t.getNearestSelectionRange(i,"backward");return new dr(e?e.start:n,o?o.end:i)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const e=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,o=l&&(!e||!pa(n.nodeAfter,t)),r=c&&(!e||!pa(i.nodeBefore,t));let d=n,u=i;return o&&(d=sr._createBefore(ga(s,t))),r&&(u=sr._createAfter(ga(a,t))),new dr(d,u)}return null}(e,t)}function ga(e,t){let n=e,i=n;for(;t.isLimit(i)&&i.parent;)n=i,i=i.parent;return n}function pa(e,t){return e&&t.isSelectable(e)}class ba{constructor(){this.markers=new Zs,this.document=new Ks(this),this.schema=new Zr,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if("$marker"===t.name)return!0}),function(e){e.document.registerPostFixer(t=>function(e,t){const n=t.document.selection,i=t.schema,o=[];let r=!1;for(const s of n.getRanges()){const e=ma(s,i);e&&!e.isEqual(s)?(o.push(e),r=!0):o.push(s)}r&&e.setSelection(function(e){const t=[];t.push(e.shift());for(const n of e){const e=t.pop();if(n.isEqual(e))t.push(e);else if(n.isIntersecting(e)){const i=e.start.isAfter(n.start)?n.start:e.start,o=e.end.isAfter(n.end)?e.end:n.end,r=new dr(i,o);t.push(r)}else t.push(e),t.push(n)}return t}(o),{backward:n.isBackward})}(t,e))}(this),this.document.registerPostFixer(Vr)}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new ps,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){mt.a.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{"string"==typeof e?e=new ps(e):"function"==typeof e&&(t=e,e=new ps),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){mt.a.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return function(e,t,n,i){return e.change(o=>{let r;r=n?n instanceof wr||n instanceof Tr?n:o.createSelection(n,i):e.document.selection,r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});const s=new ra(e,o,r.anchor);let a;a=t.is("documentFragment")?t.getChildren():[t],s.handleNodes(a,{isFirst:!0,isLast:!0});const l=s.getSelectionRange();l&&(r instanceof Tr?o.setSelection(l):r.setTo(l));const c=s.getAffectedRange()||e.createRange(r.anchor);return s.destroy(),c})}(this,e,t,n)}deleteContent(e,t){!function(e,t,n={}){if(t.isCollapsed)return;const i=t.getFirstRange();if("$graveyard"==i.root.rootName)return;const o=e.schema;e.change(e=>{if(!n.doNotResetEntireContent&&function(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n))return!1;const i=t.getFirstRange();return i.start.parent!=i.end.parent&&e.checkChild(n,"paragraph")}(o,t))return void function(e,t){const n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n)),aa(e,e.createPositionAt(n,0),t)}(e,t);const[r,s]=function(e){const t=e.root.document.model,n=e.start;let i=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const n=function(e){const t=e.parent,n=t.root.document.model.schema,i=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const o of i){if(n.isLimit(o))return null;if(n.isBlock(o))return o}}(i);if(n&&i.isTouching(t.createPositionAt(n,0))){const n=t.createSelection(e);t.modifySelection(n,{direction:"backward"}),i=n.getLastPosition()}}return[na.fromPosition(n,"toPrevious"),na.fromPosition(i,"toNext")]}(i);r.isTouching(s)||e.remove(e.createRange(r,s)),n.leaveUnmerged||(function(e,t,n){const i=e.model;if(!sa(e.model.schema,t,n))return;const[o,r]=function(e,t){const n=e.getAncestors(),i=t.getAncestors();let o=0;for(;n[o]&&n[o]==i[o];)o++;return[n[o],i[o]]}(t,n);o&&r&&(!i.hasContent(o,{ignoreMarkers:!0})&&i.hasContent(r,{ignoreMarkers:!0})?function e(t,n,i,o){const r=n.parent,s=i.parent;if(r!=o&&s!=o){for(n=t.createPositionAfter(r),(i=t.createPositionBefore(s)).isEqual(n)||t.insert(r,i);n.parent.isEmpty;){const e=n.parent;n=t.createPositionBefore(e),t.remove(e)}i=t.createPositionBefore(s),function(e,t){const n=t.nodeBefore,i=t.nodeAfter;n.name!=i.name&&e.rename(n,i.name),e.clearAttributes(n),e.setAttributes(Object.fromEntries(i.getAttributes()),n),e.merge(t)}(t,i),sa(t.model.schema,n,i)&&e(t,n,i,o)}}(e,t,n,o.parent):function e(t,n,i,o){const r=n.parent,s=i.parent;if(r!=o&&s!=o){for(n=t.createPositionAfter(r),(i=t.createPositionBefore(s)).isEqual(n)||t.insert(s,n),t.merge(n);i.parent.isEmpty;){const e=i.parent;i=t.createPositionBefore(e),t.remove(e)}sa(t.model.schema,n,i)&&e(t,n,i,o)}}(e,t,n,o.parent))}(e,r,s),o.removeDisallowedAttributes(r.parent.getChildren(),e)),la(e,t,r),!n.doNotAutoparagraph&&function(e,t){const n=e.checkChild(t,"$text"),i=e.checkChild(t,"paragraph");return!n&&i}(o,r)&&aa(e,r,t),r.detach(),s.detach()})}(this,e,t)}modifySelection(e,t){!function(e,t,n={}){const i=e.schema,o="backward"!=n.direction,r=n.unit?n.unit:"character",s=new or({boundaries:da(t.focus,o),singleCharacters:!0,direction:o?"forward":"backward"}),a={walker:s,schema:i,isForward:o,unit:r};let l;for(;l=s.next();){if(l.done)return;const n=ca(a,l.value);if(n)return void(t instanceof Tr?e.change(e=>{e.setSelectionFocus(n)}):t.setFocus(n))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change(e=>{const n=e.createDocumentFragment(),i=t.getFirstRange();if(!i||i.isCollapsed)return n;const o=i.start.root,r=i.start.getCommonPath(i.end),s=o.getNodeByPath(r);let a;a=i.start.parent==i.end.parent?i:e.createRange(e.createPositionAt(s,i.start.path[r.length]),e.createPositionAt(s,i.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),n):e.append(e.cloneElement(t,!0),n);if(a!=i){const t=i._getTransformedByMove(a.start,e.createPositionAt(n,0),l)[0],o=e.createRange(e.createPositionAt(n,0),t.start);fa(e.createRange(t.end,e.createPositionAt(n,"end")),e),fa(o,e)}return n})}(this,e)}hasContent(e,t={}){const n=e instanceof ir?dr._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=t;if(!o)for(const r of this.markers.getMarkersIntersectingRange(n))if(r.affectsData)return!0;for(const r of n.getItems())if(this.schema.isContent(r)){if(!r.is("$textProxy"))return!0;if(!i)return!0;if(-1!==r.data.search(/\S/))return!0}return!1}createPositionFromPath(e,t,n){return new sr(e,t,n)}createPositionAt(e,t){return sr._createAt(e,t)}createPositionAfter(e){return sr._createAfter(e)}createPositionBefore(e){return sr._createBefore(e)}createRange(e,t){return new dr(e,t)}createRangeIn(e){return dr._createIn(e)}createRangeOn(e){return dr._createOn(e)}createSelection(e,t,n){return new wr(e,t,n)}createBatch(e){return new ps(e)}createOperationFromJSON(e){return class{static fromJSON(e,t){return ta[e.__className].fromJSON(e,t)}}.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){this._currentWriter=new zs(this,this._pendingChanges[0].batch);const t=this._pendingChanges[0].callback(this._currentWriter);e.push(t),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}At(ba,Sn);class wa{constructor(){this._listener=Object.create(Xi)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+ii(t),t)})}set(e,t,n={}){const i=oi(e);this._listener.listenTo(this._listener,"_keydown:"+i,(e,n)=>{t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0},{priority:n.priority})}press(e){return!!this._listener.fire("_keydown:"+ii(e),e)}destroy(){this._listener.stopListening()}}class ka extends wa{constructor(e){super(),this.editor=e}set(e,t,n={}){if("string"==typeof t){const e=t;t=(t,n)=>{this.editor.execute(e),n()}}super.set(e,t,n)}}class _a{constructor(e={}){this._context=e.context||new Nt({language:e.language}),this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new at(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.config.define(this._context._getEditorConfig()),this.plugins=new St(this,t,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new Qr,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new ba;const n=new gn;this.data=new hs(this.model,n),this.editing=new Yr(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new fs([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new ka(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[];return this.plugins.init(t.concat(i),n)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise(e=>this.once("ready",e))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(e){mt.a.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}}At(_a,Sn);var va={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};class ya{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class xa{constructor(e){this._domParser=new DOMParser,this._domConverter=new Yi(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new ya}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}registerRawContentMatcher(e){this._domConverter.registerRawContentMatcher(e)}_toDom(e){const t=this._domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),i=t.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class Ca{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(Aa(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new mt.a("componentfactory-item-missing",this,{name:e});return this._components.get(Aa(e)).callback(this.editor.locale)}has(e){return this._components.has(Aa(e))}}function Aa(e){return String(e).toLowerCase()}class Ta{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new mt.a("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}At(Ta,Xi),At(Ta,Sn);class Sa{constructor(e){this.editor=e,this.componentFactory=new Ca(e),this.focusTracker=new Ta,this._editableElementsMap=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}At(Sa,bt),n(14);const Ea=new WeakMap;function Pa(e){const{view:t,element:n,text:i,isDirectHost:o=!0}=e,r=t.document;Ea.has(r)||(Ea.set(r,new Map),r.registerPostFixer(e=>Ma(r,e))),Ea.get(r).set(n,{text:i,isDirectHost:o}),t.change(e=>Ma(r,e))}function Ma(e,t){const n=Ea.get(e);let i=!1;for(const[o,r]of n)Ia(t,o,r)&&(i=!0);return i}function Ia(e,t,n){const{text:i,isDirectHost:o}=n,r=o?t:function(e){if(1===e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement"))return t}return null}(t);let s=!1;return!!r&&(n.hostElement=r,r.getAttribute("data-placeholder")!==i&&(e.setAttribute("data-placeholder",i,r),s=!0),function(e){if(!e.isAttached())return!1;const t=!Array.from(e.getChildren()).some(e=>!e.is("uiElement")),n=e.document;if(!n.isFocused&&t)return!0;const i=n.selection.anchor;return!(!t||!i||i.parent===e)}(r)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,r)&&(s=!0):function(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}(e,r)&&(s=!0),s)}class Na extends Sa{constructor(e,t){var n;super(e),this.view=t,this._toolbarConfig=(n=e.config.get("toolbar"),Array.isArray(n)?{items:n}:n?Object.assign({items:[]},n):{items:[]})}init(){const e=this.view,t=this.editor.editing.view,n=e.editable,i=t.document.getRoot();e.editable.name=i.rootName,e.render();const o=n.element;this.setEditableElement(n.name,o),this.focusTracker.add(o),e.editable.bind("isFocused").to(this.focusTracker),t.attachDomRoot(o),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view;this.editor.editing.view.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view.toolbar;t.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:i,beforeFocus:o,afterBlur:r}){n.add(i.element),t.set("Alt+F10",(e,t)=>{n.isFocused&&!i.focusTracker.isFocused&&(o&&o(),i.focus(),t())}),i.keystrokes.set("Esc",(t,n)=>{i.focusTracker.isFocused&&(e.focus(),r&&r(),n())})}({origin:e.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement,o=e.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");o&&Pa({view:t,element:n,text:o,isDirectHost:!1})}}class Oa extends Tt{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,n)=>{this._renderViewIntoCollectionParent(t,n)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!e.every(e=>"string"==typeof e))throw new mt.a("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const o of e)i.delegate(o).to(t)}),this.on("remove",(n,i)=>{for(const o of e)i.stopDelegating(o,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}class Ra{constructor(e){Object.assign(this,qa(Ua(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new mt.a("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)Qa(n)?yield n:Ka(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new Da({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,o)=>new za({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:o})}}static extend(e,t){if(e._isRendered)throw new mt.a("template-extend-render",[this,e]);!function e(t,n){if(n.attributes&&(t.attributes||(t.attributes={}),Ga(t.attributes,n.attributes)),n.eventListeners&&(t.eventListeners||(t.eventListeners={}),Ga(t.eventListeners,n.eventListeners)),n.text&&t.text.push(...n.text),n.children&&n.children.length){if(t.children.length!=n.children.length)throw new mt.a("ui-template-extend-children-mismatch",t);let i=0;for(const o of n.children)e(t.children[i++],o)}}(e,qa(Ua(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new mt.a("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Va(this.text)?this._bindToObservable({schema:this.text,updater:Ba(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,i,o;if(!this.attributes)return;const r=e.node,s=e.revertData;for(t in this.attributes)if(i=r.getAttribute(t),n=this.attributes[t],s&&(s.attributes[t]=i),o=A(n[0])&&n[0].ns?n[0].ns:null,Va(n)){const a=o?n[0].value:n;s&&Za(t)&&a.unshift(i),this._bindToObservable({schema:a,updater:Fa(r,t,o),data:e})}else"style"==t&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],e):(s&&i&&Za(t)&&n.unshift(i),n=n.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce($a,""),Ya(n)||r.setAttributeNS(o,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const o=e[i];Va(o)?this._bindToObservable({schema:[o],updater:Ha(n,i),data:t}):n.style[i]=o}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let o=0;for(const r of this.children)if(Ja(r)){if(!i){r.setParent(t);for(const e of r)n.appendChild(e.element)}}else if(Qa(r))i||(r.isRendered||r.render(),n.appendChild(r.element));else if(ji(r))n.appendChild(r);else if(i){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),r._renderNode({node:n.childNodes[o++],isApplying:!0,revertData:t})}else n.appendChild(r.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(n=>{const[i,o]=t.split("@");return n.activateDomEventListener(i,o,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;ja(e,t,n);const o=e.filter(e=>!Ya(e)).filter(e=>e.observable).map(i=>i.activateAttributeListener(e,t,n));i&&i.bindings.push(o)}_revertTemplateFromNode(e,t){for(const n of t.bindings)for(const e of n)e();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const i=t.attributes[n];null===i?e.removeAttribute(n):e.setAttribute(n,i)}for(let n=0;nja(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,i),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class Da extends La{activateDomEventListener(e,t,n){const i=(e,n)=>{t&&!n.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class za extends La{getValue(e){return!Ya(super.getValue(e))&&(this.valueIfTrue||!0)}}function Va(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(Va):e instanceof La)}function ja(e,t,{node:n}){let i=function(e,t){return e.map(e=>e instanceof La?e.getValue(t):e)}(e,n);i=1==e.length&&e[0]instanceof za?i[0]:i.reduce($a,""),Ya(i)?t.remove():t.set(i)}function Ba(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function Fa(e,t,n){return{set(i){e.setAttributeNS(n,t,i)},remove(){e.removeAttributeNS(n,t)}}}function Ha(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function Ua(e){return rt(e,e=>{if(e&&(e instanceof La||Ka(e)||Qa(e)||Ja(e)))return e})}function qa(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Et(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)Wa(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Et(e[t].value)),Wa(e,t)}(e.attributes);const t=[];if(e.children)if(Ja(e.children))t.push(e.children);else for(const n of e.children)Ka(n)||Qa(n)||ji(n)?t.push(n):t.push(new Ra(n));e.children=t}return e}function Wa(e,t){e[t]=Et(e[t])}function $a(e,t){return Ya(t)?e:Ya(e)?t:`${e} ${t}`}function Ga(e,t){for(const n in t)e[n]?e[n].push(...t[n]):e[n]=t[n]}function Ya(e){return!e&&0!==e}function Qa(e){return e instanceof Xa}function Ka(e){return e instanceof Ra}function Ja(e){return e instanceof Oa}function Za(e){return"class"==e||"style"==e}n(16);class Xa{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Tt,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Ra.bind(this,this)}createCollection(e){const t=new Oa(e);return this._viewCollections.add(t),t}registerChild(e){Ct(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Ct(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Ra(e)}extendTemplate(e){Ra.extend(this.template,e)}render(){if(this.isRendered)throw new mt.a("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}At(Xa,Xi),At(Xa,Sn);var el=function(e){return"string"==typeof e||!te(e)&&m(e)&&"[object String]"==u(e)};class tl extends Oa{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new Ra({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(e,t,n={},i=[]){const o=n&&n.xmlns,r=o?e.createElementNS(o,t):e.createElement(t);for(const s in n)r.setAttribute(s,n[s]);!el(i)&&Ct(i)||(i=[i]);for(let s of i)el(s)&&(s=e.createTextNode(s)),r.appendChild(s);return r}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}n(18);class nl extends Xa{constructor(e){super(e),this.body=new tl(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class il extends Xa{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change(n=>{const i=e.document.getRoot(t.name);n.addClass(t.isFocused?"ck-focused":"ck-blurred",i),n.removeClass(t.isFocused?"ck-blurred":"ck-focused",i)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(e,o,r)=>{r?n(i):t(i)})}(this):t(this)}}class ol extends il{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",this.name),i)})}}class rl{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];"string"==typeof n&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(e,n)=>{this[t](),n()})}}get first(){return this.focusables.find(sl)||null}get last(){return this.focusables.filter(sl).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(null===t)return this[1===e?"first":"last"];let i=(t+n+e)%n;do{const t=this.focusables.get(i);if(sl(t))return t;i=(i+n+e)%n}while(i!==t);return null}}function sl(e){return!(!e.focus||"none"==qi.window.getComputedStyle(e.element).display)}class al extends Xa{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class ll extends Xa{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}class cl{constructor(e,t){cl._observerInstance||cl._createObserver(),this._element=e,this._callback=t,cl._addElementCallback(e,t),cl._observerInstance.observe(e)}destroy(){cl._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){cl._elementCallbacks||(cl._elementCallbacks=new Map);let n=cl._elementCallbacks.get(e);n||(n=new Set,cl._elementCallbacks.set(e,n)),n.add(t)}static _deleteElementCallback(e,t){const n=cl._getElementCallbacks(e);n&&(n.delete(t),n.size||(cl._elementCallbacks.delete(e),cl._observerInstance.unobserve(e))),cl._elementCallbacks&&!cl._elementCallbacks.size&&(cl._observerInstance=null,cl._elementCallbacks=null)}static _getElementCallbacks(e){return cl._elementCallbacks?cl._elementCallbacks.get(e):null}static _createObserver(){let e;e="function"==typeof qi.window.ResizeObserver?qi.window.ResizeObserver:dl,cl._observerInstance=new e(e=>{for(const t of e){const e=cl._getElementCallbacks(t.target);if(e)for(const n of e)n(t)}})}}cl._observerInstance=null,cl._elementCallbacks=null;class dl{constructor(e){this._callback=e,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(e){this._elements.add(e),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(e){this._elements.delete(e),this._previousRects.delete(e),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(e,100)};this.listenTo(qi.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(e,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements)this._hasRectChanged(t)&&e.push({target:t,contentRect:this._previousRects.get(t)});e.length&&this._callback(e)}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e))return!1;const t=new jo(e),n=this._previousRects.get(e),i=!n||!n.isEqual(t);return this._previousRects.set(e,t),i}}At(dl,Xi);class ul extends Xa{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>"ck-dropdown__panel_"+e),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}function hl({element:e,target:t,positions:n,limiter:i,fitInViewport:o}){T(t)&&(t=t()),T(i)&&(i=i());const r=function(e){return e&&e.parentNode?e.offsetParent===qi.document.body?null:e.offsetParent:null}(e),s=new jo(e),a=new jo(t);let l,c;if(i||o){const e=function(e,t){const{elementRect:n,viewportRect:i}=t,o=n.getArea(),r=function(e,{targetRect:t,elementRect:n,limiterRect:i,viewportRect:o}){const r=[],s=n.getArea();for(const a of e){const e=fl(a,t,n);if(!e)continue;const[l,c]=e;let d=0,u=0;if(i)if(o){const e=i.getIntersection(o);e&&(d=e.getIntersectionArea(c))}else d=i.getIntersectionArea(c);o&&(u=o.getIntersectionArea(c));const h={positionName:l,positionRect:c,limiterIntersectArea:d,viewportIntersectArea:u};if(d===s)return[h];r.push(h)}return r}(e,t);if(i){const e=ml(r.filter(({viewportIntersectArea:e})=>e===o),o);if(e)return e}return ml(r,o)}(n,{targetRect:a,elementRect:s,limiterRect:i&&new jo(i).getVisible(),viewportRect:o&&new jo(qi.window)});[c,l]=e||fl(n[0],a,s)}else[c,l]=fl(n[0],a,s);let d=gl(l);return r&&(d=function({left:e,top:t},n){const i=gl(new jo(n)),o=zo(n);return e-=i.left,t-=i.top,e+=n.scrollLeft,t+=n.scrollTop,{left:e-=o.left,top:t-=o.top}}(d,r)),{left:d.left,top:d.top,name:c}}function fl(e,t,n){const i=e(t,n);if(!i)return null;const{left:o,top:r,name:s}=i;return[s,n.clone().moveTo(o,r)]}function ml(e,t){let n,i,o=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of e){if(a===t)return[r,s];const e=l**2+a**2;e>o&&(o=e,n=s,i=r)}return n?[i,n]:null}function gl({left:e,top:t}){const{scrollX:n,scrollY:i}=qi.window;return{left:e+n,top:t+i}}n(20);class pl extends Xa{constructor(e,t,n){super(e);const i=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new wa,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",e=>!e)],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&(this.panelView.position="auto"===this.panelPosition?pl._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelPosition)}),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:n,northWest:i}=pl.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[e,t,n,i]:[t,e,i,n]}}pl.defaultPanelPositions={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.bottom-t.height,left:e.left-t.width+e.width,name:"nw"})},pl._getOptimalPosition=hl,n(22);class bl extends Xa{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}n(24);class wl extends Xa{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",e=>"ck-tooltip_"+e),t.if("text","ck-hidden",e=>!e.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}n(26);class kl extends Xa{constructor(e){super(e);const t=this.bindTemplate,n=ht();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new bl,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("isVisible","ck-hidden",e=>!e),t.to("isOn",e=>e?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",e=>e||"button"),tabindex:t.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+n,"aria-disabled":t.if("isEnabled",!0,e=>!e),"aria-pressed":t.to("isOn",e=>!!this.isToggleable&&String(e))},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new wl;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new Xa;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:this.bindTemplate.to("labelStyle"),id:"ck-editor__aria-label_"+e},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new Xa;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>ri(e))}]}),e}_getTooltipString(e,t,n){return e?"string"==typeof e?e:(n&&(n=ri(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}var _l='';class vl extends kl{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new bl;return e.content=_l,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}n(28);class yl extends Xa{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Ta,this.keystrokes=new wa,this._focusCycler=new rl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class xl extends Xa{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Cl extends Xa{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}n(30);class Al extends kl{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Xa;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function Tl({emitter:e,activator:t,callback:n,contextElements:i}){e.listenTo(document,"mousedown",(e,o)=>{if(!t())return;const r="function"==typeof o.composedPath?o.composedPath():[];for(const t of i)if(t.contains(o.target)||r.includes(t))return;n()})}function Sl(e,t=vl){const n=new t(e),i=new ul(e),o=new pl(e,n,i);return n.bind("isEnabled").to(o),n instanceof vl?n.bind("isOn").to(o,"isOpen"):n.arrowView.bind("isOn").to(o,"isOpen"),function(e){(function(e){e.on("render",()=>{Tl({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})})(e),function(e){e.on("execute",t=>{t.source instanceof Al||(e.isOpen=!1)})}(e),function(e){e.keystrokes.set("arrowdown",(t,n)=>{e.isOpen&&(e.panelView.focus(),n())}),e.keystrokes.set("arrowup",(t,n)=>{e.isOpen&&(e.panelView.focusLast(),n())})}(e)}(o),o}function El(e,t){const n=e.locale,i=n.t,o=e.toolbarView=new Ml(n);o.set("ariaLabel",i("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map(e=>o.items.add(e)),e.panelView.children.add(o),o.items.delegate("execute").to(e)}function Pl(e,t){const n=e.locale,i=e.listView=new yl(n);i.items.bindTo(t).using(({type:e,model:t})=>{if("separator"===e)return new Cl(n);if("button"===e||"switchbutton"===e){const i=new xl(n);let o;return o="button"===e?new kl(n):new Al(n),o.bind(...Object.keys(t)).to(t),o.delegate("execute").to(i),i.children.add(o),i}}),e.panelView.children.add(i),i.items.delegate("execute").to(e)}n(32),n(34),n(36);class Ml extends Xa{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Ta,this.keystrokes=new wa,this.set("class"),this.set("isCompact",!1),this.itemsView=new Il(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection(),this._focusCycler=new rl({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}});const o=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var r;this.options.shouldGroupWhenFull&&this.options.isFloating&&o.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:o,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:(r=this,r.bindTemplate.to(e=>{e.target===r.element&&e.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new Ol(this):new Nl(this)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){this.items.addMany(e.map(n=>"|"==n?new al:"-"==n?(this.options.shouldGroupWhenFull&&Object(mt.c)("toolbarview-line-break-ignored-when-grouping-items",e),new ll):t.has(n)?t.create(n):void Object(mt.c)("toolbarview-item-unavailable",{name:n})).filter(e=>void 0!==e))}}class Il extends Xa{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Nl{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>e),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Ol{constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(e,t)=>{const n=t.index;for(const i of t.removed)n>=this.ungroupedItems.length?this.groupedItems.remove(i):this.ungroupedItems.remove(i);for(let i=n;ithis.ungroupedItems.length?this.groupedItems.add(e,i-this.ungroupedItems.length):this.ungroupedItems.add(e,i)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new jo(e.lastChild),i=new jo(e);if(!this.cachedPadding){const n=qi.window.getComputedStyle(e);this.cachedPadding=Number.parseInt(n["ltr"===t?"paddingRight":"paddingLeft"])}return"ltr"===t?n.right>i.right-this.cachedPadding:n.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new al),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,n=Sl(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",El(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,icon:''}),n.toolbarView.items.bindTo(this.groupedItems).using(e=>e),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class Rl extends nl{constructor(e,t,n={}){super(e),this.toolbar=new Ml(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new ol(e,t,n.editableElement),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}class Ll extends _a{constructor(e,t){super(t),st(e)&&(this.sourceElement=e,function(e){const t=e.sourceElement;if(t){if(t.ckeditorInstance)throw new mt.a("editor-source-element-already-used",e);t.ckeditorInstance=e,e.once("destroy",()=>{delete t.ckeditorInstance})}}(this)),this.data.processor=new xa(this.data.viewDocument),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new Rl(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:n});this.ui=new Na(this,i)}destroy(){const e=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&function(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}(this.sourceElement,e)})}static create(e,t={}){return new Promise(n=>{const i=st(e);if(i&&"TEXTAREA"===e.tagName)throw new mt.a("editor-wrong-element",null);const o=new this(e,t);n(o.initPlugins().then(()=>{o.ui.init()}).then(()=>{if(!i&&t.initialData)throw new mt.a("editor-create-initial-data",null);const n=t.initialData||function(e){return st(e)?(t=e)instanceof HTMLTextAreaElement?t.value:t.innerHTML:e;var t}(e);return o.data.init(n)}).then(()=>o.fire("ready")).then(()=>o))})}}At(Ll,va);class Dl{constructor(e){this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",zl,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",zl),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function zl(e){e.return=!1,e.stop()}At(Dl,Sn);class Vl{constructor(e){this.files=function(e){const t=e.files?Array.from(e.files):[],n=e.items?Array.from(e.items):[];return t.length?t:n.filter(e=>"file"===e.kind).map(e=>e.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}}class jl extends ko{constructor(e){super(e);const t=this.document;function n(e,n){n.preventDefault();const i=n.dropRange?[n.dropRange]:Array.from(t.selection.getRanges()),o=new dt(t,"clipboardInput");t.fire(o,{dataTransfer:n.dataTransfer,targetRanges:i}),o.stop.called&&n.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(t,"paste",n,{priority:"low"}),this.listenTo(t,"drop",n,{priority:"low"})}onDomEvent(e){const t={dataTransfer:new Vl(e.clipboardData?e.clipboardData:e.dataTransfer)};"drop"==e.type&&(t.dropRange=function(e,t){const n=t.target.ownerDocument,i=t.clientX,o=t.clientY;let r;return n.caretRangeFromPoint&&n.caretRangeFromPoint(i,o)?r=n.caretRangeFromPoint(i,o):t.rangeParent&&(r=n.createRange(),r.setStart(t.rangeParent,t.rangeOffset),r.collapse(!0)),r?e.domConverter.domRangeToView(r):e.document.selection.getFirstRange()}(this.view,e)),this.fire(e.type,e,t)}}class Bl extends Dl{static get pluginName(){return"PastePlainText"}init(){const e=this.editor.editing.view,t=e.document;let n=!1;e.addObserver(jl),this.listenTo(t,"keydown",(e,t)=>{n=t.shiftKey}),this.listenTo(t,"clipboardInput",(e,t)=>{n&&(t.asPlainText=!0)},{priority:"high"})}}const Fl=["figcaption","li"];class Hl extends Dl{static get pluginName(){return"Clipboard"}static get requires(){return[Bl]}init(){const e=this.editor,t=e.model.document,n=e.editing.view,i=n.document;function o(n,o){const r=o.dataTransfer;o.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));i.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this._htmlDataProcessor=new xa(i),n.addObserver(jl),this.listenTo(i,"clipboardInput",t=>{e.isReadOnly&&t.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(e,t)=>{const i=t.dataTransfer;let o="";var r;i.getData("text/html")?o=function(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t)}(i.getData("text/html")):i.getData("text/plain")&&(((r=(r=i.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||r.includes("
"))&&(r=`

${r}

`),o=r),o=this._htmlDataProcessor.toView(o);const s=new dt(this,"inputTransformation");this.fire(s,{content:o,dataTransfer:i,asPlainText:t.asPlainText}),s.stop.called&&e.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(e,t)=>{if(!t.content.isEmpty){const n=this.editor.model,i=this.editor.data.toModel(t.content,"$clipboardHolder");if(0==i.childCount)return;n.change(e=>{const o=n.document.selection;if(t.asPlainText||function(e,t){if(e.childCount>1)return!1;const n=e.getChild(0);return!t.isObject(n)&&0==[...n.getAttributeKeys()].length}(i,n.schema)){const t=Array.from(o.getAttributes()).filter(([e])=>n.schema.getAttributeProperties(e).isFormatting);o.isCollapsed||n.deleteContent(o,{doNotAutoparagraph:!0}),t.push(...o.getAttributes());const r=e.createRangeIn(i);for(const n of r.getItems())(n.is("$text")||n.is("$textProxy"))&&e.setAttributes(t,n)}n.insertContent(i)}),e.stop()}},{priority:"low"}),this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",(t,n)=>{e.isReadOnly?n.preventDefault():o(t,n)},{priority:"low"}),this.listenTo(i,"clipboardOutput",(n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",function e(t){let n="";if(t.is("$text")||t.is("$textProxy"))n=t.data;else if(t.is("element","img")&&t.hasAttribute("alt"))n=t.getAttribute("alt");else if(t.is("element","br"))n="\n";else{let i=null;for(const o of t.getChildren()){const t=e(o);i&&(i.is("containerElement")||o.is("containerElement"))&&(Fl.includes(i.name)||Fl.includes(o.name)?n+="\n":n+="\n\n"),n+=t,i=o}}return n}(i.content))),"cut"==i.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class Ul{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",ql,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",ql),this.refresh())}execute(){}destroy(){this.stopListening()}}function ql(e){e.return=!1,e.stop()}function*Wl(e,t){for(const n of t)n&&e.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}At(Ul,Sn);class $l extends Ul{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n,i){const o=n.isCollapsed,r=n.getFirstRange(),s=r.start.parent,a=r.end.parent;if(i.isLimit(s)||i.isLimit(a))o||s!=a||e.deleteContent(n);else if(o){const e=Wl(t.model.schema,n.getAttributes());Gl(t,r.start),t.setSelectionAttribute(e)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;e.deleteContent(n,{leaveUnmerged:i}),i&&(o?Gl(t,n.focus):t.setSelection(a,0))}}(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function Gl(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}class Yl extends no{constructor(e){super(e);const t=this.document;t.on("keydown",(e,n)=>{if(this.isEnabled&&n.keyCode==ni.enter){let i;t.once("enter",e=>i=e,{priority:"highest"}),t.fire("enter",new wo(t,n.domEvent,{isSoft:n.shiftKey})),i&&i.stop.called&&e.stop()}})}observe(){}}class Ql extends Dl{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Yl),e.commands.add("enter",new $l(e)),this.listenTo(n,"enter",(n,i)=>{i.preventDefault(),i.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class Kl extends Ul{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n){const i=n.isCollapsed,o=n.getFirstRange(),r=o.end.parent,s=o.start.parent==r;if(i){const i=Wl(e.schema,n.getAttributes());Jl(e,t,o.end),t.removeSelectionAttribute(n.getAttributeKeys()),t.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:i}),s?Jl(e,t,n.focus):i&&t.setSelection(r,0)}}(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;const i=t.getFirstRange(),o=i.start.parent,r=i.end.parent;return!Zl(o,e)&&!Zl(r,e)||o===r}(e.schema,e.document.selection)}}function Jl(e,t,n){const i=t.createElement("softBreak");e.insertContent(i,n),t.setSelection(i,"after")}function Zl(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Zl(e.parent,t))}class Xl extends Dl{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.conversion,n=e.editing.view,i=n.document;e.model.schema.register("softBreak",{allowWhere:"$text",isInline:!0}),t.for("upcast").elementToElement({model:"softBreak",view:"br"}),t.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),n.addObserver(Yl),e.commands.add("shiftEnter",new Kl(e)),this.listenTo(i,"enter",(t,i)=>{i.preventDefault(),i.isSoft&&(e.execute("shiftEnter"),n.scrollToTheSelection())},{priority:"low"})}}class ec extends Ul{execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!tc(e.schema,n))do{if(n=n.parent,!n)return}while(!tc(e.schema,n));e.change(e=>{e.setSelection(n,"in")})}}function tc(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const nc=oi("Ctrl+A");class ic extends Dl{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new ec(e)),this.listenTo(t,"keydown",(t,n)=>{ii(n)===nc&&(e.execute("selectAll"),n.preventDefault())})}}class oc extends Dl{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new kl(t);return i.set({label:(0,t.t)("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class rc extends Dl{static get requires(){return[ic,oc]}static get pluginName(){return"SelectAll"}}class sc{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(e,t)=>{"transparent"!=t.type&&t!==this._batch&&this._reset(!0)},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(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}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(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class ac extends Ul{constructor(e,t){super(e),this._buffer=new sc(e.model,t),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",o=i.length,r=e.range?t.createSelection(e.range):n.selection,s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock(),this._batches.add(this._buffer.batch),t.deleteContent(r),i&&t.insertContent(e.createText(i,n.selection.getAttributes()),r),s?e.setSelection(s):r.is("documentSelection")||e.setSelection(r),this._buffer.unlock(),this._buffer.input(o)})}}const lc=[ii("arrowUp"),ii("arrowRight"),ii("arrowDown"),ii("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let bb=112;bb<=135;bb++)lc.push(bb);function cc(e){return!!e.ctrlKey||lc.includes(e.keyCode)}function dc(e){if(e.newChildren.length-e.oldChildren.length!=1)return;const t=function(e,t){const n=[];let i,o=0;return e.forEach(e=>{"equal"==e?(r(),o++):"insert"==e?(s("insert")?i.values.push(t[o]):(r(),i={type:"insert",index:o,values:[t[o]]}),o++):s("delete")?i.howMany++:(r(),i={type:"delete",index:o,howMany:1})}),r(),n;function r(){i&&(n.push(i),i=null)}function s(e){return i&&i.type==e}}(Di(e.oldChildren,e.newChildren,uc),e.newChildren);if(t.length>1)return;const n=t[0];return n.values[0]&&n.values[0].is("$text")?n:void 0}function uc(e,t){return e&&e.is("$text")&&t&&t.is("$text")?e.data===t.data:e===t}class hc{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(e){if(0==e.length)return!1;for(const t of e)if("children"===t.type&&!dc(t))return!0;return!1}(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:!0}));if(t)return t.getAncestors({includeSelf:!0,parentFirst:!0}).find(e=>e.is("containerElement")||e.is("rootElement"))}(e);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),o=new Yi(this.editor.editing.view.document),r=this.editor.data.toModel(o.domToView(i)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const a=Array.from(r.getChildren()),l=Array.from(s.getChildren()),c=a[a.length-1],d=l[l.length-1],u=c&&c.is("element","softBreak"),h=d&&!d.is("element","softBreak");u&&h&&a.pop();const f=this.editor.model.schema;if(!fc(a,f)||!fc(l,f))return;const m=a.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," "),g=l.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");if(g===m)return;const p=Di(g,m),{firstChangeAt:b,insertions:w,deletions:k}=mc(p);let _=null;t&&(_=this.editing.mapper.toModelRange(t.getFirstRange()));const v=m.substr(b,w),y=this.editor.model.createRange(this.editor.model.createPositionAt(s,b),this.editor.model.createPositionAt(s,b+k));this.editor.execute("input",{text:v,range:y,resultRange:_})}_handleTextMutation(e,t){if("text"!=e.type)return;const n=e.newText.replace(/\u00A0/g," "),i=e.oldText.replace(/\u00A0/g," ");if(i===n)return;const o=Di(i,n),{firstChangeAt:r,insertions:s,deletions:a}=mc(o);let l=null;t&&(l=this.editing.mapper.toModelRange(t.getFirstRange()));const c=this.editing.view.createPositionAt(e.node,r),d=this.editing.mapper.toModelPosition(c),u=this.editor.model.createRange(d,d.getShiftedBy(a)),h=n.substr(r,s);this.editor.execute("input",{text:h,range:u,resultRange:l})}_handleTextNodeInsertion(e){if("children"!=e.type)return;const t=dc(e),n=this.editing.view.createPositionAt(e.node,t.index),i=this.editing.mapper.toModelPosition(n);this.editor.execute("input",{text:t.values[0].data.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function fc(e,t){return e.every(e=>t.isInline(e))}function mc(e){let t=null,n=null;for(let r=0;r{n.deleteContent(n.document.selection)}),e.unlock()}i.document.on(Xn?"beforeinput":"keydown",(e,t)=>r(t),{priority:"lowest"}),i.document.on("compositionstart",(function(){const e=n.document,t=1!==e.selection.rangeCount||e.selection.getFirstRange().isFlat;e.selection.isCollapsed||t||s()}),{priority:"lowest"}),i.document.on("compositionend",()=>{t=n.createSelection(n.document.selection)},{priority:"lowest"})}(e),function(e){e.editing.view.document.on("mutations",(t,n,i)=>{new hc(e).handle(n,i)})}(e)}isInput(e){return this.editor.commands.get("input")._batches.has(e)}}class pc extends Ul{constructor(e,t){super(e),this.direction=t,this._buffer=new sc(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const o=i.createSelection(e.selection||n.selection),r=o.isCollapsed;if(o.isCollapsed&&t.modifySelection(o,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1))return void this._replaceEntireContentWithParagraph(i);if(o.isCollapsed)return;let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(e=>{s+=Bn(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(o,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(s),i.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(i))return!1;if(!t.schema.checkChild(i,"paragraph"))return!1;const o=i.getChild(0);return!o||"paragraph"!==o.name}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.schema.getLimitElement(t.document.selection),i=e.createElement("paragraph");e.remove(e.createRangeIn(n)),e.insert(i,n),e.setSelection(i,0)}}class bc extends no{constructor(e){super(e);const t=e.document;let n=0;function i(e,n,i){let o;t.once("delete",e=>o=e,{priority:Number.POSITIVE_INFINITY}),t.fire("delete",new wo(t,n,i)),o&&o.stop.called&&e.stop()}t.on("keyup",(e,t)=>{t.keyCode!=ni.delete&&t.keyCode!=ni.backspace||(n=0)}),t.on("keydown",(e,t)=>{const o={};if(t.keyCode==ni.delete)o.direction="forward",o.unit="character";else{if(t.keyCode!=ni.backspace)return;o.direction="backward",o.unit="codePoint"}o.unit=(Kn?t.altKey:t.ctrlKey)?"word":o.unit,o.sequence=++n,i(e,t.domEvent,o)}),Xn&&t.on("beforeinput",(t,n)=>{if("deleteContentBackward"!=n.domEvent.inputType)return;const o={unit:"codepoint",direction:"backward",sequence:1},r=n.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(o.selectionToRemove=e.domConverter.domSelectionToView(r)),i(t,n.domEvent,o)})}observe(){}}class wc extends Dl{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document;if(t.addObserver(bc),e.commands.add("forwardDelete",new pc(e,"forward")),e.commands.add("delete",new pc(e,"backward")),this.listenTo(n,"delete",(n,i)=>{const o={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const t=e.model.createSelection(),n=[];for(const o of i.selectionToRemove.getRanges())n.push(e.editing.mapper.toModelRange(o));t.setTo(n),o.selection=t}e.execute("forward"==i.direction?"forwardDelete":"delete",o),i.preventDefault(),t.scrollToTheSelection()}),Xn){let e=null;this.listenTo(n,"delete",(t,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(t,n)=>{if(e){const t=n.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset),t.extend(e.focusNode,e.focusOffset),e=null}})}}}class kc extends Dl{static get requires(){return[gc,wc]}static get pluginName(){return"Typing"}}const _c=new Map;function vc(e,t,n){let i=_c.get(e);i||(i=new Map,_c.set(e,i)),i.set(t,n)}function yc(e){return[e]}function xc(e,t,n={}){const i=function(e,t){const n=_c.get(e);return n&&n.has(t)?n.get(t):yc}(e.constructor,t.constructor);try{return i(e=e.clone(),t,n)}catch(e){throw e}}function Cc(e,t,n){e=e.slice(),t=t.slice();const i=new Ac(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(e),i.setOriginalOperations(t);const o=i.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:o};const r=new WeakMap;for(const l of e)r.set(l,0);const s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;for(;a{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const i=e.range.getDifference(t.range).map(t=>new Ss(t,e.key,e.oldValue,e.newValue,0)),o=e.range.getIntersection(t.range);return o&&n.aIsStrong&&i.push(new Ss(o,t.key,t.newValue,e.newValue,0)),0==i.length?[new ea(0)]:i}return[e]}),vc(Ss,Ms,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const n=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(t=>new Ss(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=Ec(t,e.key,e.oldValue);i&&n.unshift(i)}return n}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]}),vc(Ss,Rs,(e,t)=>{const n=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&n.push(dr._createFromPositionAndShift(t.graveyardPosition,1));const i=e.range._getTransformedByMergeOperation(t);return i.isCollapsed||n.push(i),n.map(t=>new Ss(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),vc(Ss,Ps,(e,t)=>function(e,t){const n=dr._createFromPositionAndShift(t.sourcePosition,t.howMany);let i=null,o=[];n.containsRange(e,!0)?i=e:e.start.hasSameParentAs(n.start)?(o=e.getDifference(n),i=e.getIntersection(n)):o=[e];const r=[];for(let s of o){s=s._getTransformedByDeletion(t.sourcePosition,t.howMany);const e=t.getMovedRangeStart(),n=s.start.hasSameParentAs(e);s=s._getTransformedByInsertion(e,t.howMany,n),r.push(...s)}return i&&r.push(i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),r}(e.range,t).map(t=>new Ss(t,e.key,e.oldValue,e.newValue,e.baseVersion))),vc(Ss,Ls,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const n=e.clone();return n.range=new dr(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,n]}return e.range=e.range._getTransformedBySplitOperation(t),[e]}),vc(Ms,Ss,(e,t)=>{const n=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const i=Ec(e,t.key,t.newValue);i&&n.push(i)}return n}),vc(Ms,Ms,(e,t,n)=>(e.position.isEqual(t.position)&&n.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e])),vc(Ms,Ps,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),vc(Ms,Ls,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e])),vc(Ms,Rs,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e])),vc(Is,Ms,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e])),vc(Is,Is,(e,t,n)=>{if(e.name==t.name){if(!n.aIsStrong)return[new ea(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]}),vc(Is,Rs,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e])),vc(Is,Ps,(e,t,n)=>{if(e.oldRange&&(e.oldRange=dr._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(n.abRelation){const i=dr._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.start.path=n.abRelation.path,e.newRange.end=i.end,[e];if("right"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=i.start,e.newRange.end.path=n.abRelation.path,[e]}e.newRange=dr._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]}),vc(Is,Ls,(e,t,n)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(n.abRelation){const i=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?e.newRange.start=sr._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!n.abRelation.wasInLeftElement&&(e.newRange.start=sr._createAt(t.moveTargetPosition)),e.newRange.end=e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasInRightElement?sr._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?sr._createAt(t.insertionPosition):i.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]}),vc(Rs,Ms,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e])),vc(Rs,Rs,(e,t,n)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(n.bWasUndone){const n=t.graveyardPosition.path.slice();return n.push(0),e.sourcePosition=new sr(t.graveyardPosition.root,n),e.howMany=0,[e]}return[new ea(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const i="$graveyard"==e.targetPosition.root.rootName,o="$graveyard"==t.targetPosition.root.rootName,r=i&&!o;if(o&&!i||!r&&n.aIsStrong){const n=t.targetPosition._getTransformedByMergeOperation(t),i=e.targetPosition._getTransformedByMergeOperation(t);return[new Ps(n,e.howMany,i,0)]}return[new ea(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&n.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),vc(Rs,Ps,(e,t,n)=>{const i=dr._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!n.bWasUndone&&!n.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition)?[new ea(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])}),vc(Rs,Ls,(e,t,n)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const i=0!=t.howMany,o=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(i||o||"mergeTargetNotMoved"==n.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==n.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}),vc(Ps,Ms,(e,t)=>{const n=dr._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]}),vc(Ps,Ps,(e,t,n)=>{const i=dr._createFromPositionAndShift(e.sourcePosition,e.howMany),o=dr._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?a=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(a=!1),r=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Pc(e,t)&&Pc(t,e))return[t.getReversed()];if(i.containsPosition(t.targetPosition)&&i.containsRange(o,!0))return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Mc([i],r);if(o.containsPosition(e.targetPosition)&&o.containsRange(i,!0))return i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Mc([i],r);const l=Ot(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Mc([i],r);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(s=!1):s=!0;const c=[],d=i.getDifference(o);for(const h of d){h.start=h.start._getTransformedByDeletion(t.sourcePosition,t.howMany),h.end=h.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const e="same"==Ot(h.start.getParentPath(),t.getMovedRangeStart().getParentPath()),n=h._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,e);c.push(...n)}const u=i.getIntersection(o);return null!==u&&s&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(u):1==c.length?o.start.isBefore(i.start)||o.start.isEqual(i.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),0===c.length?[new ea(e.baseVersion)]:Mc(c,r)}),vc(Ps,Ls,(e,t,n)=>{let i=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(i=e.targetPosition._getTransformedBySplitOperation(t));const o=dr._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=i,[e];if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new dr(t.splitPosition,o.end);return e=e._getTransformedBySplitOperation(t),Mc([new dr(o.start,t.splitPosition),e],i)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(i=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(i=e.targetPosition);const r=[o._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const i=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);e.howMany>1&&i&&!n.aWasUndone&&r.push(dr._createFromPositionAndShift(t.insertionPosition,1))}return Mc(r,i)}),vc(Ps,Rs,(e,t,n)=>{const i=dr._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new ea(0)]}else if(!n.aWasUndone){const n=[];let i=t.graveyardPosition.clone(),o=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(n.push(new Ps(e.sourcePosition,e.howMany-1,e.targetPosition,0)),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const r=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),s=new Ps(i,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const l=new sr(s.targetPosition.root,a);o=o._getTransformedByMove(i,r,1);const c=new Ps(o,t.howMany,l,0);return n.push(s),n.push(c),n}const o=dr._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=o.start,e.howMany=o.end.offset-o.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]}),vc(Ns,Ms,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e])),vc(Ns,Rs,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])),vc(Ns,Ps,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),vc(Ns,Ns,(e,t,n)=>{if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new ea(0)];e.oldName=t.newName}return[e]}),vc(Ns,Ls,(e,t)=>{if("same"==Ot(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new Ns(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]}),vc(Os,Os,(e,t,n)=>{if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new ea(0)];e.oldValue=t.newValue}return[e]}),vc(Ls,Ms,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!n.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const i=new sr(t.graveyardPosition.root,n),o=Ls.getInsertionPosition(new sr(t.graveyardPosition.root,n)),r=new Ls(i,0,null,0);return r.insertionPosition=o,e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ls.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ls.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),vc(Ls,Ps,(e,t,n)=>{const i=dr._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);if(!n.bWasUndone&&o){const n=e.splitPosition._getTransformedByMoveOperation(t),i=e.graveyardPosition._getTransformedByMoveOperation(t),o=i.path.slice();o.push(0);const r=new sr(i.root,o);return[new Ps(n,e.howMany,r,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}return e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)?(e.howMany-=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset),e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new ea(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new ea(0)];if("splitBefore"==n.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const i="$graveyard"==e.splitPosition.root.rootName,o="$graveyard"==t.splitPosition.root.rootName,r=i&&!o;if(o&&!i||!r&&n.aIsStrong){const n=[];return t.howMany&&n.push(new Ps(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&n.push(new Ps(e.splitPosition,e.howMany,e.moveTargetPosition,0)),n}return[new ea(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.baRelation){const n=t.insertionPosition.path.slice();n.push(0);const i=new sr(t.insertionPosition.root,n);return[e,new Ps(e.insertionPosition,1,i,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,o=i.document,r=[],s=e.map(e=>e.getTransformedByOperations(n)),a=s.flat();for(const l of s){const e=l.filter(e=>e.root!=o.graveyard).filter(e=>!Oc(e,a));e.length&&(Nc(e),r.push(e[0]))}r.length&&i.change(e=>{e.setSelection(r,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const o=e.operations.slice().filter(e=>e.isDocumentOperation);o.reverse();for(const r of o){const e=Array.from(i.history.getOperations(r.baseVersion+1)),o=Cc([r.getReversed()],e,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const s of o)t.addOperation(s),n.applyOperation(s),i.history.setOperationAsUndone(r,s)}}}function Nc(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,!0))}class Rc extends Ic{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire("revert",n.batch,i)}),this.refresh()}}class Lc extends Ic{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(t,()=>{const n=this.editor.model.document.history.getOperations(e.batch.operations[e.batch.operations.length-1].baseVersion+1);this._restoreSelection(e.selection.ranges,e.selection.isBackward,n),this._undo(e.batch,t)}),this.refresh()}}class Dc extends Dl{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new Rc(e),this._redoCommand=new Lc(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const n=t[0];if(!n.isDocumentOperation)return;const i=n.batch,o=this._redoCommand._createdBatches.has(i),r=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||"transparent"==i.type&&!o&&!r||(o?this._undoCommand.addBatch(i):r||(this._undoCommand.addBatch(i),this._redoCommand.clearStack()),this._batchRegistry.add(i))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var zc='',Vc='';class jc extends Dl{init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?zc:Vc,o="ltr"==t.uiLanguageDirection?Vc:zc;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(e,t,n,i){const o=this.editor;o.ui.componentFactory.add(e,r=>{const s=o.commands.get(e),a=new kl(r);return a.set({label:t,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(e),o.editing.view.focus()}),a})}}class Bc extends Dl{static get requires(){return[Dc,jc]}static get pluginName(){return"Undo"}}function Fc(e){const t=e.next();return t.done?null:t.value}const Hc=["left","right","center","justify"];function Uc(e){return Hc.includes(e)}function qc(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}class Wc extends Ul{refresh(){const e=this.editor.locale,t=Fc(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.value=this.isEnabled&&t.hasAttribute("alignment")?t.getAttribute("alignment"):"rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,o=i.document,r=e.value;i.change(e=>{const t=Array.from(o.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e)),i=t[0].getAttribute("alignment");qc(r,n)||i===r||!r?function(e,t){for(const n of e)t.removeAttribute("alignment",n)}(t,e):function(e,t,n){for(const i of e)t.setAttribute("alignment",n,i)}(t,e,r)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,"alignment")}}class $c extends Dl{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:[...Hc]})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=e.config.get("alignment.options").filter(Uc);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0});const o=function(e){const t={model:{key:"alignment",values:e.slice()},view:{}};for(const n of e)t.view[n]={key:"style",value:{"text-align":n}};return t}(i.filter(e=>!qc(e,t)));e.conversion.attributeToAttribute(o),e.commands.add("alignment",new Wc(e))}}var Gc='',Yc='';const Qc=new Map([["left",Gc],["right",Yc],["center",''],["justify",'']]);class Kc extends Dl{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t,i=e.config.get("alignment.options");i.filter(Uc).forEach(e=>this._addButton(e)),t.add("alignment",e=>{const o=Sl(e),r=i.map(e=>t.create("alignment:"+e));El(o,r),o.buttonView.set({label:n("Text alignment"),tooltip:!0}),o.toolbarView.isVertical=!0,o.toolbarView.ariaLabel=n("Text alignment toolbar"),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===e.contentLanguageDirection?Yc:Gc;return o.buttonView.bind("icon").toMany(r,"isOn",(...e)=>{const t=e.findIndex(e=>e);return t<0?s:r[t].icon}),o.bind("isEnabled").toMany(r,"isEnabled",(...e)=>e.some(e=>e)),o})}_addButton(e){const t=this.editor;t.ui.componentFactory.add("alignment:"+e,n=>{const i=t.commands.get("alignment"),o=new kl(n);return o.set({label:this.localizedOptionTitles[e],icon:Qc.get(e),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",t=>t===e),this.listenTo(o,"execute",()=>{t.execute("alignment",{value:e}),t.editing.view.focus()}),o})}}class Jc extends Ul{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.value;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,i):e.removeSelectionAttribute(this.attributeKey);else{const o=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of o)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}}class Zc extends kl{constructor(e){super(e);const t=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color")},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}n(38);class Xc extends Xa{constructor(e,t){super(e);const n=t&&t.colorDefinitions||[],i={};t&&t.columns&&(i.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new Ta,this.keystrokes=new wa,this._focusCycler=new rl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(e,t)=>{t.isOn=t.color===this.selectedColor}),n.forEach(e=>{const t=new Zc;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})}),this.items.add(t)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:i}}),this.on("change:selectedColor",(e,t,n)=>{for(const i of this.items)i.isOn=i.color===n})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}}n(40);class ed extends Xa{constructor(e){super(e),this.set("text"),this.set("for"),this.id="ck-editor__label_"+ht();const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class td extends Tt{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){this.find(t=>t.color===e.color)||super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}At(td,Sn),n(42);class nd extends Xa{constructor(e,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){super(e),this.items=this.createCollection(),this.colorDefinitions=t,this.focusTracker=new Ta,this.keystrokes=new wa,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new td,this.documentColorsCount=r,this._focusCycler=new rl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const n=e.document,i=this.documentColorsCount;this.documentColors.clear();for(const o of n.getRootNames()){const r=n.getRoot(o),s=e.createRangeIn(r);for(const e of s.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=i))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.selectedColor;this.staticColorsGrid.selectedColor=t,e&&(e.selectedColor=t)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const e=Ra.bind(this.documentColors,this.documentColors),t=new ed(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new kl;return e.set({withText:!0,icon:'',tooltip:!0,label:this.removeButtonLabel}),e.class="ck-color-table__remove-color",e.on("execute",()=>{this.fire("execute",{value:null})}),e}_createStaticColorsGrid(){const e=new Xc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.delegate("execute").to(this),e}_createDocumentColorsGrid(){const e=Ra.bind(this.documentColors,this.documentColors),t=new Xc(this.locale,{columns:this.columns});return t.delegate("execute").to(this),t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{const t=new Zc;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color})}),t}),this.documentColors.on("change:isEmpty",(e,n,i)=>{i&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);this.documentColors.add(t?Object.assign({},t):{color:e,label:e,options:{hasBorder:!1}})}}function id(e,t){const n={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const i of t)n.model.values.push(i.model),n.view[i.model]=i.view,i.upcastAlso&&(n.upcastAlso[i.model]=i.upcastAlso);return n}function od(e){return t=>t.getStyle(e).replace(/\s/g,"")}function rd(e){return(t,{writer:n})=>n.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class sd extends Jc{constructor(e){super(e,"fontSize")}}function ad(e){return e.map(e=>function(e){if("object"==typeof(t=e)&&t.title&&t.model&&t.view)return cd(e);var t;const n=function(e){return ld[e]||ld[e.model]}(e);return n?cd(n):"default"===e?{model:void 0,title:"Default"}:function(e){let t;if("object"==typeof e){if(!e.model)throw new mt.a("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e)?void 0:function(e){return"number"!=typeof e&&"string"!=typeof e||(e={title:String(e),model:parseFloat(e)+"px"}),e.view={name:"span",styles:{"font-size":e.model}},cd(e)}(e)}(e)).filter(e=>!!e)}const ld={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function cd(e){return e.view.priority||(e.view.priority=7),e}class dd extends Dl{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e),e.config.define("fontSize",{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"fontSize"}),e.model.schema.setAttributeProperties("fontSize",{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),n=id("fontSize",ad(this.editor.config.get("fontSize.options")).filter(e=>e.model));t?this._prepareAnyValueConverters(n):e.conversion.attributeToElement(n),e.commands.add("fontSize",new sd(e))}_prepareAnyValueConverters(e){const t=this.editor,n=e.model.values.filter(e=>!String(e).match(/[\d.]+[\w%]+/));if(n.length)throw new mt.a("font-size-invalid-use-of-named-presets",null,{presets:n});t.conversion.for("downcast").attributeToElement({model:"fontSize",view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").attributeToAttribute({model:{key:"fontSize",value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}}class ud{constructor(e,t){t&&yn(this,t),e&&this.set(e)}}At(ud,Sn),n(44);class hd extends Dl{init(){const e=this.editor,t=e.t,n=this._getLocalizedOptions(),i=e.commands.get("fontSize");e.ui.componentFactory.add("fontSize",o=>{const r=Sl(o);return Pl(r,function(e,t){const n=new Tt;for(const i of e){const e={type:"button",model:new ud({commandName:"fontSize",commandParam:i.model,label:i.title,class:"ck-fontsize-option",withText:!0})};i.view&&i.view.styles&&e.model.set("labelStyle","font-size:"+i.view.styles["font-size"]),i.view&&i.view.classes&&e.model.set("class",`${e.model.class} ${i.view.classes}`),e.model.bind("isOn").to(t,"value",e=>e===i.model),n.add(e)}return n}(n,i)),r.buttonView.set({label:t("Font Size"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()}),r})}_getLocalizedOptions(){const e=this.editor,t=e.t,n={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return ad(e.config.get("fontSize").options).map(e=>{const t=n[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e})}}class fd extends Jc{constructor(e){super(e,"fontFamily")}}function md(e){return e.map(gd).filter(e=>!!e)}function gd(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),n=t[0],i=t.map(pd).join(", ");return{title:n,model:i,view:{name:"span",styles:{"font-family":i},priority:7}}}(e):void 0}function pd(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class bd extends Dl{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e),e.config.define("fontFamily",{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"fontFamily"}),e.model.schema.setAttributeProperties("fontFamily",{isFormatting:!0,copyOnEnter:!0});const t=id("fontFamily",md(e.config.get("fontFamily.options")).filter(e=>e.model));e.config.get("fontFamily.supportAllValues")?this._prepareAnyValueConverters():e.conversion.attributeToElement(t),e.commands.add("fontFamily",new fd(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:"fontFamily",view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").attributeToAttribute({model:{key:"fontFamily",value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}}class wd extends Dl{init(){const e=this.editor,t=e.t,n=this._getLocalizedOptions(),i=e.commands.get("fontFamily");e.ui.componentFactory.add("fontFamily",o=>{const r=Sl(o);return Pl(r,function(e,t){const n=new Tt;for(const i of e){const e={type:"button",model:new ud({commandName:"fontFamily",commandParam:i.model,label:i.title,withText:!0})};e.model.bind("isOn").to(t,"value",e=>e===i.model||!(!e||!i.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===i.model.toLowerCase()),i.view&&i.view.styles&&e.model.set("labelStyle","font-family: "+i.view.styles["font-family"]),n.add(e)}return n}(n,i)),r.buttonView.set({label:t("Font Family"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()}),r})}_getLocalizedOptions(){const e=this.editor,t=e.t;return md(e.config.get("fontFamily").options).map(e=>("Default"===e.title&&(e.title=t("Default")),e))}}class kd extends Jc{constructor(e){super(e,"fontColor")}}class _d extends Dl{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define("fontColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:"fontColor",value:od("color")}}),e.conversion.for("downcast").attributeToElement({model:"fontColor",view:rd("color")}),e.commands.add("fontColor",new kd(e)),e.model.schema.extend("$text",{allowAttributes:"fontColor"}),e.model.schema.setAttributeProperties("fontColor",{isFormatting:!0,copyOnEnter:!0})}}function vd(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:""+e.color}}}}class yd extends Dl{constructor(e,{commandName:t,icon:n,componentName:i,dropdownLabel:o}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=o,this.columns=e.config.get(this.componentName+".columns"),this.colorTableView=void 0}init(){const e=this.editor,t=e.locale,n=t.t,i=e.commands.get(this.commandName),o=function(e,t){const n=e.t,i={Black:n("Black"),"Dim grey":n("Dim grey"),Grey:n("Grey"),"Light grey":n("Light grey"),White:n("White"),Red:n("Red"),Orange:n("Orange"),Yellow:n("Yellow"),"Light green":n("Light green"),Green:n("Green"),Aquamarine:n("Aquamarine"),Turquoise:n("Turquoise"),"Light blue":n("Light blue"),Blue:n("Blue"),Purple:n("Purple")};return t.map(e=>{const t=i[e.label];return t&&t!=e.label&&(e.label=t),e})}(t,e.config.get(this.componentName).colors.map(vd).filter(e=>!!e)),r=e.config.get(this.componentName+".documentColors");e.ui.componentFactory.add(this.componentName,t=>{const s=Sl(t);return this.colorTableView=function({dropdownView:e,colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){const s=new nd(e.locale,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r});return e.colorTableView=s,e.panelView.children.add(s),s.delegate("execute").to(e,"execute"),s}({dropdownView:s,colors:o.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:0!==r?n("Document colors"):void 0,documentColorsCount:void 0===r?this.columns:r}),this.colorTableView.bind("selectedColor").to(i,"value"),s.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),s.bind("isEnabled").to(i),s.on("execute",(t,n)=>{e.execute(this.commandName,n),e.editing.view.focus()}),s.on("change:isOpen",(t,n,i)=>{s.colorTableView.appendGrids(),i&&(0!==r&&this.colorTableView.updateDocumentColors(e.model,this.componentName),this.colorTableView.updateSelectedColors())}),s})}}class xd extends yd{constructor(e){super(e,{commandName:"fontColor",componentName:"fontColor",icon:'',dropdownLabel:(0,e.locale.t)("Font Color")})}static get pluginName(){return"FontColorUI"}}class Cd extends Jc{constructor(e){super(e,"fontBackgroundColor")}}const Ad=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Td=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Sd=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Ed=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Pd=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Md=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","rebeccapurple","currentcolor","transparent"]);function Id(e){return e.startsWith("#")?Ad.test(e):e.startsWith("rgb")?Td.test(e)||Sd.test(e):e.startsWith("hsl")?Ed.test(e)||Pd.test(e):Md.has(e.toLowerCase())}const Nd=["repeat-x","repeat-y","repeat","space","round","no-repeat"],Od=["center","top","bottom","left","right"];function Rd(e){return Od.includes(e)}const Ld=["fixed","scroll","local"];function Dd(e){return Ld.includes(e)}const zd=/^url\(/;function Vd(e){return zd.test(e)}function jd(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const t=Fd(e),n=t[0],i=t[1]||n;return{top:n,bottom:t[2]||n,right:i,left:t[3]||i}}function Bd({top:e,right:t,bottom:n,left:i}){const o=[];return i!==t?o.push(e,t,n,i):n!==e?o.push(e,t,n):t!==e?o.push(e,t):o.push(e),o.join(" ")}function Fd(e){return e.replace(/, /g,",").split(" ").map(e=>e.replace(/,/g,", "))}function Hd(e){e.setNormalizer("background",Ud),e.setNormalizer("background-color",e=>({path:"background.color",value:e})),e.setReducer("background",e=>{const t=[];return t.push(["background-color",e.color]),t})}function Ud(e){const t={},n=Fd(e);for(const i of n)Nd.includes(i)?(t.repeat=t.repeat||[],t.repeat.push(i)):Rd(i)?(t.position=t.position||[],t.position.push(i)):Dd(i)?t.attachment=i:Id(i)?t.color=i:Vd(i)&&(t.image=i);return{path:"background",value:t}}class qd extends Dl{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define("fontBackgroundColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(Hd),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:"fontBackgroundColor",value:od("background-color")}}),e.conversion.for("downcast").attributeToElement({model:"fontBackgroundColor",view:rd("background-color")}),e.commands.add("fontBackgroundColor",new Cd(e)),e.model.schema.extend("$text",{allowAttributes:"fontBackgroundColor"}),e.model.schema.setAttributeProperties("fontBackgroundColor",{isFormatting:!0,copyOnEnter:!0})}}class Wd extends yd{constructor(e){super(e,{commandName:"fontBackgroundColor",componentName:"fontBackgroundColor",icon:'',dropdownLabel:(0,e.locale.t)("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class $d{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}At($d,Sn);class Gd extends $d{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Tt({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new mt.a("pendingactions-add-invalid-message",this);const t=Object.create(Sn);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Yd{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const e=t.result;this._data=e,n(e)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}At(Yd,Sn);class Qd extends Dl{static get pluginName(){return"FileRepository"}static get requires(){return[Gd]}init(){this.loaders=new Tt,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return Object(mt.c)("filerepository-no-upload-adapter"),null;const t=new Kd(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof Kd?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,n)=>{e===t&&this._loadersMap.delete(n)})}_updatePendingAction(){const e=this.editor.plugins.get(Gd);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}At(Qd,Sn);class Kd{constructor(e,t){this.id=ht(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Yd,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new mt.a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e}).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new mt.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,n(e)}).catch(e=>{t.isFulfilled=!0,i(e)})}),t}}At(Kd,Sn);class Jd extends Dl{static get requires(){return[Qd]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(Qd).createUploadAdapter=t=>new Zd(t,e,this.editor.t))}}class Zd{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,o=this.loader,r=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>t(r)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const n=i.response;if(!n||!n.uploaded)return t(n&&n.error&&n.error.message?n.error.message:r);e({default:n.url})}),i.upload&&i.upload.addEventListener("progress",e=>{e.lengthComputable&&(o.uploadTotal=e.total,o.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",function(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const n of t){const t=n.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}("ckCsrfToken");var t;return e&&40==e.length||(e=function(e){let t="";const n=new Uint8Array(40);window.crypto.getRandomValues(n);for(let i=0;i.5?e.toUpperCase():e}return t}(),t=e,document.cookie=encodeURIComponent("ckCsrfToken")+"="+encodeURIComponent(t)+";path=/"),e}()),this.xhr.send(t)}}function Xd(e,t,n,i){let o,r=null;"function"==typeof i?o=i:(r=e.commands.get(i),o=()=>{e.execute(i)}),e.model.document.on("change:data",(i,s)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const a=Fc(e.model.document.selection.getRanges());if(!a.isCollapsed)return;if("transparent"==s.type)return;const l=Array.from(e.model.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=c.position.parent;if(d.is("element","codeBlock"))return;if(r&&!0===r.value)return;const u=d.getChild(0),h=e.model.createRangeOn(u);if(!h.containsRange(a)&&!a.end.isEqual(h.end))return;const f=n.exec(u.data.substr(0,a.end.offset));f&&e.model.enqueueChange(e=>{const t=e.createPositionAt(d,0),n=e.createPositionAt(d,f[0].length),i=new xr(t,n);!1!==o({match:f})&&e.remove(i),i.detach()})})}function eu(e,t,n,i){let o,r;n instanceof RegExp?o=n:r=n,r=r||(e=>{let t;const n=[],i=[];for(;null!==(t=o.exec(e))&&!(t&&t.length<4);){let{index:e,1:o,2:r,3:s}=t;e+=t[0].length-(o+r+s).length;const a=[e+o.length+r.length,e+o.length+r.length+s.length];n.push([e,e+o.length]),n.push(a),i.push([e+o.length,e+o.length+r.length])}return{remove:n,format:i}}),e.model.document.on("change:data",(n,o)=>{if("transparent"==o.type||!t.isEnabled)return;const s=e.model,a=s.document.selection;if(!a.isCollapsed)return;const l=Array.from(s.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=a.focus,u=d.parent,{text:h,range:f}=function(e,t){let n=e.start;return{text:Array.from(e.getItems()).reduce((e,i)=>!i.is("$text")&&!i.is("$textProxy")||i.getAttribute("code")?(n=t.createPositionAfter(i),""):e+i.data,""),range:t.createRange(n,e.end)}}(s.createRange(s.createPositionAt(u,0),d),s),m=r(h),g=tu(f.start,m.format,s),p=tu(f.start,m.remove,s);g.length&&p.length&&s.enqueueChange(e=>{if(!1!==i(e,g))for(const t of p.reverse())e.remove(t)})})}function tu(e,t,n){return t.filter(e=>void 0!==e[0]&&void 0!==e[1]).map(t=>n.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1])))}function nu(e,t){return(n,i)=>{if(!e.commands.get(t).isEnabled)return!1;const o=e.model.schema.getValidRanges(i,t);for(const e of o)n.setAttribute(t,!0,e);n.removeSelectionAttribute(t)}}class iu extends Ul{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const o=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of o)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const e of i.getItems())if(t.checkAttribute(e,this.attributeKey))return e.hasAttribute(this.attributeKey);return!1}}class ou extends Dl{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"bold"}),e.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t?"bold"==t||Number(t)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add("bold",new iu(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}class ru extends Dl{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("bold",n=>{const i=e.commands.get("bold"),o=new kl(n);return o.set({label:t("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("bold"),e.editing.view.focus()}),o})}}class su extends Dl{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"italic"}),e.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add("italic",new iu(e,"italic")),e.keystrokes.set("CTRL+I","italic")}}class au extends Dl{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("italic",n=>{const i=e.commands.get("italic"),o=new kl(n);return o.set({label:t("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("italic"),e.editing.view.focus()}),o})}}class lu extends Dl{static get pluginName(){return"StrikethroughEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"strikethrough"}),e.model.schema.setAttributeProperties("strikethrough",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"strikethrough",view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add("strikethrough",new iu(e,"strikethrough")),e.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}class cu extends Dl{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("strikethrough",n=>{const i=e.commands.get("strikethrough"),o=new kl(n);return o.set({label:t("Strikethrough"),icon:'',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("strikethrough"),e.editing.view.focus()}),o})}}class du extends Dl{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"underline"}),e.model.schema.setAttributeProperties("underline",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"underline",view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add("underline",new iu(e,"underline")),e.keystrokes.set("CTRL+U","underline")}}class uu extends Dl{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("underline",n=>{const i=e.commands.get("underline"),o=new kl(n);return o.set({label:t("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("underline"),e.editing.view.focus()}),o})}}class hu extends Ul{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,i=Array.from(t.document.selection.getSelectedBlocks()),o=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(o){const t=i.filter(e=>fu(e)||gu(n,e));this._applyQuote(e,t)}else this._removeQuote(e,i.filter(fu))})}_getValue(){const e=Fc(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!fu(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.schema,t=Fc(this.editor.model.document.selection.getSelectedBlocks());return!!t&&gu(e,t)}_removeQuote(e,t){mu(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const n=e.createPositionBefore(t.start.parent);return void e.move(t,n)}t.end.isAtEnd||e.split(t.end);const n=e.createPositionAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];mu(e,t).reverse().forEach(t=>{let i=fu(t.start);i||(i=e.createElement("blockQuote"),e.wrap(t,i)),n.push(i)}),n.reverse().reduce((t,n)=>t.nextSibling==n?(e.merge(e.createPositionAfter(t)),t):n)}}function fu(e){return"blockQuote"==e.parent.name?e.parent:null}function mu(e,t){let n,i=0;const o=[];for(;i{if(e.endsWith("blockQuote")&&"blockQuote"==t.name)return!1}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(n=>{const i=e.model.document.differ.getChanges();for(const e of i)if("insert"==e.type){const i=e.position.nodeAfter;if(!i)continue;if(i.is("element","blockQuote")&&i.isEmpty)return n.remove(i),!0;if(i.is("element","blockQuote")&&!t.checkChild(e.position,i))return n.unwrap(i),!0;if(i.is("element")){const e=n.createRangeIn(i);for(const i of e.getItems())if(i.is("element","blockQuote")&&!t.checkChild(n.createPositionBefore(i),i))return n.unwrap(i),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return n.remove(t),!0}return!1})}afterInit(){const e=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(t,n)=>{const i=this.editor.model.document,o=i.selection.getLastPosition().parent;i.selection.isCollapsed&&o.isEmpty&&e.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),t.stop())})}}n(46);class bu extends Dl{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const i=e.commands.get("blockQuote"),o=new kl(n);return o.set({label:t("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),o})}}class wu extends Dl{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("ckfinder",n=>{const i=e.commands.get("ckfinder"),o=new kl(n);return o.set({label:t("Insert image or file"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i),o.on("execute",()=>{e.execute("ckfinder"),e.editing.view.focus()}),o})}}class ku extends no{observe(e){this.listenTo(e,"load",(e,t)=>{const n=t.target;this.checkShouldIgnoreEventFromTarget(n)||"IMG"==n.tagName&&this._fireEvents(t)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class _u{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const o=n[0];i===o||vu(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const o=n[0];i===o||vu(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e.id);if(vu(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&yu(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)}}function vu(e,t){return e&&t&&e.priority==t.priority&&xu(e.classes)==xu(t.classes)}function yu(e,t){return e.priority>t.priority||!(e.priorityxu(t.classes)}function xu(e){return Array.isArray(e)?e.sort().join(","):e}function Cu(e){return t=>t+e}At(_u,bt),n(48);const Au=Cu("px"),Tu=qi.document.body;class Su extends Xa{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>"ck-balloon-panel_"+e),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",Au),left:t.to("left",Au)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=Su.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast],limiter:Tu,fitInViewport:!0},e),i=Su._getOptimalPosition(n),o=parseInt(i.left),r=parseInt(i.top);Object.assign(this,{top:r,left:o,position:i.name})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=Eu(e.target),n=e.limiter?Eu(e.limiter):Tu;this.listenTo(qi.document,"scroll",(i,o)=>{const r=o.target,s=t&&r.contains(t),a=n&&r.contains(n);!s&&!a&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo(qi.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(qi.document,"scroll"),this.stopListening(qi.window,"resize")}}function Eu(e){return st(e)?e:Do(e)?e.commonAncestorContainer:"function"==typeof e?Eu(e()):null}function Pu(e,t){return e.top-t.height-Su.arrowVerticalOffset}function Mu(e){return e.bottom+Su.arrowVerticalOffset}function Iu(e,t,n){return e&&Ou(e)&&!n.isInline(t)}function Nu(e){return e.getAttribute("widget-type-around")}function Ou(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Ru(e,t,n={}){if(!e.is("containerElement"))throw new mt.a("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Bu,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandle&&function(e,t){const n=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),n=new bl;return n.set("content",''),n.render(),t.appendChild(n.element),t}));t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),Lu(e,t,(e,t,n)=>n.addClass(Et(t.classes),e),(e,t,n)=>n.removeClass(Et(t.classes),e)),e}function Lu(e,t,n,i){const o=new _u;o.on("change:top",(t,o)=>{o.oldDescriptor&&i(e,o.oldDescriptor,o.writer),o.newDescriptor&&n(e,o.newDescriptor,o.writer)}),t.setCustomProperty("addHighlight",(e,t,n)=>o.add(t,n),e),t.setCustomProperty("removeHighlight",(e,t,n)=>o.remove(t,n),e)}function Du(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function zu(e,t){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",(n,i,o)=>{t.setAttribute("contenteditable",o?"false":"true",e)}),e.on("change:isFocused",(n,i,o)=>{o?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)}),e}function Vu(e,t){const n=e.getSelectedElement();if(n){const i=Nu(e);if(i)return t.createPositionAt(n,i);if(t.schema.isBlock(n))return t.createPositionAfter(n)}const i=e.getSelectedBlocks().next().value;if(i){if(i.isEmpty)return t.createPositionAt(i,0);const n=t.createPositionAfter(i);return e.focus.isTouching(n)?n:t.createPositionBefore(i)}return e.focus}function ju(e,t){const n=new jo(qi.window),i=n.getIntersection(e),o=t.height+Su.arrowVerticalOffset;if(e.top-o>n.top||e.bottom+o{const o=i.createElement("image",t),r=n||Vu(e.document.selection,e);e.insertContent(o,r),o.parent&&i.setSelection(o,"on")})}function qu(e){const t=e.schema,n=e.document.selection;return function(e,t,n){const i=function(e,t){const n=Vu(e,t).parent;return n.isEmpty&&!n.is("element","$root")?n.parent:n}(e,n);return t.checkChild(i,"image")}(n,t,e)&&!function(e,t){const n=e.getSelectedElement();return n&&t.isObject(n)}(n,t)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","image"))}(n)}function Wu(e){const t=[];for(const n of e.getChildren())t.push(n),n.is("element")&&t.push(...n.getChildren());return t.find(e=>e.is("element","img"))}function $u(e){return n=>{n.on(`attribute:${e}:image`,t)};function t(e,t,n){if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,o=Wu(n.mapper.toViewElement(t.item));i.setAttribute(t.attributeKey,t.attributeNewValue||"",o)}}Su.arrowHorizontalOffset=25,Su.arrowVerticalOffset=10,Su._getOptimalPosition=hl,Su.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:Pu(e,t),left:e.left-Su.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(e,t)=>({top:Pu(e,t),left:e.left-.25*t.width-Su.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(e,t)=>({top:Pu(e,t),left:e.left-t.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(e,t)=>({top:Pu(e,t),left:e.left-.75*t.width+Su.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(e,t)=>({top:Pu(e,t),left:e.left-t.width+Su.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(e,t)=>({top:Pu(e,t),left:e.left+e.width/2-Su.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(e,t)=>({top:Pu(e,t),left:e.left+e.width/2-.25*t.width-Su.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(e,t)=>({top:Pu(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(e,t)=>({top:Pu(e,t),left:e.left+e.width/2-.75*t.width+Su.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(e,t)=>({top:Pu(e,t),left:e.left+e.width/2-t.width+Su.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(e,t)=>({top:Pu(e,t),left:e.right-Su.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(e,t)=>({top:Pu(e,t),left:e.right-.25*t.width-Su.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(e,t)=>({top:Pu(e,t),left:e.right-t.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(e,t)=>({top:Pu(e,t),left:e.right-.75*t.width+Su.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(e,t)=>({top:Pu(e,t),left:e.right-t.width+Su.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(e,t)=>({top:Mu(e),left:e.left-Su.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(e,t)=>({top:Mu(e),left:e.left-.25*t.width-Su.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(e,t)=>({top:Mu(e),left:e.left-t.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(e,t)=>({top:Mu(e),left:e.left-.75*t.width+Su.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(e,t)=>({top:Mu(e),left:e.left-t.width+Su.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(e,t)=>({top:Mu(e),left:e.left+e.width/2-Su.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(e,t)=>({top:Mu(e),left:e.left+e.width/2-.25*t.width-Su.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(e,t)=>({top:Mu(e),left:e.left+e.width/2-t.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(e,t)=>({top:Mu(e),left:e.left+e.width/2-.75*t.width+Su.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(e,t)=>({top:Mu(e),left:e.left+e.width/2-t.width+Su.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(e,t)=>({top:Mu(e),left:e.right-Su.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(e,t)=>({top:Mu(e),left:e.right-.25*t.width-Su.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(e,t)=>({top:Mu(e),left:e.right-t.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(e,t)=>({top:Mu(e),left:e.right-.75*t.width+Su.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(e,t)=>({top:Mu(e),left:e.right-t.width+Su.arrowHorizontalOffset,name:"arrow_ne"})};class Gu extends Ul{refresh(){this.isEnabled=qu(this.editor.model)}execute(e){const t=this.editor.model;for(const n of Et(e.source))Uu(t,{src:n})}}class Yu extends Dl{static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.model.schema,n=e.t,i=e.conversion;e.editing.view.addObserver(ku),t.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),i.for("dataDowncast").elementToElement({model:"image",view:(e,{writer:t})=>Qu(t)}),i.for("editingDowncast").elementToElement({model:"image",view:(e,{writer:t})=>function(e,t,n){return t.setCustomProperty("image",!0,e),Ru(e,t,{label:function(){const t=Wu(e).getAttribute("alt");return t?`${t} ${n}`:n}})}(Qu(t),t,n("image widget"))}),i.for("downcast").add($u("src")).add($u("alt")).add(function(){return t=>{t.on("attribute:srcset:image",e)};function e(e,t,n){if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,o=Wu(n.mapper.toViewElement(t.item));if(null===t.attributeNewValue){const e=t.attributeOldValue;e.data&&(i.removeAttribute("srcset",o),i.removeAttribute("sizes",o),e.width&&i.removeAttribute("width",o))}else{const e=t.attributeNewValue;e.data&&(i.setAttribute("srcset",e.data,o),i.setAttribute("sizes","100vw",o),e.width&&i.setAttribute("width",e.width,o))}}}()),i.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(e,{writer:t})=>t.createElement("image",{src:e.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}}).add(function(){return t=>{t.on("element:figure",e)};function e(e,t,n){if(!n.consumable.test(t.viewItem,{name:!0,classes:"image"}))return;const i=Wu(t.viewItem);if(!i||!i.hasAttribute("src")||!n.consumable.test(i,{name:!0}))return;const o=Fc(n.convertItem(i,t.modelCursor).modelRange.getItems());o&&(n.convertChildren(t.viewItem,o),n.updateConversionResult(o,t))}}()),e.commands.add("imageInsert",new Gu(e))}}function Qu(e){const t=e.createEmptyElement("img"),n=e.createContainerElement("figure",{class:"image"});return e.insert(e.createPositionAt(n,0),t),n}class Ku extends ko{constructor(e){super(e),this.domEventType="mousedown"}onDomEvent(e){this.fire(e.type,e)}}class Ju extends Dl{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.locale,n=e.model.document.selection;this.listenTo(e.editing.view.document,"keydown",(e,i)=>{if(!n.isCollapsed)return;if(i.shiftKey||i.altKey||i.ctrlKey)return;const o=i.keyCode==ni.arrowright,r=i.keyCode==ni.arrowleft;if(!o&&!r)return;const s=t.contentLanguageDirection;let a=!1;a="ltr"===s&&o||"rtl"===s&&r?this._handleForwardMovement(i):this._handleBackwardMovement(i),!0===a&&e.stop()},{priority:ft.get("high")+1}),this._isNextGravityRestorationSkipped=!1,this.listenTo(n,"change:range",(e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&th(n.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!Zu(n,t))&&(th(i,t)?(eh(e),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,o=i.getFirstPosition();return this._isGravityOverridden?(eh(e),this._restoreGravity(),Xu(n,t,o),!0):o.isAtStart?!!Zu(i,t)&&(eh(e),Xu(n,t,o),!0):function(e,t){return th(e.getShiftedBy(-1),t)}(o,t)?o.isAtEnd&&!Zu(i,t)&&th(o,t)?(eh(e),Xu(n,t,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Zu(e,t){for(const n of t)if(e.hasAttribute(n))return!0;return!1}function Xu(e,t,n){const i=n.nodeBefore;e.change(e=>{i?e.setSelectionAttribute(i.getAttributes()):e.removeSelectionAttribute(t)})}function eh(e){e.preventDefault()}function th(e,t){const{nodeBefore:n,nodeAfter:i}=e;for(const o of t){const e=n?n.getAttribute(o):void 0;if((i?i.getAttribute(o):void 0)!==e)return!0}return!1}function nh(e,t,n,i){return i.createRange(ih(e,t,n,!0,i),ih(e,t,n,!1,i))}function ih(e,t,n,i,o){let r=e.textNode||(i?e.nodeBefore:e.nodeAfter),s=null;for(;r&&r.getAttribute(t)==n;)s=r,r=i?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,i?"before":"after"):e}class oh{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(e=>this._definitions.add(e)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,n)=>{if(!n.consumable.test(t.item,"attribute:linkHref"))return;const i=n.writer,o=i.document.selection;for(const r of this._definitions){const e=i.createAttributeElement("a",r.attributes,{priority:5});i.setCustomProperty("link",!0,e),r.callback(t.attributeNewValue)?t.item.is("selection")?i.wrap(o.getFirstRange(),e):i.wrap(n.mapper.toViewRange(t.range),e):i.unwrap(n.mapper.toViewRange(t.range),e)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:image",(e,t,n)=>{const i=n.mapper.toViewElement(t.item),o=Array.from(i.getChildren()).find(e=>"a"===e.name);for(const r of this._definitions){const e=Vt(r.attributes);if(r.callback(t.attributeNewValue))for(const[t,i]of e)"class"===t?n.writer.addClass(i,o):n.writer.setAttribute(t,i,o);else for(const[t,i]of e)"class"===t?n.writer.removeClass(i,o):n.writer.removeAttribute(t,o)}})}}}var rh=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),sh=function(e){return rh.test(e)},ah="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",lh="\\ud83c[\\udffb-\\udfff]",ch="[^\\ud800-\\udfff]",dh="(?:\\ud83c[\\udde6-\\uddff]){2}",uh="[\\ud800-\\udbff][\\udc00-\\udfff]",hh="(?:"+ah+"|"+lh+")?",fh="[\\ufe0e\\ufe0f]?"+hh+"(?:\\u200d(?:"+[ch,dh,uh].join("|")+")[\\ufe0e\\ufe0f]?"+hh+")*",mh="(?:"+[ch+ah+"?",ah,dh,uh,"[\\ud800-\\udfff]"].join("|")+")",gh=RegExp(lh+"(?="+lh+")|"+mh+fh,"g"),ph=function(e){e=Jt(e);var t=sh(e)?function(e){return sh(e)?function(e){return e.match(gh)||[]}(e):function(e){return e.split("")}(e)}(e):void 0,n=t?t[0]:e.charAt(0),i=t?function(e,t,n){return tn(e,1,n=void 0===n?e.length:n)}(t).join(""):e.slice(1);return n.toUpperCase()+i};const bh=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,wh=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,kh=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,_h=/^((\w+:(\/{2,})?)|(\W))/i;function vh(e,{writer:t}){const n=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,n),n}function yh(e){return function(e){return e.replace(bh,"").match(wh)}(e=String(e))?e:"#"}function xh(e,t){return!!e&&e.is("element","image")&&t.checkAttribute("image","linkHref")}function Ch(e,t){const n=kh.test(e)?"mailto:":t,i=!!n&&!_h.test(e);return e&&i?n+e:e}class Ah extends Ul{constructor(e){super(e),this.manualDecorators=new Tt,this.automaticDecorators=new oh}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document,n=Fc(t.selection.getSelectedBlocks());xh(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.selection.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,o=[],r=[];for(const s in t)t[s]?o.push(s):r.push(s);n.change(t=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=nh(s,"linkHref",i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,a),o.forEach(e=>{t.setAttribute(e,!0,a)}),r.forEach(e=>{t.removeAttribute(e,a)}),t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(""!==e){const r=Vt(i.getAttributes());r.set("linkHref",e),o.forEach(e=>{r.set(e,!0)});const{end:a}=n.insertContent(t.createText(e,r),s);t.setSelection(a)}["linkHref",...o,...r].forEach(e=>{t.removeSelectionAttribute(e)})}else{const s=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const e of i.getSelectedBlocks())n.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of s)this._isRangeToUpdate(e,a)&&l.push(e);for(const n of l)t.setAttribute("linkHref",e,n),o.forEach(e=>{t.setAttribute(e,!0,n)}),r.forEach(e=>{t.removeAttribute(e,n)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document,i=Fc(n.selection.getSelectedBlocks());return xh(i,t.schema)?i.getAttribute(e):n.selection.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class Th extends Ul{refresh(){const e=this.editor.model,t=e.document,n=Fc(t.selection.getSelectedBlocks());this.isEnabled=xh(n,e.schema)?e.schema.checkAttribute(n,"linkHref"):e.schema.checkAttributeInSelection(t.selection,"linkHref")}execute(){const e=this.editor.model,t=e.document.selection,n=this.editor.commands.get("link");e.change(i=>{const o=t.isCollapsed?[nh(t.getFirstPosition(),"linkHref",t.getAttribute("linkHref"),e)]:e.schema.getValidRanges(t.getRanges(),"linkHref");for(const e of o)if(i.removeAttribute("linkHref",e),n)for(const t of n.manualDecorators)i.removeAttribute(t.id,e)})}}class Sh{constructor({id:e,label:t,attributes:n,defaultValue:i}){this.id=e,this.set("value"),this.defaultValue=i,this.label=t,this.attributes=n}}At(Sh,Sn),n(50);const Eh=/^(https?:)?\/\//;class Ph extends Dl{static get pluginName(){return"LinkEditing"}static get requires(){return[Ju,gc,Hl]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:vh}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>vh(yh(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new Ah(e)),e.commands.add("unlink",new Th(e));const t=function(e,t){const n={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>(e.label&&n[e.label]&&(e.label=n[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(const[n,i]of Object.entries(e)){const e=Object.assign({},i,{id:"link"+ph(n)});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>"automatic"===e.mode)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode)),e.plugins.get(Ju).registerAttribute("linkHref"),function(e,t,n,i){const o=e.editing.view,r=new Set;o.document.registerPostFixer(n=>{const o=e.model.document.selection;let s=!1;if(o.hasAttribute(t)){const a=nh(o.getFirstPosition(),t,o.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(a);for(const e of l.getItems())e.is("element","a")&&!e.hasClass(i)&&(n.addClass(i,e),r.add(e),s=!0)}return s}),e.conversion.for("editingDowncast").add(e=>{function t(){o.change(e=>{for(const t of r.values())e.removeClass(i,t),r.delete(t)})}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})})}(e,"linkHref",0,"ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:"automatic",callback:e=>Eh.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id}),n.add(new Sh(e)),t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,{writer:i})=>{if(t){const t=n.get(e.id).attributes,o=i.createAttributeElement("a",t,{priority:5});return i.setCustomProperty("link",!0,o),o}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:n.get(e.id).attributes},model:{key:e.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor,t=e.model,n=t.document.selection,i=e.commands.get("link");this.listenTo(t,"insertContent",()=>{const e=n.anchor.nodeBefore,o=n.anchor.nodeAfter;n.hasAttribute("linkHref")&&e&&e.hasAttribute("linkHref")&&(o&&o.hasAttribute("linkHref")||t.change(e=>{Mh(e,i.manualDecorators)}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.commands.get("link");e.editing.view.addObserver(Ku);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const i=e.model.document.selection;if(!i.isCollapsed)return;if(!i.hasAttribute("linkHref"))return;const o=i.getFirstPosition(),r=nh(o,"linkHref",i.getAttribute("linkHref"),e.model);(o.isTouching(r.start)||o.isTouching(r.end))&&e.model.change(e=>{Mh(e,t.manualDecorators)})})}_enableTypingOverLink(){const e=this.editor;let t,n;this.listenTo(e.editing.view.document,"delete",()=>{n=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const i=e.model.document.selection;i.isCollapsed||(n?n=!1:Ih(e)&&function(e){const t=e.document.selection,n=t.getFirstPosition(),i=t.getLastPosition(),o=n.nodeAfter;return!!o&&!!o.is("$text")&&!!o.hasAttribute("linkHref")&&(o===(i.textNode||i.nodeBefore)||nh(n,"linkHref",o.getAttribute("linkHref"),e).containsRange(e.createRange(n,i),!0))}(e.model)&&(t=i.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(i,[o])=>{n=!1,Ih(e)&&t&&(e.model.change(e=>{for(const[n,i]of t)e.setAttribute(n,i,o)}),t=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view,o=e.commands.get("link");let r=!1,s=!1;this.listenTo(i.document,"delete",(e,t)=>{s=t.domEvent.keyCode===ni.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r=!1;const e=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const o=nh(e,"linkHref",i,t);r=o.containsPosition(e)||o.end.isEqual(e)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s&&(s=!1,r||e.model.enqueueChange(e=>{Mh(e,o.manualDecorators)}))},{priority:"low"})}}function Mh(e,t){e.removeSelectionAttribute("linkHref");for(const n of t)e.removeSelectionAttribute(n.id)}function Ih(e){return e.plugins.get("Input").isInput(e.model.change(e=>e.batch))}class Nh extends $d{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){this.fire("show:"+e.type+(e.namespace?":"+e.namespace:""),{message:e.message,type:e.type,title:e.title||""})}}class Oh extends Ul{constructor(e){super(e),this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const e=this.editor.commands.get("imageInsert"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=t&&"modal"!=t)throw new mt.a("ckfinder-unknown-openermethod",e);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=t=>{i&&i(t),t.on("files:choose",n=>{const i=n.data.files.toArray(),o=i.filter(e=>!e.isImage()),r=i.filter(e=>e.isImage());for(const t of o)e.execute("link",t.getUrl());const s=[];for(const e of r){const n=e.getUrl();s.push(n||t.request("file:getProxyUrl",{file:e}))}s.length&&Rh(e,s)}),t.on("file:choose:resizedImage",t=>{const n=t.data.resizedUrl;if(n)Rh(e,[n]);else{const t=e.plugins.get("Notification"),n=e.locale.t;t.showWarning(n("Could not obtain resized image URL."),{title:n("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function Rh(e,t){if(e.commands.get("imageInsert").isEnabled)e.execute("imageInsert",{source:t});else{const t=e.plugins.get("Notification"),n=e.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class Lh extends Dl{static get pluginName(){return"CKFinderEditing"}static get requires(){return[Nh,Yu,Ph]}init(){const e=this.editor;e.commands.add("ckfinder",new Oh(e))}}const Dh=/^data:(\S*?);base64,/;class zh{constructor(e,t,n){if(!e)throw new mt.a("fileuploader-missing-file",null);if(!t)throw new mt.a("fileuploader-missing-token",null);if(!n)throw new mt.a("fileuploader-missing-api-address",null);this.file=function(e){if("string"!=typeof e)return!1;const t=e.match(Dh);return!(!t||!t.length)}(e)?function(e,t=512){try{const n=e.match(Dh)[1],i=atob(e.replace(Dh,"")),o=[];for(let e=0;ee(n)),this}onError(e){return this.once("error",(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this,t=this.xhr;function n(t){return()=>e.fire("error",t)}t.addEventListener("error",n("Network Error")),t.addEventListener("abort",n("Abort")),t.upload&&t.upload.addEventListener("progress",e=>{e.lengthComputable&&this.fire("progress",{total:e.total,uploaded:e.loaded})}),t.addEventListener("load",()=>{const e=t.status,n=t.response;if(e<200||e>299)return this.fire("error",n.message||n.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((n,i)=>{t.addEventListener("load",()=>{const e=t.status,o=t.response;return e<200||e>299?i(o.message?new mt.a("fileuploader-uploading-data-failed",this,{message:o.message}):o.error):n(o)}),t.addEventListener("error",()=>i(new Error("Network Error"))),t.addEventListener("abort",()=>i(new Error("Abort"))),t.send(e)})}}At(zh,bt);const Vh={autoRefresh:!0};class jh{constructor(e,t=Vh){if(!e)throw new mt.a("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh="function"==typeof e?e:()=>{return t=e,new Promise((e,n)=>{const i=new XMLHttpRequest;i.open("GET",t),i.addEventListener("load",()=>{const t=i.status,o=i.response;return t<200||t>299?n(new mt.a("token-cannot-download-new-token",null)):e(o)}),i.addEventListener("error",()=>n(new Error("Network Error"))),i.addEventListener("abort",()=>n(new Error("Abort"))),i.send()});var t},this._options=Object.assign({},Vh,t)}init(){return new Promise((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)})}refreshToken(){return this._refresh().then(e=>{this._validateTokenValue(e),this.set("value",e),this._options.autoRefresh&&this._registerRefreshTokenTimeout()}).then(()=>this)}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t="string"==typeof e,n=!/^".*"$/.test(e),i=t&&3===e.split(".").length;if(!n||!i)throw new mt.a("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(){const e=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout),this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},e)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?Math.floor((1e3*t-Date.now())/2):36e5}catch(e){return 36e5}}static create(e,t=Vh){return new jh(e,t).init()}}At(jh,Sn);class Bh extends $d{static get pluginName(){return"CloudServices"}init(){const e=this.context.config.get("cloudServices")||{};for(const t in e)this[t]=e[t];if(this._tokens=new Map,this.tokenUrl)return this.token=new Bh.Token(this.tokenUrl),this._tokens.set(this.tokenUrl,this.token),this.token.init();this.token=null}registerTokenUrl(e){if(this._tokens.has(e))return Promise.resolve(this.getTokenFor(e));const t=new Bh.Token(e);return this._tokens.set(e,t),t.init()}getTokenFor(e){const t=this._tokens.get(e);if(!t)throw new mt.a("cloudservices-token-not-registered",this);return t}destroy(){super.destroy();for(const e of this._tokens.values())e.destroy()}}Bh.Token=jh;class Fh extends Dl{static get requires(){return[Qd,Bh]}init(){const e=this.editor,t=e.plugins.get(Bh),n=t.token;n&&(this._uploadGateway=new Fh._UploadGateway(n,t.uploadUrl),e.plugins.get(Qd).createUploadAdapter=e=>new Hh(this._uploadGateway,e))}}class Hh{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(e,t)=>{this.loader.uploadTotal=t.total,this.loader.uploaded=t.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}Fh._UploadGateway=class{constructor(e,t){if(!e)throw new mt.a("uploadgateway-missing-token",null);if(!t)throw new mt.a("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new zh(e,this._token,this._apiAddress)}},n(52);const Uh=["before","after"],qh=(new DOMParser).parseFromString('',"image/svg+xml").firstChild;class Wh extends Dl{static get pluginName(){return"WidgetTypeAround"}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,o)=>{t.change(e=>{for(const n of t.document.roots)o?e.removeClass("ck-widget__type-around_disabled",n):e.addClass("ck-widget__type-around_disabled",n)}),o||e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...e)=>{this.isEnabled&&n(...e)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Nu(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,n,o)=>{const r=o.mapper.toViewElement(n.item);Iu(r,n.item,t)&&function(e,t,n){const i=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const n=this.toDomElement(e);return function(e,t){for(const n of Uh){const i=new Ra({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+n],title:t[n]},children:[e.ownerDocument.importNode(qh,!0)]});e.appendChild(i.render())}}(n,t),function(e){const t=new Ra({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n}));e.insert(e.createPositionAt(n,"end"),i)}(o.writer,i,r)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema;function o(e){return"ck-widget_type-around_show-fake-caret_"+e}this._listenToIfEnabled(e.editing.view.document,"keydown",(e,t)=>{si(t.keyCode)&&this._handleArrowKeyPress(e,t)},{priority:ft.get("high")+10}),this._listenToIfEnabled(n,"change:range",(t,n)=>{n.directChange&&e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=n.getSelectedElement();t&&Iu(e.editing.mapper.toViewElement(t),t,i)||e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,n)=>{const r=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(r.removeClass(Uh.map(o),e),this._currentFakeCaretModelElement=null)}const s=t.selection.getSelectedElement();if(!s)return;const a=n.mapper.toViewElement(s);if(!Iu(a,s,i))return;const l=Nu(t.selection);l&&(r.addClass(o(l),a),this._currentFakeCaretModelElement=s)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,n,i)=>{i||e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,o=i.document.selection,r=i.schema,s=n.editing.view,a=li(t.keyCode,n.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;Iu(l,n.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):o.isCollapsed&&(c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a)),c&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Nu(t.document.selection);return t.change(t=>n?n!==(e?"after":"before")&&(t.removeSelectionAttribute("widget-type-around"),!0):(t.setSelectionAttribute("widget-type-around",e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,o=t.plugins.get("Widget"),r=o._getObjectElementNextToSelection(e);return!!Iu(t.editing.mapper.toViewElement(r),r,i)&&(n.change(t=>{o._setSelectionOverElement(r),t.setSelectionAttribute("widget-type-around",e?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const o=i.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const r=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),s=function(e,t){const n=e.closest(".ck-widget");return t.mapDomToView(n)}(o,t.domConverter),a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"enter",(n,i)=>{const o=t.document.selection.getSelectedElement(),r=e.editing.mapper.toModelElement(o),s=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:Iu(o,r,s)&&(this._insertParagraph(r,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())})}_enableInsertingParagraphsOnTypingKeystroke(){const e=[ni.enter,ni.delete,ni.backspace];this._listenToIfEnabled(this.editor.editing.view.document,"keydown",(t,n)=>{e.includes(n.keyCode)||cc(n)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:ft.get("high")+1})}_enableDeleteIntegration(){const e=this.editor,t=e.model,n=t.schema;this._listenToIfEnabled(e.editing.view.document,"delete",(i,o)=>{const r=Nu(t.document.selection);if(!r)return;const s=o.direction,a=t.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)e.execute("delete",{selection:t.createSelection(a,"on")});else{const i=n.getNearestSelectionRange(t.createPositionAt(a,r),s);if(i)if(i.isCollapsed){const o=t.createSelection(i.start);if(t.modifySelection(o,{direction:s}),o.focus.isEqual(i.start)){const e=function(e,t){let n=t;for(const i of t.getAncestors({parentFirst:!0})){if(i.childCount>1||e.isLimit(i))break;n=i}return n}(n,i.start.parent);t.deleteContent(t.createSelection(e,"on"),{doNotAutoparagraph:!0})}else t.change(t=>{t.setSelection(i),e.execute(l?"forwardDelete":"delete")})}else t.change(t=>{t.setSelection(i),e.execute(l?"forwardDelete":"delete")})}o.preventDefault(),i.stop()},{priority:ft.get("high")+1})}_enableInsertContentIntegration(){const e=this.editor.model,t=e.document.selection;this._listenToIfEnabled(this.editor.model,"insertContent",(n,[i,o])=>{if(o&&!o.is("documentSelection"))return;const r=Nu(t);return r?(n.stop(),e.change(n=>{const o=t.getSelectedElement(),s=e.createPositionAt(o,r),a=n.createSelection(s),l=e.insertContent(i,a);return n.setSelection(a),l})):void 0},{priority:"high"})}}function $h(e,t,n){const i=e.schema,o=e.createRangeIn(t.root),r="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:l}of o.getWalker({startPosition:t,direction:n})){if(i.isLimit(a)&&!i.isInline(a))return s;if(l==r&&i.isBlock(a))return null}return null}function Gh(e,t,n){const i="backward"==n?t.end:t.start;if(e.checkChild(i,"$text"))return i;for(const{nextPosition:o}of t.getWalker({direction:n}))if(e.checkChild(o,"$text"))return o}n(54);class Yh extends Dl{static get pluginName(){return"Widget"}static get requires(){return[Wh]}init(){const e=this.editor.editing.view,t=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,o=i.document.selection,r=o.getSelectedElement();let s=null;for(const a of o.getRanges())for(const e of a){const t=e.item;Ou(t)&&!Qh(t,s)&&(i.addClass("ck-widget_selected",t),this._previouslySelected.add(t),s=t,t==r&&i.setSelection(o.getRanges(),{fake:!0,label:Du(r)}))}},{priority:"low"}),e.addObserver(Ku),this.listenTo(t,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(t,"keydown",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{priority:"high"}),this.listenTo(t,"keydown",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{priority:ft.get("high")-20}),this.listenTo(t,"keydown",function(e){const t=e.model;return(n,i)=>{const o=i.keyCode==ni.arrowdown,r=i.shiftKey,s=t.document.selection;if(i.keyCode!=ni.arrowup&&!o)return;const a=o;if(r&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(s,a))return;const l=function(e,t,n){const i=e.model;if(n){const e=t.isCollapsed?t.focus:t.getLastPosition(),n=$h(i,e,"forward");if(!n)return null;const o=i.createRange(e,n),r=Gh(i.schema,o,"backward");return r&&e.isBefore(r)?i.createRange(e,r):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),n=$h(i,e,"backward");if(!n)return null;const o=i.createRange(n,e),r=Gh(i.schema,o,"forward");return r&&e.isAfter(r)?i.createRange(r,e):null}}(e,s,a);l&&!l.isCollapsed&&function(e,t,n){const i=e.model,o=e.view.domConverter;if(n){const e=i.createSelection(t.start);i.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=i.createRange(e.focus,t.end))}const r=e.mapper.toViewRange(t),s=o.viewRangeToDom(r),a=jo.getDomRangeRects(s);let l;for(const c of a)if(void 0!==l){if(Math.round(c.top)>=l)return!1;l=Math.max(l,Math.round(c.bottom))}else l=Math.round(c.bottom);return!0}(e,l,a)&&(t.change(e=>{const n=a?l.end:l.start;if(r){const i=t.createSelection(s.anchor);i.setFocus(n),e.setSelection(i)}else e.setSelection(n)}),n.stop(),i.preventDefault(),i.stopPropagation())}}(this.editor.editing)),this.listenTo(t,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{priority:"high"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,o=i.document;let r=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(Ou(e))return!1;e=e.parent}return!1}(r)){if((Zn||Jn)&&t.domEvent.detail>=3){const e=n.editing.mapper,i=r.is("attributeElement")?r.findAncestor(e=>!e.is("attributeElement")):r,o=e.toModelElement(i);t.preventDefault(),this.editor.model.change(e=>{e.setSelection(o,"in")})}return}if(!Ou(r)&&(r=r.findAncestor(Ou),!r))return;t.preventDefault(),o.isFocused||i.focus();const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode;if(!si(n))return;const i=this.editor.model,o=i.schema,r=i.document.selection,s=r.getSelectedElement(),a=li(n,this.editor.locale.contentLanguageDirection);if(s&&o.isObject(s)){const n=a?r.getLastPosition():r.getFirstPosition(),s=o.getNearestSelectionRange(n,a?"forward":"backward");return void(s&&(i.change(e=>{e.setSelection(s)}),t.preventDefault(),e.stop()))}if(!r.isCollapsed)return;const l=this._getObjectElementNextToSelection(a);l&&o.isObject(l)&&(this._setSelectionOverElement(l),t.preventDefault(),e.stop())}_preventDefaultOnArrowKeyPress(e,t){if(!si(t.keyCode))return;const n=this.editor.model,i=n.schema,o=n.document.selection.getSelectedElement();o&&i.isObject(o)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(e=>{let i=t.anchor.parent;for(;i.isEmpty;){const t=i;i=t.parent,e.remove(t)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.createSelection(t.document.selection);t.modifySelection(i,{direction:e?"forward":"backward"});const o=e?i.focus.nodeBefore:i.focus.nodeAfter;return o&&n.isObject(o)?o:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass("ck-widget_selected",t);this._previouslySelected.clear()}}function Qh(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class Kh extends Ul{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Hu(e),this.value=!(!Hu(e)||!e.hasAttribute("alt"))&&e.getAttribute("alt")}execute(e){const t=this.editor.model,n=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute("alt",e.newValue,n)})}}class Jh extends Dl{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Kh(this.editor))}}n(56);class Zh extends Xa{constructor(e,t){super(e);const n="ck-labeled-field-view-"+ht(),i="ck-labeled-field-view-status-"+ht();this.fieldView=t(this,n,i),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",e=>!e),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focused"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(e){const t=new ed(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Xa(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",e=>!e)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}n(58);class Xh extends Xa{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new Ta,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to("input"),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}function ef(e,t,n){const i=new Xh(e.locale);return i.set({id:t,ariaDescribedById:n}),i.bind("isReadOnly").to(e,"isEnabled",e=>!e),i.bind("hasError").to(e,"errorText",e=>!!e),i.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(i),i}function tf(e){e.set("_isCssTransitionsDisabled",!1),e.disableCssTransitions=()=>{e._isCssTransitionsDisabled=!0},e.enableCssTransitions=()=>{e._isCssTransitionsDisabled=!1},e.extendTemplate({attributes:{class:[e.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function nf({view:e}){e.listenTo(e.element,"submit",(t,n)=>{n.preventDefault(),e.fire("submit")},{useCapture:!0})}var of='',rf='';n(60),n(7);class sf extends Xa{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Ta,this.keystrokes=new wa,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),of,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),rf,"ck-button-cancel","cancel"),this._focusables=new Oa,this._focusCycler=new rl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),tf(this)}render(){super.render(),this.keystrokes.listenTo(this.element),nf({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,i){const o=new kl(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createLabeledInputView(){const e=this.locale.t,t=new Zh(this.locale,ef);return t.label=e("Text alternative"),t}}n(63),n(65);const af=Cu("px");class lf extends Dl{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this.view=new Su(e.locale),e.ui.view.body.add(this.view),e.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new mt.a("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new mt.a("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new mt.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new cf(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,n)=>{if(n<2)return"";const i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[i,n])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new df(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>=2?Math.min(e-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class cf extends Xa{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Ta,this.buttonPrevView=this._createButtonView(t("Previous"),''),this.buttonNextView=this._createButtonView(t("Next"),''),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new kl(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class df extends Xa{constructor(e,t){super(e);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:n.to("top",af),left:n.to("left",af),width:n.to("width",af),height:n.to("height",af)}},children:this.content}),this.on("change:numberOfPanels",(e,t,n,i)=>{n>i?this._addPanels(n-i):this._removePanels(i-n),this.updatePosition()})}_addPanels(e){for(;e--;){const e=new Xa;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:n,height:i}=new jo(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}function uf(e){const t=e.editing.view,n=Su.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class hf extends Dl{static get requires(){return[lf]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),o=new kl(n);return o.set({label:t("Change image text alternative"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,t=e.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new sf(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(!0),t()}),this.listenTo(e.ui,"update",()=>{Fu(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(Fu(e.editing.view.document.selection)){const n=uf(e);t.updatePosition(n)}}(e):this._hideForm(!0)}),Tl({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:uf(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class ff extends Dl{static get requires(){return[Jh,hf]}static get pluginName(){return"ImageTextAlternative"}}n(67);class mf extends Dl{static get requires(){return[Yu,Yh,ff]}static get pluginName(){return"Image"}}class gf extends Xa{constructor(e){super(e),this.buttonView=new kl(e),this._fileInputView=new pf(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class pf extends Xa{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function bf(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}class wf extends Dl{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageUpload",n=>{const i=new gf(n),o=e.commands.get("imageUpload"),r=e.config.get("image.upload.types"),s=bf(r);return i.set({acceptedType:r.map(e=>"image/"+e).join(","),allowMultipleFiles:!0}),i.buttonView.set({label:t("Insert image"),icon:'',tooltip:!0}),i.buttonView.bind("isEnabled").to(o),i.on("done",(t,n)=>{const i=Array.from(n).filter(e=>s.test(e.type));i.length&&e.execute("imageUpload",{file:i})}),i})}}n(69),n(71),n(73);class kf extends Dl{constructor(e){super(e),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const i=this.editor,o=t.item,r=o.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const s=i.plugins.get(Qd),a=r?t.attributeNewValue:null,l=this.placeholder,c=i.editing.mapper.toViewElement(o),d=n.writer;if("reading"==a)return _f(c,d),void vf(l,c,d);if("uploading"==a){const e=s.loaders.get(r);return _f(c,d),void(e?(yf(c,d),function(e,t,n,i){const o=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),o),n.on("change:uploadedPercent",(e,t,n)=>{i.change(e=>{e.setStyle("width",n+"%",o)})})}(c,d,e,i.editing.view),function(e,t,n){if(n.data){const i=Wu(e);t.setAttribute("src",n.data,i)}}(c,d,e)):vf(l,c,d))}"complete"==a&&s.loaders.get(r)&&function(e,t,n){const i=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),i),setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(i)))},3e3)}(c,d,i.editing.view),function(e,t){Cf(e,t,"progressBar")}(c,d),yf(c,d),function(e,t){t.removeClass("ck-appear",e)}(c,d)}}function _f(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function vf(e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const i=Wu(t);i.getAttribute("src")!==e&&n.setAttribute("src",e,i),xf(t,"placeholder")||n.insert(n.createPositionAfter(i),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function yf(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Cf(e,t,"placeholder")}function xf(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function Cf(e,t,n){const i=xf(e,n);i&&t.remove(t.createRangeOn(i))}class Af{constructor(e){this.document=e}createDocumentFragment(e){return new mi(this.document,e)}createElement(e,t,n){return new wn(this.document,e,t,n)}createText(e){return new Dt(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const i=n.getChildIndex(e);return this.removeChildren(i,1,n),this.insertChild(i,t,n),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new wn(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){w(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return zn._createAt(e,t)}createPositionAfter(e){return zn._createAfter(e)}createPositionBefore(e){return zn._createBefore(e)}createRange(e,t){return new Vn(e,t)}createRangeOn(e){return Vn._createOn(e)}createRangeIn(e){return Vn._createIn(e)}createSelection(e,t,n){return new Fn(e,t,n)}}class Tf extends Ul{refresh(){const e=this.editor.model.document.selection.getSelectedElement(),t=e&&"image"===e.name||!1;this.isEnabled=qu(this.editor.model)||t}execute(e){const t=this.editor,n=t.model,i=t.plugins.get(Qd);for(const o of Et(e.file))Sf(n,i,o)}}function Sf(e,t,n){const i=t.createLoader(n);i&&Uu(e,{uploadId:i.id})}class Ef extends Dl{static get requires(){return[Qd,Nh,Hl]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const e=this.editor,t=e.model.document,n=e.model.schema,i=e.conversion,o=e.plugins.get(Qd),r=bf(e.config.get("image.upload.types"));n.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),e.commands.add("imageUpload",new Tf(e)),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,n)=>{if(i=n.dataTransfer,Array.from(i.types).includes("text/html")&&""!==i.getData("text/html"))return;var i;const o=Array.from(n.dataTransfer.files).filter(e=>!!e&&r.test(e.type)),s=n.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(n=>{n.setSelection(s),o.length&&(t.stop(),e.model.enqueueChange("default",()=>{e.execute("imageUpload",{file:o})}))})}),this.listenTo(e.plugins.get(Hl),"inputTransformation",(t,n)=>{const i=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>{return!(!(t=e.item).is("element","img")||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))&&!e.item.getAttribute("uploadProcessed");var t}).map(e=>{return{promise:(t=e.item,new Promise((e,n)=>{const i=t.getAttribute("src");fetch(i).then(e=>e.blob()).then(t=>{const n=function(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(t,i),o=n.replace("image/",""),r=new File([t],"image."+o,{type:n});e(r)}).catch(n)})),imageElement:e.item};var t});if(!i.length)return;const r=new Af(e.editing.view.document);for(const e of i){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=o.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}}),e.editing.view.document.on("dragover",(e,t)=>{t.preventDefault()}),t.on("change",()=>{const n=t.differ.getChanges({includeChangesInGraveyard:!0});for(const t of n)if("insert"==t.type&&"$text"!=t.name){const n=t.position.nodeAfter,i="$graveyard"==t.position.root.rootName;for(const t of Pf(e,n)){const e=t.getAttribute("uploadId");if(!e)continue;const n=o.loaders.get(e);n&&(i?n.abort():"idle"==n.status&&this._readAndUpload(n,t))}}})}_readAndUpload(e,t){const n=this.editor,i=n.model,o=n.locale.t,r=n.plugins.get(Qd),s=n.plugins.get(Nh);return i.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","reading",t)}),e.read().then(()=>{const o=e.upload();if(Zn){const e=Wu(n.editing.mapper.toViewElement(t));n.editing.view.once("render",()=>{if(!e.parent)return;const t=n.editing.view.domConverter.mapViewToDom(e.parent);if(!t)return;const i=t.style.display;t.style.display="none",t._ckHack=t.offsetHeight,t.style.display=i})}return i.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","uploading",t)}),o}).then(e=>{i.enqueueChange("transparent",n=>{n.setAttributes({uploadStatus:"complete",src:e.default},t),this._parseAndSetSrcsetAttributeOnImage(e,t,n)}),a()}).catch(n=>{if("error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&s.showWarning(n,{title:o("Upload failed"),namespace:"upload"}),a(),i.enqueueChange("transparent",e=>{e.remove(t)})});function a(){i.enqueueChange("transparent",e=>{e.removeAttribute("uploadId",t),e.removeAttribute("uploadStatus",t)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t))return i=Math.max(i,t),!0}).map(t=>`${e[t]} ${t}w`).join(", ");""!=o&&n.setAttribute("srcset",{data:o,width:i},t)}}function Pf(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is("element","image")).map(e=>e.item)}class Mf extends Dl{static get pluginName(){return"ImageUpload"}static get requires(){return[Ef,wf,kf]}}class If extends Ul{refresh(){const e=this.editor.model,t=Fc(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Nf(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const o=(e.selection||n.selection).getSelectedBlocks();for(const e of o)!e.is("element","paragraph")&&Nf(e,t.schema)&&i.rename(e,"paragraph")})}}function Nf(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class Of extends Ul{execute(e){const t=this.editor.model;let n=e.position;t.change(e=>{const i=e.createElement("paragraph");if(!t.schema.checkChild(n.parent,i)){const o=t.schema.findAllowedParent(n,i);if(!o)return;n=e.split(n,o).position}t.insertContent(i,n),e.setSelection(i,"in")})}}class Rf extends Dl{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new If(e)),e.commands.add("insertParagraph",new Of(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Rf.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Rf.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Lf extends Ul{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=Fc(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Df(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(e=>{const o=Array.from(n.selection.getSelectedBlocks()).filter(e=>Df(e,i,t.schema));for(const t of o)t.is("element",i)||e.rename(t,i)})}}function Df(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}class zf extends Dl{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Rf]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)"paragraph"!==i.model&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Lf(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(t,i)=>{const o=e.model.document.selection.getFirstPosition().parent;n.some(e=>o.is("element",e.model))&&!o.is("element","paragraph")&&0===o.childCount&&i.writer.rename(o,"paragraph")})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:ft.get("low")+1})}}n(12);class Vf extends Dl{init(){const e=this.editor,t=e.t,n=function(e){const t=e.t,n={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e})}(e),i=t("Choose heading"),o=t("Heading");e.ui.componentFactory.add("heading",t=>{const r={},s=new Tt,a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a];for(const e of n){const t={type:"button",model:new ud({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),c.push(l)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const d=Sl(t);return Pl(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",(...e)=>e.some(e=>e)),d.buttonView.bind("label").to(a,"value",l,"value",(e,t)=>{const n=e||t&&"paragraph";return r[n]?r[n]:i}),this.listenTo(d,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()}),d})}}function jf(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}function Bf(e){const t=e.parent;return"figcaption"==e.name&&t&&"figure"==t.name&&t.hasClass("image")?{name:!0}:null}class Ff extends Dl{static get pluginName(){return"ImageCaptionEditing"}init(){const e=this.editor,t=e.editing.view,n=e.data,i=e.editing,o=e.t;e.model.schema.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e)),e.conversion.for("upcast").elementToElement({view:Bf,model:"caption"}),n.downcastDispatcher.on("insert:caption",Hf(e=>e.createContainerElement("figcaption"),!1));const r=function(e,t){return n=>{const i=n.createEditableElement("figcaption");return n.setCustomProperty("imageCaption",!0,i),Pa({view:e,element:i,text:t}),zu(i,n)}}(t,o("Enter image caption"));i.downcastDispatcher.on("insert:caption",Hf(r)),i.downcastDispatcher.on("insert",this._fixCaptionVisibility(e=>e.item),{priority:"high"}),i.downcastDispatcher.on("remove",this._fixCaptionVisibility(e=>e.position.parent),{priority:"high"}),t.document.registerPostFixer(e=>this._updateCaptionVisibility(e))}_updateCaptionVisibility(e){const t=this.editor.editing.mapper,n=this._lastSelectedCaption;let i;const o=this.editor.model.document.selection,r=o.getSelectedElement();if(r&&r.is("element","image")){const e=jf(r);i=t.toViewElement(e)}const s=Uf(o.getFirstPosition().parent);if(s&&(i=t.toViewElement(s)),i)return n?(n===i||(qf(n,e),this._lastSelectedCaption=i),Wf(i,e)):(this._lastSelectedCaption=i,Wf(i,e));if(n){const t=qf(n,e);return this._lastSelectedCaption=null,t}return!1}_fixCaptionVisibility(e){return(t,n,i)=>{const o=Uf(e(n)),r=i.writer;if(o){const e=this.editor.editing.mapper.toViewElement(o);e&&(o.childCount?r.removeClass("ck-hidden",e):r.addClass("ck-hidden",e))}}}_insertMissingModelCaptionElement(e){const t=this.editor.model,n=t.document.differ.getChanges(),i=[];for(const o of n)if("insert"==o.type&&"$text"!=o.name){const e=o.position.nodeAfter;if(e.is("element","image")&&!jf(e)&&i.push(e),!e.is("element","image")&&e.childCount)for(const n of t.createRangeIn(e).getItems())n.is("element","image")&&!jf(n)&&i.push(n)}for(const o of i)e.appendElement("caption",o);return!!i.length}}function Hf(e,t=!0){return(n,i,o)=>{const r=i.item;if((r.childCount||t)&&Hu(r.parent)){if(!o.consumable.consume(i.item,"insert"))return;const t=o.mapper.toViewElement(i.range.start.parent),n=e(o.writer),s=o.writer;r.childCount||s.addClass("ck-hidden",n),function(e,t,n,i){const o=i.writer.createPositionAt(n,"end");i.writer.insert(o,e),i.mapper.bindElements(t,e)}(n,i.item,t,o)}}}function Uf(e){const t=e.getAncestors({includeSelf:!0}).find(e=>"caption"==e.name);return t&&t.parent&&"image"==t.parent.name?t:null}function qf(e,t){return!e.childCount&&!e.hasClass("ck-hidden")&&(t.addClass("ck-hidden",e),!0)}function Wf(e,t){return!!e.hasClass("ck-hidden")&&(t.removeClass("ck-hidden",e),!0)}n(76);class $f extends Ul{constructor(e,t){super(e),this.defaultStyle=!1,this.styles=t.reduce((e,t)=>(e[t.name]=t,t.isDefault&&(this.defaultStyle=t.name),e),{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Hu(e),e)if(e.hasAttribute("imageStyle")){const t=e.getAttribute("imageStyle");this.value=!!this.styles[t]&&t}else this.value=this.defaultStyle;else this.value=!1}execute(e){const t=e.value,n=this.editor.model,i=n.document.selection.getSelectedElement();n.change(e=>{this.styles[t].isDefault?e.removeAttribute("imageStyle",i):e.setAttribute("imageStyle",t,i)})}}function Gf(e,t){for(const n of t)if(n.name===e)return n}var Yf='',Qf='',Kf='',Jf='';const Zf={full:{name:"full",title:"Full size image",icon:Yf,isDefault:!0},side:{name:"side",title:"Side image",icon:Jf,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Qf,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:Kf,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Jf,className:"image-style-align-right"}},Xf={full:Yf,left:Qf,right:Jf,center:Kf};function em(e=[]){return e.map(tm)}function tm(e){if("string"==typeof e){const t=e;Zf[t]?e=Object.assign({},Zf[t]):(Object(mt.c)("image-style-not-found",{name:t}),e={name:t})}else if(Zf[e.name]){const t=Zf[e.name],n=Object.assign({},e);for(const i in t)Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);e=n}return"string"==typeof e.icon&&Xf[e.icon]&&(e.icon=Xf[e.icon]),e}class nm extends Dl{static get pluginName(){return"ImageStyleEditing"}init(){const e=this.editor,t=e.model.schema,n=e.data,i=e.editing;e.config.define("image.styles",["full","side"]);const o=em(e.config.get("image.styles"));t.extend("image",{allowAttributes:"imageStyle"});const r=function(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,t.name))return;const o=Gf(n.attributeNewValue,e),r=Gf(n.attributeOldValue,e),s=i.mapper.toViewElement(n.item),a=i.writer;r&&a.removeClass(r.className,s),o&&a.addClass(o.className,s)}}(o);i.downcastDispatcher.on("attribute:imageStyle:image",r),n.downcastDispatcher.on("attribute:imageStyle:image",r),n.upcastDispatcher.on("element:figure",function(e){const t=e.filter(e=>!e.isDefault);return(e,n,i)=>{if(!n.modelRange)return;const o=n.viewItem,r=Fc(n.modelRange.getItems());if(i.schema.checkAttribute(r,"imageStyle"))for(const s of t)i.consumable.consume(o,{classes:s.className})&&i.writer.setAttribute("imageStyle",s.name,r)}}(o),{priority:"low"}),e.commands.add("imageStyle",new $f(e,o))}}n(78);class im extends Dl{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=function(e,t){for(const n of e)t[n.title]&&(n.title=t[n.title]);return e}(em(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const t of e)this._createButton(t)}_createButton(e){const t=this.editor;t.ui.componentFactory.add("imageStyle:"+e.name,n=>{const i=t.commands.get("imageStyle"),o=new kl(n);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i,"isEnabled"),o.bind("isOn").to(i,"value",t=>t===e.name),this.listenTo(o,"execute",()=>{t.execute("imageStyle",{value:e.name}),t.editing.view.focus()}),o})}}class om extends Dl{static get requires(){return[lf]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",t=>{(function(e){const t=e.getSelectedElement();return!(!t||!Ou(t))})(e.editing.view.document.selection)&&t.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:i,balloonClassName:o="ck-toolbar-container"}){if(!n.length)return void Object(mt.c)("widget-toolbar-no-items",{toolbarId:e});const r=this.editor,s=r.t,a=new Ml(r.locale);if(a.ariaLabel=t||s("Widget toolbar"),this._toolbarDefinitions.has(e))throw new mt.a("widget-toolbar-duplicated",this,{toolbarId:e});a.fillFromConfig(n,r.ui.componentFactory),this._toolbarDefinitions.set(e,{view:a,getRelatedElement:i,balloonClassName:o})}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const i of this._toolbarDefinitions.values()){const o=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const r=o.getAncestors().length;r>e&&(e=r,t=o,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?rm(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:sm(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const e of this._toolbarDefinitions.values())if(this._isToolbarVisible(e)){const t=e.getRelatedElement(this.editor.editing.view.document.selection);rm(this.editor,t)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function rm(e,t){const n=e.plugins.get("ContextualBalloon"),i=sm(e,t);n.updatePosition(i)}function sm(e,t){const n=Su.defaultPositions;return{target:e.editing.view.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,ju]}}class am extends Ul{constructor(e){super(e),this._childCommands=[]}refresh(){}execute(...e){return this._getFirstEnabledCommand().execute(e)}registerChildCommand(e){this._childCommands.push(e),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(e=>e.isEnabled)}}class lm extends Dl{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new am(e)),e.commands.add("outdent",new am(e))}}var cm='',dm='';class um extends Dl{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?cm:dm,o="ltr"==t.uiLanguageDirection?dm:cm;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),o)}_defineButton(e,t,n){const i=this.editor;i.ui.componentFactory.add(e,o=>{const r=i.commands.get(e),s=new kl(o);return s.set({label:t,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(s,"execute",()=>{i.execute(e),i.editing.view.focus()}),s})}}class hm extends Ul{constructor(e,t){super(e),this._indentBehavior=t}refresh(){const e=this.editor.model,t=Fc(e.document.selection.getSelectedBlocks());this.isEnabled=!(!t||!e.schema.checkAttribute(t,"blockIndent"))&&this._indentBehavior.checkEnabled(t.getAttribute("blockIndent"))}execute(){const e=this.editor.model,t=function(e){const t=e.schema;return Array.from(e.document.selection.getSelectedBlocks()).filter(e=>t.checkAttribute(e,"blockIndent"))}(e);e.change(e=>{for(const n of t){const t=n.getAttribute("blockIndent"),i=this._indentBehavior.getNextIndent(t);i?e.setAttribute("blockIndent",i,n):e.removeAttribute("blockIndent",n)}})}}class fm{constructor(e){this.isForward="forward"===e.direction,this.offset=e.offset,this.unit=e.unit}checkEnabled(e){const t=parseFloat(e||0);return this.isForward||t>0}getNextIndent(e){const t=parseFloat(e||0);if(e&&!e.endsWith(this.unit))return this.isForward?this.offset+this.unit:void 0;const n=t+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class mm{constructor(e){this.isForward="forward"===e.direction,this.classes=e.classes}checkEnabled(e){const t=this.classes.indexOf(e);return this.isForward?t=0}getNextIndent(e){const t=this.classes.indexOf(e);return this.classes[t+(this.isForward?1:-1)]}}function gm(e){var t;e.setNormalizer("margin",e=>({path:"margin",value:jd(e)})),e.setNormalizer("margin-top",e=>({path:"margin.top",value:e})),e.setNormalizer("margin-right",e=>({path:"margin.right",value:e})),e.setNormalizer("margin-bottom",e=>({path:"margin.bottom",value:e})),e.setNormalizer("margin-left",e=>({path:"margin.left",value:e})),e.setReducer("margin",(t="margin",e=>{const{top:n,right:i,bottom:o,left:r}=e,s=[];return[n,i,r,o].every(e=>!!e)?s.push([t,Bd(e)]):(n&&s.push([t+"-top",n]),i&&s.push([t+"-right",i]),o&&s.push([t+"-bottom",o]),r&&s.push([t+"-left",r])),s})),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}const pm=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class bm extends ko{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}n(80);class wm extends Xa{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Ta,this.keystrokes=new wa,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),of,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),rf,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new Oa,this._focusCycler=new rl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),tf(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),nf({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Zh(this.locale,ef);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const o=new kl(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new Al(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(e,t)=>void 0===t&&void 0===e?n.defaultValue:e),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new Xa;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}n(82);class km extends Xa{constructor(e){super(e);const t=e.t;this.focusTracker=new Ta,this.keystrokes=new wa,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),'',"unlink"),this.editButtonView=this._createButton(t("Edit link"),'',"edit"),this.set("href"),this._focusables=new Oa,this._focusCycler=new rl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new kl(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new kl(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&yh(e)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",e=>e||n("This link has no URL")),e.bind("isEnabled").to(this,"href",e=>!!e),e.template.tag="a",e.template.eventListeners={},e}}class _m extends Dl{static get requires(){return[lf]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(bm),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(lf),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new km(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set("Ctrl+K",(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new wm(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isReadOnly").to(t,"isEnabled",e=>!e),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:t}=i.urlInputView.fieldView.element,o=Ch(t,n);e.execute("link",o,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(e,t)=>{this._closeFormView(),t()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set("Ctrl+K",(e,n)=>{n(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",e=>{const i=new kl(e);return i.isEnabled=!0,i.label=n("Link"),i.icon='',i.keystroke="Ctrl+K",i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(t,"isEnabled"),i.bind("isOn").to(t,"value",e=>!!e),this.listenTo(i,"execute",()=>this._showUI(!0)),i})}_enableUserBalloonInteractions(){this.listenTo(this.editor.editing.view.document,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),Tl({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=r();const o=()=>{const e=this._getSelectedLinkElement(),t=r();n&&!e||!n&&t!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=e,i=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document;let n=null;if(this.editor.model.markers.has("link-ui")){const t=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),i=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));n=e.domConverter.viewRangeToDom(i)}else{const i=this._getSelectedLinkElement(),o=t.selection.getFirstRange();n=i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(o)}return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection;if(t.isCollapsed)return vm(t.getFirstPosition());{const n=t.getFirstRange().getTrimmed(),i=vm(n.start),o=vm(n.end);return i&&i==o&&e.createRangeIn(i).getTrimmed().isEqual(n)?i:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has("link-ui"))t.updateMarker("link-ui",{range:n});else if(n.start.isAtEnd){const i=function e(t,n,i){const o=i.createPositionFromPath(t.start.root,[t.start.path[0]+1,0],"toNext"),r=i.createRange(o,t.end);return r.start.path[0]>t.end.path[0]?i.createRange(n):o.isAtStart&&o.isAtEnd?e(r,n,i):r}(n,e.document.selection.focus,t);t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:i})}else t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has("link-ui")&&e.change(e=>{e.removeMarker("link-ui")})}}function vm(e){return e.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})}function ym(e,t){let n=e.start;return{text:Array.from(e.getItems()).reduce((e,i)=>i.is("$text")||i.is("$textProxy")?e+i.data:(n=t.createPositionAfter(i),""),""),range:t.createRange(n,e.end)}}class xm{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(e,"change:data",(e,t)=>{"transparent"!=t.type&&this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,o=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:r,range:s}=ym(o,n),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const n=Object.assign(t,{text:r,range:s});"object"==typeof a&&Object.assign(n,a),this.fire("matched:"+e,n)}}}At(xm,Sn);const Cm=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})))$","i");class Am extends Dl{static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new xm(e.model,e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=Tm(e.substr(0,e.length-1));return t?{url:t}:void 0}),n=e.plugins.get("Input");t.on("matched:data",(t,i)=>{const{batch:o,range:r,url:s}=i;if(!n.isInput(o))return;const a=r.end.getShiftedBy(-1),l=a.getShiftedBy(-s.length),c=e.model.createRange(l,a);this._applyAutoLink(s,c)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const n=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=ym(e,t),o=Tm(n);if(o){const e=t.createRange(i.end.getShiftedBy(-o.length),i.end);this._applyAutoLink(o,e)}}_applyAutoLink(e,t){const n=this.editor.model;this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,n)&&n.enqueueChange(n=>{const i=this.editor.config.get("link.defaultProtocol"),o=Ch(e,i);n.setAttribute("linkHref",o,t)})}}function Tm(e){const t=Cm.exec(e);return t?t[2]:null}class Sm extends Ul{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=Array.from(e.document.selection.getSelectedBlocks()).filter(t=>Pm(t,e.schema)),n=!0===this.value;e.change(e=>{if(n){let n=t[t.length-1].nextSibling,i=Number.POSITIVE_INFINITY,o=[];for(;n&&"listItem"==n.name&&0!==n.getAttribute("listIndent");){const e=n.getAttribute("listIndent");e=n;)r>o.getAttribute("listIndent")&&(r=o.getAttribute("listIndent")),o.getAttribute("listIndent")==r&&e[t?"unshift":"push"](o),o=o[t?"previousSibling":"nextSibling"]}}function Pm(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class Mm extends Ul{constructor(e,t){super(e),this._indentBy="forward"==t?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;let t=Array.from(e.document.selection.getSelectedBlocks());e.change(e=>{const n=t[t.length-1];let i=n.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>n.getAttribute("listIndent");)t.push(i),i=i.nextSibling;this._indentBy<0&&(t=t.reverse());for(const o of t){const t=o.getAttribute("listIndent")+this._indentBy;t<0?e.rename(o,"paragraph"):e.setAttribute("listIndent",t,o)}this.fire("_executeCleanup",t)})}_checkEnabled(){const e=Fc(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}function Im(e,t,n,i){const o=t.parent,r=n.mapper,s=n.writer;let a=r.toViewPosition(i.createPositionBefore(e));const l=Rm(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),c=e.previousSibling;if(l&&l.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(e))}else if(c&&"listItem"==c.name){a=r.toViewPosition(i.createPositionAt(c,"end"));const e=r.findMappedViewAncestor(a),t=function(e){for(const t of e.getChildren())if("ul"==t.name||"ol"==t.name)return t;return null}(e);a=t?s.createPositionBefore(t):s.createPositionAt(e,"end")}else a=r.toViewPosition(i.createPositionBefore(e));if(a=Om(a),s.insert(a,o),c&&"listItem"==c.name){const e=r.toViewElement(c),n=s.createRange(s.createPositionAt(e,0),a).getWalker({ignoreElementEnd:!0});for(const i of n)if(i.item.is("element","li")){const e=s.breakContainer(s.createPositionBefore(i.item)),o=i.item.parent,r=s.createPositionAt(t,"end");Nm(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(o),r),n.position=e}}else{const n=o.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const t of n.getChildren()){const n=r.toModelElement(t);if(!(n&&n.getAttribute("listIndent")>e.getAttribute("listIndent")))break;i=t}i&&(s.breakContainer(s.createPositionAfter(i)),s.move(s.createRangeOn(i.parent),s.createPositionAt(t,"end")))}}Nm(s,o,o.nextSibling),Nm(s,o.previousSibling,o)}function Nm(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function Om(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function Rm(e,t){const n=!!t.sameIndent,i=!!t.smallerIndent,o=t.listIndent;let r=e;for(;r&&"listItem"==r.name;){const e=r.getAttribute("listIndent");if(n&&o==e||i&&o>e)return r;r="forward"===t.direction?r.nextSibling:r.previousSibling}return null}function Lm(e,t,n,i){e.ui.componentFactory.add(t,o=>{const r=e.commands.get(t),s=new kl(o);return s.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{e.execute(t),e.editing.view.focus()}),s})}function Dm(e,t){const n=[],i=e.parent,o={ignoreElementEnd:!0,startPosition:e,shallow:!0,direction:t},r=i.getAttribute("listIndent"),s=[...new or(o)].filter(e=>e.item.is("element")).map(e=>e.item);for(const a of s){if(!a.is("element","listItem"))break;if(a.getAttribute("listIndent")r)){if(a.getAttribute("listType")!==i.getAttribute("listType"))break;if(a.getAttribute("listStyle")!==i.getAttribute("listStyle"))break;"backward"===t?n.unshift(a):n.push(a)}}return n}function zm(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:vn.call(this)}function Vm(e){return(t,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent"))return;o.consume(n.item,"insert"),o.consume(n.item,"attribute:listType"),o.consume(n.item,"attribute:listIndent");const r=n.item;Im(r,function(e,t){const n=t.mapper,i=t.writer,o="numbered"==e.getAttribute("listType")?"ol":"ul",r=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=zm,t}(i),s=i.createContainerElement(o,null);return i.insert(i.createPositionAt(s,0),r),n.bindElements(e,r),r}(r,i),i,e)}}function jm(e,t,n){if(!n.consumable.consume(t.item,"attribute:listType"))return;const i=n.mapper.toViewElement(t.item),o=n.writer;o.breakContainer(o.createPositionBefore(i)),o.breakContainer(o.createPositionAfter(i)),o.rename("numbered"==t.attributeNewValue?"ol":"ul",i.parent)}function Bm(e,t,n){const i=n.mapper.toViewElement(t.item).parent,o=n.writer;Nm(o,i,i.nextSibling),Nm(o,i.previousSibling,i);for(const r of t.item.getChildren())n.consumable.consume(r,"insert")}function Fm(e,t,n){if("listItem"!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const i=n.writer,o=[];for(;("ul"==e.parent.name||"ol"==e.parent.name)&&(e=i.breakContainer(e),"li"==e.parent.name);){const t=e,n=i.createPositionAt(e.parent,"end");if(!t.isEqual(n)){const e=i.remove(i.createRange(t,n));o.push(e)}e=i.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t0){const t=Nm(i,n,n.nextSibling);t&&t.parent==n&&e.offset--}}Nm(i,e.nodeBefore,e.nodeAfter)}}}function Hm(e,t,n){const i=n.mapper.toViewPosition(t.position);Nm(n.writer,i.nodeBefore,i.nodeAfter)}function Um(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){const e=n.writer,i=e.createElement("listItem"),o=function(e){let t=0,n=e.parent;for(;n;){if(n.is("element","li"))t++;else{const e=n.previousSibling;e&&e.is("element","li")&&t++}n=n.parent}return t}(t.viewItem);if(e.setAttribute("listIndent",o,i),e.setAttribute("listType",t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted",i),!n.safeInsert(i,t.modelCursor))return;const r=function(e,t,n){const{writer:i,schema:o}=n;let r=i.createPositionAfter(e);for(const s of t)if("ul"==s.name||"ol"==s.name)r=n.convertItem(s,r).modelCursor;else{const t=n.convertItem(s,i.createPositionAt(e,"end")),a=t.modelRange.start.nodeAfter;a&&a.is("element")&&!o.checkChild(e,a.name)&&(e=t.modelCursor.parent.is("element","listItem")?t.modelCursor.parent:Ym(t.modelCursor),r=i.createPositionAfter(e))}return r}(i,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,r),n.updateConversionResult(i,t)}}function qm(e,t,n){if(n.consumable.test(t.view