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/morro_chapeu/public_html/painel/
10.0.0.135

 
[ NAME ] [ SIZE ] [ PERM ] [ DATE ] [ ACT ]
+FILE +DIR
assets dir drwxrwxr-x 2024-01-09 08:07 R D
1.a08e66d1a5603bc34b53.js 750.417 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
1.da415ece6de33d508cd9.js 711.983 KB -rw-rw-r-- 2021-12-13 12:33 R E G D
3rdpartylicenses.txt 98.439 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
5.92ea032ed39fb7f26140.js 1.65 MB -rw-rw-r-- 2021-05-13 21:27 R E G D
5.da37d5c858feac0d4a06.js 1.57 MB -rw-rw-r-- 2021-05-10 08:30 R E G D
5.db200d637fc54847a6d9.js 1.64 MB -rw-rw-r-- 2021-05-10 08:30 R E G D
5.f3a2e394394c5be65b5b.js 1.53 MB -rw-rw-r-- 2021-05-10 08:30 R E G D
6.155aa9116f18b1baa246.js 1.23 MB -rw-rw-r-- 2023-09-21 11:52 R E G D
6.19d4f0e38116ec2d129e.js 1.22 MB -rw-rw-r-- 2023-08-01 11:44 R E G D
6.379ae3d08b879443064c.js 1.23 MB -rw-rw-r-- 2023-08-08 11:41 R E G D
6.3d9aa3c9fc8800e31a5a.js 1.17 MB -rw-rw-r-- 2023-05-05 12:34 R E G D
6.581a5469a5d9699cca82.js 1.23 MB -rw-rw-r-- 2024-01-16 10:22 R E G D
6.71716e05c604a2549f63.js 1.23 MB -rw-rw-r-- 2023-08-07 17:13 R E G D
6.76c904a04ab306ce97a1.js 919.369 KB -rw-rw-r-- 2021-12-13 12:30 R E G D
6.812cf41ba13997856159.js 1.23 MB -rw-rw-r-- 2023-09-29 09:31 R E G D
6.8796c46b397bc7b4fae6.js 919.339 KB -rw-rw-r-- 2021-12-13 12:27 R E G D
6.8a051bb41714259f2f38.js 1.23 MB -rw-rw-r-- 2023-10-13 09:15 R E G D
6.8c47bec977c1749acd7f.js 1.19 MB -rw-rw-r-- 2023-05-29 16:26 R E G D
6.981fcb158428fe44dc1b.js 1.23 MB -rw-rw-r-- 2024-01-16 10:35 R E G D
6.a05a47894e3fc123a673.js 1.23 MB -rw-rw-r-- 2023-09-22 10:47 R E G D
6.a492224232ec2a9229d3.js 919.344 KB -rw-rw-r-- 2021-12-10 00:05 R E G D
6.b5168e518fbcaa4e6c6c.js 1.2 MB -rw-rw-r-- 2023-06-02 17:09 R E G D
6.b623be8c6cf6570556be.js 920.975 KB -rw-rw-r-- 2021-08-18 08:24 R E G D
6.cff89d652264f4717288.js 936.173 KB -rw-rw-r-- 2021-08-19 07:45 R E G D
6.db4a4ecce23df16a8ab8.js 1.22 MB -rw-rw-r-- 2023-06-30 09:30 R E G D
6.dc2e24e52564ff6e8e17.js 1.23 MB -rw-rw-r-- 2023-08-22 15:20 R E G D
6.e35ecce60aa675aa31c6.js 919.34 KB -rw-rw-r-- 2021-12-13 12:33 R E G D
6.f73018e8ccf0bf2d129b.js 907.243 KB -rw-rw-r-- 2021-06-07 11:42 R E G D
7.26beda7f142c0ff7afb5.js 764.825 KB -rw-rw-r-- 2023-05-30 16:22 R E G D
7.43637b98d52adefcc02d.js 785.189 KB -rw-rw-r-- 2023-07-17 12:13 R E G D
7.71aaba5a06b35bc90384.js 156.593 KB -rw-rw-r-- 2021-08-19 07:45 R E G D
7.8f49b6d2dc17e2646ec2.js 764.825 KB -rw-rw-r-- 2023-05-05 12:34 R E G D
7.96cfd267659b2c3603fe.js 786.354 KB -rw-rw-r-- 2023-09-29 09:31 R E G D
7.9cea2a8587531319528b.js 800.521 KB -rw-rw-r-- 2023-10-13 09:15 R E G D
7.a7af2e8037ab94053d91.js 764.855 KB -rw-rw-r-- 2023-06-30 09:30 R E G D
7.b8fb279ebafada9276ea.js 113.962 KB -rw-rw-r-- 2021-06-07 11:42 R E G D
7.bcfd6e0985966b30579c.js 800.521 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
7.ce024134a20ecdad0674.js 192.373 KB -rw-rw-r-- 2021-12-13 12:33 R E G D
7.eb1bce936795c0aff076.js 800.521 KB -rw-rw-r-- 2023-10-11 17:25 R E G D
date.js 0.489 KB -rw-r--r-- 2024-01-10 12:17 R E G D
default.php 1.22 MB -rw-r--r-- 2024-01-10 06:18 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:42 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:42 R E G D
favicon.ico 5.303 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
image.f11dbc75e7a09fc85e41.png 840.703 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
image.png 840.703 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
index.html 2.569 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
layouts-admin-layout-admin-layout-module.js 878.396 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
layouts-admin-layout-admin-layout-module.js.map 876.072 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
main.07b55195782607387f4c.js 1.39 MB -rw-rw-r-- 2023-06-29 18:28 R E G D
main.10bb55efb46c09ec5f0d.js 957.037 KB -rw-rw-r-- 2021-05-10 08:30 R E G D
main.18acfcaeb22d55a4c981.js 1.39 MB -rw-rw-r-- 2023-06-30 09:30 R E G D
main.29af2c22bb960f33910a.js 967.385 KB -rw-rw-r-- 2021-05-13 21:27 R E G D
main.532a8995c8fff90c2be5.js 1.38 MB -rw-rw-r-- 2023-04-25 20:28 R E G D
main.569a4f635214c7e9a03d.js 958.453 KB -rw-rw-r-- 2021-05-10 08:30 R E G D
main.5858d96e2ea1de338ff9.js 1.39 MB -rw-rw-r-- 2023-08-01 11:44 R E G D
main.61104b74b437ee6092eb.js 1.03 MB -rw-rw-r-- 2021-08-18 11:48 R E G D
main.62e2029525133470dc41.js 1.09 MB -rw-rw-r-- 2021-12-13 12:33 R E G D
main.67099eeb8d40adaad454.js 1.55 MB -rw-rw-r-- 2023-10-13 09:15 R E G D
main.6cd5ead1c15cea07104c.js 1.39 MB -rw-rw-r-- 2023-08-22 15:20 R E G D
main.760c28abdec3ac68fe32.js 1.55 MB -rw-rw-r-- 2023-09-28 17:46 R E G D
main.76295aa6d48359d29873.js 1.39 MB -rw-rw-r-- 2023-08-08 11:41 R E G D
main.7a2abf4e0084f54fa752.js 1.55 MB -rw-rw-r-- 2023-10-11 19:36 R E G D
main.8afe9bc218f1243252b8.js 1.55 MB -rw-rw-r-- 2024-01-16 10:35 R E G D
main.8e523a49aed8d1c1e5ef.js 958.452 KB -rw-rw-r-- 2021-05-10 08:30 R E G D
main.93f3a6e8a49d92fdd60a.js 1.55 MB -rw-rw-r-- 2023-09-29 09:31 R E G D
main.aa8549074e00980a00a5.js 1.39 MB -rw-rw-r-- 2023-05-30 16:22 R E G D
main.af5b139f30091e9054e1.js 1.03 MB -rw-rw-r-- 2021-08-19 07:45 R E G D
main.b830b72dc5eca0ff573a.js 967.689 KB -rw-rw-r-- 2021-06-07 11:42 R E G D
main.b9eccda1269072ce96ee.js 1.55 MB -rw-rw-r-- 2023-09-21 11:52 R E G D
main.bdf06f1364f14322297b.js 1.38 MB -rw-rw-r-- 2023-04-25 20:50 R E G D
main.c9f336cbbaff0814841c.js 967.404 KB -rw-rw-r-- 2021-05-13 21:21 R E G D
main.d9db1193431174a160b2.js 1.39 MB -rw-rw-r-- 2023-08-07 17:13 R E G D
main.ecde60f30fe0b3ec6cd1.js 1.55 MB -rw-rw-r-- 2023-09-22 10:47 R E G D
main.eead034ef276be811ca6.js 966.815 KB -rw-rw-r-- 2021-05-10 08:30 R E G D
main.efa1f4392976e158f98a.js 1.39 MB -rw-rw-r-- 2023-06-02 17:09 R E G D
main.f1db7890c01ff8056949.js 1.38 MB -rw-rw-r-- 2023-05-05 12:34 R E G D
main.f2dda673cda5546d6495.js 1.02 MB -rw-rw-r-- 2021-08-18 08:24 R E G D
main.f442e15663795cc12fd1.js 1.39 MB -rw-rw-r-- 2023-05-29 16:26 R E G D
main.fbc46ae70eda7f09f30f.js 1.38 MB -rw-rw-r-- 2023-04-25 20:46 R E G D
main.fedac3507f623656cc97.js 1.09 MB -rw-rw-r-- 2021-12-10 00:05 R E G D
main.js 834.783 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
main.js.map 836.399 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
polyfills-es5.1e0431463749c8d18737.js 249.687 KB -rw-rw-r-- 2021-05-13 21:27 R E G D
polyfills-es5.8b2e24a70255d7d09ae9.js 249.737 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
polyfills-es5.a5ccebd3e224f1a26aa4.js 249.687 KB -rw-rw-r-- 2021-12-13 12:33 R E G D
polyfills-es5.js 1.14 MB -rw-rw-r-- 2023-08-07 16:42 R E G D
polyfills-es5.js.map 923.377 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
polyfills.5313c1020e23c54079b9.js 166.701 KB -rw-rw-r-- 2021-12-13 12:33 R E G D
polyfills.758faf18f4b2f92959a3.js 166.752 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
polyfills.7bce44d4afad50687263.js 166.701 KB -rw-rw-r-- 2021-05-13 21:27 R E G D
polyfills.js 771.544 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
polyfills.js.map 659.782 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
runtime.0755e4ba66289dbf2b49.js 2.236 KB -rw-rw-r-- 2021-05-13 21:27 R E G D
runtime.151a3c4b23b0c096daf1.js 2.285 KB -rw-rw-r-- 2023-08-08 11:41 R E G D
runtime.15e05131a65b255d3df9.js 2.285 KB -rw-rw-r-- 2023-05-05 12:34 R E G D
runtime.178188fe78011ba42f9b.js 2.285 KB -rw-rw-r-- 2023-05-30 16:22 R E G D
runtime.264f746d05be32fac4db.js 2.256 KB -rw-rw-r-- 2021-05-13 21:21 R E G D
runtime.27c0e54af6604b88efc3.js 2.285 KB -rw-rw-r-- 2021-12-13 12:31 R E G D
runtime.33cdceae1afe0a1df44b.js 2.236 KB -rw-rw-r-- 2021-05-10 08:30 R E G D
runtime.4bd5d0e8f4d5f0b2b272.js 2.285 KB -rw-rw-r-- 2023-08-22 15:20 R E G D
runtime.4df5e7c8bad8c55d8db6.js 2.285 KB -rw-rw-r-- 2021-08-18 08:24 R E G D
runtime.53754ade5d5becf66cf5.js 2.285 KB -rw-rw-r-- 2023-10-13 09:15 R E G D
runtime.57bbe346a9d65e0c2f14.js 2.285 KB -rw-rw-r-- 2023-09-29 09:31 R E G D
runtime.57ef4f080e8e2fda1271.js 2.285 KB -rw-rw-r-- 2023-09-21 11:52 R E G D
runtime.70f22bd855c32894a6c6.js 2.285 KB -rw-rw-r-- 2023-08-01 11:44 R E G D
runtime.7132456d1f7c1ea39d77.js 2.285 KB -rw-rw-r-- 2023-09-22 10:47 R E G D
runtime.72965298cdcc120899c8.js 2.285 KB -rw-rw-r-- 2021-12-10 00:05 R E G D
runtime.7cb6bb41c5b4c03d0638.js 2.236 KB -rw-rw-r-- 2021-05-10 08:30 R E G D
runtime.8ac46e5dc50497425539.js 2.285 KB -rw-rw-r-- 2023-06-30 09:30 R E G D
runtime.8cd91bc056b149749aee.js 2.285 KB -rw-rw-r-- 2021-08-19 07:45 R E G D
runtime.8d7c1b24ff1115e9fd0f.js 2.285 KB -rw-rw-r-- 2023-06-02 17:09 R E G D
runtime.a06761ccf6ce754846f3.js 2.285 KB -rw-rw-r-- 2023-10-11 17:25 R E G D
runtime.a3bab758cf3c401e5363.js 2.236 KB -rw-rw-r-- 2021-05-10 08:30 R E G D
runtime.a9f0b2f2ede4fefd71ef.js 2.285 KB -rw-rw-r-- 2023-08-07 17:13 R E G D
runtime.b3d3fa4a462efb602627.js 2.285 KB -rw-rw-r-- 2021-12-13 12:27 R E G D
runtime.b3f34b77cba4c7ec3932.js 2.285 KB -rw-rw-r-- 2023-05-29 16:26 R E G D
runtime.b6fee8e18cc43c63ed6a.js 2.285 KB -rw-rw-r-- 2021-12-13 12:33 R E G D
runtime.bc75bd59618c07135ef5.js 2.285 KB -rw-rw-r-- 2021-06-07 11:42 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-16 10:35 R E G D
runtime.fc4b32a80670361d3f94.js 2.285 KB -rw-rw-r-- 2024-01-16 10:22 R E G D
runtime.js 9.29 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
runtime.js.map 9.423 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
scripts.23c891176a6fdb868027.js 302.444 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
scripts.js 805.319 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
scripts.js.map 986.763 KB -rw-rw-r-- 2023-08-07 16:42 R E G D
styles.3c620dc5e2f49488a936.css 659.578 KB -rw-rw-r-- 2024-01-16 10:22 R E G D
styles.4093d4faa194d286a583.css 659.542 KB -rw-rw-r-- 2023-10-13 09:15 R E G D
styles.88803303827e21610fd2.css 659.613 KB -rw-rw-r-- 2024-01-16 10:35 R E G D
styles.959b2475488bbcef438b.css 659.451 KB -rw-rw-r-- 2023-09-29 09:31 R E G D
styles.bdcf43b971e8a82cc0ab.css 659.436 KB -rw-rw-r-- 2023-05-05 12:34 R E G D
styles.e387d6c3a8da44068ce6.css 651.809 KB -rw-rw-r-- 2021-05-13 21:27 R E G D
styles.f32803e083c13c4d76d3.css 659.242 KB -rw-rw-r-- 2021-12-13 12:33 R E G D
styles.f60b3910ffa5b3762b73.css 659.24 KB -rw-rw-r-- 2021-08-19 07:45 R E G D
styles.f7d0c7893f32640d2f92.css 651.809 KB -rw-rw-r-- 2021-06-07 11:42 R E G D
styles.js 3.77 MB -rw-rw-r-- 2023-08-07 16:42 R E G D
styles.js.map 3.92 MB -rw-rw-r-- 2023-08-07 16:42 R E G D
transparencia-transparencia-module.js 1.43 MB -rw-rw-r-- 2023-08-07 16:42 R E G D
transparencia-transparencia-module.js.map 1.66 MB -rw-rw-r-- 2023-08-07 16:42 R E G D
vendor.js 10.27 MB -rw-rw-r-- 2023-08-07 16:42 R E G D
vendor.js.map 10.04 MB -rw-rw-r-- 2023-08-07 16:42 R E G D
REQUEST EXIT
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{KZYO:function(t,e,n){!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.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,t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,(function(e){return t[e]}).bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=102)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return r}));class i extends Error{constructor(t,e,n){super(`${t}${n?" "+JSON.stringify(n):""}${s(t)}`),this.name="CKEditorError",this.context=e,this.data=n}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const n=new i(t.message,e);throw n.stack=t.stack,n}}function o(t,e){console.warn(...a(t,e))}function r(t,e){console.error(...a(t,e))}function s(t){return"\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-"+t}function a(t,e){const n=s(t);return e?[t,e,n]:[t,n]}},function(t,e,n){"use strict";var i,o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),r=[];function s(t){for(var e=-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(t,e,n){var i=n(1),o=n(21);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(23);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(25);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(27);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(29);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(31);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(33);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(35);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(37);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(39);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(41);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,n){var i=n(1),o=n(43);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(45);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(47);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(49);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(51);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(53);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(55);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(57);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(59);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(61);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e){t.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(t,e,n){var i=n(1),o=n(64);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(66);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(68);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(70);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(72);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(74);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e){t.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(t,e,n){var i=n(1),o=n(77);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(79);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(81);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(83);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(85);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(87);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(89);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(91);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(93);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(t,e,n){var i=n(1),o=n(95);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(97);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(99);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){var i=n(1),o=n(101);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),i(o,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),t.exports=o.locals||{}},function(t,e){t.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(t,e,n){"use strict";n.r(e),n.d(e,"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(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":d&&d in Object(t)?function(t){var e=s.call(t,l),n=t[l];try{t[l]=void 0;var i=!0}catch(t){}var o=a.call(t);return i&&(e?t[l]=n:delete t[l]),o}(t):function(t){return c.call(t)}(t)},h=function(t,e){return function(n){return t(e(n))}},f=h(Object.getPrototypeOf,Object),m=function(t){return null!=t&&"object"==typeof t},g=Function.prototype.toString,p=Object.prototype.hasOwnProperty,b=g.call(Object),w=function(t){if(!m(t)||"[object Object]"!=u(t))return!1;var e=f(t);if(null===e)return!0;var n=p.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&g.call(n)==b},k=function(t,e){return t===e||t!=t&&e!=e},_=function(t,e){for(var n=t.length;n--;)if(k(t[n][0],e))return n;return-1},v=Array.prototype.splice;function y(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},y.prototype.set=function(t,e){var n=this.__data__,i=_(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};var x,A=y,C=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},T=function(t){if(!C(t))return!1;var e=u(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},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(t){if(null!=t){try{return P.call(t)}catch(t){}try{return t+""}catch(t){}}return""},I=/^\[object .+?Constructor\]$/,N=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!C(t)||function(t){return!!E&&E in t}(t))&&(T(t)?N:I).test(M(t))}(n)?n:void 0},R=O(i.a,"Map"),D=O(Object,"create"),L=Object.prototype.hasOwnProperty,z=Object.prototype.hasOwnProperty;function V(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},st={};st["[object Float32Array]"]=st["[object Float64Array]"]=st["[object Int8Array]"]=st["[object Int16Array]"]=st["[object Int32Array]"]=st["[object Uint8Array]"]=st["[object Uint8ClampedArray]"]=st["[object Uint16Array]"]=st["[object Uint32Array]"]=!0,st["[object Arguments]"]=st["[object Array]"]=st["[object ArrayBuffer]"]=st["[object Boolean]"]=st["[object DataView]"]=st["[object Date]"]=st["[object Error]"]=st["[object Function]"]=st["[object Map]"]=st["[object Number]"]=st["[object Object]"]=st["[object RegExp]"]=st["[object Set]"]=st["[object String]"]=st["[object WeakMap]"]=!1;var at=function(t){return function(e){return t(e)}},lt=n(5),ct=lt.a&<.a.isTypedArray,dt=ct?at(ct):function(t){return m(t)&&rt(t.length)&&!!st[u(t)]},ut=Object.prototype.hasOwnProperty,ht=function(t,e){var n=et(t),i=!n&&tt(t),o=!n&&!i&&Object(nt.a)(t),r=!n&&!i&&!o&&dt(t),s=n||i||o||r,a=s?function(t,e){for(var n=-1,i=Array(t);++n{this._setToTarget(t,i,e[i],n)})}}function le(t){return re(t,ce)}function ce(t){return se(t)?t:void 0}class de{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=function t(){t.called=!0},this.off=function t(){t.called=!0}}}const ue=new Array(256).fill().map((t,e)=>("0"+e.toString(16)).slice(-2));function he(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+ue[t>>0&255]+ue[t>>8&255]+ue[t>>16&255]+ue[t>>24&255]+ue[e>>0&255]+ue[e>>8&255]+ue[e>>16&255]+ue[e>>24&255]+ue[n>>0&255]+ue[n>>8&255]+ue[n>>16&255]+ue[n>>24&255]+ue[i>>0&255]+ue[i>>8&255]+ue[i>>16&255]+ue[i>>24&255]}var fe={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},me=(n(6),n(0));const ge=Symbol("listeningTo"),pe=Symbol("emitterId");var be={on(t,e,n={}){this.listenTo(this,t,e,n)},once(t,e,n){let i=!1;this.listenTo(this,t,(function(t,...n){i||(i=!0,t.off(),e.call(this,t,...n))}),n)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,n,i={}){let o,r;this[ge]||(this[ge]={});const s=this[ge];ke(t)||we(t);const a=ke(t);(o=s[a])||(o=s[a]={emitter:t,callbacks:{}}),(r=o.callbacks[e])||(r=o.callbacks[e]=[]),r.push(n),function(t,e){const n=_e(t);if(n[e])return;let i=e,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 t of r)t.callbacks=n[i].callbacks.slice();n[i].childEvents.push(o)}}(t,e);const l=ve(t,e),c=fe.get(i.priority),d={callback:n,priority:c};for(const u of l){let t=!1;for(let e=0;e-1?t(e,n.substr(0,n.lastIndexOf(":"))):null}(this,i);if(n.path.push(this),o){const t=[n,...e];o=Array.from(o);for(let e=0;e{this._delegations||(this._delegations=new Map),t.forEach(t=>{const i=this._delegations.get(t);i?i.set(e,n):this._delegations.set(t,new Map([[e,n]]))})}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const n=this._delegations.get(t);n&&n.delete(e)}else this._delegations.delete(t);else this._delegations.clear()}};function we(t,e){t[pe]||(t[pe]=e||he())}function ke(t){return t[pe]}function _e(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function ve(t,e){const n=_e(t)[e];if(!n)return[];let i=[n.callbacks];for(let o=0;o{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(n=>{if(n in t.prototype)return;const i=Object.getOwnPropertyDescriptor(e,n);i.enumerable=!1,Object.defineProperty(t.prototype,n,i)})})}class Te{constructor(t={},e={}){const n=Ae(t);if(n||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const i of t)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(t,e){return this.addMany([t],e)}addMany(t,e){if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new me.a("collection-add-item-invalid-index",this);for(let n=0;n{this._setUpBindToBinding(e=>new t(e))},using:t=>{this._setUpBindToBinding("function"==typeof t?e=>t(e):e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,n=(n,i,o)=>{const r=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(i);if(r&&s)this._bindToExternalToInternalMap.set(i,s),this._bindToInternalToExternalMap.set(s,i);else{const n=t(i);if(!n)return void this._skippedIndexesFromExternal.push(o);let r=o;for(const t of this._skippedIndexesFromExternal)o>t&&r--;for(const t of e._skippedIndexesFromExternal)r>=t&&r++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,r);for(let t=0;t{const i=this._bindToExternalToInternalMap.get(e);i&&this.remove(i),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(ne&&t.push(e),t),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let n;if(e in t){if(n=t[e],"string"!=typeof n)throw new me.a("collection-add-invalid-id",this);if(this.get(n))throw new me.a("collection-add-item-already-exists",this)}else t[e]=n=he();return n}_remove(t){let e,n,i,o=!1;const r=this._idProperty;if("string"==typeof t?(n=t,i=this._itemMap.get(n),o=!i,i&&(e=this._items.indexOf(i))):"number"==typeof t?(e=t,i=this._items[e],o=!i,i&&(n=i[r])):(i=t,n=i[r],e=this._items.indexOf(i),o=-1==e||!this._itemMap.get(n)),o)throw new me.a("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(s),this.fire("remove",i,e),[i,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Ce(Te,be);class Se{constructor(t,e=[],n=[]){this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const i of e)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 t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new me.a("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[]){const n=this,i=this._context,o=new Set,r=[],s=u(t),a=u(e),l=function(t){const e=[];for(const n of t)d(n)||e.push(n);return e.length?e:null}(t);if(l){const t="plugincollection-plugin-not-found";return Object(me.b)(t,{plugins:l}),Promise.reject(new me.a(t,i,{plugins:l}))}return Promise.all(s.map((function t(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 me.a("plugincollection-context-required",null,{plugin:o.name,requiredBy:s.name});if(e.includes(o))throw new me.a("plugincollection-required",i,{plugin:o.name,requiredBy:s.name});t(o)});const l=n._contextPlugins.get(s)||new s(i);n._add(s,l),r.push(l),a()})}(s).catch(t=>{throw Object(me.b)("plugincollection-load",{plugin:s}),t})}))).then(()=>c(r,"init")).then(()=>c(r,"afterInit")).then(()=>r);function c(t,e){return t.reduce((t,i)=>i[e]?n._contextPlugins.has(i)?t:t.then(i[e].bind(i)):t,Promise.resolve())}function d(t){return"function"==typeof t?t:n._availablePlugins.get(t)}function u(t){return t.map(t=>d(t)).filter(t=>!!t)}}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;if(n){if(this._plugins.has(n))throw new me.a("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t});this._plugins.set(n,e)}}}function Ee(t){return Array.isArray(t)?t:[t]}Ce(Se,be),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Pe=["ar","fa","he","ku","ug"];class Me{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Ie(this.uiLanguage),this.contentLanguageDirection=Ie(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}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(t,e=[]){return e=Ee(e),"string"==typeof t&&(t={string:t}),function(t,e){return t.replace(/%(\d+)/g,(t,n)=>n1===t?0:1);if("string"==typeof r[o])return r[o];const a=Number(s(n));return r[o][a]}(this.uiLanguage,t,t.plural?e[0]:1),e)}}function Ie(t){return Pe.includes(t)?"rtl":"ltr"}class Ne{constructor(t){this.config=new ae(t,this.constructor.defaultConfig);const e=this.constructor.builtinPlugins;this.config.define("plugins",e),this.plugins=new Se(this,e);const n=this.config.get("language")||{};this.locale=new Me({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Te,this._contextOwner=null}initPlugins(){const t=this.config.get("plugins")||[];for(const e of t){if("function"!=typeof e)throw new me.a("context-initplugins-constructor-only",null,{Plugin:e});if(!0!==e.isContextPlugin)throw new me.a("context-initplugins-invalid-plugin",null,{Plugin:e})}return this.plugins.init(t)}destroy(){return Promise.all(Array.from(this.editors,t=>t.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new me.a("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const n=new this(t);e(n.initPlugins().then(()=>n))})}}function Oe(t,e){const n=Math.min(t.length,e.length);for(let i=0;it.data.length)throw new me.a("view-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.data.length)throw new me.a("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}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(t){return"$textProxy"===t||"view:$textProxy"===t||"textProxy"===t||"view:textProxy"===t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this.textNode:this.parent;for(;null!==n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}}function Ve(t){return Ae(t)?new Map(t):function(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}(t)}class je{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const n=Be(e,t);if(n)return{element:e,pattern:t,match:n}}return null}matchAll(...t){const e=[];for(const n of t)for(const t of this._patterns){const i=Be(n,t);i&&e.push({element:n,pattern:t,match:i})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function Be(t,e){if("function"==typeof e)return e(t);const n={};return e.name&&(n.name=function(t,e){return t instanceof RegExp?t.test(e):t===e}(e.name,t.name),!n.name)||e.attributes&&(n.attributes=function(t,e){const n=[];for(const i in t){const o=t[i];if(!e.hasAttribute(i))return null;{const t=e.getAttribute(i);if(!0===o)n.push(i);else if(o instanceof RegExp){if(!o.test(t))return null;n.push(i)}else{if(t!==o)return null;n.push(i)}}}return n}(e.attributes,t),!n.attributes)?null:!(e.classes&&(n.classes=function(t,e){const n=[];for(const i of t)if(i instanceof RegExp){const t=e.getClassNames();for(const e of t)i.test(e)&&n.push(e);if(0===n.length)return null}else{if(!e.hasClass(i))return null;n.push(i)}return n}(e.classes,t),!n.classes))&&!(e.styles&&(n.styles=function(t,e){const n=[];for(const i in t){const o=t[i];if(!e.hasStyle(i))return null;{const t=e.getStyle(i);if(o instanceof RegExp){if(!o.test(t))return null;n.push(i)}else{if(t!==o)return null;n.push(i)}}}return n}(e.styles,t),!n.styles))&&n}var Fe=function(t){return"symbol"==typeof t||m(t)&&"[object Symbol]"==u(t)},He=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ue=/^\w*$/;function qe(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=e?e.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=t.apply(this,i);return n.cache=r.set(o,s)||r,s};return n.cache=new(qe.Cache||H),n}qe.Cache=H;var We=qe,$e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ye=/\\(\\)?/g,Ge=function(t){var e=We((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace($e,(function(t,n,i,o){e.push(i?o.replace(Ye,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),Ke=o?o.prototype:void 0,Qe=Ke?Ke.toString:void 0,Je=function(t){return null==t?"":function t(e){if("string"==typeof e)return e;if(et(e))return function(t,e){for(var n=-1,i=null==t?0:t.length,o=Array(i);++no?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var r=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(W?function(t,e){return W(t,"toString",{configurable:!0,enumerable:!1,value:cn(e),writable:!0})}:sn),hn=function(t){return function(t,e){return un(function(t,e,n){return e=ln(void 0===e?t.length-1:e,0),function(){for(var i=arguments,o=-1,r=ln(i.length-e,0),s=Array(r);++o1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(o--,r):void 0,s&&function(t,e,n){if(!C(n))return!1;var i=typeof e;return!!("number"==i?bt(n)&&ot(e,n.length):"string"==i&&e in n)&&k(n[e],t)}(n[0],n[1],s)&&(r=o<3?void 0:r,o=1),e=Object(e);++ie===t);return Array.isArray(e)}set(t,e){if(C(t))for(const[n,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=pn(t);(function(t,e){null==t||function(t,e){null==(t=function(t,e){return e.length<2?t:tn(t,en(e,0,-1))}(t,e=Ze(e,t)))||delete t[Xe(function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}(e))]}(t,e)})(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!C(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(){return this.isEmpty?[]:this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const n of e)t.push(...this._styleProcessor.getReducedForm(n,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const n=e.splice(0,e.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(t,e,n){if(C(e))bn(n,pn(t),e);else if(this._normalizers.has(t)){const i=this._normalizers.get(t),{path:o,value:r}=i(e);bn(n,o,r)}else bn(n,t,e)}getNormalized(t,e){if(!t)return fn({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const n=this._extractors.get(t);if("string"==typeof n)return nn(e,n);const i=n(t,e);if(i)return i}return nn(e,pn(t))}getReducedForm(t,e){const n=this.getNormalized(t,e);return void 0===n?[]:this._reducers.has(t)?this._reducers.get(t)(n):[[t,n]]}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const n of e)this._mapStyleNames(n,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function pn(t){return t.replace("-",".")}function bn(t,e,n){let i=n;C(n)&&(i=fn({},nn(t,e),n)),function(t,e,n){null==t||function(t,e,n,i){if(!C(t))return t;for(var o=-1,r=(e=Ze(e,t)).length,s=r-1,a=t;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(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof wn))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,n]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==n)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new je(...t);let n=this.parent;for(;n;){if(e.match(n))return n;n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),n=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==n?"":" "+n)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const n=new this.constructor(this.document,this.name,this._attrs,e);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(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(t,e){return"string"==typeof e?[new Le(t,e)]:(Ae(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new Le(t,e):e instanceof ze?new Le(t,e.data):e))}(this.document,e);for(const o of i)null!==o.parent&&o._remove(),o.parent=this,o.document=this.document,this._children.splice(t,0,o),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of Ee(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of Ee(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of Ee(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function kn(t,e){const n=e.split(/\s+/);t.clear(),n.forEach(e=>t.add(e))}class _n extends wn{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=vn}is(t,e=null){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}}function vn(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const n of t)if(!n.is("uiElement"))return null;return this.childCount}var yn=hn((function(t,e){K(e,_t(e),t)}));const xn=Symbol("observableProperties"),An=Symbol("boundObservables"),Cn=Symbol("boundProperties"),Tn={set(t,e){if(C(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);En(this);const n=this[xn];if(t in this&&!n.has(t))throw new me.a("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(e){const i=n.get(t);let o=this.fire("set:"+t,t,e,i);void 0===o&&(o=e),i===o&&n.has(t)||(n.set(t,o),this.fire("change:"+t,t,o,i))}}),this[t]=e},bind(...t){if(!t.length||!In(t))throw new me.a("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new me.a("observable-bind-duplicate-properties",this);En(this);const e=this[Cn];t.forEach(t=>{if(e.has(t))throw new me.a("observable-bind-rebind",this)});const n=new Map;return t.forEach(t=>{const i={property:t,to:[]};e.set(t,i),n.set(t,i)}),{to:Pn,toMany:Mn,_observable:this,_bindProperties:t,_to:[],_bindings:n}},unbind(...t){if(!this[xn])return;const e=this[Cn],n=this[An];if(t.length){if(!In(t))throw new me.a("observable-unbind-wrong-properties",this);t.forEach(t=>{const i=e.get(t);if(!i)return;let o,r,s,a;i.to.forEach(t=>{o=t[0],r=t[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"))}),e.delete(t)})}else n.forEach((t,e)=>{this.stopListening(e,"change")}),n.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new me.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(t,n)=>{t.return=e.apply(this,n)}),this[t]=function(...e){return this.fire(t,e)}}};yn(Tn,be);var Sn=Tn;function En(t){t[xn]||(Object.defineProperty(t,xn,{value:new Map}),Object.defineProperty(t,An,{value:new Map}),Object.defineProperty(t,Cn,{value:new Map}))}function Pn(...t){const e=function(...t){if(!t.length)throw new me.a("observable-bind-to-parse-error",null);const e={to:[]};let n;return"function"==typeof t[t.length-1]&&(e.callback=t.pop()),t.forEach(t=>{if("string"==typeof t)n.properties.push(t);else{if("object"!=typeof t)throw new me.a("observable-bind-to-parse-error",null);n={observable:t,properties:[]},e.to.push(n)}}),e}(...t),n=Array.from(this._bindings.keys()),i=n.length;if(!e.callback&&e.to.length>1)throw new me.a("observable-bind-to-no-callback",this);if(i>1&&e.callback)throw new me.a("observable-bind-to-extra-callback",this);var o;e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==i)throw new me.a("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(n[0]).callback=e.callback),o=this._observable,this._to.forEach(t=>{const e=o[An];let n;e.get(t.observable)||o.listenTo(t.observable,"change",(i,r)=>{n=e.get(t.observable)[r],n&&n.forEach(t=>{Nn(o,t.property)})})}),function(t){let e;t._bindings.forEach((n,i)=>{t._to.forEach(o=>{e=o.properties[n.callback?0:t._bindProperties.indexOf(i)],n.to.push([o.observable,e]),function(t,e,n,i){const o=t[An],r=o.get(n),s=r||{};s[i]||(s[i]=new Set),s[i].add(e),r||o.set(n,s)}(t._observable,n,o.observable,e)})})}(this),this._bindProperties.forEach(t=>{Nn(this._observable,t)})}function Mn(t,e,n){if(this._bindings.size>1)throw new me.a("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const n=t.map(t=>[t,e]);return Array.prototype.concat.apply([],n)}(t,e),n)}function In(t){return t.every(t=>"string"==typeof t)}function Nn(t,e){const n=t[Cn].get(e);let i;n.callback?i=n.callback.apply(t,n.to.map(t=>t[0][t[1]])):(i=n.to[0],i=i[0][i[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=i:t.set(e,i)}class On extends _n{constructor(t,e,n,i){super(t,e,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}is(t,e=null){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}destroy(){this.stopListening()}}Ce(On,Sn);const Rn=Symbol("rootName");class Dn extends On{constructor(t,e){super(t,e),this.rootName="main"}is(t,e=null){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}get rootName(){return this.getCustomProperty(Rn)}set rootName(t){this._setCustomProperty(Rn,t)}set _name(t){this.name=t}}class Ln{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new me.a("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new me.a("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,this.position=zn._createAt(t.startPosition?t.startPosition:t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,n,i;do{i=this.position,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,n=t.parent;if(null===n.parent&&t.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let i;if(n instanceof Le){if(t.isAtEnd)return this.position=zn._createAfter(n),this._next();i=n.data[t.offset]}else i=n.getChild(t.offset);if(i instanceof wn)return this.shallow?t.offset++:t=new zn(i,0),this.position=t,this._formatReturnValue("elementStart",i,e,t,1);if(i instanceof Le){if(this.singleCharacters)return t=new zn(i,0),this.position=t,this._next();{let n,o=i.data.length;return i==this._boundaryEndParent?(o=this.boundaries.end.offset,n=new ze(i,0,o),t=zn._createAfter(n)):(n=new ze(i,0,i.data.length),t.offset++),this.position=t,this._formatReturnValue("text",n,e,t,o)}}if("string"==typeof i){let i;i=this.singleCharacters?1:(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset;const o=new ze(n,t.offset,i);return t.offset+=i,this.position=t,this._formatReturnValue("text",o,e,t,i)}return t=zn._createAfter(n),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,e,t)}_previous(){let t=this.position.clone();const e=this.position,n=t.parent;if(null===n.parent&&0===t.offset)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let i;if(n instanceof Le){if(t.isAtStart)return this.position=zn._createBefore(n),this._previous();i=n.data[t.offset-1]}else i=n.getChild(t.offset-1);if(i instanceof wn)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",i,e,t,1)):(t=new zn(i,i.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,e,t));if(i instanceof Le){if(this.singleCharacters)return t=new zn(i,i.data.length),this.position=t,this._previous();{let n,o=i.data.length;if(i==this._boundaryStartParent){const e=this.boundaries.start.offset;n=new ze(i,e,i.data.length-e),o=n.data.length,t=zn._createBefore(n)}else n=new ze(i,0,i.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",n,e,t,o)}}if("string"==typeof i){let i;i=this.singleCharacters?1:t.offset-(n===this._boundaryStartParent?this.boundaries.start.offset:0),t.offset-=i;const o=new ze(n,t.offset,i);return this.position=t,this._formatReturnValue("text",o,e,t,i)}return t=zn._createBefore(n),this.position=t,this._formatReturnValue("elementStart",n,e,t,1)}_formatReturnValue(t,e,n,i,o){return e instanceof ze&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=zn._createAfter(e.textNode):(i=zn._createAfter(e.textNode),this.position=i)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=zn._createBefore(e.textNode):(i=zn._createBefore(e.textNode),this.position=i))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:o}}}}class zn{constructor(t,e){this.parent=t,this.offset=e}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 t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof On);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=zn._createAt(this),n=e.offset+t;return e.offset=n<0?0:n,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new Ln(e);return n.skip(t),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let i=0;for(;e[i]==n[i]&&e[i];)i++;return 0===i?null:e[i-1]}is(t){return"position"===t||"view:position"===t}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);const i=Oe(e,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return e[i]0?new this(n,i):new this(i,n)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(zn._createBefore(t),e)}}function jn(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function Bn(t){let e=0;for(const n of t)e++;return e}class Fn{constructor(t=null,e,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.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 t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=Bn(this.getRanges());if(e!=Bn(t.getRanges()))return!1;if(0==e)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let e=!1;for(let i of t.getRanges())if(i=i.getTrimmed(),n.start.isEqual(i.start)&&n.end.isEqual(i.end)){e=!0;break}if(!e)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,e,n){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof Fn||t instanceof Hn)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Vn)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof zn)this._setRanges([new Vn(t)]),this._setFakeOptions(e);else if(t instanceof De){const i=!!n&&!!n.backward;let o;if(void 0===e)throw new me.a("view-selection-setto-required-second-parameter",this);o="in"==e?Vn._createIn(t):"on"==e?Vn._createOn(t):new Vn(zn._createAt(t,e)),this._setRanges([o],i),this._setFakeOptions(n)}else{if(!Ae(t))throw new me.a("view-selection-setto-not-selectable",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new me.a("view-selection-setfocus-no-ranges",this);const n=zn._createAt(t,e);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(t){return"selection"===t||"view:selection"===t}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const n of t)this._addRange(n);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof Vn))throw new me.a("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new me.a("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new Vn(t.start,t.end))}}Ce(Fn,be);class Hn{constructor(t=null,e,n){this._selection=new Fn,this._selection.delegate("change").to(this),this._selection.setTo(t,e,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(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setFocus(t,e){this._selection.setFocus(t,e)}}Ce(Hn,be);class Un{constructor(t){this.selection=new Hn,this.roots=new Te({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(e=n(t),e)break}while(e)}}Ce(Un,Sn);class qn extends wn{constructor(t,e,n,i){super(t,e,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 me.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(t,e=null){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function Wn(){if($n(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if($n(t)>1)return null;t=t.parent}return!t||$n(t)>1?null:this.childCount}function $n(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}qn.DEFAULT_PRIORITY=10;class Yn extends wn{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=Gn}is(t,e=null){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof De||Array.from(e).length>0))throw new me.a("view-emptyelement-cannot-add",[this,e])}}function Gn(){return null}const Kn=navigator.userAgent.toLowerCase();var Qn=function(t){return t.indexOf("macintosh")>-1}(Kn),Jn=function(t){return!!t.match(/gecko\/\d+/)}(Kn),Zn=function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(Kn),Xn=function(t){return t.indexOf("android")>-1}(Kn);(function(t){t.indexOf("chrome/")>-1&&t.indexOf("edge/")})(Kn),function(){let t=!1;try{t=0==="\u0107".search(new RegExp("[\\p{L}]","u"))}catch(t){}}();const ti={"\u2318":"ctrl","\u21e7":"shift","\u2325":"alt"},ei={ctrl:"\u2318",shift:"\u21e7",alt:"\u2325"},ni=function(){const t={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 e=65;e<=90;e++)t[String.fromCharCode(e).toLowerCase()]=e;for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}();function ii(t){let e;if("string"==typeof t){if(e=ni[t.toLowerCase()],!e)throw new me.a("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?ni.alt:0)+(t.ctrlKey?ni.ctrl:0)+(t.shiftKey?ni.shift:0);return e}function oi(t){return"string"==typeof t&&(t=ci(t)),t.map(t=>"string"==typeof t?ii(t):t).reduce((t,e)=>e+t,0)}function ri(t){return Qn?ci(t).map(t=>ei[t.toLowerCase()]||t).reduce((t,e)=>t.slice(-1)in ti?t+e:t+"+"+e):t}function si(t){return t==ni.arrowright||t==ni.arrowleft||t==ni.arrowup||t==ni.arrowdown}function ai(t,e){const n="ltr"===e;switch(t){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(t,e){const n=ai(t,e);return"down"===n||"right"===n}function ci(t){return t.split(/\s*\+\s*/)}class di extends wn{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=ui}is(t,e=null){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof De||Array.from(e).length>0))throw new me.a("view-uielement-cannot-add",this)}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const n of this.getAttributeKeys())e.setAttribute(n,this.getAttribute(n));return e}}function ui(){return null}class hi extends wn{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=fi}is(t,e=null){return e?e===this.name&&("rawElement"===t||"view:rawElement"===t||"element"===t||"view:element"===t):"rawElement"===t||"view:rawElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof De||Array.from(e).length>0))throw new me.a("view-rawelement-cannot-add",[this,e])}}function fi(){return null}class mi{constructor(t,e){this.document=t,this._children=[],e&&this._insertChild(0,e)}[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(t){return"documentFragment"===t||"view:documentFragment"===t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(t,e){return"string"==typeof e?[new Le(t,e)]:(Ae(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new Le(t,e):e instanceof ze?new Le(t,e.data):e))}(this.document,e);for(const o of i)null!==o.parent&&o._remove(),o.parent=this,this._children.splice(t,0,o),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n{}),i}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){w(t)&&void 0===n&&(n=e),n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof zn?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new me.a("view-writer-break-non-container-element",this.document);if(!e.parent)throw new me.a("view-writer-break-root",this.document);if(t.isAtStart)return zn._createBefore(e);if(!t.isAtEnd){const n=e._clone(!1);this.insert(zn._createAfter(e),n);const i=new Vn(t,zn._createAt(e,"end")),o=new zn(n,0);this.move(i,o)}return zn._createAfter(e)}mergeAttributes(t){const e=t.offset,n=t.parent;if(n.is("$text"))return t;if(n.is("attributeElement")&&0===n.childCount){const t=n.parent,e=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new zn(t,e))}const i=n.getChild(e-1),o=n.getChild(e);if(!i||!o)return t;if(i.is("$text")&&o.is("$text"))return _i(i,o);if(i.is("attributeElement")&&o.is("attributeElement")&&i.isSimilar(o)){const t=i.childCount;return i._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new zn(i,t))}return t}mergeContainers(t){const e=t.nodeBefore,n=t.nodeAfter;if(!(e&&n&&e.is("containerElement")&&n.is("containerElement")))throw new me.a("view-writer-merge-containers-invalid-position",this.document);const i=e.getChild(e.childCount-1),o=zn._createAt(i instanceof Le?i:e,"end");return this.move(Vn._createIn(n),zn._createAt(e,"end")),this.remove(Vn._createOn(n)),o}insert(t,e){!function t(e,n){for(const i of e){if(!vi.some(t=>i instanceof t))throw new me.a("view-writer-insert-invalid-node-type",n);i.is("$text")||t(i.getChildren(),n)}}(e=Ae(e)?[...e]:[e],this.document);const n=pi(t);if(!n)throw new me.a("view-writer-invalid-position-container",this.document);const i=this._breakAttributes(t,!0),o=n._insertChild(i.offset,e);for(const a of e)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 t=this.mergeAttributes(r);return new Vn(s,t)}}remove(t){const e=t instanceof Vn?t:Vn._createOn(t);if(xi(e,this.document),e.isCollapsed)return new mi(this.document);const{start:n,end:i}=this._breakAttributesRange(e,!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 e.start=r,e.end=r.clone(),new mi(this.document,o)}clear(t,e){xi(t,this.document);const n=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const n=i.item;let o;if(n.is("element")&&e.isSimilar(n))o=Vn._createOn(n);else if(!i.nextPosition.isAfter(t.start)&&n.is("$textProxy")){const t=n.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(o=Vn._createIn(t))}o&&(o.end.isAfter(t.end)&&(o.end=t.end),o.start.isBefore(t.start)&&(o.start=t.start),this.remove(o))}}move(t,e){let n;if(e.isAfter(t.end)){const i=(e=this._breakAttributes(e,!0)).parent,o=i.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=i.childCount-o}else n=this.remove(t);return this.insert(e,n)}wrap(t,e){if(!(e instanceof qn))throw new me.a("view-writer-wrap-invalid-attribute",this.document);if(xi(t,this.document),t.isCollapsed){let n=t.start;n.parent.is("element")&&!Array.from(n.parent.getChildren()).some(t=>!t.is("uiElement"))&&(n=n.getLastMatchingPosition(t=>t.item.is("uiElement"))),n=this._wrapPosition(n,e);const i=this.document.selection;return i.isCollapsed&&i.getFirstPosition().isEqual(t.start)&&this.setSelection(n),new Vn(n)}return this._wrapRange(t,e)}unwrap(t,e){if(!(e instanceof qn))throw new me.a("view-writer-unwrap-invalid-attribute",this.document);if(xi(t,this.document),t.isCollapsed)return t;const{start:n,end:i}=this._breakAttributesRange(t,!0),o=this._unwrapChildren(n.parent,n.offset,i.offset,e),r=this.mergeAttributes(o.start);r.isEqual(o.start)||o.end.offset--;const s=this.mergeAttributes(o.end);return new Vn(r,s)}rename(t,e){const n=new _n(this.document,t,e.getAttributes());return this.insert(zn._createAfter(e),n),this.move(Vn._createIn(e),zn._createAt(n,0)),this.remove(Vn._createOn(e)),n}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return zn._createAt(t,e)}createPositionAfter(t){return zn._createAfter(t)}createPositionBefore(t){return zn._createBefore(t)}createRange(t,e){return new Vn(t,e)}createRangeOn(t){return Vn._createOn(t)}createRangeIn(t){return Vn._createIn(t)}createSelection(t,e,n){return new Fn(t,e,n)}_wrapChildren(t,e,n,i){let o=e;const r=[];for(;o!1,t.parent._insertChild(t.offset,n);const i=new Vn(t,t.getShiftedBy(1));this.wrap(i,e);const o=new zn(n.parent,n.index);n._remove();const r=o.nodeBefore,s=o.nodeAfter;return r instanceof Le&&s instanceof Le?_i(r,s):wi(o)}_wrapAttributeElement(t,e){if(!Ai(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n))return!1;for(const n of t.getStyleNames())if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&(e.hasAttribute(n)||this.setAttribute(n,t.getAttribute(n),e));for(const n of t.getStyleNames())e.hasStyle(n)||this.setStyle(n,t.getStyle(n),e);for(const n of t.getClassNames())e.hasClass(n)||this.addClass(n,e);return!0}_unwrapAttributeElement(t,e){if(!Ai(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const n of t.getStyleNames())if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const n=t.start,i=t.end;if(xi(t,this.document),t.isCollapsed){const n=this._breakAttributes(t.start,e);return new Vn(n,n)}const o=this._breakAttributes(i,e),r=o.parent.childCount,s=this._breakAttributes(n,e);return o.offset+=o.parent.childCount-r,new Vn(s,o)}_breakAttributes(t,e=!1){const n=t.offset,i=t.parent;if(t.parent.is("emptyElement"))throw new me.a("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new me.a("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new me.a("view-writer-cannot-break-raw-element",this.document);if(!e&&i.is("$text")&&yi(i.parent))return t.clone();if(yi(i))return t.clone();if(i.is("$text"))return this._breakAttributes(ki(t),e);if(n==i.childCount){const t=new zn(i.parent,i.index+1);return this._breakAttributes(t,e)}if(0===n){const t=new zn(i.parent,i.index);return this._breakAttributes(t,e)}{const t=i.index+1,o=i._clone();i.parent._insertChild(t,o),this._addToClonedElementsGroup(o);const r=i._removeChildren(n,i.childCount-n);o._appendChild(r);const s=new zn(i.parent,t);return this._breakAttributes(s,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const i of t.getChildren())this._addToClonedElementsGroup(i);const e=t.id;if(!e)return;let n=this._cloneGroups.get(e);n||(n=new Set,this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const i of t.getChildren())this._removeFromClonedElementsGroup(i);const e=t.id;if(!e)return;const n=this._cloneGroups.get(e);n&&n.delete(t)}}function pi(t){let e=t.parent;for(;!yi(e);){if(!e)return;e=e.parent}return e}function bi(t,e){return t.prioritye.priority)&&t.getIdentity()t.createTextNode("\xa0"),Si=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},Ei=(()=>{let t="";for(let e=0;e<7;e++)t+="\u200b";return t})();function Pi(t){return Ci(t)&&t.data.substr(0,7)===Ei}function Mi(t){return 7==t.data.length&&Pi(t)}function Ii(t){return Pi(t)?t.data.slice(7):t.data}function Ni(t,e){if(e.keyCode==ni.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,n=t.getRangeAt(0).startOffset;Pi(e)&&n<=7&&t.collapse(e,0)}}}function Oi(t,e,n,i=!1){n=n||function(t,e){return t===e},Array.isArray(t)||(t=Array.prototype.slice.call(t)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const o=function(t,e,n){const i=Ri(t,e,n);if(-1===i)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const o=Ri(Di(t,i),Di(e,i),n);return{firstIndex:i,lastIndexOld:t.length-o,lastIndexNew:e.length-o}}(t,e,n);return i?function(t,e){const{firstIndex:n,lastIndexOld:i,lastIndexNew:o}=t;if(-1===n)return Array(e).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:t.slice(i,r)}),o-i>0&&n.push({index:i+(r-i),type:"delete",howMany:o-i}),n}(e,o)}function Ri(t,e,n){for(let i=0;i200||o>200||i+o>300)return Li.fastDiff(t,e,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(t,e,n){t.insertBefore(n,t.childNodes[e]||null)}function Vi(t){const e=t.parentNode;e&&e.removeChild(t)}function ji(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}Li.fastDiff=Oi;class Bi{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new me.a("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){let t;for(const e of this.markedChildren)this._updateChildrenMappings(e);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const e of this.markedAttributes)this._updateAttrs(e);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),n=e.parent.ownerDocument;this._inlineFiller=Pi(e.parent)?e.parent:Fi(n,e.parent,e.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=this.domConverter.mapViewToDom(t).childNodes,i=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(n,i),r=this._findReplaceActions(o,n,i);if(-1!==r.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const o of r)if("replace"===o){const o=e.equal+e.insert,r=e.equal+e.delete,s=t.getChild(o);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,n[r]),Vi(i[o]),e.equal++}else e[o]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?zn._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Ci(e.parent)&&Pi(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!Pi(t))throw new me.a("view-renderer-filler-was-lost",this);Mi(t)?t.parentNode.removeChild(t):t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,n=t.offset;return!(!this.domConverter.mapViewToDom(e.root)||!e.is("element")||!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e)||n===e.getFillerOffset()||t.nodeBefore instanceof Le||t.nodeAfter instanceof Le)}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t),i=this.domConverter.viewToDom(t,n.ownerDocument),o=n.data;let r=i.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=Ei+r),o!=r){const t=Oi(o,r);for(const e of t)"insert"===e.type?n.insertData(e.index,e.values.join("")):n.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.attributes).map(t=>t.name),i=t.getAttributeKeys();for(const o of i)e.setAttribute(o,t.getAttribute(o));for(const o of n)t.hasAttribute(o)||e.removeAttribute(o)}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n)return;const i=e.inlineFillerPosition,o=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,n.ownerDocument,{bind:!0,inlineFillerPosition:i}));i&&i.parent===t&&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(t,e){return Li(t=function(t,e){const n=Array.from(t);return 0!=n.length&&e?(n[n.length-1]==e&&n.pop(),n):n}(t,this._fakeSelectionContainer),e,Ui.bind(null,this.domConverter))}_findReplaceActions(t,e,n){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let i=[],o=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?r.push(n[s.equal+s.insert]):"delete"===a?o.push(e[s.equal+s.delete]):(i=i.concat(Li(o,r,Hi).map(t=>"equal"===t?"replace":t)),i.push("equal"),o=[],r=[]),s[a]++;return i.concat(Li(o,r,Hi).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent="\xa0",e}(e));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(t))return;n.parentElement&&n.parentElement==t||t.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||"\xa0";const i=e.getSelection(),o=e.createRange();i.removeAllRanges(),o.selectNodeContents(n),i.addRange(o)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(n.parent,n.offset),e.extend(i.parent,i.offset),Jn&&function(t,e){const n=t.parent;if(n.nodeType!=Node.ELEMENT_NODE||t.offset!=n.childNodes.length-1)return;const i=n.childNodes[t.offset];i&&"BR"==i.tagName&&e.addRange(e.getRangeAt(0))}(i,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return!(e&&this.selection.isEqual(e)||!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,n=t.ownerDocument.getSelection();return!e||e.parentElement!==t||n.anchorNode!==e&&!e.contains(n.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const t of this.domDocuments)if(t.getSelection().rangeCount){const e=t.activeElement,n=this.domConverter.mapDomToView(e);e&&n&&t.getSelection().removeAllRanges()}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function Fi(t,e,n){const i=e instanceof Array?e:e.childNodes,o=i[n];if(Ci(o))return o.data=Ei+o.data,o;{const o=t.createTextNode(Ei);return Array.isArray(e)?i.splice(n,0,o):zi(e,n,o),o}}function Hi(t,e){return ji(t)&&ji(e)&&!Ci(t)&&!Ci(e)&&t.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function Ui(t,e,n){return e===n||(Ci(e)&&Ci(n)?e.data===n.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(n)))}Ce(Bi,Sn);var qi={window:window,document:document};function Wi(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function $i(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}const Yi=Si(document);class Gi{constructor(t,e={}){this.document=t,this.blockFillerMode=e.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 je,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new Fn(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of t.childNodes)this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,n={}){if(t.is("$text")){const n=this._processDataFromViewText(t);return e.createTextNode(n)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let i;if(t.is("documentFragment"))i=e.createDocumentFragment(),n.bind&&this.bindDocumentFragments(i,t);else{if(t.is("uiElement"))return i=t.render(e),n.bind&&this.bindElements(i,t),i;i=t.hasAttribute("xmlns")?e.createElementNS(t.getAttribute("xmlns"),t.name):e.createElement(t.name),t.is("rawElement")&&t.render(i),n.bind&&this.bindElements(i,t);for(const e of t.getAttributeKeys())i.setAttribute(e,t.getAttribute(e))}if(!1!==n.withChildren)for(const o of this.viewChildrenToDom(t,e,n))i.appendChild(o);return i}}*viewChildrenToDom(t,e,n={}){const i=t.getFillerOffset&&t.getFillerOffset();let o=0;for(const r of t.getChildren())i===o&&(yield this._blockFiller(e)),yield this.viewToDom(r,e,n),o++;i===o&&(yield this._blockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),i=document.createRange();return i.setStart(e.parent,e.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const n=this.findCorrespondingDomText(e);if(!n)return null;let i=t.offset;return Pi(n)&&(i+=7),{parent:n,offset:i}}{let n,i,o;if(0===t.offset){if(n=this.mapViewToDom(e),!n)return null;o=n.childNodes[0]}else{const e=t.nodeBefore;if(i=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore),!i)return null;n=i.parentNode,o=i.nextSibling}return Ci(o)&&Pi(o)?{parent:o,offset:7}:{parent:n,offset:i?Wi(i)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t,this.blockFillerMode))return null;const n=this.getHostViewElement(t);if(n)return n;if(Ci(t)){if(Mi(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new Le(this.document,e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let n;if(this.isDocumentFragment(t))n=new mi(this.document),e.bind&&this.bindDocumentFragments(t,n);else{const i=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();n=new wn(this.document,i),e.bind&&this.bindElements(t,n);const o=t.attributes;for(let t=o.length-1;t>=0;t--)n._setAttribute(o[t].name,o[t].value);if(!1!==e.withChildren&&this._rawContentElementMatcher.match(n))return n._setCustomProperty("$rawContent",t.innerHTML),this._encounteredRawContentDomNodes.add(t),n}if(!1!==e.withChildren)for(const i of this.domChildrenToView(t,e))n._appendChild(i);return n}}*domChildrenToView(t,e={}){for(let n=0;n{const{scrollLeft:e,scrollTop:n}=t;i.push([e,n])}),e.focus(),Qi(e,t=>{const[e,n]=i.shift();t.scrollLeft=e,t.scrollTop=n}),qi.window.scrollTo(t,n)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(Yi):!("BR"!==t.tagName||!Ji(t,this.blockElements)||1!==t.parentNode.childNodes.length)||function(t,e){return Ci(t)&&"\xa0"==t.data&&Ji(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const n=e.collapsed;return e.detach(),n}getHostViewElement(t){const e=$i(t);for(e.pop();e.length;){const t=e.pop(),n=this._domToViewMapping.get(t);if(n&&(n.is("uiElement")||n.is("rawElement")))return n}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_isDomSelectionPositionCorrect(t,e){if(Ci(t)&&Pi(t)&&e<7)return!1;if(this.isElement(t)&&Pi(t.childNodes[e]))return!1;const n=this.mapDomToView(t);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const n=this._getTouchingViewTextNode(t,!1);(!n||!this._nodeEndsWithSpace(n))&&n||(e="\xa0"+e.substr(1))}if(" "==e.charAt(e.length-1)){const n=this._getTouchingViewTextNode(t,!0);" "!=e.charAt(e.length-2)&&n&&" "!=n.data.charAt(0)||(e=e.substr(0,e.length-1)+"\xa0")}return e.replace(/ {2}/g," \xa0")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(Ki(t,this.preElements))return Ii(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(t,!1),i=this._getTouchingInlineDomNode(t,!0),o=this._checkShouldLeftTrimDomText(t,n),r=this._checkShouldRightTrimDomText(t,i);return o&&(e=e.replace(/^ /,"")),r&&(e=e.replace(/ $/,"")),e=Ii(new Text(e)),e=e.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(e)||!i||i.data&&" "==i.data.charAt(0))&&(e=e.replace(/\u00A0$/," ")),o&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t,e){return!e||!!se(e)||!this._encounteredRawContentDomNodes.has(t.previousSibling)&&/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(t,e){return!e&&!Pi(t)}_getTouchingViewTextNode(t,e){const n=new Ln({startPosition:e?zn._createAfter(t):zn._createBefore(t),direction:e?"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(t,e){if(!t.parentNode)return null;const n=e?"nextNode":"previousNode",i=t.ownerDocument,o=$i(t)[0],r=i.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>Ci(t)||"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=t;const s=r[n]();if(null!==s){const e=function(t,e){const n=$i(t),i=$i(e);let o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1]}(t,s);if(e&&!Ki(t,this.blockElements,e)&&!Ki(s,this.blockElements,e))return s}return null}}function Ki(t,e,n){let i=$i(t);return n&&(i=i.slice(i.indexOf(n)+1)),i.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function Qi(t,e){for(;t&&t!=qi.document;)e(t),t=t.parentNode}function Ji(t,e){const n=t.parentNode;return n&&n.tagName&&e.includes(n.tagName.toLowerCase())}function Zi(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}var Xi=yn({},be,{listenTo(t,...e){if(ji(t)||Zi(t)){const n=this._getProxyEmitter(t)||new to(t);n.attach(...e),t=n}be.listenTo.call(this,t,...e)},stopListening(t,e,n){if(ji(t)||Zi(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}be.stopListening.call(this,t,e,n),t instanceof to&&t.detach(e)},_getProxyEmitter(t){return e=this,n=eo(t),e[ge]&&e[ge][n]?e[ge][n].emitter:null;var e,n}});class to{constructor(t){we(this,eo(t)),this._domNode=t}}function eo(t){return t["data-ck-expando"]||(t["data-ck-expando"]=he())}yn(to.prototype,be,{attach(t,e,n={}){if(this._domListeners&&this._domListeners[t])return;const i={capture:!!n.useCapture,passive:!!n.usePassive},o=this._createDomListener(t,i);this._domNode.addEventListener(t,o,i),this._domListeners||(this._domListeners={}),this._domListeners[t]=o},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const n=e=>{this.fire(t,e)};return n.removeListener=()=>{this._domNode.removeEventListener(t,n,e),delete this._domListeners[t]},n}});class no{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&3===t.nodeType&&(t=t.parentNode),!(!t||1!==t.nodeType)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}function io(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new H;++ea))return!1;var c=r.get(t);if(c&&r.get(e))return c==e;var d=-1,u=!0,h=2&n?new oo:void 0;for(r.set(t,e),r.set(e,t);++d{this.listenTo(t,e,(t,e)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,n){this.isEnabled&&this.document.fire(t,new wo(this.view,e,n))}}class _o extends ko{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey||t.metaKey,shiftKey:t.shiftKey,get keystroke(){return ii(this)}})}}var vo=function(){return i.a.Date.now()},yo=/^\s+|\s+$/g,xo=/^[-+]0x[0-9a-f]+$/i,Ao=/^0b[01]+$/i,Co=/^0o[0-7]+$/i,To=parseInt,So=function(t){if("number"==typeof t)return t;if(Fe(t))return NaN;if(C(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=C(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(yo,"");var n=Ao.test(t);return n||Co.test(t)?To(t.slice(2),n?2:8):xo.test(t)?NaN:+t},Eo=Math.max,Po=Math.min,Mo=function(t,e,n){var i,o,r,s,a,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=i,r=o;return i=o=void 0,c=e,s=t.apply(r,n)}function m(t){return c=t,a=setTimeout(p,e),d?f(t):s}function g(t){var n=t-l;return void 0===l||n>=e||n<0||u&&t-c>=r}function p(){var t=vo();if(g(t))return b(t);a=setTimeout(p,function(t){var n=e-(t-l);return u?Po(n,r-(t-c)):n}(t))}function b(t){return a=void 0,h&&i?f(t):(i=o=void 0,s)}function w(){var t=vo(),n=g(t);if(i=arguments,o=this,l=t,n){if(void 0===a)return m(l);if(u)return clearTimeout(a),a=setTimeout(p,e),f(l)}return void 0===a&&(a=setTimeout(p,e)),s}return e=So(e)||0,C(n)&&(d=!!n.leading,r=(u="maxWait"in n)?Eo(So(n.maxWait)||0,e):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(t){super(t),this._fireSelectionChangeDoneDebounced=Mo(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("keydown",(e,n)=>{t.selection.isFake&&si(n.keyCode)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,n=new Fn(e.getRanges(),{backward:e.isBackward,fake:!1});t!=ni.arrowleft&&t!=ni.arrowup||n.setTo(n.getFirstPosition()),t!=ni.arrowright&&t!=ni.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}class No extends no{constructor(t){super(t),this.mutationObserver=t.getObserver(bo),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Mo(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",(t,n)=>{this._handleSelectionChange(n,e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled)return;const n=e.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 t={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Oo extends ko{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.forceRender(),50)}),e.on("blur",(n,i)=>{const o=e.selection.editableElement;null!==o&&o!==i.target||(e.isFocused=!1,t.forceRender())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Ro extends ko{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}class Do extends ko{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}function Lo(t){return"[object Range]"==Object.prototype.toString.apply(t)}function zo(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const Vo=["top","right","bottom","left","width","height"];class jo{constructor(t){const e=Lo(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),se(t)||e)if(e){const e=jo.getDomRangeRects(t);Bo(this,jo.getBoundingRect(e))}else Bo(this,t.getBoundingClientRect());else if(Zi(t)){const{innerWidth:e,innerHeight:n}=t;Bo(this,{top:0,right:e,bottom:n,left:0,width:e,height:n})}else Bo(this,t)}clone(){return new jo(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new jo(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!Fo(t)){let n=t.parentNode||t.commonAncestorContainer;for(;n&&!Fo(n);){const t=new jo(n),i=e.getIntersection(t);if(!i)return null;i.getArea()Jo(t,i));const s=Jo(t,i);if(Uo(i,s,e),i.parent!=i){if(o=i.frameElement,i=i.parent,!o)return}else i=null}}function Uo(t,e,n){const i=e.clone().moveBy(0,n),o=e.clone().moveBy(0,-n),r=new jo(t).excludeScrollbarsAndBorders();if(![o,i].every(t=>r.contains(t))){let{scrollX:s,scrollY:a}=t;$o(o,r)?a-=r.top-e.top+n:Wo(i,r)&&(a+=e.bottom-r.bottom+n),Yo(e,r)?s-=r.left-e.left+n:Go(e,r)&&(s+=e.right-r.right+n),t.scrollTo(s,a)}}function qo(t,e){const n=Ko(t);let i,o;for(;t!=n.document.body;)o=e(),i=new jo(t).excludeScrollbarsAndBorders(),i.contains(o)||($o(o,i)?t.scrollTop-=i.top-o.top:Wo(o,i)&&(t.scrollTop+=o.bottom-i.bottom),Yo(o,i)?t.scrollLeft-=i.left-o.left:Go(o,i)&&(t.scrollLeft+=o.right-i.right)),t=t.parentNode}function Wo(t,e){return t.bottom>e.bottom}function $o(t,e){return t.tope.right}function Ko(t){return Lo(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function Qo(t){if(Lo(t)){let e=t.commonAncestorContainer;return Ci(e)&&(e=e.parentNode),e}return t.parentNode}function Jo(t,e){const n=Ko(t),i=new jo(t);if(n===e)return i;{let t=n;for(;t!=e;){const e=new jo(t.frameElement).excludeScrollbarsAndBorders();i.moveBy(e.left,e.top),t=t.parent}}return i}Object.assign({},{scrollViewportToShowTarget:Ho,scrollAncestorsToShowTarget:function(t){qo(Qo(t),()=>new jo(t))}});class Zo{constructor(t){this.document=new Un(t),this.domConverter=new Gi(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(Do),this.document.on("keydown",Ni),function(t){t.document.on("keydown",(e,n)=>function(t,e,n){if(e.keyCode==ni.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),i=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(i||e.shiftKey){const e=n.domPositionToView(t.focusNode,t.focusOffset);if(null===e)return;let o=!1;const r=e.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(o=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(o){const e=n.viewPositionToDom(r);i?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}}(0,n,t.domConverter))}(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase();const i={};for(const{name:r,value:s}of Array.from(t.attributes))i[r]=s,"class"===r?this._writer.addClass(s.split(" "),n):this._writer.setAttribute(r,s,n);this._initialDomRootAttributes.set(t,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(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(t.ownerDocument),n.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),n.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),n.on("change:text",(t,e)=>this._renderer.markToSync("text",e)),n.on("change:isReadOnly",()=>this.change(o)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const r of this._observers.values())r.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:t})=>e.removeAttribute(t));const n=this._initialDomRootAttributes.get(e);for(const i in n)e.setAttribute(i,n[i]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[n,i]of this.domRoots)e.observe(i,n);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&Ho({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new me.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){me.a.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return zn._createAt(t,e)}createPositionAfter(t){return zn._createAfter(t)}createPositionBefore(t){return zn._createBefore(t)}createRange(t,e){return new Vn(t,e)}createRangeOn(t){return Vn._createOn(t)}createRangeIn(t){return Vn._createIn(t)}createSelection(t,e,n){return new Fn(t,e,n)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}Ce(Zo,Sn);class Xo{constructor(t){this.parent=null,this._attrs=Ve(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new me.a("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new me.a("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),i=t.getAncestors(e);let o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),i=Oe(e,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return e[i](t[e[0]]=e[1],t),{})),t}is(t){return"node"===t||"model:node"===t}_clone(){return new Xo(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Ve(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class tr extends Xo{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"$text"===t||"model:$text"===t||"text"===t||"model:text"===t||"node"===t||"model:node"===t}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new tr(this.data,this.getAttributes())}static fromJSON(t){return new tr(t.data,t.attributes)}}class er{constructor(t,e,n){if(this.textNode=t,e<0||e>t.offsetSize)throw new me.a("model-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.offsetSize)throw new me.a("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}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(t){return"$textProxy"===t||"model:$textProxy"===t||"textProxy"===t||"model:textProxy"===t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class nr{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new me.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&tt.toJSON())}}class ir extends Xo{constructor(t,e,n){super(e),this.name=t,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(t,e=null){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||"node"===t||"model:node"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}findAncestor(t,e={includeSelf:!1}){let n=e.includeSelf?this:this.parent;for(;n;){if(n.name===t)return n;n=n.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new ir(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){return"string"==typeof t?[new tr(t)]:(Ae(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new tr(t):t instanceof er?new tr(t.data,t.getAttributes()):t))}(e);for(const i of n)null!==i.parent&&i._remove(),i.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const i of n)i.parent=null;return n}static fromJSON(t){let e=null;if(t.children){e=[];for(const n of t.children)e.push(n.name?ir.fromJSON(n):tr.fromJSON(n))}return new ir(t.name,t.attributes,e)}}class or{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new me.a("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new me.a("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,this.position=t.startPosition?t.startPosition.clone():sr._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.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(t){let e,n,i,o;do{i=this.position,o=this._visitedParent,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=i,this._visitedParent=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),n=this._visitedParent;if(null===n.parent&&e.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const i=e.parent,o=ar(e,i),r=o||lr(e,i,o);if(r instanceof ir)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,rr("elementStart",r,t,e,1);if(r instanceof tr){let i;if(this.singleCharacters)i=1;else{let t=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsett&&(t=this.boundaries.start.offset),i=e.offset-t}const o=new er(r,e.offset-r.startOffset-i,i);return e.offset-=i,this.position=e,rr("text",o,t,e,i)}return e.path.pop(),this.position=e,this._visitedParent=n.parent,rr("elementStart",n,t,e,1)}}function rr(t,e,n,i,o){return{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:o}}}class sr{constructor(t,e,n="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new me.a("model-position-root-invalid",t);if(!(e instanceof Array)||0===e.length)throw new me.a("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;en.path.length){if(e.offset!==i.maxOffset)return!1;e.path=e.path.slice(0,-1),i=i.parent,e.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}is(t){return"position"===t||"model:position"===t}hasSameParentAs(t){return this.root===t.root&&"same"==Oe(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=sr._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let n;return e.containsPosition(this)||e.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?sr._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,e){const n=sr._createAt(this);if(this.root!=t.root)return n;if("same"==Oe(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;n.offset-=e}}else if("prefix"==Oe(t.getParentPath(),this.getParentPath())){const i=t.path.length-1;if(t.offset<=this.path[i]){if(t.offset+e>this.path[i])return null;n.path[i]-=e}}return n}_getTransformedByInsertion(t,e){const n=sr._createAt(this);if(this.root!=t.root)return n;if("same"==Oe(t.getParentPath(),this.getParentPath()))(t.offsete+1;){const e=i.maxOffset-n.offset;0!==e&&t.push(new dr(n,n.getShiftedBy(e))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const e=this.end.path[n.path.length-1],i=e-n.offset;0!==i&&t.push(new dr(n,n.getShiftedBy(i))),n.offset=e,n.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new or(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new or(t);for(const n of e)yield n.item}*getPositions(t={}){t.boundaries=this;const e=new or(t);yield e.position;for(const n of e)yield n.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new dr(this.start,this.end)]}getTransformedByOperations(t){const e=[new dr(this.start,this.end)];for(const n of t)for(let t=0;t0?new this(n,i):new this(i,n)}static _createIn(t){return new this(sr._createAt(t,0),sr._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(sr._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new me.a("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const n=t.indexOf(e),i=new this(e.start,e.end);if(n>0)for(let o=n-1;t[o].end.isEqual(i.start);o++)i.start=sr._createAt(t[o].start);for(let o=n+1;o{if(e.viewPosition)return;const n=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this.findPositionIn(n,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const n=this.findMappedViewAncestor(e.viewPosition),i=this._viewToModelMapping.get(n),o=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=sr._createAt(i,o)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const n of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(n);this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t);const i=this._elementToMarkerNames.get(t)||new Set;i.add(e),this._markerNameToElements.set(e,n),this._elementToMarkerNames.set(t,i)}unbindElementFromMarkerName(t,e){const n=this._markerNameToElements.get(e);n&&(n.delete(t),0==n.size&&this._markerNameToElements.delete(e));const i=this._elementToMarkerNames.get(t);i&&(i.delete(e),0==i.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new dr(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new Vn(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const n=new Set;for(const i of e)if(i.is("attributeElement"))for(const t of i.getElementsWithSameId())n.add(t);else n.add(i);return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,n){if(n!=t)return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t);if(t.is("$text"))return e;let i=0;for(let o=0;o1?e[0]+":"+e[1]:e[0]}class mr{constructor(t){this.conversionApi=Object.assign({dispatcher:this},t),this._reconversionEventsMapping=new Map}convertChanges(t,e,n){for(const o of t.getMarkersToRemove())this.convertMarkerRemove(o.name,o.range,n);const i=this._mapChangesWithAutomaticReconversion(t);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 t=e.get(o).getRange();this.convertMarkerRemove(o,t,n),this.convertMarkerAdd(o,t,n)}for(const o of t.getMarkersToAdd())this.convertMarkerAdd(o.name,o.range,n)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const n of Array.from(t).map(pr))this._convertInsertWithAttributes(n);this._clearConversionApi()}convertRemove(t,e,n,i){this.conversionApi.writer=i,this.fire("remove:"+n,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,n,i,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(t,"attribute:"+e);for(const r of t){const t={item:r.item,range:dr._createFromPositionAndShift(r.previousPosition,r.length),attributeKey:e,attributeOldValue:n,attributeNewValue:i};this._testAndFire("attribute:"+e,t)}this._clearConversionApi()}reconvertElement(t,e){const n=dr._createOn(t);this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(n);const i=this.conversionApi.mapper,o=i.toViewElement(t);e.remove(o),this._convertInsertWithAttributes({item:t,range:n});const r=i.toViewElement(t);for(const s of dr._createIn(t)){const{item:t}=s,n=br(t,i);n?n.root!==r.root&&e.move(e.createRangeOn(n),i.toViewPosition(sr._createBefore(t))):this._convertInsertWithAttributes(pr(s))}i.unbindViewElement(o),this._clearConversionApi()}convertSelection(t,e,n){const i=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(t,i),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of i){const n=e.getRange();if(!gr(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const i={item:t,markerName:e.name,markerRange:n};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,i,this.conversionApi)}for(const e of t.getAttributeKeys()){const n={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,n){if(!e.root.document||"$graveyard"==e.root.rootName)return;this.conversionApi.writer=n;const i="addMarker:"+t,o=new hr;if(o.add(e,i),this.conversionApi.consumable=o,this.fire(i,{markerName:t,markerRange:e},this.conversionApi),o.test(e,i)){this.conversionApi.consumable=this._createConsumableForRange(e,i);for(const n of e.getItems()){if(!this.conversionApi.consumable.test(n,i))continue;const o={item:n,range:dr._createOn(n),markerName:t,markerRange:e};this.fire(i,o,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(t,e,n){e.root.document&&"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(t,e){this._reconversionEventsMapping.set(e,t)}_createInsertConsumable(t){const e=new hr;for(const n of t){const t=n.item;e.add(t,"insert");for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n)}return e}_createConsumableForRange(t,e){const n=new hr;for(const i of t.getItems())n.add(i,e);return n}_createSelectionConsumable(t,e){const n=new hr;n.add(t,"selection");for(const i of e)n.add(t,"addMarker:"+i.name);for(const i of t.getAttributeKeys())n.add(t,"attribute:"+i);return n}_testAndFire(t,e){this.conversionApi.consumable.test(e.item,t)&&this.fire(function(t,e){return`${t}:${e.item.name||"$text"}`}(t,e),e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(t){this._testAndFire("insert",t);for(const e of t.item.getAttributeKeys())t.attributeKey=e,t.attributeOldValue=null,t.attributeNewValue=t.item.getAttribute(e),this._testAndFire("attribute:"+e,t)}_mapChangesWithAutomaticReconversion(t){const e=new Set,n=[];for(const i of t.getChanges()){const t=i.position||i.range.start,o=t.parent;if(ar(t,o)){n.push(i);continue}const r="attribute"===i.type?lr(t,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(e.has(r))continue;e.add(r),n.push({type:"reconvert",element:r})}else n.push(i)}return n}_isReconvertTriggerEvent(t,e){return this._reconversionEventsMapping.get(t)===e}}function gr(t,e,n){const i=e.getRange(),o=Array.from(t.getAncestors());return o.shift(),o.reverse(),!o.some(t=>{if(i.containsItem(t))return!!n.toViewElement(t).getCustomProperty("addHighlight")})}function pr(t){return{item:t.item,range:dr._createFromPositionAndShift(t.previousPosition,t.length)}}function br(t,e){if(t.is("textProxy")){const n=e.toViewPosition(sr._createBefore(t)).parent;return n.is("$text")?n:null}return e.toViewElement(t)}Ce(mr,be);class wr{constructor(t,e,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,n)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.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(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new dr(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new dr(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new dr(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,n){if(null===t)this._setRanges([]);else if(t instanceof wr)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof dr)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof sr)this._setRanges([new dr(t)]);else if(t instanceof Xo){const i=!!n&&!!n.backward;let o;if("in"==e)o=dr._createIn(t);else if("on"==e)o=dr._createOn(t);else{if(void 0===e)throw new me.a("model-selection-setto-required-second-parameter",[this,t]);o=new dr(sr._createAt(t,e))}this._setRanges([o],i)}else{if(!Ae(t))throw new me.a("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const n=(t=Array.from(t)).some(e=>{if(!(e instanceof dr))throw new me.a("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(t=>!t.isEqual(e))});if(t.length!==this._ranges.length||n){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new me.a("model-selection-setfocus-no-ranges",[this,t]);const n=sr._createAt(t,e);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(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(t){return"selection"===t||"model:selection"===t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=vr(e.start,t);n&&yr(n,e)&&(yield n);for(const o of e.getWalker()){const n=o.item;"elementEnd"==o.type&&_r(n,t,e)&&(yield n)}const i=vr(e.end,t);i&&!e.end.isTouching(sr._createAt(i,0))&&yr(i,e)&&(yield i)}}containsEntireContent(t=this.anchor.root){const e=sr._createAt(t,0),n=sr._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new dr(t.start,t.end))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function kr(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&t.parent)}function _r(t,e,n){return kr(t,e)&&yr(t,n)}function vr(t,e){const n=t.parent.root.document.model.schema,i=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=i.find(t=>!o&&(o=n.isLimit(t),!o&&kr(t,e)));return i.forEach(t=>e.add(t)),r}function yr(t,e){const n=function(t){const e=t.root.document.model.schema;let n=t.parent;for(;n;){if(e.isBlock(n))return n;n=n.parent}}(t);return!n||!e.containsRange(dr._createOn(n),!0)}Ce(wr,be);class xr extends dr{constructor(t,e){super(t,e),Ar.call(this)}detach(){this.stopListening()}is(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t}toRange(){return new dr(this.start,this.end)}static fromRange(t){return new xr(t.start,t.end)}}function Ar(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&Cr.call(this,n)},{priority:"low"})}function Cr(t){const e=this.getTransformedByOperation(t),n=dr._createFromRanges(e),i=!n.isEqual(this),o=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let r=null;if(i){"$graveyard"==n.root.rootName&&(r="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",e,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}Ce(xr,be);class Tr{constructor(t){this._selection=new Sr(t),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(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}is(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return"selection:"+t}static _isStoreAttributeKey(t){return t.startsWith("selection:")}}Ce(Tr,be);class Sr extends wr{constructor(t){super(),this.markers=new Te({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,e)=>{const n=e[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 t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new me.a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,e,n,i)=>{this._updateMarker(e,i)}),this.listenTo(this._document,"change",(t,e)=>{!function(t,e){const n=t.document.differ;for(const i of n.getChanges()){if("insert"!=i.type)continue;const n=i.position.parent;i.length===n.maxOffset&&t.enqueueChange(e,t=>{const e=Array.from(n.getAttributeKeys()).filter(t=>t.startsWith("selection:"));for(const i of e)t.removeAttribute(i,n)})}}(this._model,e)})}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 t=0;t{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1),e.detach()}}),e}_updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const i of this._model.markers){const e=i.name.split(":",1)[0];if(!this._observedMarkers.has(e))continue;const n=i.getRange();for(const o of this.getRanges())n.containsRange(o,!o.isCollapsed)&&t.push(i)}const n=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(t,e){const n=t.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const o=Array.from(this.markers),r=this.markers.has(t);if(e){let n=!1;for(const t of this.getRanges())if(e.containsRange(t,!t.isCollapsed)){n=!0;break}n&&!r?(this.markers.add(t),i=!0):!n&&r&&(this.markers.remove(t),i=!0)}else r&&(this.markers.remove(t),i=!0);i&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(t){const e=Ve(this._getSurroundingAttributes()),n=Ve(this.getAttributes());if(t)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(e);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(t,e,n=!0){const i=n?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,i),!0)}_removeAttribute(t,e=!0){const n=e?"normal":"low";return!("low"==n&&"normal"==this._attributePriority.get(t)||(this._attributePriority.set(t,n),!super.hasAttribute(t)||(this._attrs.delete(t),0)))}_setAttributesTo(t){const e=new Set;for(const[n,i]of this.getAttributes())t.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of t)this._setAttribute(n,i,!1)&&e.add(n);return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith("selection:")){const n=e.substr("selection:".length);yield[n,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let n=null;if(this.isCollapsed){const i=t.textNode?t.textNode:t.nodeBefore,o=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=Er(i)),n||(n=Er(o)),!this.isGravityOverridden&&!n){let t=i;for(;t&&!e.isInline(t)&&!n;)t=t.previousSibling,n=Er(t)}if(!n){let t=o;for(;t&&!e.isInline(t)&&!n;)t=t.nextSibling,n=Er(t)}n||(n=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const i of t){if(i.item.is("element")&&e.isObject(i.item))break;if("text"==i.type){n=i.item.getAttributes();break}}}return n}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function Er(t){return t instanceof er||t instanceof tr?t.getAttributes():null}class Pr{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}var Mr=function(t){return oe(t,5)};class Ir extends Pr{elementToElement(t){return this.add(function(t){return(t=Mr(t)).view=Rr(t.view,"container"),e=>{var n;if(e.on("insert:"+t.model,(n=t.view,(t,e,i)=>{const o=n(e.item,i);if(!o)return;if(!i.consumable.consume(e.item,"insert"))return;const r=i.mapper.toViewPosition(e.range.start);i.mapper.bindElements(e.item,o),i.writer.insert(r,o)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const n of t.triggerBy.attributes)e._mapReconversionTriggerEvent(t.model,`attribute:${n}:${t.model}`);if(t.triggerBy.children)for(const n of t.triggerBy.children)e._mapReconversionTriggerEvent(t.model,"insert:"+n),e._mapReconversionTriggerEvent(t.model,"remove:"+n)}}}(t))}attributeToElement(t){return this.add(function(t){let e="attribute:"+((t=Mr(t)).model.key?t.model.key:t.model);if(t.model.name&&(e+=":"+t.model.name),t.model.values)for(const i of t.model.values)t.view[i]=Rr(t.view[i],"attribute");else t.view=Rr(t.view,"attribute");const n=Dr(t);return i=>{i.on(e,function(t){return(e,n,i)=>{const o=t(n.attributeOldValue,i),r=t(n.attributeNewValue,i);if(!o&&!r)return;if(!i.consumable.consume(n.item,e.name))return;const s=i.writer;if(n.item instanceof wr||n.item instanceof Tr)s.wrap(s.document.selection.getFirstRange(),r);else{let t=i.mapper.toViewRange(n.range);null!==n.attributeOldValue&&o&&(t=s.unwrap(t,o)),null!==n.attributeNewValue&&r&&s.wrap(t,r)}}}(n),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){let e="attribute:"+((t=Mr(t)).model.key?t.model.key:t.model);if(t.model.name&&(e+=":"+t.model.name),t.model.values)for(const i of t.model.values)t.view[i]=Lr(t.view[i]);else t.view=Lr(t.view);const n=Dr(t);return i=>{var o;i.on(e,(o=n,(t,e,n)=>{const i=o(e.attributeOldValue,n),r=o(e.attributeNewValue,n);if(!i&&!r)return;if(!n.consumable.consume(e.item,t.name))return;const s=n.mapper.toViewElement(e.item),a=n.writer;if(!s)throw new me.a("conversion-attribute-to-attribute-on-text",[e,n]);if(null!==e.attributeOldValue&&i)if("class"==i.key){const t=Ee(i.value);for(const e of t)a.removeClass(e,s)}else if("style"==i.key){const t=Object.keys(i.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(i.key,s);if(null!==e.attributeNewValue&&r)if("class"==r.key){const t=Ee(r.value);for(const e of t)a.addClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.setStyle(e,r.value[e],s)}else a.setAttribute(r.key,r.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=Mr(t)).view=Rr(t.view,"ui"),e=>{var n;e.on("addMarker:"+t.model,(n=t.view,(t,e,i)=>{e.isOpening=!0;const o=n(e,i);e.isOpening=!1;const r=n(e,i);if(!o||!r)return;const s=e.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,t.name))return;for(const n of s)if(!i.consumable.consume(n.item,t.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(s.start),o),i.mapper.bindElementToMarker(o,e.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),i.mapper.bindElementToMarker(r,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t,e,n)=>{const i=n.mapper.markerNameToElements(e.markerName);if(i){for(const t of i)n.mapper.unbindElementFromMarkerName(t,e.markerName),n.writer.clear(n.writer.createRangeOn(t),t);n.writer.clearClonedElementsGroup(e.markerName),t.stop()}},{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var n;e.on("addMarker:"+t.model,(n=t.view,(t,e,i)=>{if(!e.item)return;if(!(e.item instanceof wr||e.item instanceof Tr||e.item.is("$textProxy")))return;const o=zr(n,e,i);if(!o)return;if(!i.consumable.consume(e.item,t.name))return;const r=i.writer,s=Nr(r,o),a=r.document.selection;if(e.item instanceof wr||e.item instanceof Tr)r.wrap(a.getFirstRange(),s,a);else{const t=i.mapper.toViewRange(e.range),n=r.wrap(t,s);for(const o of n.getItems())if(o.is("attributeElement")&&o.isSimilar(s)){i.mapper.bindElementToMarker(o,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,n,i)=>{if(!n.item)return;if(!(n.item instanceof ir))return;const o=zr(t,n,i);if(!o)return;if(!i.consumable.test(n.item,e.name))return;const r=i.mapper.toViewElement(n.item);if(r&&r.getCustomProperty("addHighlight")){i.consumable.consume(n.item,e.name);for(const t of dr._createIn(n.item))i.consumable.consume(t.item,e.name);r.getCustomProperty("addHighlight")(r,o,i.writer),i.mapper.bindElementToMarker(r,n.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,n,i)=>{if(n.markerRange.isCollapsed)return;const o=zr(t,n,i);if(!o)return;const r=Nr(i.writer,o),s=i.mapper.markerNameToElements(n.markerName);if(s){for(const t of s)i.mapper.unbindElementFromMarkerName(t,n.markerName),t.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(t),r):t.getCustomProperty("removeHighlight")(t,o.id,i.writer);i.writer.clearClonedElementsGroup(n.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(t){const e=(t=Mr(t)).model;return t.view||(t.view=n=>({group:e,name:n.substr(t.model.length+1)})),n=>{var i;n.on("addMarker:"+e,(i=t.view,(t,e,n)=>{const o=i(e.markerName,n);if(!o)return;const r=e.markerRange;n.consumable.consume(r,t.name)&&(Or(r,!1,n,e,o),Or(r,!0,n,e,o),t.stop())}),{priority:t.converterPriority||"normal"}),n.on("removeMarker:"+e,function(t){return(e,n,i)=>{const o=t(n.markerName,i);if(!o)return;const r=i.mapper.markerNameToElements(n.markerName);if(r){for(const t of r)i.mapper.unbindElementFromMarkerName(t,n.markerName),t.is("containerElement")?(s(`data-${o.group}-start-before`,t),s(`data-${o.group}-start-after`,t),s(`data-${o.group}-end-before`,t),s(`data-${o.group}-end-after`,t)):i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(n.markerName),e.stop()}function s(t,e){if(e.hasAttribute(t)){const n=new Set(e.getAttribute(t).split(","));n.delete(o.name),0==n.size?i.writer.removeAttribute(t,e):i.writer.setAttribute(t,Array.from(n).join(","),e)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function Nr(t,e){const n=t.createAttributeElement("span",e.attributes);return e.classes&&n._addClass(e.classes),e.priority&&(n._priority=e.priority),n._id=e.id,n}function Or(t,e,n,i,o){const r=e?t.start:t.end;if(n.schema.checkChild(r,"$text"))!function(t,e,n,i,o){const r=n.writer.createUIElement(`${o.group}-${e?"start":"end"}`,o.name?{name:o.name}:null);n.writer.insert(t,r),n.mapper.bindElementToMarker(r,i.markerName)}(n.mapper.toViewPosition(r),e,n,i,o);else{let t,s;e&&r.nodeAfter||!e&&!r.nodeBefore?(t=r.nodeAfter,s=!0):(t=r.nodeBefore,s=!1),function(t,e,n,i,o,r){const s=`data-${r.group}-${e?"start":"end"}-${n?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(r.name),i.writer.setAttribute(s,a.join(","),t),i.mapper.bindElementToMarker(t,o.markerName)}(n.mapper.toViewElement(t),e,s,n,i,o)}}function Rr(t,e){return"function"==typeof t?t:(n,i)=>function(t,e,n){let i;"string"==typeof t&&(t={name:t});const o=e.writer,r=Object.assign({},t.attributes);if(i="container"==n?o.createContainerElement(t.name,r):"attribute"==n?o.createAttributeElement(t.name,r,{priority:t.priority||qn.DEFAULT_PRIORITY}):o.createUIElement(t.name,r),t.styles){const e=Object.keys(t.styles);for(const n of e)o.setStyle(n,t.styles[n],i)}if(t.classes){const e=t.classes;if("string"==typeof e)o.addClass(e,i);else for(const t of e)o.addClass(t,i)}return i}(t,i,e)}function Dr(t){return t.model.values?(e,n)=>{const i=t.view[e];return i?i(e,n):null}:t.view}function Lr(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function zr(t,e,n){const i="function"==typeof t?t(e,n):t;return i?(i.priority||(i.priority=10),i.id||(i.id=e.markerName),i):null}function Vr(t){const{schema:e,document:n}=t.model;for(const i of n.getRootNames()){const o=n.getRoot(i);if(o.isEmpty&&!e.checkChild(o,"$text")&&e.checkChild(o,"paragraph"))return t.insertElement("paragraph",o),!0}return!1}function jr(t,e,n){const i=n.createContext(t);return!!n.checkChild(i,"paragraph")&&!!n.checkChild(i.push("paragraph"),e)}function Br(t,e){const n=e.createElement("paragraph");return e.insert(n,t),e.createPositionAt(n,0)}class Fr extends Pr{elementToElement(t){return this.add(Hr(t))}elementToAttribute(t){return this.add(function(t){Wr(t=Mr(t));const e=$r(t,!1),n=Ur(t.view),i=n?"element:"+n:"element";return n=>{n.on(i,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){let e=null;("string"==typeof(t=Mr(t)).view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let n;return n="class"==e||"style"==e?{["class"==e?"classes":"styles"]:t.view.value}:{attributes:{[e]:void 0===t.view.value?/[\s\S]*/:t.view.value}},t.view.name&&(n.name=t.view.name),t.view=n,e}(t)),Wr(t,e);const n=$r(t,!0);return e=>{e.on("element",n,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return Object(me.c)("upcast-helpers-element-to-marker-deprecated"),this.add(function(t){return function(t){const e=t.model;t.model=(t,n)=>{const i="string"==typeof e?e:e(t,n);return n.writer.createElement("$marker",{"data-name":i})}}(t=Mr(t)),Hr(t)}(t))}dataToMarker(t){return this.add(function(t){(t=Mr(t)).model||(t.model=e=>e?t.view+":"+e:t.view);const e=qr(Yr(t,"start")),n=qr(Yr(t,"end"));return i=>{i.on("element:"+t.view+"-start",e,{priority:t.converterPriority||"normal"}),i.on("element:"+t.view+"-end",n,{priority:t.converterPriority||"normal"});const o=fe.get("low"),r=fe.get("highest"),s=fe.get(t.converterPriority)/r;i.on("element",function(t){return(e,n,i)=>{const o="data-"+t.view;function r(e,o){for(const r of o){const o=t.model(r,i),s=i.writer.createElement("$marker",{"data-name":o});i.writer.insert(s,e),n.modelCursor=n.modelCursor.isEqual(e)?n.modelCursor.getShiftedBy(1):n.modelCursor._getTransformedByInsertion(e,1),n.modelRange=n.modelRange._getTransformedByInsertion(e,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(","))}}(t),{priority:o+s})}}(t))}}function Hr(t){const e=qr(t=Mr(t)),n=Ur(t.view),i=n?"element:"+n:"element";return n=>{n.on(i,e,{priority:t.converterPriority||"normal"})}}function Ur(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function qr(t){const e=new je(t.view);return(n,i,o)=>{const r=e.match(i.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!o.consumable.test(i.viewItem,s))return;const a=function(t,e,n){return t instanceof Function?t(e,n):n.writer.createElement(t)}(t.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(t,e=null){const n=null===e||(t=>t.getAttribute(e));t.model={key:"object"!=typeof t.model?t.model:t.model.key,value:"object"!=typeof t.model||void 0===t.model.value?n:t.model.value}}function $r(t,e){const n=new je(t.view);return(i,o,r)=>{const s=n.match(o.viewItem);if(!s)return;const a=t.model.key,l="function"==typeof t.model.value?t.model.value(o.viewItem,r):t.model.value;null!==l&&(function(t,e){const n="function"==typeof t?t(e):t;return!("object"==typeof n&&!Ur(n)||n.classes||n.attributes||n.styles)}(t.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(t,e,n,i){let o=!1;for(const r of Array.from(t.getItems({shallow:n})))i.schema.checkAttribute(r,e.key)&&(i.writer.setAttribute(e.key,e.value,r),o=!0);return o}(o.modelRange,{key:a,value:l},e,r)&&r.consumable.consume(o.viewItem,s.match)))}}function Yr(t,e){const n={};return n.view=t.view+"-"+e,n.model=(e,n)=>{const i=e.getAttribute("name"),o=t.model(i,n);return n.writer.createElement("$marker",{"data-name":o})},n}class Gr{constructor(t,e){this.model=t,this.view=new Zo(e),this.mapper=new ur,this.downcastDispatcher=new mr({mapper:this.mapper,schema:t.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(t=>{this.downcastDispatcher.convertChanges(n.differ,o,t),this.downcastDispatcher.convertSelection(i,o,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(n,i)=>{const o=i.newSelection,r=[];for(const t of o.getRanges())r.push(e.toModelRange(t));const s=t.createSelection(r,{backward:o.isBackward});s.isEqual(t.document.selection)||t.change(t=>{t.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const i=n.writer,o=n.mapper.toViewPosition(e.range.start),r=i.createText(e.item.data);i.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,n)=>{const i=n.mapper.toViewPosition(e.position),o=e.position.getShiftedBy(e.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",(t,e,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",(t,e,n)=>{const i=e.selection;if(i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const o=[];for(const r of i.getRanges()){const t=n.mapper.toViewRange(r);o.push(t)}n.writer.setSelection(o,{backward:i.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const i=e.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(t=>{if("$graveyard"==t.rootName)return null;const e=new Dn(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}Ce(Gr,Sn);class Kr{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n)throw new me.a("commandcollection-command-not-found",this,{commandName:t});return n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}class Qr{constructor(){this._consumables=new Map}add(t,e){let n;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?n=this._consumables.get(t):(n=new Jr(t),this._consumables.set(t,n)),n.add(e))}test(t,e){const n=this._consumables.get(t);return void 0===n?null:t.is("$text")||t.is("documentFragment")?n:n.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const n=this._consumables.get(t);void 0!==n&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):n.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},n=t.getAttributeKeys();for(const r of n)"style"!=r&&"class"!=r&&e.attributes.push(r);const i=t.getClassNames();for(const r of i)e.classes.push(r);const o=t.getStyleNames();for(const r of o)e.styles.push(r);return e}static createFrom(t,e){if(e||(e=new Qr(t)),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,Qr.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const n of t.getChildren())e=Qr.createFrom(n,e);return e}}class Jr{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const n=this._test(e,t[e]);if(!0!==n)return n}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const n=et(e)?e:[e],i=this._consumables[t];for(const o of n){if("attributes"===t&&("class"===o||"style"===o))throw new me.a("viewconsumable-invalid-attribute",this);if(i.set(o,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(o))i.set(t,!0)}}_test(t,e){const n=et(e)?e:[e],i=this._consumables[t];for(const o of n)if("attributes"!==t||"class"!==o&&"style"!==o){const t=i.get(o);if(void 0===t)return null;if(!t)return!1}else{const t="class"==o?"classes":"styles",e=this._test(t,[...this._consumables[t].keys()]);if(!0!==e)return e}return!0}_consume(t,e){const n=et(e)?e:[e],i=this._consumables[t];for(const o of n)if("attributes"!==t||"class"!==o&&"style"!==o){if(i.set(o,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(o))i.set(t,!1)}else{const t="class"==o?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const n=et(e)?e:[e],i=this._consumables[t];for(const o of n)if("attributes"!==t||"class"!==o&&"style"!==o)!1===i.get(o)&&i.set(o,!0);else{const t="class"==o?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class Zr{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new Xr(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new Xr(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new me.a("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new me.a("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!(!e||!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!(!e||!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!(!e||!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);return!!n&&n.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof sr){const e=t.nodeBefore,n=t.nodeAfter;if(!(e instanceof ir))throw new me.a("schema-check-merge-no-element-before",this);if(!(n instanceof ir))throw new me.a("schema-check-merge-no-element-after",this);return this.checkMerge(e,n)}for(const n of e.getChildren())if(!this.checkChild(t,n))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[n,i])=>{if(!i)return;const o=t(n,i);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[n,i])=>{const o=t(n,i);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;for(e=t instanceof sr?t.parent:(t instanceof dr?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const n=e.getCommonAncestor();return t?t.getCommonAncestor(n,{includeSelf:!0}):n},null);!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const n=[...t.getFirstPosition().getAncestors(),new tr("",t.getAttributes())];return this.checkAttribute(n,e)}{const n=t.getRanges();for(const t of n)for(const n of t)if(this.checkAttribute(n.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const n of t)yield*this._getValidRangesForRange(n,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new dr(t);let n,i;const o=t.getAncestors().reverse().find(t=>this.isLimit(t))||t.root;"both"!=e&&"backward"!=e||(n=new or({boundaries:dr._createIn(o),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(i=new or({boundaries:dr._createIn(o),startPosition:t}));for(const r of function*(t,e){let n=!1;for(;!n;){if(n=!0,t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}}}(n,i)){const t=r.value;if(t.type==(r.walker==n?"elementEnd":"elementStart")&&this.isObject(t.item))return dr._createOn(t.item);if(this.checkChild(t.nextPosition,"$text"))return new dr(t.nextPosition)}return null}findAllowedParent(t,e){let n=t.parent;for(;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(t,e){for(const n of t)if(n.is("$text"))ds(this,n,e);else{const t=dr._createIn(n).getPositions();for(const n of t)ds(this,n.nodeBefore||n.parent,e)}}createContext(t){return new Xr(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,n=Object.keys(e);for(const i of n)t[i]=ts(e[i],i);for(const i of n)es(t,i);for(const i of n)ns(t,i);for(const i of n)is(t,i),os(t,i);for(const i of n)rs(t,i),ss(t,i);this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const i=e.getItem(n);if(t.allowIn.includes(i.name)){if(0==n)return!0;{const t=this.getDefinition(i);return this._checkContextMatch(t,e,n-1)}}return!1}*_getValidRangesForRange(t,e){let n=t.start,i=t.start;for(const o of t.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(dr._createIn(o),e)),this.checkAttribute(o,e)||(n.isEqual(i)||(yield new dr(n,i)),n=sr._createAfter(o)),i=sr._createAfter(o);n.isEqual(i)||(yield new dr(n,i))}}Ce(Zr,Sn);class Xr{constructor(t){if(t instanceof Xr)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.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(t){const e=new Xr([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function ts(t,e){const n={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){for(const n of t){const t=Object.keys(n).filter(t=>t.startsWith("is"));for(const i of t)e[i]=n[i]}}(t,n),as(t,n,"allowIn"),as(t,n,"allowContentOf"),as(t,n,"allowWhere"),as(t,n,"allowAttributes"),as(t,n,"allowAttributesOf"),as(t,n,"inheritTypesFrom"),function(t,e){for(const n of t){const t=n.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,n),n}function es(t,e){for(const n of t[e].allowContentOf)t[n]&&ls(t,n).forEach(t=>{t.allowIn.push(e)});delete t[e].allowContentOf}function ns(t,e){for(const n of t[e].allowWhere){const i=t[n];i&&t[e].allowIn.push(...i.allowIn)}delete t[e].allowWhere}function is(t,e){for(const n of t[e].allowAttributesOf){const i=t[n];i&&t[e].allowAttributes.push(...i.allowAttributes)}delete t[e].allowAttributesOf}function os(t,e){const n=t[e];for(const i of n.inheritTypesFrom){const e=t[i];if(e){const t=Object.keys(e).filter(t=>t.startsWith("is"));for(const i of t)i in n||(n[i]=e[i])}}delete n.inheritTypesFrom}function rs(t,e){const n=t[e],i=n.allowIn.filter(e=>t[e]);n.allowIn=Array.from(new Set(i))}function ss(t,e){const n=t[e];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function as(t,e,n){for(const i of t)"string"==typeof i[n]?e[n].push(i[n]):Array.isArray(i[n])&&e[n].push(...i[n])}function ls(t,e){const n=t[e];return(i=t,Object.keys(i).map(t=>i[t])).filter(t=>t.allowIn.includes(n.name));var i}function cs(t){return"string"==typeof t?{name:t,*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function ds(t,e,n){for(const i of e.getAttributeKeys())t.checkAttribute(e,i)||n.removeAttribute(i,e)}class us{constructor(t={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),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(t,e,n=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let n;for(const i of new Xr(t)){const t={};for(const e of i.getAttributeKeys())t[e]=i.getAttribute(e);const o=e.createElement(i.name,t);n&&e.append(o,n),n=sr._createAt(o,0)}return n}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=Qr.createFrom(t),this.conversionApi.store={};const{modelRange:i}=this._convertItem(t,this._modelCursor),o=e.createDocumentFragment();if(i){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,o);o.markers=function(t,e){const n=new Set,i=new Map,o=dr._createIn(t).getItems();for(const r of o)"$marker"==r.name&&n.add(r);for(const r of n){const t=r.getAttribute("data-name"),n=e.createPositionBefore(r);i.has(t)?i.get(t).end=n.clone():i.set(t,new dr(n.clone())),e.remove(r)}return i}(o,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(t,e){const n=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,n,this.conversionApi):t.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof dr))throw new me.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){let n=e.is("position")?e:sr._createAt(e,0);const i=new dr(n);for(const o of Array.from(t.getChildren())){const t=this._convertItem(o,n);t.modelRange instanceof dr&&(i.end=t.modelRange.end,n=t.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(t,e){const n=this._splitToAllowedParent(t,e);return!!n&&(this.conversionApi.writer.insert(t,n.position),!0)}_updateConversionResult(t,e){const n=this._getSplitParts(t),i=this.conversionApi.writer;e.modelRange||(e.modelRange=i.createRange(i.createPositionBefore(t),i.createPositionAfter(n[n.length-1])));const o=this._cursorParents.get(t);e.modelCursor=o?i.createPositionAt(o,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:n,writer:i}=this.conversionApi;let o=n.findAllowedParent(e,t);if(o){if(o===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return jr(e,t,n)?{position:Br(e,i)}:null;const r=this.conversionApi.writer.split(e,o),s=[];for(const l of r.range.getWalker())if("elementEnd"==l.type)s.push(l.item);else{const t=s.pop();this._registerSplitPair(t,l.item)}const a=r.range.end.parent;return this._cursorParents.set(t,a),{position:r.position,cursorParent:a}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const n=this._splitParts.get(t);this._splitParts.set(e,n),n.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}Ce(us,be);class hs{constructor(t,e){this.model=t,this.stylesProcessor=e,this.processor=void 0,this.mapper=new ur,this.downcastDispatcher=new mr({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const i=n.writer,o=n.mapper.toViewPosition(e.range.start),r=i.createText(e.item.data);i.insert(o,r)},{priority:"lowest"}),this.upcastDispatcher=new us({schema:t.schema}),this.viewDocument=new Un(e),this._viewWriter=new gi(this.viewDocument),this.upcastDispatcher.on("text",(t,e,{schema:n,consumable:i,writer:o})=>{let r=e.modelCursor;if(!i.test(e.viewItem))return;if(!n.checkChild(r,"$text")){if(!jr(r,"$text",n))return;r=Br(r,o)}i.consume(e.viewItem);const s=o.createText(e.viewItem.data);o.insert(s,r),e.modelRange=o.createRange(r,r.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:i}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=i}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:i}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.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(t={}){const{rootName:e="main",trim:n="empty"}=t;if(!this._checkIfRootsExists([e]))throw new me.a("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(e);return"empty"!==n||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,t):""}stringify(t,e){const n=this.toView(t,e);return this.processor.toData(n)}toView(t,e){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const o=dr._createIn(t),r=new mi(n);if(this.mapper.bindElements(t,r),this.downcastDispatcher.conversionApi.options=e,this.downcastDispatcher.convertInsert(o,i),!t.is("documentFragment")){const e=function(t){const e=[],n=t.root.document;if(!n)return[];const i=dr._createIn(t);for(const o of n.model.markers){const t=i.getIntersection(o.getRange());t&&e.push([o.name,t])}return e}(t);for(const[t,n]of e)this.downcastDispatcher.convertMarkerAdd(t,n,i)}return delete this.downcastDispatcher.conversionApi.options,r}init(t){if(this.model.document.version)throw new me.a("datacontroller-init-document-not-empty",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new me.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",t=>{for(const n of Object.keys(e)){const i=this.model.document.getRoot(n);t.insert(this.parse(e[n],i),i,0)}}),Promise.resolve()}set(t){let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new me.a("datacontroller-set-non-existent-root",this);this.model.enqueueChange("transparent",t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const n of Object.keys(e)){const i=this.model.document.getRoot(n);t.remove(t.createRangeIn(i)),t.insert(this.parse(e[n],i),i,0)}})}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change(n=>this.upcastDispatcher.convert(t,n,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}Ce(hs,Sn);class fs{constructor(t,e){this._helpers=new Map,this._downcast=Ee(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Ee(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const n=this._downcast.includes(e);if(!this._upcast.includes(e)&&!n)throw new me.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:n})}for(t){if(!this._helpers.has(t))throw new me.a("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:n}of ms(t))this.for("upcast").elementToElement({model:e,view:n,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:n}of ms(t))this.for("upcast").elementToAttribute({view:n,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:n}of ms(t))this.for("upcast").attributeToAttribute({view:n,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:n}){if(this._helpers.has(t))throw new me.a("conversion-group-exists",this);const i=n?new Ir(e):new Fr(e);this._helpers.set(t,i)}}function*ms(t){if(t.model.values)for(const e of t.model.values){const n={key:t.model.key,value:e},i=t.view[e],o=t.upcastAlso?t.upcastAlso[e]:void 0;yield*gs(n,i,o)}else yield*gs(t.model,t.view,t.upcastAlso)}function*gs(t,e,n){if(yield{model:t,view:e},n)for(const i of Ee(n))yield{model:t,view:i}}class ps{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class bs{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class ws{constructor(t){this.markers=new Map,this._children=new nr,t&&this._insertChild(0,t)}[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(t){return"documentFragment"===t||"model:documentFragment"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const n of t)e.push(n.name?ir.fromJSON(n):tr.fromJSON(n));return new ws(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){return"string"==typeof t?[new tr(t)]:(Ae(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new tr(t):t instanceof er?new tr(t.data,t.getAttributes()):t))}(e);for(const i of n)null!==i.parent&&i._remove(),i.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const i of n)i.parent=null;return n}}function ks(t,e){const n=(e=ys(e)).reduce((t,e)=>t+e.offsetSize,0),i=t.parent;As(t);const o=t.index;return i._insertChild(o,e),xs(i,o+e.length),xs(i,o),new dr(t,t.getShiftedBy(n))}function _s(t){if(!t.isFlat)throw new me.a("operation-utils-remove-range-not-flat",this);const e=t.start.parent;As(t.start),As(t.end);const n=e._removeChildren(t.start.index,t.end.index-t.start.index);return xs(e,t.start.index),n}function vs(t,e){if(!t.isFlat)throw new me.a("operation-utils-move-range-not-flat",this);const n=_s(t);return ks(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),n)}function ys(t){const e=[];t instanceof Array||(t=[t]);for(let n=0;nt.maxOffset)throw new me.a("move-operation-nodes-do-not-exist",this);if(t===e&&n=n&&this.targetPosition.path[t]t._clone(!0))),e=new Ms(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=new sr(this.position.root.document.graveyard,[0]);return new Ps(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsett._clone(!0))),ks(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const n=[];for(const o of t.nodes)n.push(o.name?ir.fromJSON(o):tr.fromJSON(o));const i=new Ms(sr.fromJSON(t.position,e),n,t.baseVersion);return i.shouldReceiveAttributes=t.shouldReceiveAttributes,i}}class Is extends bs{constructor(t,e,n,i,o,r){super(r),this.name=t,this.oldRange=e?e.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 t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new Is(t.name,t.oldRange?dr.fromJSON(t.oldRange,e):null,t.newRange?dr.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class Ns extends bs{constructor(t,e,n,i){super(i),this.position=t,this.position.stickiness="toNext",this.oldName=e,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 t=this.position.nodeAfter;if(!(t instanceof ir))throw new me.a("rename-operation-wrong-position",this);if(t.name!==this.oldName)throw new me.a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new Ns(sr.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class Os extends bs{constructor(t,e,n,i,o){super(o),this.root=t,this.key=e,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 me.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 me.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 me.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 t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new me.a("rootattribute-operation-fromjson-no-root",this,{rootName:t.root});return new Os(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class Rs extends bs{constructor(t,e,n,i,o){super(o),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,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 t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new dr(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),n=new sr(this.sourcePosition.root,e)._getTransformedByMergeOperation(this),i=new Ds(t,this.howMany,this.graveyardPosition,this.baseVersion+1);return i.insertionPosition=n,i}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new me.a("merge-operation-source-position-invalid",this);if(!e.parent)throw new me.a("merge-operation-target-position-invalid",this);if(this.howMany!=t.maxOffset)throw new me.a("merge-operation-how-many-invalid",this)}_execute(){const t=this.sourcePosition.parent;vs(dr._createIn(t),this.targetPosition),vs(dr._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const n=sr.fromJSON(t.sourcePosition,e),i=sr.fromJSON(t.targetPosition,e),o=sr.fromJSON(t.graveyardPosition,e);return new this(n,t.howMany,i,o,t.baseVersion)}}class Ds extends bs{constructor(t,e,n,i){super(i),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=Ds.getInsertionPosition(t),this.insertionPosition.stickiness="toNone",this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new sr(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new dr(this.splitPosition,t)}clone(){const t=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return t.insertionPosition=this.insertionPosition,t}getReversed(){const t=new sr(this.splitPosition.root.document.graveyard,[0]);return new Rs(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent;if(!t||t.maxOffset{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof dr)for(const n of t.getItems())e(n);else e(t)}move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof dr))throw new me.a("writer-move-invalid-range",this);if(!t.isFlat)throw new me.a("writer-move-range-not-flat",this);const i=sr._createAt(e,n);if(i.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!Hs(t.root,i.root))throw new me.a("writer-move-different-document",this);const o=new Ps(t.start,t.end.offset-t.start.offset,i,t.root.document?t.root.document.version:null);this.batch.addOperation(o),this.model.applyOperation(o)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof dr?t:dr._createOn(t)).getMinimalFlatRanges().reverse();for(const n of e)this._addOperationForAffectedMarkers("move",n),Fs(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,n=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof ir))throw new me.a("writer-merge-no-element-before",this);if(!(n instanceof ir))throw new me.a("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,n){return this.model.createPositionFromPath(t,e,n)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,n){return this.model.createSelection(t,e,n)}_mergeDetached(t){const e=t.nodeBefore,n=t.nodeAfter;this.move(dr._createIn(n),sr._createAt(e,"end")),this.remove(n)}_merge(t){const e=sr._createAt(t.nodeBefore,"end"),n=sr._createAt(t.nodeAfter,0),i=new sr(t.root.document.graveyard,[0]),o=new Rs(n,t.nodeAfter.maxOffset,e,i,t.root.document.version);this.batch.addOperation(o),this.model.applyOperation(o)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof ir))throw new me.a("writer-rename-not-element-instance",this);const n=t.root.document?t.root.document.version:null,i=new Ns(sr._createBefore(t),t.name,e,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(t,e){this._assertWriterUsedCorrectly();let n,i,o=t.parent;if(!o.parent)throw new me.a("writer-split-element-no-parent",this);if(e||(e=o.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new me.a("writer-split-invalid-limit-element",this);do{const e=new Ds(t,o.maxOffset-t.offset,null,o.root.document?o.root.document.version:null);this.batch.addOperation(e),this.model.applyOperation(e),n||i||(n=o,i=t.parent.nextSibling),o=(t=this.createPositionAfter(t.parent)).parent}while(o!==e);return{position:t,range:new dr(sr._createAt(n,"end"),sr._createAt(i,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new me.a("writer-wrap-range-not-flat",this);const n=e instanceof ir?e:new ir(e);if(n.childCount>0)throw new me.a("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new me.a("writer-wrap-element-attached",this);this.insert(n,t.start);const i=new dr(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(i,sr._createAt(n,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new me.a("writer-unwrap-element-no-parent",this);this.move(dr._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new me.a("writer-addmarker-no-usingoperation",this);const n=e.usingOperation,i=e.range,o=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new me.a("writer-addmarker-marker-exists",this);if(!i)throw new me.a("writer-addmarker-no-range",this);return n?(Bs(this,t,null,i,o),this.model.markers.get(t)):this.model.markers._set(t,i,n,o)}updateMarker(t,e){this._assertWriterUsedCorrectly();const n="string"==typeof t?t:t.name,i=this.model.markers.get(n);if(!i)throw new me.a("writer-updatemarker-marker-not-exists",this);if(!e)return void this.model.markers._refresh(i);const o="boolean"==typeof e.usingOperation,r="boolean"==typeof e.affectsData,s=r?e.affectsData:i.affectsData;if(!o&&!e.range&&!r)throw new me.a("writer-updatemarker-wrong-options",this);const a=i.getRange(),l=e.range?e.range:a;o&&e.usingOperation!==i.managedUsingOperations?e.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(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new me.a("writer-removemarker-no-marker",this);const n=this.model.markers.get(e);n.managedUsingOperations?Bs(this,e,n.getRange(),null,n.affectsData):this.model.markers._remove(e)}setSelection(t,e,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[n,i]of Ve(t))this._setSelectionAttribute(n,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=Tr._getStoreAttributeKey(t);this.setAttribute(i,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=Tr._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new me.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let o=!1;if("move"===t)o=e.containsPosition(i.start)||e.start.isEqual(i.start)||e.containsPosition(i.end)||e.end.isEqual(i.end);else{const t=e.nodeAfter,n=i.end.parent==t&&0==i.end.offset,r=i.end.nodeAfter==t,s=i.start.nodeAfter==t;o=i.start.parent==e.nodeBefore&&i.start.isAtEnd||n||r||s}o&&this.updateMarker(n.name,{range:i})}}}function Vs(t,e,n,i){const o=t.model,r=o.document;let s,a,l,c=i.start;for(const u of i.getWalker({shallow:!0}))l=u.item.getAttribute(e),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,e,a,n,i.root.document?r.version:null);t.batch.addOperation(l),o.applyOperation(l)}s instanceof sr&&s!=c&&a!=n&&d()}function js(t,e,n,i){const o=t.model,r=o.document,s=i.getAttribute(e);let a,l;s!=n&&(i.root===i?l=new Os(i,e,s,n,i.document?r.version:null):(a=new dr(sr._createBefore(i),t.createPositionAfter(i)),l=new Ss(a,e,s,n,a.root.document?r.version:null)),t.batch.addOperation(l),o.applyOperation(l))}function Bs(t,e,n,i,o){const r=t.model,s=new Is(e,n,i,r.markers,o,r.document.version);t.batch.addOperation(s),r.applyOperation(s)}function Fs(t,e,n,i){let o;if(t.root.document){const n=i.document,r=new sr(n.graveyard,[0]);o=new Ps(t,e,r,n.version)}else o=new Es(t,e);n.addOperation(o),i.applyOperation(o)}function Hs(t,e){return t===e||t instanceof Ls&&e instanceof Ls}class Us{constructor(t){this._markerCollection=t,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(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=dr._createOn(t);for(const n of this._markerCollection.getMarkersIntersectingRange(e)){const t=n.getRange();this.bufferMarkerChange(n.name,t,t,n.affectsData)}this._cachedChanges=null}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),n=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),n||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=dr._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1),this._markInsert(t.graveyardPosition.parent,t.graveyardPosition.offset,1);const n=t.targetPosition.parent;this._isInInsertedElement(n)||this._markInsert(n,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,n,i){const o=this._changedMarkers.get(t);o?(o.newRange=n,o.affectsData=i,null==o.oldRange&&null==o.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:n,affectsData:i})}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.oldRange&&t.push({name:e,range:n.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.newRange&&t.push({name:e,range:n.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}}))}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const e=[];for(const n of this._changesInElement.keys()){const t=this._changesInElement.get(n).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offsett.position.root!=e.position.root?t.position.root.rootNamen.offset){if(i>o){const t={type:"attribute",offset:o,howMany:i-o,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=n.offset&&t.offseto?(t.nodesToHandle=i-o,t.offset=o):t.nodesToHandle=0);if("remove"==n.type&&t.offsetn.offset){const o={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(o,e),e.push(o),t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==n.type&&(t.offset>=n.offset&&i<=o?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=n.offset&&i>=o&&(n.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:sr._createAt(t,e),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,n){return{type:"remove",position:sr._createAt(t,e),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,n){const i=[];n=new Map(n);for(const[o,r]of e){const e=n.has(o)?n.get(o):null;e!==r&&i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++}),n.delete(o)}for(const[o,r]of n)i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:o,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return i}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const n=this._changesInElement.get(e),i=t.startOffset;if(n)for(const o of n)if("insert"==o.type&&i>=o.offset&&ii){for(let t=0;t=t&&i.baseVersion{const n=e[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new me.a("model-document-applyoperation-wrong-version",this,{operation:n})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(t,e,n,i)=>{this.differ.bufferMarkerChange(e.name,n,i,e.affectsData),null===n&&e.on("change",(t,n)=>{this.differ.bufferMarkerChange(e.name,n,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new me.a("model-document-createroot-name-exists",this,{name:e});const n=new Ls(this,t,e);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>"$graveyard"!=t)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=Re(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,n=e.schema,i=e.createPositionFromPath(t,[0]);return n.getNearestSelectionRange(i)||e.createRange(i)}_validateSelectionRange(t){return Js(t.start)&&Js(t.end)}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(this.selection.refresh(),e=n(t),e)break}while(e)}}function Js(t){const e=t.textNode;if(e){const n=e.data,i=t.offset-e.startOffset;return!Gs(n,i)&&!Ks(n,i)}return!0}Ce(Qs,be);class Zs{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,n=!1,i=!1){const o=t instanceof Xs?t.name:t;if(o.includes(","))throw new me.a("markercollection-incorrect-marker-name",this);const r=this._markers.get(o);if(r){const t=r.getRange();let s=!1;return t.isEqual(e)||(r._attachLiveRange(xr.fromRange(e)),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,t,e),r}const s=xr.fromRange(e),a=new Xs(o,s,n,i);return this._markers.set(o,a),this.fire("update:"+o,a,null,e),a}_remove(t){const e=t instanceof Xs?t.name:t,n=this._markers.get(e);return!!n&&(this._markers.delete(e),this.fire("update:"+e,n,n.getRange(),null),this._destroyMarker(n),!0)}_refresh(t){const e=t instanceof Xs?t.name:t,n=this._markers.get(e);if(!n)throw new me.a("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire("update:"+e,n,i,i,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}Ce(Zs,be);class Xs{constructor(t,e,n,i){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new me.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new me.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new me.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new me.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new me.a("marker-destroyed",this);return this._liveRange.toRange()}is(t){return"marker"===t||"model:marker"===t}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Ce(Xs,be);class ta extends bs{get type(){return"noop"}clone(){return new ta(this.baseVersion)}getReversed(){return new ta(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const ea={};ea[Ss.className]=Ss,ea[Ms.className]=Ms,ea[Is.className]=Is,ea[Ps.className]=Ps,ea[ta.className]=ta,ea[bs.className]=bs,ea[Ns.className]=Ns,ea[Os.className]=Os,ea[Ds.className]=Ds,ea[Rs.className]=Rs;class na extends sr{constructor(t,e,n="toNone"){if(super(t,e,n),!this.root.is("rootElement"))throw new me.a("model-liveposition-root-not-rootelement",t);ia.call(this)}detach(){this.stopListening()}is(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t}toPosition(){return new sr(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}function ia(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&oa.call(this,n)},{priority:"low"})}function oa(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}Ce(na,be);class ra{constructor(t,e,n){this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t,e){t=Array.from(t);for(let n=0;n!0);if(r.checkChild(l,"$text"))return l}}function da(t,e){const n=sr._createAt(t.root,e?"end":0);return e?new dr(t,n):new dr(n,t)}function ua(t,e,n){return' ,.?!:;"-()'.includes(t.charAt(e+(n?0:-1)))}function ha(t,e,n){return e===(n?t.endOffset:0)}function fa(t,e){const n=[];Array.from(t.getItems({direction:"backward"})).map(t=>e.createRangeOn(t)).filter(e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))).forEach(t=>{n.push(t.start.parent),e.remove(t)}),n.forEach(t=>{let n=t;for(;n.parent&&n.isEmpty;){const t=e.createRangeOn(n);n=n.parent,e.remove(t)}})}function ma(t,e){return t.isCollapsed?function(t,e){const n=t.start,i=e.getNearestSelectionRange(n);if(!i)return null;if(!i.isCollapsed)return i;const o=i.start;return n.isEqual(o)?null:new dr(o)}(t,e):function(t,e){const{start:n,end:i}=t,o=e.checkChild(n,"$text"),r=e.checkChild(i,"$text"),s=e.getLimitElement(n),a=e.getLimitElement(i);if(s===a){if(o&&r)return null;if(function(t,e,n){const i=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,"$text"),o=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,"$text");return i||o}(n,i,e)){const t=n.nodeAfter&&e.isSelectable(n.nodeAfter)?null:e.getNearestSelectionRange(n,"forward"),o=i.nodeBefore&&e.isSelectable(i.nodeBefore)?null:e.getNearestSelectionRange(i,"backward");return new dr(t?t.start:n,o?o.end:i)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const t=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,o=l&&(!t||!pa(n.nodeAfter,e)),r=c&&(!t||!pa(i.nodeBefore,e));let d=n,u=i;return o&&(d=sr._createBefore(ga(s,e))),r&&(u=sr._createAfter(ga(a,e))),new dr(d,u)}return null}(t,e)}function ga(t,e){let n=t,i=n;for(;e.isLimit(i)&&i.parent;)n=i,i=i.parent;return n}function pa(t,e){return t&&e.isSelectable(t)}class ba{constructor(){this.markers=new Zs,this.document=new Qs(this),this.schema=new Zr,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[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((t,e)=>{if("$marker"===e.name)return!0}),function(t){t.document.registerPostFixer(e=>function(t,e){const n=e.document.selection,i=e.schema,o=[];let r=!1;for(const s of n.getRanges()){const t=ma(s,i);t&&!t.isEqual(s)?(o.push(t),r=!0):o.push(s)}r&&t.setSelection(function(t){const e=[];e.push(t.shift());for(const n of t){const t=e.pop();if(n.isEqual(t))e.push(t);else if(n.isIntersecting(t)){const i=t.start.isAfter(n.start)?n.start:t.start,o=t.end.isAfter(n.end)?t.end:n.end,r=new dr(i,o);e.push(r)}else e.push(t),e.push(n)}return e}(o),{backward:n.isBackward})}(e,t))}(this),this.document.registerPostFixer(Vr)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new ps,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){me.a.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{"string"==typeof t?t=new ps(t):"function"==typeof t&&(e=t,t=new ps),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){me.a.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,n){return function(t,e,n,i){return t.change(o=>{let r;r=n?n instanceof wr||n instanceof Tr?n:o.createSelection(n,i):t.document.selection,r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const s=new ra(t,o,r.anchor);let a;a=e.is("documentFragment")?e.getChildren():[e],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()||t.createRange(r.anchor);return s.destroy(),c})}(this,t,e,n)}deleteContent(t,e){!function(t,e,n={}){if(e.isCollapsed)return;const i=e.getFirstRange();if("$graveyard"==i.root.rootName)return;const o=t.schema;t.change(t=>{if(!n.doNotResetEntireContent&&function(t,e){const n=t.getLimitElement(e);if(!e.containsEntireContent(n))return!1;const i=e.getFirstRange();return i.start.parent!=i.end.parent&&t.checkChild(n,"paragraph")}(o,e))return void function(t,e){const n=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(n)),aa(t,t.createPositionAt(n,0),e)}(t,e);const[r,s]=function(t){const e=t.root.document.model,n=t.start;let i=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const n=function(t){const e=t.parent,n=e.root.document.model.schema,i=e.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(e.createPositionAt(n,0))){const n=e.createSelection(t);e.modifySelection(n,{direction:"backward"}),i=n.getLastPosition()}}return[na.fromPosition(n,"toPrevious"),na.fromPosition(i,"toNext")]}(i);r.isTouching(s)||t.remove(t.createRange(r,s)),n.leaveUnmerged||(function(t,e,n){const i=t.model;if(!sa(t.model.schema,e,n))return;const[o,r]=function(t,e){const n=t.getAncestors(),i=e.getAncestors();let o=0;for(;n[o]&&n[o]==i[o];)o++;return[n[o],i[o]]}(e,n);o&&r&&(!i.hasContent(o,{ignoreMarkers:!0})&&i.hasContent(r,{ignoreMarkers:!0})?function t(e,n,i,o){const r=n.parent,s=i.parent;if(r!=o&&s!=o){for(n=e.createPositionAfter(r),(i=e.createPositionBefore(s)).isEqual(n)||e.insert(r,i);n.parent.isEmpty;){const t=n.parent;n=e.createPositionBefore(t),e.remove(t)}i=e.createPositionBefore(s),function(t,e){const n=e.nodeBefore,i=e.nodeAfter;n.name!=i.name&&t.rename(n,i.name),t.clearAttributes(n),t.setAttributes(Object.fromEntries(i.getAttributes()),n),t.merge(e)}(e,i),sa(e.model.schema,n,i)&&t(e,n,i,o)}}(t,e,n,o.parent):function t(e,n,i,o){const r=n.parent,s=i.parent;if(r!=o&&s!=o){for(n=e.createPositionAfter(r),(i=e.createPositionBefore(s)).isEqual(n)||e.insert(s,n),e.merge(n);i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}sa(e.model.schema,n,i)&&t(e,n,i,o)}}(t,e,n,o.parent))}(t,r,s),o.removeDisallowedAttributes(r.parent.getChildren(),t)),la(t,e,r),!n.doNotAutoparagraph&&function(t,e){const n=t.checkChild(e,"$text"),i=t.checkChild(e,"paragraph");return!n&&i}(o,r)&&aa(t,r,e),r.detach(),s.detach()})}(this,t,e)}modifySelection(t,e){!function(t,e,n={}){const i=t.schema,o="backward"!=n.direction,r=n.unit?n.unit:"character",s=new or({boundaries:da(e.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(e instanceof Tr?t.change(t=>{t.setSelectionFocus(n)}):e.setFocus(n))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const n=t.createDocumentFragment(),i=e.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:t.createRange(t.createPositionAt(s,i.start.path[r.length]),t.createPositionAt(s,i.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("$textProxy")?t.appendText(e.data,e.getAttributes(),n):t.append(t.cloneElement(e,!0),n);if(a!=i){const e=i._getTransformedByMove(a.start,t.createPositionAt(n,0),l)[0],o=t.createRange(t.createPositionAt(n,0),e.start);fa(t.createRange(e.end,t.createPositionAt(n,"end")),t),fa(o,t)}return n})}(this,t)}hasContent(t,e={}){const n=t instanceof ir?dr._createIn(t):t;if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=e;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(t,e,n){return new sr(t,e,n)}createPositionAt(t,e){return sr._createAt(t,e)}createPositionAfter(t){return sr._createAfter(t)}createPositionBefore(t){return sr._createBefore(t)}createRange(t,e){return new dr(t,e)}createRangeIn(t){return dr._createIn(t)}createRangeOn(t){return dr._createOn(t)}createSelection(t,e,n){return new wr(t,e,n)}createBatch(t){return new ps(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return ea[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){this._currentWriter=new zs(this,this._pendingChanges[0].batch);const e=this._pendingChanges[0].callback(this._currentWriter);t.push(e),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}Ce(ba,Sn);class wa{constructor(){this._listener=Object.create(Xi)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+ii(e),e)})}set(t,e,n={}){const i=oi(t);this._listener.listenTo(this._listener,"_keydown:"+i,(t,n)=>{e(n,()=>{n.preventDefault(),n.stopPropagation(),t.stop()}),t.return=!0},{priority:n.priority})}press(t){return!!this._listener.fire("_keydown:"+ii(t),t)}destroy(){this._listener.stopListening()}}class ka extends wa{constructor(t){super(),this.editor=t}set(t,e,n={}){if("string"==typeof e){const t=e;e=(e,n)=>{this.editor.execute(t),n()}}super.set(t,e,n)}}class _a{constructor(t={}){this._context=t.context||new Ne({language:t.language}),this._context._addEditor(this,!t.context);const e=Array.from(this.constructor.builtinPlugins||[]);this.config=new ae(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.config.define(this._context._getEditorConfig()),this.plugins=new Se(this,e,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new Kr,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 Gr(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 t=this.config,e=t.get("plugins"),n=t.get("removePlugins")||[],i=t.get("extraPlugins")||[];return this.plugins.init(e.concat(i),n)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.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(...t){try{return this.commands.execute(...t)}catch(t){me.a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}Ce(_a,Sn);var va={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}};class ya{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class xa{constructor(t){this._domParser=new DOMParser,this._domConverter=new Gi(t,{blockFillerMode:"nbsp"}),this._htmlWriter=new ya}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}registerRawContentMatcher(t){this._domConverter.registerRawContentMatcher(t)}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),n=e.createDocumentFragment(),i=e.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class Aa{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(Ca(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new me.a("componentfactory-item-missing",this,{name:t});return this._components.get(Ca(t)).callback(this.editor.locale)}has(t){return this._components.has(Ca(t))}}function Ca(t){return String(t).toLowerCase()}class Ta{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new me.a("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}Ce(Ta,Xi),Ce(Ta,Sn);class Sa{constructor(t){this.editor=t,this.componentFactory=new Aa(t),this.focusTracker=new Ta,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}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}}Ce(Sa,be),n(14);const Ea=new WeakMap;function Pa(t){const{view:e,element:n,text:i,isDirectHost:o=!0}=t,r=e.document;Ea.has(r)||(Ea.set(r,new Map),r.registerPostFixer(t=>Ma(r,t))),Ea.get(r).set(n,{text:i,isDirectHost:o}),e.change(t=>Ma(r,t))}function Ma(t,e){const n=Ea.get(t);let i=!1;for(const[o,r]of n)Ia(e,o,r)&&(i=!0);return i}function Ia(t,e,n){const{text:i,isDirectHost:o}=n,r=o?e:function(t){if(1===t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}(e);let s=!1;return!!r&&(n.hostElement=r,r.getAttribute("data-placeholder")!==i&&(t.setAttribute("data-placeholder",i,r),s=!0),function(t){if(!t.isAttached())return!1;const e=!Array.from(t.getChildren()).some(t=>!t.is("uiElement")),n=t.document;if(!n.isFocused&&e)return!0;const i=n.selection.anchor;return!(!e||!i||i.parent===t)}(r)?function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,r)&&(s=!0):function(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}(t,r)&&(s=!0),s)}class Na extends Sa{constructor(t,e){var n;super(t),this.view=e,this._toolbarConfig=(n=t.config.get("toolbar"),Array.isArray(n)?{items:n}:n?Object.assign({items:[]},n):{items:[]})}init(){const t=this.view,e=this.editor.editing.view,n=t.editable,i=e.document.getRoot();t.editable.name=i.rootName,t.render();const o=n.element;this.setEditableElement(n.name,o),this.focusTracker.add(o),t.editable.bind("isFocused").to(this.focusTracker),e.attachDomRoot(o),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view.toolbar;e.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:t,originKeystrokeHandler:e,originFocusTracker:n,toolbar:i,beforeFocus:o,afterBlur:r}){n.add(i.element),e.set("Alt+F10",(t,e)=>{n.isFocused&&!i.focusTracker.isFocused&&(o&&o(),i.focus(),e())}),i.keystrokes.set("Esc",(e,n)=>{i.focusTracker.isFocused&&(t.focus(),r&&r(),n())})}({origin:t.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e})}_initPlaceholder(){const t=this.editor,e=t.editing.view,n=e.document.getRoot(),i=t.sourceElement,o=t.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");o&&Pa({view:e,element:n,text:o,isDirectHost:!1})}}class Oa extends Te{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(t,e,n)=>{this._renderViewIntoCollectionParent(e,n)}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...t){if(!t.length||!t.every(t=>"string"==typeof t))throw new me.a("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const n of this)for(const i of t)n.delegate(i).to(e);this.on("add",(n,i)=>{for(const o of t)i.delegate(o).to(e)}),this.on("remove",(n,i)=>{for(const o of t)i.stopDelegating(o,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}class Ra{constructor(t){Object.assign(this,qa(Ua(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new me.a("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const n of e.children)Ka(n)?yield n:Qa(n)&&(yield*t(n))}(this)}static bind(t,e){return{to:(n,i)=>new La({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:i}),if:(n,i,o)=>new za({observable:t,emitter:e,attribute:n,valueIfTrue:i,callback:o})}}static extend(t,e){if(t._isRendered)throw new me.a("template-extend-render",[this,t]);!function t(e,n){if(n.attributes&&(e.attributes||(e.attributes={}),Ya(e.attributes,n.attributes)),n.eventListeners&&(e.eventListeners||(e.eventListeners={}),Ya(e.eventListeners,n.eventListeners)),n.text&&e.text.push(...n.text),n.children&&n.children.length){if(e.children.length!=n.children.length)throw new me.a("ui-template-extend-children-mismatch",e);let i=0;for(const o of n.children)t(e.children[i++],o)}}(t,qa(Ua(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new me.a("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),Va(this.text)?this._bindToObservable({schema:this.text,updater:Ba(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,n,i,o;if(!this.attributes)return;const r=t.node,s=t.revertData;for(e in this.attributes)if(i=r.getAttribute(e),n=this.attributes[e],s&&(s.attributes[e]=i),o=C(n[0])&&n[0].ns?n[0].ns:null,Va(n)){const a=o?n[0].value:n;s&&Za(e)&&a.unshift(i),this._bindToObservable({schema:a,updater:Fa(r,e,o),data:t})}else"style"==e&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],t):(s&&i&&Za(e)&&n.unshift(i),n=n.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce($a,""),Ga(n)||r.setAttributeNS(o,e,n))}_renderStyleAttribute(t,e){const n=e.node;for(const i in t){const o=t[i];Va(o)?this._bindToObservable({schema:[o],updater:Ha(n,i),data:e}):n.style[i]=o}}_renderElementChildren(t){const e=t.node,n=t.intoFragment?document.createDocumentFragment():e,i=t.isApplying;let o=0;for(const r of this.children)if(Ja(r)){if(!i){r.setParent(e);for(const t of r)n.appendChild(t.element)}}else if(Ka(r))i||(r.isRendered||r.render(),n.appendChild(r.element));else if(ji(r))n.appendChild(r);else if(i){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),r._renderNode({node:n.childNodes[o++],isApplying:!0,revertData:e})}else n.appendChild(r.render());t.intoFragment&&e.appendChild(n)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const n=this.eventListeners[e].map(n=>{const[i,o]=e.split("@");return n.activateDomEventListener(i,o,t)});t.revertData&&t.revertData.bindings.push(n)}}_bindToObservable({schema:t,updater:e,data:n}){const i=n.revertData;ja(t,e,n);const o=t.filter(t=>!Ga(t)).filter(t=>t.observable).map(i=>i.activateAttributeListener(t,e,n));i&&i.bindings.push(o)}_revertTemplateFromNode(t,e){for(const n of e.bindings)for(const t of n)t();if(e.text)t.textContent=e.text;else{for(const n in e.attributes){const i=e.attributes[n];null===i?t.removeAttribute(n):t.setAttribute(n,i)}for(let n=0;nja(t,e,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,i),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class La extends Da{activateDomEventListener(t,e,n){const i=(t,n)=>{e&&!n.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,t,i),()=>{this.emitter.stopListening(n.node,t,i)}}}class za extends Da{getValue(t){return!Ga(super.getValue(t))&&(this.valueIfTrue||!0)}}function Va(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(Va):t instanceof Da)}function ja(t,e,{node:n}){let i=function(t,e){return t.map(t=>t instanceof Da?t.getValue(e):t)}(t,n);i=1==t.length&&t[0]instanceof za?i[0]:i.reduce($a,""),Ga(i)?e.remove():e.set(i)}function Ba(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function Fa(t,e,n){return{set(i){t.setAttributeNS(n,e,i)},remove(){t.removeAttributeNS(n,e)}}}function Ha(t,e){return{set(n){t.style[e]=n},remove(){t.style[e]=null}}}function Ua(t){return re(t,t=>{if(t&&(t instanceof Da||Qa(t)||Ka(t)||Ja(t)))return t})}function qa(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){t.text=Ee(t.text)}(t),t.on&&(t.eventListeners=function(t){for(const e in t)Wa(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=Ee(t[e].value)),Wa(t,e)}(t.attributes);const e=[];if(t.children)if(Ja(t.children))e.push(t.children);else for(const n of t.children)Qa(n)||Ka(n)||ji(n)?e.push(n):e.push(new Ra(n));t.children=e}return t}function Wa(t,e){t[e]=Ee(t[e])}function $a(t,e){return Ga(e)?t:Ga(t)?e:`${t} ${e}`}function Ya(t,e){for(const n in e)t[n]?t[n].push(...e[n]):t[n]=e[n]}function Ga(t){return!t&&0!==t}function Ka(t){return t instanceof Xa}function Qa(t){return t instanceof Ra}function Ja(t){return t instanceof Oa}function Za(t){return"class"==t||"style"==t}n(16);class Xa{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new Te,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,n)=>{n.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Ra.bind(this,this)}createCollection(t){const e=new Oa(t);return this._viewCollections.add(e),e}registerChild(t){Ae(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){Ae(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new Ra(t)}extendTemplate(t){Ra.extend(this.template,t)}render(){if(this.isRendered)throw new me.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(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}Ce(Xa,Xi),Ce(Xa,Sn);var tl=function(t){return"string"==typeof t||!et(t)&&m(t)&&"[object String]"==u(t)};class el extends Oa{constructor(t,e=[]){super(e),this.locale=t}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 t=document.querySelector(".ck-body-wrapper");t||(t=function(t,e,n={},i=[]){const o=n&&n.xmlns,r=o?t.createElementNS(o,e):t.createElement(e);for(const s in n)r.setAttribute(s,n[s]);!tl(i)&&Ae(i)||(i=[i]);for(let s of i)tl(s)&&(s=t.createTextNode(s)),r.appendChild(s);return r}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}n(18);class nl extends Xa{constructor(t){super(t),this.body=new el(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class il extends Xa{constructor(t,e,n){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=e}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 t=this._editingView;function e(e){t.change(n=>{const i=t.document.getRoot(e.name);n.addClass(e.isFocused?"ck-focused":"ck-blurred",i),n.removeClass(e.isFocused?"ck-blurred":"ck-focused",i)})}t.isRenderingInProgress?function n(i){t.once("change:isRenderingInProgress",(t,o,r)=>{r?n(i):e(i)})}(this):e(this)}}class ol extends il{constructor(t,e,n){super(t,e,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change(n=>{const i=t.document.getRoot(this.name);n.setAttribute("aria-label",e("Rich Text Editor, %0",this.name),i)})}}class rl{constructor(t){if(Object.assign(this,t),t.actions&&t.keystrokeHandler)for(const e in t.actions){let n=t.actions[e];"string"==typeof n&&(n=[n]);for(const i of n)t.keystrokeHandler.set(i,(t,n)=>{this[e](),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 t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,n)=>{const i=e.element===this.focusTracker.focusedElement;return i&&(t=n),i}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,n=this.focusables.length;if(!n)return null;if(null===e)return this[1===t?"first":"last"];let i=(e+n+t)%n;do{const e=this.focusables.get(i);if(sl(e))return e;i=(i+n+t)%n}while(i!==e);return null}}function sl(t){return!(!t.focus||"none"==qi.window.getComputedStyle(t.element).display)}class al extends Xa{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class ll extends Xa{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}class cl{constructor(t,e){cl._observerInstance||cl._createObserver(),this._element=t,this._callback=e,cl._addElementCallback(t,e),cl._observerInstance.observe(t)}destroy(){cl._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){cl._elementCallbacks||(cl._elementCallbacks=new Map);let n=cl._elementCallbacks.get(t);n||(n=new Set,cl._elementCallbacks.set(t,n)),n.add(e)}static _deleteElementCallback(t,e){const n=cl._getElementCallbacks(t);n&&(n.delete(e),n.size||(cl._elementCallbacks.delete(t),cl._observerInstance.unobserve(t))),cl._elementCallbacks&&!cl._elementCallbacks.size&&(cl._observerInstance=null,cl._elementCallbacks=null)}static _getElementCallbacks(t){return cl._elementCallbacks?cl._elementCallbacks.get(t):null}static _createObserver(){let t;t="function"==typeof qi.window.ResizeObserver?qi.window.ResizeObserver:dl,cl._observerInstance=new t(t=>{for(const e of t){const t=cl._getElementCallbacks(e.target);if(t)for(const n of t)n(e)}})}}cl._observerInstance=null,cl._elementCallbacks=null;class dl{constructor(t){this._callback=t,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(t){this._elements.add(t),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(t){this._elements.delete(t),this._previousRects.delete(t),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(t,100)};this.listenTo(qi.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(t,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements)this._hasRectChanged(e)&&t.push({target:e,contentRect:this._previousRects.get(e)});t.length&&this._callback(t)}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t))return!1;const e=new jo(t),n=this._previousRects.get(t),i=!n||!n.isEqual(e);return this._previousRects.set(t,e),i}}Ce(dl,Xi);class ul extends Xa{constructor(t){super(t);const e=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",e.to("position",t=>"ck-dropdown__panel_"+t),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}function hl({element:t,target:e,positions:n,limiter:i,fitInViewport:o}){T(e)&&(e=e()),T(i)&&(i=i());const r=function(t){return t&&t.parentNode?t.offsetParent===qi.document.body?null:t.offsetParent:null}(t),s=new jo(t),a=new jo(e);let l,c;if(i||o){const t=function(t,e){const{elementRect:n,viewportRect:i}=e,o=n.getArea(),r=function(t,{targetRect:e,elementRect:n,limiterRect:i,viewportRect:o}){const r=[],s=n.getArea();for(const a of t){const t=fl(a,e,n);if(!t)continue;const[l,c]=t;let d=0,u=0;if(i)if(o){const t=i.getIntersection(o);t&&(d=t.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}(t,e);if(i){const t=ml(r.filter(({viewportIntersectArea:t})=>t===o),o);if(t)return t}return ml(r,o)}(n,{targetRect:a,elementRect:s,limiterRect:i&&new jo(i).getVisible(),viewportRect:o&&new jo(qi.window)});[c,l]=t||fl(n[0],a,s)}else[c,l]=fl(n[0],a,s);let d=gl(l);return r&&(d=function({left:t,top:e},n){const i=gl(new jo(n)),o=zo(n);return t-=i.left,e-=i.top,t+=n.scrollLeft,e+=n.scrollTop,{left:t-=o.left,top:e-=o.top}}(d,r)),{left:d.left,top:d.top,name:c}}function fl(t,e,n){const i=t(e,n);if(!i)return null;const{left:o,top:r,name:s}=i;return[s,n.clone().moveTo(o,r)]}function ml(t,e){let n,i,o=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of t){if(a===e)return[r,s];const t=l**2+a**2;t>o&&(o=t,n=s,i=r)}return n?[i,n]:null}function gl({left:t,top:e}){const{scrollX:n,scrollY:i}=qi.window;return{left:t+n,top:e+i}}n(20);class pl extends Xa{constructor(t,e,n){super(t);const i=this.bindTemplate;this.buttonView=e,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",t=>!t)],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[e,n]}),e.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 t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:t,southWest:e,northEast:n,northWest:i}=pl.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[t,e,n,i]:[e,t,i,n]}}pl.defaultPanelPositions={southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.bottom-e.height,left:t.left-e.width+t.width,name:"nw"})},pl._getOptimalPosition=hl,n(22);class bl extends Xa{constructor(){super();const t=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:t.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 t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}n(24);class wl extends Xa{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}n(26);class kl extends Xa{constructor(t){super(t);const e=this.bindTemplate,n=he();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",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+n,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.to("isOn",t=>!!this.isToggleable&&String(t))},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.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 t=new wl;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new Xa;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:this.bindTemplate.to("labelStyle"),id:"ck-editor__aria-label_"+t},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new Xa;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>ri(t))}]}),t}_getTooltipString(t,e,n){return t?"string"==typeof t?t:(n&&(n=ri(n)),t instanceof Function?t(e,n):`${e}${n?` (${n})`:""}`):""}}var _l='';class vl extends kl{constructor(t){super(t),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 t=new bl;return t.content=_l,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}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 t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class xl extends Xa{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Al extends Xa{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}n(30);class Cl extends kl{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new Xa;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function Tl({emitter:t,activator:e,callback:n,contextElements:i}){t.listenTo(document,"mousedown",(t,o)=>{if(!e())return;const r="function"==typeof o.composedPath?o.composedPath():[];for(const e of i)if(e.contains(o.target)||r.includes(e))return;n()})}function Sl(t,e=vl){const n=new e(t),i=new ul(t),o=new pl(t,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(t){(function(t){t.on("render",()=>{Tl({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof Cl||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,n)=>{t.isOpen&&(t.panelView.focus(),n())}),t.keystrokes.set("arrowup",(e,n)=>{t.isOpen&&(t.panelView.focusLast(),n())})}(t)}(o),o}function El(t,e){const n=t.locale,i=n.t,o=t.toolbarView=new Ml(n);o.set("ariaLabel",i("Dropdown toolbar")),t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>o.items.add(t)),t.panelView.children.add(o),o.items.delegate("execute").to(t)}function Pl(t,e){const n=t.locale,i=t.listView=new yl(n);i.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new Al(n);if("button"===t||"switchbutton"===t){const i=new xl(n);let o;return o="button"===t?new kl(n):new Cl(n),o.bind(...Object.keys(e)).to(e),o.delegate("execute").to(i),i.children.add(o),i}}),t.panelView.children.add(i),i.items.delegate("execute").to(t)}n(32),n(34),n(36);class Ml extends Xa{constructor(t,e){super(t);const n=this.bindTemplate,i=this.t;this.options=e||{},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(t),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(t=>{t.target===r.element&&t.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new Ol(this):new Nl(this)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.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(t,e){this.items.addMany(t.map(n=>"|"==n?new al:"-"==n?(this.options.shouldGroupWhenFull&&Object(me.c)("toolbarview-line-break-ignored-when-grouping-items",t),new ll):e.has(n)?e.create(n):void Object(me.c)("toolbarview-item-unavailable",{name:n})).filter(t=>void 0!==t))}}class Il extends Xa{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Nl{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(t=>t),t.focusables.bindTo(t.items).using(t=>t),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Ol{constructor(t){this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("change",(t,e)=>{const n=e.index;for(const i of e.removed)n>=this.ungroupedItems.length?this.groupedItems.remove(i):this.ungroupedItems.remove(i);for(let i=n;ithis.ungroupedItems.length?this.groupedItems.add(t,i-this.ungroupedItems.length):this.ungroupedItems.add(t,i)}this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}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 t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,n=new jo(t.lastChild),i=new jo(t);if(!this.cachedPadding){const n=qi.window.getComputedStyle(t);this.cachedPadding=Number.parseInt(n["ltr"===e?"paddingRight":"paddingLeft"])}return"ltr"===e?n.right>i.right-this.cachedPadding:n.left{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.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 t=this.viewLocale,e=t.t,n=Sl(t);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",El(n,[]),n.buttonView.set({label:e("Show more items"),tooltip:!0,icon:''}),n.toolbarView.items.bindTo(this.groupedItems).using(t=>t),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class Rl extends nl{constructor(t,e,n={}){super(t),this.toolbar=new Ml(t,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new ol(t,e,n.editableElement),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}class Dl extends _a{constructor(t,e){super(e),se(t)&&(this.sourceElement=t,function(t){const e=t.sourceElement;if(e){if(e.ckeditorInstance)throw new me.a("editor-source-element-already-used",t);e.ckeditorInstance=t,t.once("destroy",()=>{delete e.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 t=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&function(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}(this.sourceElement,t)})}static create(t,e={}){return new Promise(n=>{const i=se(t);if(i&&"TEXTAREA"===t.tagName)throw new me.a("editor-wrong-element",null);const o=new this(t,e);n(o.initPlugins().then(()=>{o.ui.init()}).then(()=>{if(!i&&e.initialData)throw new me.a("editor-create-initial-data",null);const n=e.initialData||function(t){return se(t)?(e=t)instanceof HTMLTextAreaElement?e.value:e.innerHTML:t;var e}(t);return o.data.init(n)}).then(()=>o.fire("ready")).then(()=>o))})}}Ce(Dl,va);class Ll{constructor(t){this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",zl,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",zl),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function zl(t){t.return=!1,t.stop()}Ce(Ll,Sn);class Vl{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],n=t.items?Array.from(t.items):[];return e.length?e:n.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}}class jl extends ko{constructor(t){super(t);const e=this.document;function n(t,n){n.preventDefault();const i=n.dropRange?[n.dropRange]:Array.from(e.selection.getRanges()),o=new de(e,"clipboardInput");e.fire(o,{dataTransfer:n.dataTransfer,targetRanges:i}),o.stop.called&&n.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(e,"paste",n,{priority:"low"}),this.listenTo(e,"drop",n,{priority:"low"})}onDomEvent(t){const e={dataTransfer:new Vl(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"==t.type&&(e.dropRange=function(t,e){const n=e.target.ownerDocument,i=e.clientX,o=e.clientY;let r;return n.caretRangeFromPoint&&n.caretRangeFromPoint(i,o)?r=n.caretRangeFromPoint(i,o):e.rangeParent&&(r=n.createRange(),r.setStart(e.rangeParent,e.rangeOffset),r.collapse(!0)),r?t.domConverter.domRangeToView(r):t.document.selection.getFirstRange()}(this.view,t)),this.fire(t.type,t,e)}}class Bl extends Ll{static get pluginName(){return"PastePlainText"}init(){const t=this.editor.editing.view,e=t.document;let n=!1;t.addObserver(jl),this.listenTo(e,"keydown",(t,e)=>{n=e.shiftKey}),this.listenTo(e,"clipboardInput",(t,e)=>{n&&(e.asPlainText=!0)},{priority:"high"})}}const Fl=["figcaption","li"];class Hl extends Ll{static get pluginName(){return"Clipboard"}static get requires(){return[Bl]}init(){const t=this.editor,e=t.model.document,n=t.editing.view,i=n.document;function o(n,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));i.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this._htmlDataProcessor=new xa(i),n.addObserver(jl),this.listenTo(i,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(t,e)=>{const i=e.dataTransfer;let o="";var r;i.getData("text/html")?o=function(t){return t.replace(/(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(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 de(this,"inputTransformation");this.fire(s,{content:o,dataTransfer:i,asPlainText:e.asPlainText}),s.stop.called&&t.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const n=this.editor.model,i=this.editor.data.toModel(e.content,"$clipboardHolder");if(0==i.childCount)return;n.change(t=>{const o=n.document.selection;if(e.asPlainText||function(t,e){if(t.childCount>1)return!1;const n=t.getChild(0);return!e.isObject(n)&&0==[...n.getAttributeKeys()].length}(i,n.schema)){const e=Array.from(o.getAttributes()).filter(([t])=>n.schema.getAttributeProperties(t).isFormatting);o.isCollapsed||n.deleteContent(o,{doNotAutoparagraph:!0}),e.push(...o.getAttributes());const r=t.createRangeIn(i);for(const n of r.getItems())(n.is("$text")||n.is("$textProxy"))&&t.setAttributes(e,n)}n.insertContent(i)}),t.stop()}},{priority:"low"}),this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",(e,n)=>{t.isReadOnly?n.preventDefault():o(e,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 t(e){let n="";if(e.is("$text")||e.is("$textProxy"))n=e.data;else if(e.is("element","img")&&e.hasAttribute("alt"))n=e.getAttribute("alt");else if(e.is("element","br"))n="\n";else{let i=null;for(const o of e.getChildren()){const e=t(o);i&&(i.is("containerElement")||o.is("containerElement"))&&(Fl.includes(i.name)||Fl.includes(o.name)?n+="\n":n+="\n\n"),n+=e,i=o}}return n}(i.content))),"cut"==i.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}class Ul{constructor(t){this.editor=t,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",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",ql,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",ql),this.refresh())}execute(){}destroy(){this.stopListening()}}function ql(t){t.return=!1,t.stop()}function*Wl(t,e){for(const n of e)n&&t.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}Ce(Ul,Sn);class $l extends Ul{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,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||t.deleteContent(n);else if(o){const t=Wl(e.model.schema,n.getAttributes());Yl(e,r.start),e.setSelectionAttribute(t)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;t.deleteContent(n,{leaveUnmerged:i}),i&&(o?Yl(e,n.focus):e.setSelection(a,0))}}(this.editor.model,n,e.selection,t.schema),this.fire("afterExecute",{writer:n})})}}function Yl(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class Gl extends no{constructor(t){super(t);const e=this.document;e.on("keydown",(t,n)=>{if(this.isEnabled&&n.keyCode==ni.enter){let i;e.once("enter",t=>i=t,{priority:"highest"}),e.fire("enter",new wo(e,n.domEvent,{isSoft:n.shiftKey})),i&&i.stop.called&&t.stop()}})}observe(){}}class Kl extends Ll{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Gl),t.commands.add("enter",new $l(t)),this.listenTo(n,"enter",(n,i)=>{i.preventDefault(),i.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class Ql extends Ul{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n){const i=n.isCollapsed,o=n.getFirstRange(),r=o.end.parent,s=o.start.parent==r;if(i){const i=Wl(t.schema,n.getAttributes());Jl(t,e,o.end),e.removeSelectionAttribute(n.getAttributeKeys()),e.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:i}),s?Jl(t,e,n.focus):i&&e.setSelection(r,0)}}(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const n=e.anchor;if(!n||!t.checkChild(n,"softBreak"))return!1;const i=e.getFirstRange(),o=i.start.parent,r=i.end.parent;return!Zl(o,t)&&!Zl(r,t)||o===r}(t.schema,t.document.selection)}}function Jl(t,e,n){const i=e.createElement("softBreak");t.insertContent(i,n),e.setSelection(i,"after")}function Zl(t,e){return!t.is("rootElement")&&(e.isLimit(t)||Zl(t.parent,e))}class Xl extends Ll{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.conversion,n=t.editing.view,i=n.document;t.model.schema.register("softBreak",{allowWhere:"$text",isInline:!0}),e.for("upcast").elementToElement({model:"softBreak",view:"br"}),e.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")}),n.addObserver(Gl),t.commands.add("shiftEnter",new Ql(t)),this.listenTo(i,"enter",(e,i)=>{i.preventDefault(),i.isSoft&&(t.execute("shiftEnter"),n.scrollToTheSelection())},{priority:"low"})}}class tc extends Ul{execute(){const t=this.editor.model,e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!ec(t.schema,n))do{if(n=n.parent,!n)return}while(!ec(t.schema,n));t.change(t=>{t.setSelection(n,"in")})}}function ec(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const nc=oi("Ctrl+A");class ic extends Ll{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new tc(t)),this.listenTo(e,"keydown",(e,n)=>{ii(n)===nc&&(t.execute("selectAll"),n.preventDefault())})}}class oc extends Ll{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const n=t.commands.get("selectAll"),i=new kl(e);return i.set({label:(0,e.t)("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),i})}}class rc extends Ll{static get requires(){return[ic,oc]}static get pluginName(){return"SelectAll"}}class sc{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{"transparent"!=e.type&&e!==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(t){this.size+=t,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(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class ac extends Ul{constructor(t,e){super(t),this._buffer=new sc(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,i=t.text||"",o=i.length,r=t.range?e.createSelection(t.range):n.selection,s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock(),this._batches.add(this._buffer.batch),e.deleteContent(r),i&&e.insertContent(t.createText(i,n.selection.getAttributes()),r),s?t.setSelection(s):r.is("documentSelection")||t.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(t){return!!t.ctrlKey||lc.includes(t.keyCode)}function dc(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const n=[];let i,o=0;return t.forEach(t=>{"equal"==t?(r(),o++):"insert"==t?(s("insert")?i.values.push(e[o]):(r(),i={type:"insert",index:o,values:[e[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(t){return i&&i.type==t}}(Li(t.oldChildren,t.newChildren,uc),t.newChildren);if(e.length>1)return;const n=e[0];return n.values[0]&&n.values[0].is("$text")?n:void 0}function uc(t,e){return t&&t.is("$text")&&e&&e.is("$text")?t.data===e.data:t===e}class hc{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!dc(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const n of t)this._handleTextMutation(n,e),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(t,e){const n=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(e)return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),o=new Gi(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(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," "),g=l.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," ");if(g===m)return;const p=Li(g,m),{firstChangeAt:b,insertions:w,deletions:k}=mc(p);let _=null;e&&(_=this.editing.mapper.toModelRange(e.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(t,e){if("text"!=t.type)return;const n=t.newText.replace(/\u00A0/g," "),i=t.oldText.replace(/\u00A0/g," ");if(i===n)return;const o=Li(i,n),{firstChangeAt:r,insertions:s,deletions:a}=mc(o);let l=null;e&&(l=this.editing.mapper.toModelRange(e.getFirstRange()));const c=this.editing.view.createPositionAt(t.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(t){if("children"!=t.type)return;const e=dc(t),n=this.editing.view.createPositionAt(t.node,e.index),i=this.editing.mapper.toModelPosition(n);this.editor.execute("input",{text:e.values[0].data.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function fc(t,e){return t.every(t=>e.isInline(t))}function mc(t){let e=null,n=null;for(let r=0;r{n.deleteContent(n.document.selection)}),t.unlock()}i.document.on(Xn?"beforeinput":"keydown",(t,e)=>r(e),{priority:"lowest"}),i.document.on("compositionstart",(function(){const t=n.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;t.selection.isCollapsed||e||s()}),{priority:"lowest"}),i.document.on("compositionend",()=>{e=n.createSelection(n.document.selection)},{priority:"lowest"})}(t),function(t){t.editing.view.document.on("mutations",(e,n,i)=>{new hc(t).handle(n,i)})}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}}class pc extends Ul{constructor(t,e){super(t),this.direction=e,this._buffer=new sc(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const o=i.createSelection(t.selection||n.selection),r=o.isCollapsed;if(o.isCollapsed&&e.modifySelection(o,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void this._replaceEntireContentWithParagraph(i);if(o.isCollapsed)return;let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(t=>{s+=Bn(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(o,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(s),i.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(i))return!1;if(!e.schema.checkChild(i,"paragraph"))return!1;const o=i.getChild(0);return!o||"paragraph"!==o.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.schema.getLimitElement(e.document.selection),i=t.createElement("paragraph");t.remove(t.createRangeIn(n)),t.insert(i,n),t.setSelection(i,0)}}class bc extends no{constructor(t){super(t);const e=t.document;let n=0;function i(t,n,i){let o;e.once("delete",t=>o=t,{priority:Number.POSITIVE_INFINITY}),e.fire("delete",new wo(e,n,i)),o&&o.stop.called&&t.stop()}e.on("keyup",(t,e)=>{e.keyCode!=ni.delete&&e.keyCode!=ni.backspace||(n=0)}),e.on("keydown",(t,e)=>{const o={};if(e.keyCode==ni.delete)o.direction="forward",o.unit="character";else{if(e.keyCode!=ni.backspace)return;o.direction="backward",o.unit="codePoint"}o.unit=(Qn?e.altKey:e.ctrlKey)?"word":o.unit,o.sequence=++n,i(t,e.domEvent,o)}),Xn&&e.on("beforeinput",(e,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=t.domConverter.domSelectionToView(r)),i(e,n.domEvent,o)})}observe(){}}class wc extends Ll{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document;if(e.addObserver(bc),t.commands.add("forwardDelete",new pc(t,"forward")),t.commands.add("delete",new pc(t,"backward")),this.listenTo(n,"delete",(n,i)=>{const o={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const e=t.model.createSelection(),n=[];for(const o of i.selectionToRemove.getRanges())n.push(t.editing.mapper.toModelRange(o));e.setTo(n),o.selection=e}t.execute("forward"==i.direction?"forwardDelete":"delete",o),i.preventDefault(),e.scrollToTheSelection()}),Xn){let t=null;this.listenTo(n,"delete",(e,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(e,n)=>{if(t){const e=n.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}})}}}class kc extends Ll{static get requires(){return[gc,wc]}static get pluginName(){return"Typing"}}const _c=new Map;function vc(t,e,n){let i=_c.get(t);i||(i=new Map,_c.set(t,i)),i.set(e,n)}function yc(t){return[t]}function xc(t,e,n={}){const i=function(t,e){const n=_c.get(t);return n&&n.has(e)?n.get(e):yc}(t.constructor,e.constructor);try{return i(t=t.clone(),e,n)}catch(t){throw t}}function Ac(t,e,n){t=t.slice(),e=e.slice();const i=new Cc(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(t),i.setOriginalOperations(e);const o=i.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:o};const r=new WeakMap;for(const l of t)r.set(l,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const i=t.range.getDifference(e.range).map(e=>new Ss(e,t.key,t.oldValue,t.newValue,0)),o=t.range.getIntersection(e.range);return o&&n.aIsStrong&&i.push(new Ss(o,e.key,e.newValue,t.newValue,0)),0==i.length?[new ta(0)]:i}return[t]}),vc(Ss,Ms,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const n=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new Ss(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const i=Ec(e,t.key,t.oldValue);i&&n.unshift(i)}return n}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),vc(Ss,Rs,(t,e)=>{const n=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&n.push(dr._createFromPositionAndShift(e.graveyardPosition,1));const i=t.range._getTransformedByMergeOperation(e);return i.isCollapsed||n.push(i),n.map(e=>new Ss(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),vc(Ss,Ps,(t,e)=>function(t,e){const n=dr._createFromPositionAndShift(e.sourcePosition,e.howMany);let i=null,o=[];n.containsRange(t,!0)?i=t:t.start.hasSameParentAs(n.start)?(o=t.getDifference(n),i=t.getIntersection(n)):o=[t];const r=[];for(let s of o){s=s._getTransformedByDeletion(e.sourcePosition,e.howMany);const t=e.getMovedRangeStart(),n=s.start.hasSameParentAs(t);s=s._getTransformedByInsertion(t,e.howMany,n),r.push(...s)}return i&&r.push(i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]),r}(t.range,e).map(e=>new Ss(e,t.key,t.oldValue,t.newValue,t.baseVersion))),vc(Ss,Ds,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const n=t.clone();return n.range=new dr(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,n]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),vc(Ms,Ss,(t,e)=>{const n=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const i=Ec(t,e.key,e.newValue);i&&n.push(i)}return n}),vc(Ms,Ms,(t,e,n)=>(t.position.isEqual(e.position)&&n.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t])),vc(Ms,Ps,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),vc(Ms,Ds,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),vc(Ms,Rs,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),vc(Is,Ms,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),vc(Is,Is,(t,e,n)=>{if(t.name==e.name){if(!n.aIsStrong)return[new ta(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]}),vc(Is,Rs,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),vc(Is,Ps,(t,e,n)=>{if(t.oldRange&&(t.oldRange=dr._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(n.abRelation){const i=dr._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==n.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=n.abRelation.path,t.newRange.end=i.end,[t];if("right"==n.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=i.start,t.newRange.end.path=n.abRelation.path,[t]}t.newRange=dr._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}),vc(Is,Ds,(t,e,n)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(n.abRelation){const i=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?t.newRange.start=sr._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!n.abRelation.wasInLeftElement&&(t.newRange.start=sr._createAt(e.moveTargetPosition)),t.newRange.end=t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasInRightElement?sr._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?sr._createAt(e.insertionPosition):i.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}),vc(Rs,Ms,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),vc(Rs,Rs,(t,e,n)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(n.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),t.sourcePosition=new sr(e.graveyardPosition.root,n),t.howMany=0,[t]}return[new ta(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const i="$graveyard"==t.targetPosition.root.rootName,o="$graveyard"==e.targetPosition.root.rootName,r=i&&!o;if(o&&!i||!r&&n.aIsStrong){const n=e.targetPosition._getTransformedByMergeOperation(e),i=t.targetPosition._getTransformedByMergeOperation(e);return[new Ps(n,t.howMany,i,0)]}return[new ta(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&n.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),vc(Rs,Ps,(t,e,n)=>{const i=dr._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!n.bWasUndone&&!n.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition)?[new ta(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),vc(Rs,Ds,(t,e,n)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const i=0!=e.howMany,o=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(i||o||"mergeTargetNotMoved"==n.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==n.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}),vc(Ps,Ms,(t,e)=>{const n=dr._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),vc(Ps,Ps,(t,e,n)=>{const i=dr._createFromPositionAndShift(t.sourcePosition,t.howMany),o=dr._createFromPositionAndShift(e.sourcePosition,e.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=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Pc(t,e)&&Pc(e,t))return[e.getReversed()];if(i.containsPosition(e.targetPosition)&&i.containsRange(o,!0))return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Mc([i],r);if(o.containsPosition(t.targetPosition)&&o.containsRange(i,!0))return i.start=i.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),i.end=i.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Mc([i],r);const l=Oe(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Mc([i],r);"remove"!=t.type||"remove"==e.type||n.aWasUndone||n.forceWeakRemove?"remove"==t.type||"remove"!=e.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(e.sourcePosition,e.howMany),h.end=h.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const t="same"==Oe(h.start.getParentPath(),e.getMovedRangeStart().getParentPath()),n=h._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,t);c.push(...n)}const u=i.getIntersection(o);return null!==u&&s&&(u.start=u.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),u.end=u.end._getCombined(e.sourcePosition,e.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 ta(t.baseVersion)]:Mc(c,r)}),vc(Ps,Ds,(t,e,n)=>{let i=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(i=t.targetPosition._getTransformedBySplitOperation(e));const o=dr._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=i,[t];if(o.start.hasSameParentAs(e.splitPosition)&&o.containsPosition(e.splitPosition)){let t=new dr(e.splitPosition,o.end);return t=t._getTransformedBySplitOperation(e),Mc([new dr(o.start,e.splitPosition),t],i)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==n.abRelation&&(i=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==n.abRelation&&(i=t.targetPosition);const r=[o._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const i=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);t.howMany>1&&i&&!n.aWasUndone&&r.push(dr._createFromPositionAndShift(e.insertionPosition,1))}return Mc(r,i)}),vc(Ps,Rs,(t,e,n)=>{const i=dr._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition))if("remove"!=t.type||n.forceWeakRemove){if(1==t.howMany)return n.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new ta(0)]}else if(!n.aWasUndone){const n=[];let i=e.graveyardPosition.clone(),o=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(n.push(new Ps(t.sourcePosition,t.howMany-1,t.targetPosition,0)),i=i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const r=e.deletionPosition._getCombined(t.sourcePosition,t.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,e.howMany,l,0);return n.push(s),n.push(c),n}const o=dr._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=o.start,t.howMany=o.end.offset-o.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),vc(Ns,Ms,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),vc(Ns,Rs,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),vc(Ns,Ps,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),vc(Ns,Ns,(t,e,n)=>{if(t.position.isEqual(e.position)){if(!n.aIsStrong)return[new ta(0)];t.oldName=e.newName}return[t]}),vc(Ns,Ds,(t,e)=>{if("same"==Oe(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new Ns(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),vc(Os,Os,(t,e,n)=>{if(t.root===e.root&&t.key===e.key){if(!n.aIsStrong||t.newValue===e.newValue)return[new ta(0)];t.oldValue=e.newValue}return[t]}),vc(Ds,Ms,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset{if(!t.graveyardPosition&&!n.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const i=new sr(e.graveyardPosition.root,n),o=Ds.getInsertionPosition(new sr(e.graveyardPosition.root,n)),r=new Ds(i,0,null,0);return r.insertionPosition=o,t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=Ds.getInsertionPosition(t.splitPosition),t.graveyardPosition=r.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[r,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=Ds.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),vc(Ds,Ps,(t,e,n)=>{const i=dr._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const o=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);if(!n.bWasUndone&&o){const n=t.splitPosition._getTransformedByMoveOperation(e),i=t.graveyardPosition._getTransformedByMoveOperation(e),o=i.path.slice();o.push(0);const r=new sr(i.root,o);return[new Ps(n,t.howMany,r,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}return t.splitPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.splitPosition)?(t.howMany-=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset),t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new ta(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new ta(0)];if("splitBefore"==n.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const i="$graveyard"==t.splitPosition.root.rootName,o="$graveyard"==e.splitPosition.root.rootName,r=i&&!o;if(o&&!i||!r&&n.aIsStrong){const n=[];return e.howMany&&n.push(new Ps(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&n.push(new Ps(t.splitPosition,t.howMany,t.moveTargetPosition,0)),n}return[new ta(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.baRelation){const n=e.insertionPosition.path.slice();n.push(0);const i=new sr(e.insertionPosition.root,n);return[t,new Ps(t.insertionPosition,1,i,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model,o=i.document,r=[],s=t.map(t=>t.getTransformedByOperations(n)),a=s.flat();for(const l of s){const t=l.filter(t=>t.root!=o.graveyard).filter(t=>!Oc(t,a));t.length&&(Nc(t),r.push(t[0]))}r.length&&i.change(t=>{t.setSelection(r,{backward:e})})}_undo(t,e){const n=this.editor.model,i=n.document;this._createdBatches.add(e);const o=t.operations.slice().filter(t=>t.isDocumentOperation);o.reverse();for(const r of o){const t=Array.from(i.history.getOperations(r.baseVersion+1)),o=Ac([r.getReversed()],t,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const s of o)e.addOperation(s),n.applyOperation(s),i.history.setOperationAsUndone(r,s)}}}function Nc(t){t.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let e=1;ee!==t&&e.containsRange(t,!0))}class Rc extends Ic{execute(t=null){const e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const t=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t),this.fire("revert",n.batch,i)}),this.refresh()}}class Dc extends Ic{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,()=>{const n=this.editor.model.document.history.getOperations(t.batch.operations[t.batch.operations.length-1].baseVersion+1);this._restoreSelection(t.selection.ranges,t.selection.isBackward,n),this._undo(t.batch,e)}),this.refresh()}}class Lc extends Ll{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new Rc(t),this._redoCommand=new Dc(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const n=e[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",(t,e,n)=>{this._redoCommand.addBatch(n)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var zc='',Vc='';class jc extends Ll{init(){const t=this.editor,e=t.locale,n=t.t,i="ltr"==e.uiLanguageDirection?zc:Vc,o="ltr"==e.uiLanguageDirection?Vc:zc;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(t,e,n,i){const o=this.editor;o.ui.componentFactory.add(t,r=>{const s=o.commands.get(t),a=new kl(r);return a.set({label:e,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(t),o.editing.view.focus()}),a})}}class Bc extends Ll{static get requires(){return[Lc,jc]}static get pluginName(){return"Undo"}}function Fc(t){const e=t.next();return e.done?null:e.value}const Hc=["left","right","center","justify"];function Uc(t){return Hc.includes(t)}function qc(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}class Wc extends Ul{refresh(){const t=this.editor.locale,e=Fc(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!e&&this._canBeAligned(e),this.value=this.isEnabled&&e.hasAttribute("alignment")?e.getAttribute("alignment"):"rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,n=e.locale,i=e.model,o=i.document,r=t.value;i.change(t=>{const e=Array.from(o.selection.getSelectedBlocks()).filter(t=>this._canBeAligned(t)),i=e[0].getAttribute("alignment");qc(r,n)||i===r||!r?function(t,e){for(const n of t)e.removeAttribute("alignment",n)}(e,t):function(t,e,n){for(const i of t)e.setAttribute("alignment",n,i)}(e,t,r)})}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,"alignment")}}class $c extends Ll{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...Hc]})}init(){const t=this.editor,e=t.locale,n=t.model.schema,i=t.config.get("alignment.options").filter(Uc);n.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0});const o=function(t){const e={model:{key:"alignment",values:t.slice()},view:{}};for(const n of t)e.view[n]={key:"style",value:{"text-align":n}};return e}(i.filter(t=>!qc(t,e)));t.conversion.attributeToAttribute(o),t.commands.add("alignment",new Wc(t))}}var Yc='',Gc='';const Kc=new Map([["left",Yc],["right",Gc],["center",''],["justify",'']]);class Qc extends Ll{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t,i=t.config.get("alignment.options");i.filter(Uc).forEach(t=>this._addButton(t)),e.add("alignment",t=>{const o=Sl(t),r=i.map(t=>e.create("alignment:"+t));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"===t.contentLanguageDirection?Gc:Yc;return o.buttonView.bind("icon").toMany(r,"isOn",(...t)=>{const e=t.findIndex(t=>t);return e<0?s:r[e].icon}),o.bind("isEnabled").toMany(r,"isEnabled",(...t)=>t.some(t=>t)),o})}_addButton(t){const e=this.editor;e.ui.componentFactory.add("alignment:"+t,n=>{const i=e.commands.get("alignment"),o=new kl(n);return o.set({label:this.localizedOptionTitles[t],icon:Kc.get(t),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",e=>e===t),this.listenTo(o,"execute",()=>{e.execute("alignment",{value:t}),e.editing.view.focus()}),o})}}class Jc extends Ul{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute(this.attributeKey),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=t.value;e.change(t=>{if(n.isCollapsed)i?t.setSelectionAttribute(this.attributeKey,i):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const e of o)i?t.setAttribute(this.attributeKey,i,e):t.removeAttribute(this.attributeKey,e)}})}}class Zc extends kl{constructor(t){super(t);const e=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:e.to("color")},class:["ck","ck-color-grid__tile",e.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(t,e){super(t);const n=e&&e.colorDefinitions||[],i={};e&&e.columns&&(i.gridTemplateColumns=`repeat( ${e.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",(t,e)=>{e.isOn=e.color===this.selectedColor}),n.forEach(t=>{const e=new Zc;e.set({color:t.color,label:t.label,tooltip:!0,hasBorder:t.options.hasBorder}),e.on("execute",()=>{this.fire("execute",{value:t.color,hasBorder:t.options.hasBorder,label:t.label})}),this.items.add(e)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:i}}),this.on("change:selectedColor",(t,e,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 t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}}n(40);class td extends Xa{constructor(t){super(t),this.set("text"),this.set("for"),this.id="ck-editor__label_"+he();const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class ed extends Te{constructor(t){super(t),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(t,e){this.find(e=>e.color===t.color)||super.add(t,e)}hasColor(t){return!!this.find(e=>e.color===t)}}Ce(ed,Sn),n(42);class nd extends Xa{constructor(t,{colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){super(t),this.items=this.createCollection(),this.colorDefinitions=e,this.focusTracker=new Ta,this.keystrokes=new wa,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new ed,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(t,e){const n=t.document,i=this.documentColorsCount;this.documentColors.clear();for(const o of n.getRootNames()){const r=n.getRoot(o),s=t.createRangeIn(r);for(const t of s.getItems())if(t.is("$textProxy")&&t.hasAttribute(e)&&(this._addColorToDocumentColors(t.getAttribute(e)),this.documentColors.length>=i))return}}updateSelectedColors(){const t=this.documentColorsGrid,e=this.selectedColor;this.staticColorsGrid.selectedColor=e,t&&(t.selectedColor=e)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const t=Ra.bind(this.documentColors,this.documentColors),e=new td(this.locale);e.text=this._documentColorsLabel,e.extendTemplate({attributes:{class:["ck","ck-color-grid__label",t.if("isEmpty","ck-hidden")]}}),this.items.add(e),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const t=new kl;return t.set({withText:!0,icon:'',tooltip:!0,label:this.removeButtonLabel}),t.class="ck-color-table__remove-color",t.on("execute",()=>{this.fire("execute",{value:null})}),t}_createStaticColorsGrid(){const t=new Xc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return t.delegate("execute").to(this),t}_createDocumentColorsGrid(){const t=Ra.bind(this.documentColors,this.documentColors),e=new Xc(this.locale,{columns:this.columns});return e.delegate("execute").to(this),e.extendTemplate({attributes:{class:t.if("isEmpty","ck-hidden")}}),e.items.bindTo(this.documentColors).using(t=>{const e=new Zc;return e.set({color:t.color,hasBorder:t.options&&t.options.hasBorder}),t.label&&e.set({label:t.label,tooltip:!0}),e.on("execute",()=>{this.fire("execute",{value:t.color})}),e}),this.documentColors.on("change:isEmpty",(t,n,i)=>{i&&(e.selectedColor=null)}),e}_addColorToDocumentColors(t){const e=this.colorDefinitions.find(e=>e.color===t);this.documentColors.add(e?Object.assign({},e):{color:t,label:t,options:{hasBorder:!1}})}}function id(t,e){const n={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const i of e)n.model.values.push(i.model),n.view[i.model]=i.view,i.upcastAlso&&(n.upcastAlso[i.model]=i.upcastAlso);return n}function od(t){return e=>e.getStyle(t).replace(/\s/g,"")}function rd(t){return(e,{writer:n})=>n.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}class sd extends Jc{constructor(t){super(t,"fontSize")}}function ad(t){return t.map(t=>function(t){if("object"==typeof(e=t)&&e.title&&e.model&&e.view)return cd(t);var e;const n=function(t){return ld[t]||ld[t.model]}(t);return n?cd(n):"default"===t?{model:void 0,title:"Default"}:function(t){let e;if("object"==typeof t){if(!t.model)throw new me.a("font-size-invalid-definition",null,t);e=parseFloat(t.model)}else e=parseFloat(t);return isNaN(e)}(t)?void 0:function(t){return"number"!=typeof t&&"string"!=typeof t||(t={title:String(t),model:parseFloat(t)+"px"}),t.view={name:"span",styles:{"font-size":t.model}},cd(t)}(t)}(t)).filter(t=>!!t)}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(t){return t.view.priority||(t.view.priority=7),t}class dd extends Ll{static get pluginName(){return"FontSizeEditing"}constructor(t){super(t),t.config.define("fontSize",{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontSize"}),t.model.schema.setAttributeProperties("fontSize",{isFormatting:!0,copyOnEnter:!0});const e=t.config.get("fontSize.supportAllValues"),n=id("fontSize",ad(this.editor.config.get("fontSize.options")).filter(t=>t.model));e?this._prepareAnyValueConverters(n):t.conversion.attributeToElement(n),t.commands.add("fontSize",new sd(t))}_prepareAnyValueConverters(t){const e=this.editor,n=t.model.values.filter(t=>!String(t).match(/[\d.]+[\w%]+/));if(n.length)throw new me.a("font-size-invalid-use-of-named-presets",null,{presets:n});e.conversion.for("downcast").attributeToElement({model:"fontSize",view:(t,{writer:e})=>{if(t)return e.createAttributeElement("span",{style:"font-size:"+t},{priority:7})}}),e.conversion.for("upcast").attributeToAttribute({model:{key:"fontSize",value:t=>t.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}}class ud{constructor(t,e){e&&yn(this,e),t&&this.set(t)}}Ce(ud,Sn),n(44);class hd extends Ll{init(){const t=this.editor,e=t.t,n=this._getLocalizedOptions(),i=t.commands.get("fontSize");t.ui.componentFactory.add("fontSize",o=>{const r=Sl(o);return Pl(r,function(t,e){const n=new Te;for(const i of t){const t={type:"button",model:new ud({commandName:"fontSize",commandParam:i.model,label:i.title,class:"ck-fontsize-option",withText:!0})};i.view&&i.view.styles&&t.model.set("labelStyle","font-size:"+i.view.styles["font-size"]),i.view&&i.view.classes&&t.model.set("class",`${t.model.class} ${i.view.classes}`),t.model.bind("isOn").to(e,"value",t=>t===i.model),n.add(t)}return n}(n,i)),r.buttonView.set({label:e("Font Size"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t,n={Default:e("Default"),Tiny:e("Tiny"),Small:e("Small"),Big:e("Big"),Huge:e("Huge")};return ad(t.config.get("fontSize").options).map(t=>{const e=n[t.title];return e&&e!=t.title&&(t=Object.assign({},t,{title:e})),t})}}class fd extends Jc{constructor(t){super(t,"fontFamily")}}function md(t){return t.map(gd).filter(t=>!!t)}function gd(t){return"object"==typeof t?t:"default"===t?{title:"Default",model:void 0}:"string"==typeof t?function(t){const e=t.replace(/"|'/g,"").split(","),n=e[0],i=e.map(pd).join(", ");return{title:n,model:i,view:{name:"span",styles:{"font-family":i},priority:7}}}(t):void 0}function pd(t){return(t=t.trim()).indexOf(" ")>0&&(t=`'${t}'`),t}class bd extends Ll{static get pluginName(){return"FontFamilyEditing"}constructor(t){super(t),t.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 t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontFamily"}),t.model.schema.setAttributeProperties("fontFamily",{isFormatting:!0,copyOnEnter:!0});const e=id("fontFamily",md(t.config.get("fontFamily.options")).filter(t=>t.model));t.config.get("fontFamily.supportAllValues")?this._prepareAnyValueConverters():t.conversion.attributeToElement(e),t.commands.add("fontFamily",new fd(t))}_prepareAnyValueConverters(){const t=this.editor;t.conversion.for("downcast").attributeToElement({model:"fontFamily",view:(t,{writer:e})=>e.createAttributeElement("span",{style:"font-family:"+t},{priority:7})}),t.conversion.for("upcast").attributeToAttribute({model:{key:"fontFamily",value:t=>t.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}}class wd extends Ll{init(){const t=this.editor,e=t.t,n=this._getLocalizedOptions(),i=t.commands.get("fontFamily");t.ui.componentFactory.add("fontFamily",o=>{const r=Sl(o);return Pl(r,function(t,e){const n=new Te;for(const i of t){const t={type:"button",model:new ud({commandName:"fontFamily",commandParam:i.model,label:i.title,withText:!0})};t.model.bind("isOn").to(e,"value",t=>t===i.model||!(!t||!i.model)&&t.split(",")[0].replace(/'/g,"").toLowerCase()===i.model.toLowerCase()),i.view&&i.view.styles&&t.model.set("labelStyle","font-family: "+i.view.styles["font-family"]),n.add(t)}return n}(n,i)),r.buttonView.set({label:e("Font Family"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t;return md(t.config.get("fontFamily").options).map(t=>("Default"===t.title&&(t.title=e("Default")),t))}}class kd extends Jc{constructor(t){super(t,"fontColor")}}class _d extends Ll{static get pluginName(){return"FontColorEditing"}constructor(t){super(t),t.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}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:"fontColor",value:od("color")}}),t.conversion.for("downcast").attributeToElement({model:"fontColor",view:rd("color")}),t.commands.add("fontColor",new kd(t)),t.model.schema.extend("$text",{allowAttributes:"fontColor"}),t.model.schema.setAttributeProperties("fontColor",{isFormatting:!0,copyOnEnter:!0})}}function vd(t){return"string"==typeof t?{model:t,label:t,hasBorder:!1,view:{name:"span",styles:{color:t}}}:{model:t.color,label:t.label||t.color,hasBorder:void 0!==t.hasBorder&&t.hasBorder,view:{name:"span",styles:{color:""+t.color}}}}class yd extends Ll{constructor(t,{commandName:e,icon:n,componentName:i,dropdownLabel:o}){super(t),this.commandName=e,this.componentName=i,this.icon=n,this.dropdownLabel=o,this.columns=t.config.get(this.componentName+".columns"),this.colorTableView=void 0}init(){const t=this.editor,e=t.locale,n=e.t,i=t.commands.get(this.commandName),o=function(t,e){const n=t.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 e.map(t=>{const e=i[t.label];return e&&e!=t.label&&(t.label=e),t})}(e,t.config.get(this.componentName).colors.map(vd).filter(t=>!!t)),r=t.config.get(this.componentName+".documentColors");t.ui.componentFactory.add(this.componentName,e=>{const s=Sl(e);return this.colorTableView=function({dropdownView:t,colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){const s=new nd(t.locale,{colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r});return t.colorTableView=s,t.panelView.children.add(s),s.delegate("execute").to(t,"execute"),s}({dropdownView:s,colors:o.map(t=>({label:t.label,color:t.model,options:{hasBorder:t.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",(e,n)=>{t.execute(this.commandName,n),t.editing.view.focus()}),s.on("change:isOpen",(e,n,i)=>{s.colorTableView.appendGrids(),i&&(0!==r&&this.colorTableView.updateDocumentColors(t.model,this.componentName),this.colorTableView.updateSelectedColors())}),s})}}class xd extends yd{constructor(t){super(t,{commandName:"fontColor",componentName:"fontColor",icon:'',dropdownLabel:(0,t.locale.t)("Font Color")})}static get pluginName(){return"FontColorUI"}}class Ad extends Jc{constructor(t){super(t,"fontBackgroundColor")}}const Cd=/^#([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(t){return t.startsWith("#")?Cd.test(t):t.startsWith("rgb")?Td.test(t)||Sd.test(t):t.startsWith("hsl")?Ed.test(t)||Pd.test(t):Md.has(t.toLowerCase())}const Nd=["repeat-x","repeat-y","repeat","space","round","no-repeat"],Od=["center","top","bottom","left","right"];function Rd(t){return Od.includes(t)}const Dd=["fixed","scroll","local"];function Ld(t){return Dd.includes(t)}const zd=/^url\(/;function Vd(t){return zd.test(t)}function jd(t=""){if(""===t)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const e=Fd(t),n=e[0],i=e[1]||n;return{top:n,bottom:e[2]||n,right:i,left:e[3]||i}}function Bd({top:t,right:e,bottom:n,left:i}){const o=[];return i!==e?o.push(t,e,n,i):n!==t?o.push(t,e,n):e!==t?o.push(t,e):o.push(t),o.join(" ")}function Fd(t){return t.replace(/, /g,",").split(" ").map(t=>t.replace(/,/g,", "))}function Hd(t){t.setNormalizer("background",Ud),t.setNormalizer("background-color",t=>({path:"background.color",value:t})),t.setReducer("background",t=>{const e=[];return e.push(["background-color",t.color]),e})}function Ud(t){const e={},n=Fd(t);for(const i of n)Nd.includes(i)?(e.repeat=e.repeat||[],e.repeat.push(i)):Rd(i)?(e.position=e.position||[],e.position.push(i)):Ld(i)?e.attachment=i:Id(i)?e.color=i:Vd(i)&&(e.image=i);return{path:"background",value:e}}class qd extends Ll{static get pluginName(){return"FontBackgroundColorEditing"}constructor(t){super(t),t.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}),t.data.addStyleProcessorRules(Hd),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:"fontBackgroundColor",value:od("background-color")}}),t.conversion.for("downcast").attributeToElement({model:"fontBackgroundColor",view:rd("background-color")}),t.commands.add("fontBackgroundColor",new Ad(t)),t.model.schema.extend("$text",{allowAttributes:"fontBackgroundColor"}),t.model.schema.setAttributeProperties("fontBackgroundColor",{isFormatting:!0,copyOnEnter:!0})}}class Wd extends yd{constructor(t){super(t,{commandName:"fontBackgroundColor",componentName:"fontBackgroundColor",icon:'',dropdownLabel:(0,t.locale.t)("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class $d{constructor(t){this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}Ce($d,Sn);class Yd extends $d{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Te({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new me.a("pendingactions-add-invalid-message",this);const e=Object.create(Sn);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Gd{constructor(){const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((n,i)=>{e.onload=()=>{const t=e.result;this._data=t,n(t)},e.onerror=()=>{i("error")},e.onabort=()=>{i("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}Ce(Gd,Sn);class Kd extends Ll{static get pluginName(){return"FileRepository"}static get requires(){return[Yd]}init(){this.loaders=new Te,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",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return Object(me.c)("filerepository-no-upload-adapter"),null;const e=new Qd(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(t=>{this._loadersMap.set(t,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof Qd?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((t,n)=>{t===e&&this._loadersMap.delete(n)})}_updatePendingAction(){const t=this.editor.plugins.get(Yd);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}Ce(Kd,Sn);class Qd{constructor(t,e){this.id=he(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new Gd,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new me.a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if("reading"!==this.status)throw this.status;return this.status="idle",t}).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:t})}upload(){if("idle"!=this.status)throw new me.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==t?this._reader.abort():"uploading"==t&&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(t){const e={};return e.promise=new Promise((n,i)=>{e.rejecter=i,e.isFulfilled=!1,t.then(t=>{e.isFulfilled=!0,n(t)}).catch(t=>{e.isFulfilled=!0,i(t)})}),e}}Ce(Qd,Sn);class Jd extends Ll{static get requires(){return[Kd]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(Kd).createUploadAdapter=e=>new Zd(e,t,this.editor.t))}}class Zd{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return this.loader.file.then(t=>new Promise((e,n)=>{this._initRequest(),this._initListeners(e,n,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,n){const i=this.xhr,o=this.loader,r=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>e(r)),i.addEventListener("abort",()=>e()),i.addEventListener("load",()=>{const n=i.response;if(!n||!n.uploaded)return e(n&&n.error&&n.error.message?n.error.message:r);t({default:n.url})}),i.upload&&i.upload.addEventListener("progress",t=>{t.lengthComputable&&(o.uploadTotal=t.total,o.uploaded=t.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",function(){let t=function(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const n of e){const e=n.split("=");if(decodeURIComponent(e[0].trim().toLowerCase())===t)return decodeURIComponent(e[1])}return null}("ckCsrfToken");var e;return t&&40==t.length||(t=function(t){let e="";const n=new Uint8Array(40);window.crypto.getRandomValues(n);for(let i=0;i.5?t.toUpperCase():t}return e}(),e=t,document.cookie=encodeURIComponent("ckCsrfToken")+"="+encodeURIComponent(e)+";path=/"),t}()),this.xhr.send(e)}}function Xd(t,e,n,i){let o,r=null;"function"==typeof i?o=i:(r=t.commands.get(i),o=()=>{t.execute(i)}),t.model.document.on("change:data",(i,s)=>{if(r&&!r.isEnabled||!e.isEnabled)return;const a=Fc(t.model.document.selection.getRanges());if(!a.isCollapsed)return;if("transparent"==s.type)return;const l=Array.from(t.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=t.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&&t.model.enqueueChange(t=>{const e=t.createPositionAt(d,0),n=t.createPositionAt(d,f[0].length),i=new xr(e,n);!1!==o({match:f})&&t.remove(i),i.detach()})})}function tu(t,e,n,i){let o,r;n instanceof RegExp?o=n:r=n,r=r||(t=>{let e;const n=[],i=[];for(;null!==(e=o.exec(t))&&!(e&&e.length<4);){let{index:t,1:o,2:r,3:s}=e;t+=e[0].length-(o+r+s).length;const a=[t+o.length+r.length,t+o.length+r.length+s.length];n.push([t,t+o.length]),n.push(a),i.push([t+o.length,t+o.length+r.length])}return{remove:n,format:i}}),t.model.document.on("change:data",(n,o)=>{if("transparent"==o.type||!e.isEnabled)return;const s=t.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(t,e){let n=t.start;return{text:Array.from(t.getItems()).reduce((t,i)=>!i.is("$text")&&!i.is("$textProxy")||i.getAttribute("code")?(n=e.createPositionAfter(i),""):t+i.data,""),range:e.createRange(n,t.end)}}(s.createRange(s.createPositionAt(u,0),d),s),m=r(h),g=eu(f.start,m.format,s),p=eu(f.start,m.remove,s);g.length&&p.length&&s.enqueueChange(t=>{if(!1!==i(t,g))for(const e of p.reverse())t.remove(e)})})}function eu(t,e,n){return e.filter(t=>void 0!==t[0]&&void 0!==t[1]).map(e=>n.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1])))}function nu(t,e){return(n,i)=>{if(!t.commands.get(e).isEnabled)return!1;const o=t.model.schema.getValidRanges(i,e);for(const t of o)n.setAttribute(e,!0,t);n.removeSelectionAttribute(e)}}class iu extends Ul{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(n.isCollapsed)i?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const e of o)i?t.setAttribute(this.attributeKey,i,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const t of i.getItems())if(e.checkAttribute(t,this.attributeKey))return t.hasAttribute(this.attributeKey);return!1}}class ou extends Ll{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"bold"}),t.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add("bold",new iu(t,"bold")),t.keystrokes.set("CTRL+B","bold")}}class ru extends Ll{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("bold",n=>{const i=t.commands.get("bold"),o=new kl(n);return o.set({label:e("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("bold"),t.editing.view.focus()}),o})}}class su extends Ll{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"italic"}),t.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add("italic",new iu(t,"italic")),t.keystrokes.set("CTRL+I","italic")}}class au extends Ll{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("italic",n=>{const i=t.commands.get("italic"),o=new kl(n);return o.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("italic"),t.editing.view.focus()}),o})}}class lu extends Ll{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"strikethrough"}),t.model.schema.setAttributeProperties("strikethrough",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"strikethrough",view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add("strikethrough",new iu(t,"strikethrough")),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}class cu extends Ll{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("strikethrough",n=>{const i=t.commands.get("strikethrough"),o=new kl(n);return o.set({label:e("Strikethrough"),icon:'',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("strikethrough"),t.editing.view.focus()}),o})}}class du extends Ll{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"underline"}),t.model.schema.setAttributeProperties("underline",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"underline",view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add("underline",new iu(t,"underline")),t.keystrokes.set("CTRL+U","underline")}}class uu extends Ll{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("underline",n=>{const i=t.commands.get("underline"),o=new kl(n);return o.set({label:e("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("underline"),t.editing.view.focus()}),o})}}class hu extends Ul{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.schema,i=Array.from(e.document.selection.getSelectedBlocks()),o=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(o){const e=i.filter(t=>fu(t)||gu(n,t));this._applyQuote(t,e)}else this._removeQuote(t,i.filter(fu))})}_getValue(){const t=Fc(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!fu(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.schema,e=Fc(this.editor.model.document.selection.getSelectedBlocks());return!!e&&gu(t,e)}_removeQuote(t,e){mu(t,e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const n=t.createPositionBefore(e.start.parent);return void t.move(e,n)}e.end.isAtEnd||t.split(e.end);const n=t.createPositionAfter(e.end.parent);t.move(e,n)})}_applyQuote(t,e){const n=[];mu(t,e).reverse().forEach(e=>{let i=fu(e.start);i||(i=t.createElement("blockQuote"),t.wrap(e,i)),n.push(i)}),n.reverse().reduce((e,n)=>e.nextSibling==n?(t.merge(t.createPositionAfter(e)),e):n)}}function fu(t){return"blockQuote"==t.parent.name?t.parent:null}function mu(t,e){let n,i=0;const o=[];for(;i{if(t.endsWith("blockQuote")&&"blockQuote"==e.name)return!1}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(n=>{const i=t.model.document.differ.getChanges();for(const t of i)if("insert"==t.type){const i=t.position.nodeAfter;if(!i)continue;if(i.is("element","blockQuote")&&i.isEmpty)return n.remove(i),!0;if(i.is("element","blockQuote")&&!e.checkChild(t.position,i))return n.unwrap(i),!0;if(i.is("element")){const t=n.createRangeIn(i);for(const i of t.getItems())if(i.is("element","blockQuote")&&!e.checkChild(n.createPositionBefore(i),i))return n.unwrap(i),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty)return n.remove(e),!0}return!1})}afterInit(){const t=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,n)=>{const i=this.editor.model.document,o=i.selection.getLastPosition().parent;i.selection.isCollapsed&&o.isEmpty&&t.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())})}}n(46);class bu extends Ll{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const i=t.commands.get("blockQuote"),o=new kl(n);return o.set({label:e("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),o})}}class wu extends Ll{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("ckfinder",n=>{const i=t.commands.get("ckfinder"),o=new kl(n);return o.set({label:e("Insert image or file"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i),o.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),o})}}class ku extends no{observe(t){this.listenTo(t,"load",(t,e)=>{const n=e.target;this.checkShouldIgnoreEventFromTarget(n)||"IMG"==n.tagName&&this._fireEvents(e)},{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}class _u{constructor(){this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const o=n[0];i===o||vu(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const o=n[0];i===o||vu(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t.id);if(vu(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&yu(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t);n>-1&&e.splice(n,1)}}function vu(t,e){return t&&e&&t.priority==e.priority&&xu(t.classes)==xu(e.classes)}function yu(t,e){return t.priority>e.priority||!(t.priorityxu(e.classes)}function xu(t){return Array.isArray(t)?t.sort().join(","):t}function Au(t){return e=>e+t}Ce(_u,be),n(48);const Cu=Au("px"),Tu=qi.document.body;class Su extends Xa{constructor(t){super(t);const e=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",e.to("position",t=>"ck-balloon-panel_"+t),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",Cu),left:e.to("left",Cu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=Su.defaultPositions,n=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast],limiter:Tu,fitInViewport:!0},t),i=Su._getOptimalPosition(n),o=parseInt(i.left),r=parseInt(i.top);Object.assign(this,{top:r,left:o,position:i.name})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},this._startPinning(t),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(t){this.attachTo(t);const e=Eu(t.target),n=t.limiter?Eu(t.limiter):Tu;this.listenTo(qi.document,"scroll",(i,o)=>{const r=o.target,s=e&&r.contains(e),a=n&&r.contains(n);!s&&!a&&e&&n||this.attachTo(t)},{useCapture:!0}),this.listenTo(qi.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(qi.document,"scroll"),this.stopListening(qi.window,"resize")}}function Eu(t){return se(t)?t:Lo(t)?t.commonAncestorContainer:"function"==typeof t?Eu(t()):null}function Pu(t,e){return t.top-e.height-Su.arrowVerticalOffset}function Mu(t){return t.bottom+Su.arrowVerticalOffset}function Iu(t,e,n){return t&&Ou(t)&&!n.isInline(e)}function Nu(t){return t.getAttribute("widget-type-around")}function Ou(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function Ru(t,e,n={}){if(!t.is("containerElement"))throw new me.a("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=Bu,n.label&&function(t,e,n){n.setCustomProperty("widgetLabel",e,t)}(t,n.label,e),n.hasSelectionHandle&&function(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),n=new bl;return n.set("content",''),n.render(),e.appendChild(n.element),e}));e.insert(e.createPositionAt(t,0),n),e.addClass(["ck-widget_with-selection-handle"],t)}(t,e),Du(t,e,(t,e,n)=>n.addClass(Ee(e.classes),t),(t,e,n)=>n.removeClass(Ee(e.classes),t)),t}function Du(t,e,n,i){const o=new _u;o.on("change:top",(e,o)=>{o.oldDescriptor&&i(t,o.oldDescriptor,o.writer),o.newDescriptor&&n(t,o.newDescriptor,o.writer)}),e.setCustomProperty("addHighlight",(t,e,n)=>o.add(e,n),t),e.setCustomProperty("removeHighlight",(t,e,n)=>o.remove(e,n),t)}function Lu(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function zu(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(n,i,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)}),t.on("change:isFocused",(n,i,o)=>{o?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}function Vu(t,e){const n=t.getSelectedElement();if(n){const i=Nu(t);if(i)return e.createPositionAt(n,i);if(e.schema.isBlock(n))return e.createPositionAfter(n)}const i=t.getSelectedBlocks().next().value;if(i){if(i.isEmpty)return e.createPositionAt(i,0);const n=e.createPositionAfter(i);return t.focus.isTouching(n)?n:e.createPositionBefore(i)}return t.focus}function ju(t,e){const n=new jo(qi.window),i=n.getIntersection(t),o=e.height+Su.arrowVerticalOffset;if(t.top-o>n.top||t.bottom+o{const o=i.createElement("image",e),r=n||Vu(t.document.selection,t);t.insertContent(o,r),o.parent&&i.setSelection(o,"on")})}function qu(t){const e=t.schema,n=t.document.selection;return function(t,e,n){const i=function(t,e){const n=Vu(t,e).parent;return n.isEmpty&&!n.is("element","$root")?n.parent:n}(t,n);return e.checkChild(i,"image")}(n,e,t)&&!function(t,e){const n=t.getSelectedElement();return n&&e.isObject(n)}(n,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("element","image"))}(n)}function Wu(t){const e=[];for(const n of t.getChildren())e.push(n),n.is("element")&&e.push(...n.getChildren());return e.find(t=>t.is("element","img"))}function $u(t){return n=>{n.on(`attribute:${t}:image`,e)};function e(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const i=n.writer,o=Wu(n.mapper.toViewElement(e.item));i.setAttribute(e.attributeKey,e.attributeNewValue||"",o)}}Su.arrowHorizontalOffset=25,Su.arrowVerticalOffset=10,Su._getOptimalPosition=hl,Su.defaultPositions={northWestArrowSouthWest:(t,e)=>({top:Pu(t,e),left:t.left-Su.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(t,e)=>({top:Pu(t,e),left:t.left-.25*e.width-Su.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(t,e)=>({top:Pu(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(t,e)=>({top:Pu(t,e),left:t.left-.75*e.width+Su.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(t,e)=>({top:Pu(t,e),left:t.left-e.width+Su.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:Pu(t,e),left:t.left+t.width/2-Su.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(t,e)=>({top:Pu(t,e),left:t.left+t.width/2-.25*e.width-Su.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(t,e)=>({top:Pu(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(t,e)=>({top:Pu(t,e),left:t.left+t.width/2-.75*e.width+Su.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(t,e)=>({top:Pu(t,e),left:t.left+t.width/2-e.width+Su.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:Pu(t,e),left:t.right-Su.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(t,e)=>({top:Pu(t,e),left:t.right-.25*e.width-Su.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(t,e)=>({top:Pu(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(t,e)=>({top:Pu(t,e),left:t.right-.75*e.width+Su.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(t,e)=>({top:Pu(t,e),left:t.right-e.width+Su.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(t,e)=>({top:Mu(t),left:t.left-Su.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(t,e)=>({top:Mu(t),left:t.left-.25*e.width-Su.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(t,e)=>({top:Mu(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(t,e)=>({top:Mu(t),left:t.left-.75*e.width+Su.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(t,e)=>({top:Mu(t),left:t.left-e.width+Su.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Mu(t),left:t.left+t.width/2-Su.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(t,e)=>({top:Mu(t),left:t.left+t.width/2-.25*e.width-Su.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(t,e)=>({top:Mu(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(t,e)=>({top:Mu(t),left:t.left+t.width/2-.75*e.width+Su.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(t,e)=>({top:Mu(t),left:t.left+t.width/2-e.width+Su.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Mu(t),left:t.right-Su.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(t,e)=>({top:Mu(t),left:t.right-.25*e.width-Su.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(t,e)=>({top:Mu(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(t,e)=>({top:Mu(t),left:t.right-.75*e.width+Su.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(t,e)=>({top:Mu(t),left:t.right-e.width+Su.arrowHorizontalOffset,name:"arrow_ne"})};class Yu extends Ul{refresh(){this.isEnabled=qu(this.editor.model)}execute(t){const e=this.editor.model;for(const n of Ee(t.source))Uu(e,{src:n})}}class Gu extends Ll{static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion;t.editing.view.addObserver(ku),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),i.for("dataDowncast").elementToElement({model:"image",view:(t,{writer:e})=>Ku(e)}),i.for("editingDowncast").elementToElement({model:"image",view:(t,{writer:e})=>function(t,e,n){return e.setCustomProperty("image",!0,t),Ru(t,e,{label:function(){const e=Wu(t).getAttribute("alt");return e?`${e} ${n}`:n}})}(Ku(e),e,n("image widget"))}),i.for("downcast").add($u("src")).add($u("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const i=n.writer,o=Wu(n.mapper.toViewElement(e.item));if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(i.removeAttribute("srcset",o),i.removeAttribute("sizes",o),t.width&&i.removeAttribute("width",o))}else{const t=e.attributeNewValue;t.data&&(i.setAttribute("srcset",t.data,o),i.setAttribute("sizes","100vw",o),t.width&&i.setAttribute("width",t.width,o))}}}()),i.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(t,{writer:e})=>e.createElement("image",{src:t.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}}).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const i=Wu(e.viewItem);if(!i||!i.hasAttribute("src")||!n.consumable.test(i,{name:!0}))return;const o=Fc(n.convertItem(i,e.modelCursor).modelRange.getItems());o&&(n.convertChildren(e.viewItem,o),n.updateConversionResult(o,e))}}()),t.commands.add("imageInsert",new Yu(t))}}function Ku(t){const e=t.createEmptyElement("img"),n=t.createContainerElement("figure",{class:"image"});return t.insert(t.createPositionAt(n,0),e),n}class Qu extends ko{constructor(t){super(t),this.domEventType="mousedown"}onDomEvent(t){this.fire(t.type,t)}}class Ju extends Ll{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t),this.attributes=new Set,this._overrideUid=null}init(){const t=this.editor,e=t.locale,n=t.model.document.selection;this.listenTo(t.editing.view.document,"keydown",(t,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=e.contentLanguageDirection;let a=!1;a="ltr"===s&&o||"rtl"===s&&r?this._handleForwardMovement(i):this._handleBackwardMovement(i),!0===a&&t.stop()},{priority:fe.get("high")+1}),this._isNextGravityRestorationSkipped=!1,this.listenTo(n,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&eh(n.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!Zu(n,e))&&(eh(i,e)?(th(t),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,o=i.getFirstPosition();return this._isGravityOverridden?(th(t),this._restoreGravity(),Xu(n,e,o),!0):o.isAtStart?!!Zu(i,e)&&(th(t),Xu(n,e,o),!0):function(t,e){return eh(t.getShiftedBy(-1),e)}(o,e)?o.isAtEnd&&!Zu(i,e)&&eh(o,e)?(th(t),Xu(n,e,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Zu(t,e){for(const n of e)if(t.hasAttribute(n))return!0;return!1}function Xu(t,e,n){const i=n.nodeBefore;t.change(t=>{i?t.setSelectionAttribute(i.getAttributes()):t.removeSelectionAttribute(e)})}function th(t){t.preventDefault()}function eh(t,e){const{nodeBefore:n,nodeAfter:i}=t;for(const o of e){const t=n?n.getAttribute(o):void 0;if((i?i.getAttribute(o):void 0)!==t)return!0}return!1}function nh(t,e,n,i){return i.createRange(ih(t,e,n,!0,i),ih(t,e,n,!1,i))}function ih(t,e,n,i,o){let r=t.textNode||(i?t.nodeBefore:t.nodeAfter),s=null;for(;r&&r.getAttribute(e)==n;)s=r,r=i?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,i?"before":"after"):t}class oh{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(t=>this._definitions.add(t)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(t,e,n)=>{if(!n.consumable.test(e.item,"attribute:linkHref"))return;const i=n.writer,o=i.document.selection;for(const r of this._definitions){const t=i.createAttributeElement("a",r.attributes,{priority:5});i.setCustomProperty("link",!0,t),r.callback(e.attributeNewValue)?e.item.is("selection")?i.wrap(o.getFirstRange(),t):i.wrap(n.mapper.toViewRange(e.range),t):i.unwrap(n.mapper.toViewRange(e.range),t)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:image",(t,e,n)=>{const i=n.mapper.toViewElement(e.item),o=Array.from(i.getChildren()).find(t=>"a"===t.name);for(const r of this._definitions){const t=Ve(r.attributes);if(r.callback(e.attributeNewValue))for(const[e,i]of t)"class"===e?n.writer.addClass(i,o):n.writer.setAttribute(e,i,o);else for(const[e,i]of t)"class"===e?n.writer.removeClass(i,o):n.writer.removeAttribute(e,o)}})}}}var rh=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),sh=function(t){return rh.test(t)},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(t){t=Je(t);var e=sh(t)?function(t){return sh(t)?function(t){return t.match(gh)||[]}(t):function(t){return t.split("")}(t)}(t):void 0,n=e?e[0]:t.charAt(0),i=e?function(t,e,n){return en(t,1,n=void 0===n?t.length:n)}(e).join(""):t.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(t,{writer:e}){const n=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,n),n}function yh(t){return function(t){return t.replace(bh,"").match(wh)}(t=String(t))?t:"#"}function xh(t,e){return!!t&&t.is("element","image")&&e.checkAttribute("image","linkHref")}function Ah(t,e){const n=kh.test(t)?"mailto:":e,i=!!n&&!_h.test(t);return t&&i?n+t:t}class Ch extends Ul{constructor(t){super(t),this.manualDecorators=new Te,this.automaticDecorators=new oh}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document,n=Fc(e.selection.getSelectedBlocks());xh(n,t.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(n,"linkHref")):(this.value=e.selection.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(t,e={}){const n=this.editor.model,i=n.document.selection,o=[],r=[];for(const s in e)e[s]?o.push(s):r.push(s);n.change(e=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=nh(s,"linkHref",i.getAttribute("linkHref"),n);e.setAttribute("linkHref",t,a),o.forEach(t=>{e.setAttribute(t,!0,a)}),r.forEach(t=>{e.removeAttribute(t,a)}),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const r=Ve(i.getAttributes());r.set("linkHref",t),o.forEach(t=>{r.set(t,!0)});const{end:a}=n.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...o,...r].forEach(t=>{e.removeSelectionAttribute(t)})}else{const s=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const t of i.getSelectedBlocks())n.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const l=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&l.push(t);for(const n of l)e.setAttribute("linkHref",t,n),o.forEach(t=>{e.setAttribute(t,!0,n)}),r.forEach(t=>{e.removeAttribute(t,n)})}})}_getDecoratorStateFromModel(t){const e=this.editor.model,n=e.document,i=Fc(n.selection.getSelectedBlocks());return xh(i,e.schema)?i.getAttribute(t):n.selection.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e)if(n.containsRange(t))return!1;return!0}}class Th extends Ul{refresh(){const t=this.editor.model,e=t.document,n=Fc(e.selection.getSelectedBlocks());this.isEnabled=xh(n,t.schema)?t.schema.checkAttribute(n,"linkHref"):t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(){const t=this.editor.model,e=t.document.selection,n=this.editor.commands.get("link");t.change(i=>{const o=e.isCollapsed?[nh(e.getFirstPosition(),"linkHref",e.getAttribute("linkHref"),t)]:t.schema.getValidRanges(e.getRanges(),"linkHref");for(const t of o)if(i.removeAttribute("linkHref",t),n)for(const e of n.manualDecorators)i.removeAttribute(e.id,t)})}}class Sh{constructor({id:t,label:e,attributes:n,defaultValue:i}){this.id=t,this.set("value"),this.defaultValue=i,this.label=e,this.attributes=n}}Ce(Sh,Sn),n(50);const Eh=/^(https?:)?\/\//;class Ph extends Ll{static get pluginName(){return"LinkEditing"}static get requires(){return[Ju,gc,Hl]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:vh}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>vh(yh(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new Ch(t)),t.commands.add("unlink",new Th(t));const e=function(t,e){const n={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach(t=>(t.label&&n[t.label]&&(t.label=n[t.label]),t)),e}(t.t,function(t){const e=[];if(t)for(const[n,i]of Object.entries(t)){const t=Object.assign({},i,{id:"link"+ph(n)});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter(t=>"automatic"===t.mode)),this._enableManualDecorators(e.filter(t=>"manual"===t.mode)),t.plugins.get(Ju).registerAttribute("linkHref"),function(t,e,n,i){const o=t.editing.view,r=new Set;o.document.registerPostFixer(n=>{const o=t.model.document.selection;let s=!1;if(o.hasAttribute(e)){const a=nh(o.getFirstPosition(),e,o.getAttribute(e),t.model),l=t.editing.mapper.toViewRange(a);for(const t of l.getItems())t.is("element","a")&&!t.hasClass(i)&&(n.addClass(i,t),r.add(t),s=!0)}return s}),t.conversion.for("editingDowncast").add(t=>{function e(){o.change(t=>{for(const e of r.values())t.removeClass(i,e),r.delete(e)})}t.on("insert",e,{priority:"highest"}),t.on("remove",e,{priority:"highest"}),t.on("attribute",e,{priority:"highest"}),t.on("selection",e,{priority:"highest"})})}(t,"linkHref",0,"ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:"automatic",callback:t=>Eh.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach(t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),n.add(new Sh(t)),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:i})=>{if(e){const e=n.get(t.id).attributes,o=i.createAttributeElement("a",e,{priority:5});return i.setCustomProperty("link",!0,o),o}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:n.get(t.id).attributes},model:{key:t.id}})})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor,e=t.model,n=e.document.selection,i=t.commands.get("link");this.listenTo(e,"insertContent",()=>{const t=n.anchor.nodeBefore,o=n.anchor.nodeAfter;n.hasAttribute("linkHref")&&t&&t.hasAttribute("linkHref")&&(o&&o.hasAttribute("linkHref")||e.change(t=>{Mh(t,i.manualDecorators)}))},{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.commands.get("link");t.editing.view.addObserver(Qu);let n=!1;this.listenTo(t.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(t.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const i=t.model.document.selection;if(!i.isCollapsed)return;if(!i.hasAttribute("linkHref"))return;const o=i.getFirstPosition(),r=nh(o,"linkHref",i.getAttribute("linkHref"),t.model);(o.isTouching(r.start)||o.isTouching(r.end))&&t.model.change(t=>{Mh(t,e.ma