/*! For license information please see ckeditor.js.LICENSE.txt */ (()=>{var e,t,i={5030:(e,t,i)=>{const o=i(1835),n={};for(const e of Object.keys(o))n[o[e]]=e;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=r;for(const e of Object.keys(r)){if(!("channels"in r[e]))throw new Error("missing channels property: "+e);if(!("labels"in r[e]))throw new Error("missing channel labels property: "+e);if(r[e].labels.length!==r[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:i}=r[e];delete r[e].channels,delete r[e].labels,Object.defineProperty(r[e],"channels",{value:t}),Object.defineProperty(r[e],"labels",{value:i})}r.rgb.hsl=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(t,i,o),r=Math.max(t,i,o),s=r-n;let a,c;r===n?a=0:t===r?a=(i-o)/s:i===r?a=2+(o-t)/s:o===r&&(a=4+(t-i)/s),a=Math.min(60*a,360),a<0&&(a+=360);const l=(n+r)/2;return c=r===n?0:l<=.5?s/(r+n):s/(2-r-n),[a,100*c,100*l]},r.rgb.hsv=function(e){let t,i,o,n,r;const s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),d=l-Math.min(s,a,c),u=function(e){return(l-e)/6/d+.5};return 0===d?(n=0,r=0):(r=d/l,t=u(s),i=u(a),o=u(c),s===l?n=o-i:a===l?n=1/3+t-o:c===l&&(n=2/3+i-t),n<0?n+=1:n>1&&(n-=1)),[360*n,100*r,100*l]},r.rgb.hwb=function(e){const t=e[0],i=e[1];let o=e[2];const n=r.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(i,o));return o=1-1/255*Math.max(t,Math.max(i,o)),[n,100*s,100*o]},r.rgb.cmyk=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(1-t,1-i,1-o);return[100*((1-t-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*((1-o-n)/(1-n)||0),100*n]},r.rgb.keyword=function(e){const t=n[e];if(t)return t;let i,r=1/0;for(const t of Object.keys(o)){const n=(a=o[t],((s=e)[0]-a[0])**2+(s[1]-a[1])**2+(s[2]-a[2])**2);n.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,[100*(.4124*t+.3576*i+.1805*o),100*(.2126*t+.7152*i+.0722*o),100*(.0193*t+.1192*i+.9505*o)]},r.rgb.lab=function(e){const t=r.rgb.xyz(e);let i=t[0],o=t[1],n=t[2];return i/=95.047,o/=100,n/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*o-16,500*(i-o),200*(o-n)]},r.hsl.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;let n,r,s;if(0===i)return s=255*o,[s,s,s];n=o<.5?o*(1+i):o+i-o*i;const a=2*o-n,c=[0,0,0];for(let e=0;e<3;e++)r=t+1/3*-(e-1),r<0&&r++,r>1&&r--,s=6*r<1?a+6*(n-a)*r:2*r<1?n:3*r<2?a+(n-a)*(2/3-r)*6:a,c[e]=255*s;return c},r.hsl.hsv=function(e){const t=e[0];let i=e[1]/100,o=e[2]/100,n=i;const r=Math.max(o,.01);return o*=2,i*=o<=1?o:2-o,n*=r<=1?r:2-r,[t,100*(0===o?2*n/(r+n):2*i/(o+i)),(o+i)/2*100]},r.hsv.rgb=function(e){const t=e[0]/60,i=e[1]/100;let o=e[2]/100;const n=Math.floor(t)%6,r=t-Math.floor(t),s=255*o*(1-i),a=255*o*(1-i*r),c=255*o*(1-i*(1-r));switch(o*=255,n){case 0:return[o,c,s];case 1:return[a,o,s];case 2:return[s,o,c];case 3:return[s,a,o];case 4:return[c,s,o];case 5:return[o,s,a]}},r.hsv.hsl=function(e){const t=e[0],i=e[1]/100,o=e[2]/100,n=Math.max(o,.01);let r,s;s=(2-i)*o;const a=(2-i)*n;return r=i*n,r/=a<=1?a:2-a,r=r||0,s/=2,[t,100*r,100*s]},r.hwb.rgb=function(e){const t=e[0]/360;let i=e[1]/100,o=e[2]/100;const n=i+o;let r;n>1&&(i/=n,o/=n);const s=Math.floor(6*t),a=1-o;r=6*t-s,1&s&&(r=1-r);const c=i+r*(a-i);let l,d,u;switch(s){default:case 6:case 0:l=a,d=c,u=i;break;case 1:l=c,d=a,u=i;break;case 2:l=i,d=a,u=c;break;case 3:l=i,d=c,u=a;break;case 4:l=c,d=i,u=a;break;case 5:l=a,d=i,u=c}return[255*l,255*d,255*u]},r.cmyk.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n)),255*(1-Math.min(1,o*(1-n)+n))]},r.xyz.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100;let n,r,s;return n=3.2406*t+-1.5372*i+-.4986*o,r=-.9689*t+1.8758*i+.0415*o,s=.0557*t+-.204*i+1.057*o,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n=Math.min(Math.max(0,n),1),r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),[255*n,255*r,255*s]},r.xyz.lab=function(e){let t=e[0],i=e[1],o=e[2];return t/=95.047,i/=100,o/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,[116*i-16,500*(t-i),200*(i-o)]},r.lab.xyz=function(e){let t,i,o;i=(e[0]+16)/116,t=e[1]/500+i,o=i-e[2]/200;const n=i**3,r=t**3,s=o**3;return i=n>.008856?n:(i-16/116)/7.787,t=r>.008856?r:(t-16/116)/7.787,o=s>.008856?s:(o-16/116)/7.787,t*=95.047,i*=100,o*=108.883,[t,i,o]},r.lab.lch=function(e){const t=e[0],i=e[1],o=e[2];let n;return n=360*Math.atan2(o,i)/2/Math.PI,n<0&&(n+=360),[t,Math.sqrt(i*i+o*o),n]},r.lch.lab=function(e){const t=e[0],i=e[1],o=e[2]/360*2*Math.PI;return[t,i*Math.cos(o),i*Math.sin(o)]},r.rgb.ansi16=function(e,t=null){const[i,o,n]=e;let s=null===t?r.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),0===s)return 30;let a=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(i/255));return 2===s&&(a+=60),a},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){const t=e[0],i=e[1],o=e[2];return t===i&&i===o?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(o/255*5)},r.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const i=.5*(1+~~(e>50));return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},r.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},r.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=i.split("").map((e=>e+e)).join(""));const o=parseInt(i,16);return[o>>16&255,o>>8&255,255&o]},r.rgb.hcg=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.max(Math.max(t,i),o),r=Math.min(Math.min(t,i),o),s=n-r;let a,c;return a=s<1?r/(1-s):0,c=s<=0?0:n===t?(i-o)/s%6:n===i?2+(o-t)/s:4+(t-i)/s,c/=6,c%=1,[360*c,100*s,100*a]},r.hsl.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=i<.5?2*t*i:2*t*(1-i);let n=0;return o<1&&(n=(i-.5*o)/(1-o)),[e[0],100*o,100*n]},r.hsv.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=t*i;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},r.hcg.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;if(0===i)return[255*o,255*o,255*o];const n=[0,0,0],r=t%1*6,s=r%1,a=1-s;let c=0;switch(Math.floor(r)){case 0:n[0]=1,n[1]=s,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=s;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=s,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return c=(1-i)*o,[255*(i*n[0]+c),255*(i*n[1]+c),255*(i*n[2]+c)]},r.hcg.hsv=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);let o=0;return i>0&&(o=t/i),[e[0],100*o,100*i]},r.hcg.hsl=function(e){const t=e[1]/100,i=e[2]/100*(1-t)+.5*t;let o=0;return i>0&&i<.5?o=t/(2*i):i>=.5&&i<1&&(o=t/(2*(1-i))),[e[0],100*o,100*i]},r.hcg.hwb=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],100*(i-t),100*(1-i)]},r.hwb.hcg=function(e){const t=e[1]/100,i=1-e[2]/100,o=i-t;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=function(e){return[0,0,e[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(i.length)+i},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},8847:(e,t,i)=>{const o=i(5030),n=i(6138),r={};Object.keys(o).forEach((e=>{r[e]={},Object.defineProperty(r[e],"channels",{value:o[e].channels}),Object.defineProperty(r[e],"labels",{value:o[e].labels});const t=n(e);Object.keys(t).forEach((i=>{const o=t[i];r[e][i]=function(e){const t=function(...t){const i=t[0];if(null==i)return i;i.length>1&&(t=i);const o=e(t);if("object"==typeof o)for(let e=o.length,t=0;t1&&(t=i),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(o)}))})),e.exports=r},6138:(e,t,i)=>{const o=i(5030);function n(e,t){return function(i){return t(e(i))}}function r(e,t){const i=[t[e].parent,e];let r=o[t[e].parent][e],s=t[e].parent;for(;t[s].parent;)i.unshift(t[s].parent),r=n(o[t[s].parent][s],r),s=t[s].parent;return r.conversion=i,r}e.exports=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(o);for(let i=t.length,o=0;o{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8156:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},9248:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}",""]);const r=n},1501:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}",""]);const r=n},9262:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}.ck.ck-clipboard-drop-target-line:before{border-style:solid;content:"";height:0;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-width)*-.5);width:0}[dir=ltr] .ck.ck-clipboard-drop-target-line:before{border-color:transparent transparent transparent var(--ck-clipboard-drop-target-color);border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height);left:-1px}[dir=rtl] .ck.ck-clipboard-drop-target-line:before{border-color:transparent var(--ck-clipboard-drop-target-color) transparent transparent;border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0;right:-1px}',""]);const r=n},2291:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content pre{background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;color:#353535;direction:ltr;font-style:normal;min-width:200px;padding:1em;tab-size:4;text-align:left;white-space:pre-wrap}.ck-content pre code{background:unset;border-radius:0;padding:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{background:var(--ck-color-code-block-label-background);color:#fff;font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);right:10px;top:-1px;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}",""]);const r=n},9881:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border:solid var(--ck-color-base-border);border-width:1px 1px 0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-sticky-panel__content_sticky{border-bottom-width:1px}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-menu-bar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-toolbar{border:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}",""]);const r=n},1111:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}@media (forced-colors:active){.ck .ck-placeholder,.ck.ck-placeholder{forced-color-adjust:preserve-parent-color}}.ck .ck-placeholder:before,.ck.ck-placeholder:before{cursor:text}@media (forced-colors:none){.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text)}}@media (forced-colors:active){.ck .ck-placeholder:before,.ck.ck-placeholder:before{font-style:italic;margin-left:1px}}",""]);const r=n},6531:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}",""]);const r=n},9465:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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}",""]);const r=n},6186:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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}",""]);const r=n},1799:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{background:#dedede;border:0;height:4px;margin:15px 0}",""]);const r=n},9856:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-widget.raw-html-embed{display:flow-root;font-style:normal;margin:.9em auto;min-width:15em;position:relative}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{display:flex;flex-direction:column;position:absolute}.ck-widget.raw-html-embed .raw-html-embed__preview{display:flex;overflow:hidden;position:relative}.ck-widget.raw-html-embed .raw-html-embed__preview-content{border-collapse:separate;border-spacing:7px;display:table;margin:auto;position:relative;width:100%}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{background:var(--ck-color-focus-border);padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{right:var(--ck-spacing-standard);top:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;direction:ltr;font-family:monospace;font-size:var(--ck-font-size-base);height:var(--ck-html-embed-source-height);min-width:0;padding:var(--ck-spacing-standard);resize:none;tab-size:4;text-align:left;white-space:pre-wrap;width:var(--ck-html-embed-content-width)}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{background-color:var(--ck-color-base-foreground);box-sizing:border-box}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}",""]);const r=n},8574:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;height:auto;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image{z-index:1}.ck.ck-editor__editable .image.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable .image-inline img{height:auto}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}",""]);const r=n},3038:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highlighted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}@media (forced-colors:active){.ck-content .image>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:none}}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highlighted-background)}to{background-color:var(--ck-color-image-caption-background)}}",""]);const r=n},1173:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-image-custom-resize-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{display:inline-block}.ck.ck-image-custom-resize-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-image-custom-resize-form{flex-wrap:wrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-image-custom-resize-form .ck-button{flex-basis:50%}}",""]);const r=n},1545:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-image-insert-url .ck-image-insert-url__action-row{display:grid;grid-template-columns:repeat(2,1fr)}:root{--ck-image-insert-insert-by-url-width:250px}.ck.ck-image-insert-url{--ck-input-width:100%}.ck.ck-image-insert-url .ck-image-insert-url__action-row{grid-column-gap:var(--ck-spacing-large);margin-top:var(--ck-spacing-large)}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-cancel,.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-save{justify-content:center;min-width:auto}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}.ck.ck-image-insert-form>.ck.ck-button{display:block;padding:var(--ck-list-button-padding);width:100%}[dir=ltr] .ck.ck-image-insert-form>.ck.ck-button{text-align:left}[dir=rtl] .ck.ck-image-insert-form>.ck.ck-button{text-align:right}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:first-child){border-top:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:last-child){border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible,.ck.ck-image-insert-form>.ck.ck-image-insert-url{min-width:var(--ck-image-insert-insert-by-url-width)}.ck.ck-image-insert-form>.ck.ck-image-insert-url{padding:var(--ck-spacing-large)}.ck.ck-image-insert-form:focus{outline:none}",""]);const r=n},1091:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-editor__editable img.image_placeholder{background-size:100% 100%}",""]);const r=n},4214:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content img.image_resized{height:auto}.ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}",""]);const r=n},7879:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.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)}.ck-content .image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}",""]);const r=n},1230:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.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:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@media (prefers-reduced-motion:reduce){.ck-image-upload-complete-icon{animation-duration:0ms}.ck-image-upload-complete-icon:after{animation:none;height:.45em;opacity:1;width:.3em}}@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%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}',""]);const r=n},1160:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}',""]);const r=n},7504:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:none;opacity:1}}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const r=n},8429:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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%}}",""]);const r=n},7456:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}",""]);const r=n},5659:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.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{max-width:100%;min-width:0}[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}}",""]);const r=n},2350:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-link-form{align-items:flex-start;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{min-width:var(--ck-input-width);padding:0}.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{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[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{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}",""]);const r=n},3669:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{background-color:rgba(0,0,0,.4);background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzUuNzUgMCAwIDEtLjIxNy4yMDYgNS4yNTEgNS4yNTEgMCAwIDEtOC41MDMtNS45NTUuNy43IDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NHptNS40OTQtNS4zMzVhLjc1Ljc1IDAgMCAxLS4xMi4yNzRsLTEuMTQ3IDEuNjM5YS43NS43NSAwIDEgMS0xLjIyOC0uODZsLjg2LTEuMjNhMy43NSAzLjc1IDAgMCAwLTYuMTQ0LTQuMzAxbC0uODYgMS4yMjlhLjc1Ljc1IDAgMCAxLTEuMjI5LS44NmwxLjE0OC0xLjY0YS43NS43NSAwIDAgMSAuMjE3LS4yMDYgNS4yNTEgNS4yNTEgMCAwIDEgOC41MDMgNS45NTVtLTQuNTYzLTIuNTMyYS43NS43NSAwIDAgMSAuMTg0IDEuMDQ1bC0zLjE1NSA0LjUwNWEuNzUuNzUgMCAxIDEtMS4yMjktLjg2bDMuMTU1LTQuNTA2YS43NS43NSAwIDAgMSAxLjA0NS0uMTg0Ii8+PC9zdmc+");background-position:50%;background-repeat:no-repeat;background-size:14px;border-radius:100%;content:"";height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));overflow:hidden;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}',""]);const r=n},7875:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-editor__editable .ck-list-bogus-paragraph{display:block}",""]);const r=n},532:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}",""]);const r=n},1911:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}",""]);const r=n},1330:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}",""]);const r=n},5484:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}',""]);const r=n},3155:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content .media{clear:both;display:block;margin:.9em 0;min-width:15em}",""]);const r=n},5767:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck-media__wrapper .ck-media__placeholder{align-items:center;display:flex;flex-direction:column}.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 .ck-media__placeholder__url__text{display:block;overflow:hidden}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .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*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.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{background:var(--ck-color-base-foreground);padding:calc(var(--ck-spacing-standard)*3)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{background-position:50%;background-size:cover;height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);min-width:var(--ck-media-embed-placeholder-icon-size)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{height:100%;width:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);font-style:italic;text-align:center;text-overflow:ellipsis;white-space:nowrap}.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-height:380px;max-width:300px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSlzY2FsZSguOTgwMTIpIj48cmVjdCB3aWR0aD0iNjAuMDk5IiBoZWlnaHQ9IjYwLjA5OSIgeD0iMTc2LjAzMSIgeT0iMjMxLjM5OSIgZmlsbD0iIzM0YTY2OCIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjIzOCIgcnk9IjUuMjM4Ii8+PHBhdGggZmlsbD0iIzVjODhjNSIgZD0ibTIwNi40NzcgMjYwLjktMjguOTg3IDI4Ljk4N2E1LjIyIDUuMjIgMCAwIDAgMy43OCAxLjYxaDQ5LjYyMWMxLjY5NCAwIDMuMTktLjc5OCA0LjE0Ni0yLjAzN3oiLz48cGF0aCBmaWxsPSIjZGQ0YjNlIiBkPSJNMjI2Ljc0MiAyMjIuOTg4Yy05LjI2NiAwLTE2Ljc3NyA3LjE3LTE2Ljc3NyAxNi4wMTQuMDA3IDIuNzYyLjY2MyA1LjQ3NCAyLjA5MyA3Ljg3NS40My43MDMuODMgMS40MDggMS4xOSAyLjEwN3EuNS43NTMuOTUgMS41MDguNTE1LjcxNS45ODggMS40NGMxLjMxIDEuNzY5IDIuNSAzLjUwMiAzLjYzNyA1LjE2OC43OTMgMS4yNzUgMS42ODMgMi42NCAyLjQ2NiAzLjk5IDIuMzYzIDQuMDk0IDQuMDA3IDguMDkyIDQuNiAxMy45MTR2LjAxMmMuMTgyLjQxMi41MTYuNjY2Ljg3OS42NjcuNDAzLS4wMDEuNzY4LS4zMTQuOTMtLjc5OS42MDMtNS43NTYgMi4yMzgtOS43MjkgNC41ODUtMTMuNzk0Ljc4Mi0xLjM1IDEuNjczLTIuNzE1IDIuNDY1LTMuOTkgMS4xMzctMS42NjYgMi4zMjgtMy40IDMuNjM4LTUuMTY5cS40NzMtLjcyMy45ODgtMS40MzkuNDUtLjc1NS45NS0xLjUwOGMuMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIGN4PSIyMjYuNzQyIiBjeT0iMjM5LjAwMiIgZmlsbD0iIzgwMmQyNyIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjgyOCIgcnk9IjUuNTY0Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjlxLS4wMDEtLjU0My0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhxLS4wMDEtLjAwMy0uMDA0LS4wMDVjLTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTVtNC40MyA1LjY2LjAwMy4wMDZ2LS4wMDN6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGZpbGw9IiNjM2MzYzMiIGQ9Im0yMTUuMTg0IDI1MS45MjktNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMiA1LjIgMCAwIDAgLjQ0OS0yLjEyM3YtMzEuMTY1Yy0uNDY5LjY3NS0uOTM0IDEuMzQ5LTEuMzgyIDIuMDA1LS43OTIgMS4yNzUtMS42ODIgMi42NC0yLjQ2NSAzLjk5LTIuMzQ3IDQuMDY1LTMuOTgyIDguMDM4LTQuNTg1IDEzLjc5NC0uMTYyLjQ4NS0uNTI3Ljc5OC0uOTMuNzk5LS4zNjMtLjAwMS0uNjk3LS4yNTUtLjg3OS0uNjY3di0uMDEyYy0uNTkzLTUuODIyLTIuMjM3LTkuODItNC42LTEzLjkxNC0uNzgzLTEuMzUtMS42NzMtMi43MTUtMi40NjYtMy45OS0xLjEzNy0xLjY2Ni0yLjMyNy0zLjQtMy42MzctNS4xNjl6Ii8+PHBhdGggZmlsbD0iI2ZkZGM0ZiIgZD0ibTIxMi45ODMgMjQ4LjQ5NS0zNi45NTIgMzYuOTUzdi44MTJhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYgMTM2IDAgMCAwLTIuNzY0LTMuOSAzOCAzOCAwIDAgMC0uOTg5LTEuNDQgMzUgMzUgMCAwIDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJtMjExLjk5OCAyNjEuMDgzLTYuMTUyIDYuMTUxIDI0LjI2NCAyNC4yNjRoLjc4MWE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOS01LjIzOHYtMS4wNDV6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDI0IiBoZWlnaHQ9IjEwMjQiPjxwYXRoIGZpbGw9IiNGRkZGRkUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTk2Ny40ODQgMEg1Ni41MTdDMjUuMzA0IDAgMCAyNS4zMDQgMCA1Ni41MTd2OTEwLjk2NkMwIDk5OC42OTQgMjUuMjk3IDEwMjQgNTYuNTIyIDEwMjRINTQ3VjYyOEg0MTRWNDczaDEzM1YzNTkuMDI5YzAtMTMyLjI2MiA4MC43NzMtMjA0LjI4MiAxOTguNzU2LTIwNC4yODIgNTYuNTEzIDAgMTA1LjA4NiA0LjIwOCAxMTkuMjQ0IDYuMDg5VjI5OWwtODEuNjE2LjAzN2MtNjMuOTkzIDAtNzYuMzg0IDMwLjQ5Mi03Ni4zODQgNzUuMjM2VjQ3M2gxNTMuNDg3bC0xOS45ODYgMTU1SDcwN3YzOTZoMjYwLjQ4NGMzMS4yMTMgMCA1Ni41MTYtMjUuMzAzIDU2LjUxNi01Ni41MTZWNTYuNTE1QzEwMjQgMjUuMzAzIDk5OC42OTcgMCA5NjcuNDg0IDAiLz48L3N2Zz4=)}.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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OW0wIDQ1LjM5MWM2Ny4yNjUgMCA3NS4yMzMuMjU3IDEwMS43OTcgMS40NjkgMjQuNTYyIDEuMTIgMzcuOTAxIDUuMjI0IDQ2Ljc3OCA4LjY3NCAxMS43NTkgNC41NyAyMC4xNTEgMTAuMDI5IDI4Ljk2NiAxOC44NDVzMTQuMjc1IDE3LjIwNyAxOC44NDUgMjguOTY2YzMuNDUgOC44NzcgNy41NTQgMjIuMjE2IDguNjc0IDQ2Ljc3OCAxLjIxMiAyNi41NjQgMS40NjkgMzQuNTMyIDEuNDY5IDEwMS43OTggMCA2Ny4yNjUtLjI1NyA3NS4yMzMtMS40NjkgMTAxLjc5Ny0xLjEyIDI0LjU2Mi01LjIyNCAzNy45MDEtOC42NzQgNDYuNzc4LTQuNTcgMTEuNzU5LTEwLjAyOSAyMC4xNTEtMTguODQ1IDI4Ljk2NnMtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1Yy04Ljg3NyAzLjQ1LTIyLjIxNiA3LjU1NC00Ni43NzggOC42NzQtMjYuNTYgMS4yMTItMzQuNTI3IDEuNDY5LTEwMS43OTcgMS40NjktNjcuMjcxIDAtNzUuMjM3LS4yNTctMTAxLjc5OC0xLjQ2OS0yNC41NjItMS4xMi0zNy45MDEtNS4yMjQtNDYuNzc4LTguNjc0LTExLjc1OS00LjU3LTIwLjE1MS0xMC4wMjktMjguOTY2LTE4Ljg0NXMtMTQuMjc1LTE3LjIwNy0xOC44NDUtMjguOTY2Yy0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NnMxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDVjOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OSIgbWFzaz0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0yNTEuOTIxIDMzNi4wNTNjLTQ2LjM3OCAwLTgzLjk3NC0zNy41OTYtODMuOTc0LTgzLjk3M3MzNy41OTYtODMuOTc0IDgzLjk3NC04My45NzRjNDYuMzc3IDAgODMuOTczIDM3LjU5NiA4My45NzMgODMuOTc0IDAgNDYuMzc3LTM3LjU5NiA4My45NzMtODMuOTczIDgzLjk3M20wLTIxMy4zMzhjLTcxLjQ0NyAwLTEyOS4zNjUgNTcuOTE4LTEyOS4zNjUgMTI5LjM2NSAwIDcxLjQ0NiA1Ny45MTggMTI5LjM2NCAxMjkuMzY1IDEyOS4zNjQgNzEuNDQ2IDAgMTI5LjM2NC01Ny45MTggMTI5LjM2NC0xMjkuMzY0IDAtNzEuNDQ3LTU3LjkxOC0xMjkuMzY1LTEyOS4zNjQtMTI5LjM2NU00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjNzMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzFjMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIi8+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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwME0xNjMuNCAzMDUuNWM4OC43IDAgMTM3LjItNzMuNSAxMzcuMi0xMzcuMiAwLTIuMSAwLTQuMi0uMS02LjIgOS40LTYuOCAxNy42LTE1LjMgMjQuMS0yNS04LjYgMy44LTE3LjkgNi40LTI3LjcgNy42IDEwLTYgMTcuNi0xNS40IDIxLjItMjYuNy05LjMgNS41LTE5LjYgOS41LTMwLjYgMTEuNy04LjgtOS40LTIxLjMtMTUuMi0zNS4yLTE1LjItMjYuNiAwLTQ4LjIgMjEuNi00OC4yIDQ4LjIgMCAzLjguNCA3LjUgMS4zIDExLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40LTQuMSA3LjEtNi41IDE1LjQtNi41IDI0LjIgMCAxNi43IDguNSAzMS41IDIxLjUgNDAuMS03LjktLjItMTUuMy0yLjQtMjEuOC02di42YzAgMjMuNCAxNi42IDQyLjggMzguNyA0Ny4zLTQgMS4xLTguMyAxLjctMTIuNyAxLjctMy4xIDAtNi4xLS4zLTkuMS0uOSA2LjEgMTkuMiAyMy45IDMzLjEgNDUgMzMuNS0xNi41IDEyLjktMzcuMyAyMC42LTU5LjkgMjAuNi0zLjkgMC03LjctLjItMTEuNS0uNyAyMS4xIDEzLjggNDYuNSAyMS44IDczLjcgMjEuOCIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==)}.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}',""]);const r=n},6004:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-media-form{align-items:flex-start;display:flex;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%}}",""]);const r=n},4975:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-show-blocks-border-color:#757575}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,ADDRESS\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,ADDRESS\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-image:url(\"data:image/svg+xml;utf8,ADDRESS\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-image:url(\"data:image/svg+xml;utf8,ADDRESS\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,ASIDE\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,ASIDE\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-image:url(\"data:image/svg+xml;utf8,ASIDE\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-image:url(\"data:image/svg+xml;utf8,ASIDE\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,BLOCKQUOTE\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,BLOCKQUOTE\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-image:url(\"data:image/svg+xml;utf8,BLOCKQUOTE\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-image:url(\"data:image/svg+xml;utf8,BLOCKQUOTE\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,DETAILS\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,DETAILS\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-image:url(\"data:image/svg+xml;utf8,DETAILS\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-image:url(\"data:image/svg+xml;utf8,DETAILS\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,DIV\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,DIV\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *):not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-image:url(\"data:image/svg+xml;utf8,DIV\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-image:url(\"data:image/svg+xml;utf8,DIV\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,FOOTER\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,FOOTER\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-image:url(\"data:image/svg+xml;utf8,FOOTER\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-image:url(\"data:image/svg+xml;utf8,FOOTER\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,H1\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,H1\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-image:url(\"data:image/svg+xml;utf8,H1\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-image:url(\"data:image/svg+xml;utf8,H1\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,H2\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,H2\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-image:url(\"data:image/svg+xml;utf8,H2\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-image:url(\"data:image/svg+xml;utf8,H2\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,H3\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,H3\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-image:url(\"data:image/svg+xml;utf8,H3\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-image:url(\"data:image/svg+xml;utf8,H3\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,H4\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,H4\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-image:url(\"data:image/svg+xml;utf8,H4\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-image:url(\"data:image/svg+xml;utf8,H4\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,H5\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,H5\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-image:url(\"data:image/svg+xml;utf8,H5\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-image:url(\"data:image/svg+xml;utf8,H5\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,H6\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,H6\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-image:url(\"data:image/svg+xml;utf8,H6\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-image:url(\"data:image/svg+xml;utf8,H6\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,HEADER\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,HEADER\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-image:url(\"data:image/svg+xml;utf8,HEADER\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-image:url(\"data:image/svg+xml;utf8,HEADER\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,MAIN\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,MAIN\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-image:url(\"data:image/svg+xml;utf8,MAIN\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-image:url(\"data:image/svg+xml;utf8,MAIN\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,NAV\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,NAV\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-image:url(\"data:image/svg+xml;utf8,NAV\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-image:url(\"data:image/svg+xml;utf8,NAV\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,PRE\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,PRE\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-image:url(\"data:image/svg+xml;utf8,PRE\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-image:url(\"data:image/svg+xml;utf8,PRE\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,OL\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,OL\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-image:url(\"data:image/svg+xml;utf8,OL\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-image:url(\"data:image/svg+xml;utf8,OL\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,UL\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,UL\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-image:url(\"data:image/svg+xml;utf8,UL\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-image:url(\"data:image/svg+xml;utf8,UL\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,P\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,P\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-image:url(\"data:image/svg+xml;utf8,P\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-image:url(\"data:image/svg+xml;utf8,P\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,SECTION\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,SECTION\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-image:url(\"data:image/svg+xml;utf8,SECTION\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-image:url(\"data:image/svg+xml;utf8,SECTION\");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-repeat:no-repeat;padding-top:15px;[dir=ltr] &{background-image:url(\"data:image/svg+xml;utf8,FIGCAPTION\");background-position:1px 1px}[dir=rtl] &{background-image:url(\"data:image/svg+xml;utf8,FIGCAPTION\");background-position:calc(100% - 1px) 1px}}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-image:url(\"data:image/svg+xml;utf8,FIGCAPTION\");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-image:url(\"data:image/svg+xml;utf8,FIGCAPTION\");background-position:calc(100% - 1px) 1px}",""]);const r=n},9227:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck-source-editing-area{overflow:hidden;position:relative}.ck-source-editing-area textarea,.ck-source-editing-area:after{border:1px solid transparent;font-family:monospace;font-size:var(--ck-font-size-normal);line-height:var(--ck-line-height-base);margin:0;padding:var(--ck-spacing-large);white-space:pre-wrap}.ck-source-editing-area:after{content:attr(data-value) " ";display:block;visibility:hidden}.ck-source-editing-area textarea{border-color:var(--ck-color-base-border);border-radius:0;box-sizing:border-box;height:100%;outline:none;overflow:hidden;position:absolute;resize:none;width:100%}.ck-rounded-corners .ck-source-editing-area textarea,.ck-source-editing-area textarea.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck-source-editing-area textarea:not([readonly]):focus{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}',""]);const r=n},2221:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-character-grid{max-width:100%}.ck.ck-character-grid .ck-character-grid__tiles{display:grid}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{max-height:200px;overflow-x:hidden;overflow-y:auto;width:350px}@media screen and (max-width:600px){.ck.ck-character-grid{width:190px}}.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(10,1fr);margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(5,1fr)}}.ck.ck-character-grid .ck-character-grid__tile{border:0;font-size:1.2em;height:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-character-grid-tile-size)}@media (prefers-reduced-motion:reduce){.ck.ck-character-grid .ck-character-grid__tile{transition:none}}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);text-align:center;width:100%}",""]);const r=n},3445:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-character-info{border-top:1px solid var(--ck-color-base-border);display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-character-info>*{font-size:var(--ck-font-size-small);text-transform:uppercase}.ck.ck-character-info .ck-character-info__name{max-width:280px;overflow:hidden;text-overflow:ellipsis}.ck.ck-character-info .ck-character-info__code{opacity:.6}@media screen and (max-width:600px){.ck.ck-character-info{max-width:190px}}",""]);const r=n},7405:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-special-characters-navigation>.ck-label{max-width:160px;overflow:hidden;text-overflow:ellipsis}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}@media screen and (max-width:600px){.ck.ck-special-characters-navigation{max-width:190px}.ck.ck-special-characters-navigation>.ck-form__header__label{overflow:hidden;text-overflow:ellipsis}}",""]);const r=n},4307:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border-radius:0}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);height:20px;width:20px}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}",""]);const r=n},1806:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}",""]);const r=n},6016:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}",""]);const r=n},8603:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;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)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}@media (prefers-reduced-motion:reduce){.ck .ck-insert-table-dropdown-grid-box{transition:none}}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}",""]);const r=n},9969:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-content .table{display:table;margin:.9em auto}.ck-content .table table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%}.ck-content .table table td,.ck-content .table table th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}.ck-content .table table th{background:rgba(0,0,0,.05);font-weight:700}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}",""]);const r=n},7406:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-color-selector-caption-background:#f7f7f7;--ck-color-selector-caption-text:#333;--ck-color-selector-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-selector-caption-background);caption-side:top;color:var(--ck-color-selector-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word}@media (forced-colors:active){.ck-content .table>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .table>figcaption.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}}.ck.ck-editor__editable .table>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-selector-caption-highlighted-background)}to{background-color:var(--ck-color-selector-caption-background)}}",""]);const r=n},6701:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}",""]);const r=n},4204:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-color-selector-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table table{overflow:hidden}.ck-content .table td,.ck-content .table th{overflow-wrap:break-word;position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:0;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:0;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-selector-column-resizer-hover);bottom:-999999px;opacity:.25;top:-999999px}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}",""]);const r=n},8864:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-color-selector-focused-cell-background:rgba(158,201,250,.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-selector-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}",""]);const r=n},5704:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:"";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{border-radius:0}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both}@media (prefers-reduced-motion:reduce){.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}',""]);const r=n},4001:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}",""]);const r=n},2850:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,':root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top: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,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}',""]);const r=n},1710:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-aria-live-announcer{left:-10000px;position:absolute;top:-10000px}.ck.ck-aria-live-region-list{list-style-type:none}",""]);const r=n},2688:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-autocomplete{position:relative}.ck.ck-autocomplete>.ck-search__results{position:absolute;z-index:var(--ck-z-panel)}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{bottom:100%}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{bottom:auto;top:100%}.ck.ck-autocomplete>.ck-search__results{border-radius:0}.ck-rounded-corners .ck.ck-autocomplete>.ck-search__results,.ck.ck-autocomplete>.ck-search__results.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-autocomplete>.ck-search__results{background:var(--ck-color-base-background);border:1px solid var(--ck-color-dropdown-panel-border);box-shadow:var(--ck-drop-shadow),0 0;max-height:200px;min-width:auto;overflow-y:auto}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:-1px}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{border-top-left-radius:0;border-top-right-radius:0;margin-top:-1px}",""]);const r=n},8948:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}[dir=ltr] .ck.ck-button,[dir=ltr] a.ck.ck-button{justify-content:left}[dir=rtl] .ck.ck-button,[dir=rtl] a.ck.ck-button{justify-content:right}.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,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)}.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{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}@media (prefers-reduced-motion:reduce){.ck.ck-button,a.ck.ck-button{transition:none}}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.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{color:inherit;cursor:inherit;font-size:inherit;font-weight: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{opacity:.5}.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,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,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-left:var(--ck-spacing-small);margin-right:calc(var(--ck-spacing-small)*-1)}.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)}.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-on,a.ck.ck-button.ck-on{color:var(--ck-color-button-on-color)}.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)}.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}",""]);const r=n},9624:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[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{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.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)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}@media (prefers-reduced-motion:reduce){.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{transition:none}}.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:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.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))}",""]);const r=n},1750:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;padding:var(--ck-list-button-padding);width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}",""]);const r=n},7962:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{transition:box-shadow .2s ease}@media (forced-colors:none){.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;width:var(--ck-color-grid-tile-size)}.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.ck-color-selector__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.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: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)}}@media (forced-colors:active){.ck.ck-color-grid__tile{height:unset;min-height:unset;min-width:unset;padding:0 var(--ck-spacing-small);width:unset}.ck.ck-color-grid__tile .ck-button__label{display:inline-block}}@media (prefers-reduced-motion:reduce){.ck.ck-color-grid__tile{transition:none}}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}",""]);const r=n},3086:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".color-picker-hex-input{width:max-content}.color-picker-hex-input .ck.ck-input{min-width:unset}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset}.ck.ck-color-picker__row .ck.ck-labeled-field-view{padding-top:unset}.ck.ck-color-picker__row .ck.ck-input-text{width:unset}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}",""]);const r=n},2922:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{align-items:center;display:flex}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{justify-content:flex-start}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-cancel,.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-save{flex:1}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{width:100%}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-left:var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker{padding:8px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker{height:100px;min-width:180px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{padding:0 8px 8px}",""]);const r=n},880:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-dialog-overlay{bottom:0;left:0;overscroll-behavior:none;position:fixed;right:0;top:0;user-select:none}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent{animation:none;background:none;pointer-events:none}.ck.ck-dialog{overscroll-behavior:none;position:absolute;width:fit-content}.ck.ck-dialog .ck.ck-form__header{flex-shrink:0}.ck.ck-dialog .ck.ck-form__header .ck-form__header__label{cursor:grab}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent .ck.ck-dialog{pointer-events:all}:root{--ck-dialog-overlay-background-color:rgba(0,0,0,.5);--ck-dialog-drop-shadow:0px 0px 6px 2px rgba(0,0,0,.15);--ck-dialog-max-width:100vw;--ck-dialog-max-height:90vh;--ck-color-dialog-background:var(--ck-color-base-background);--ck-color-dialog-form-header-border:var(--ck-color-base-border)}.ck.ck-dialog-overlay{animation:ck-dialog-fade-in .3s;background:var(--ck-dialog-overlay-background-color);z-index:var(--ck-z-dialog)}.ck.ck-dialog{border-radius:0}.ck-rounded-corners .ck.ck-dialog,.ck.ck-dialog.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dialog{box-shadow:var(--ck-drop-shadow),0 0;--ck-drop-shadow:var(--ck-dialog-drop-shadow);background:var(--ck-color-dialog-background);border:1px solid var(--ck-color-base-border);max-height:var(--ck-dialog-max-height);max-width:var(--ck-dialog-max-width)}.ck.ck-dialog .ck.ck-form__header{border-bottom:1px solid var(--ck-color-dialog-form-header-border)}@keyframes ck-dialog-fade-in{0%{background:transparent}to{background:var(--ck-dialog-overlay-background-color)}}",""]);const r=n},8091:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-dialog .ck.ck-dialog__actions{display:flex;justify-content:flex-end;padding:var(--ck-spacing-large)}.ck.ck-dialog .ck.ck-dialog__actions>*+*{margin-left:var(--ck-spacing-large)}",""]);const r=n},426:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-dropdown-max-width:75vw}.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-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.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-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-panel) + 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{margin-left:var(--ck-spacing-standard);right: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{overflow:hidden;text-overflow:ellipsis;width:7em}.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 .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.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{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 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}.ck.ck-dropdown__panel:focus{outline:none}",""]);const r=n},2454:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-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}",""]);const r=n},7133:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.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)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.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}',""]);const r=n},7475:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.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}",""]);const r=n},9550:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-accessibility-help-dialog-max-width:600px;--ck-accessibility-help-dialog-max-height:400px;--ck-accessibility-help-dialog-border-color:#ccced1;--ck-accessibility-help-dialog-code-background-color:#ededed;--ck-accessibility-help-dialog-kbd-shadow-color:#9c9c9c}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{border:1px solid transparent;max-height:var(--ck-accessibility-help-dialog-max-height);max-width:var(--ck-accessibility-help-dialog-max-width);overflow:auto;padding:var(--ck-spacing-large);user-select:text}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{*{white-space:normal}}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content .ck-label{display:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3{font-size:1.2em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4{font-size:1em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content p,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content table{margin:1em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl{border-bottom:none;border-top:1px solid var(--ck-accessibility-help-dialog-border-color);display:grid;grid-template-columns:2fr 1fr}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{border-bottom:1px solid var(--ck-accessibility-help-dialog-border-color);padding:.4em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{grid-column-start:1}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd{grid-column-start:2;text-align:right}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{background:var(--ck-accessibility-help-dialog-code-background-color);border-radius:2px;display:inline-block;font-size:.9em;line-height:1;padding:.4em;text-align:center;vertical-align:middle}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code{font-family:monospace}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{box-shadow:0 1px 1px var(--ck-accessibility-help-dialog-kbd-shadow-color);margin:0 1px;min-width:1.8em}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd+kbd{margin-left:2px}",""]);const r=n},178:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>: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-panel-background)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background)}",""]);const r=n},4866:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__header h2.ck-form__header__label{flex-grow:1}:root{--ck-form-header-height:44px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}[dir=ltr] .ck.ck-form__header>.ck-icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-form__header>.ck-icon{margin-left:var(--ck-spacing-medium)}.ck.ck-form__header .ck-form__header__label{--ck-font-size-base:15px;font-weight:700}",""]);const r=n},1998:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-highlighted-text mark{background:var(--ck-color-highlight-background);font-size:inherit;font-weight:inherit;line-height:inherit;vertical-align:initial}",""]);const r=n},4106:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{font-size:.8333350694em;height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}",""]);const r=n},1546:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}@media (prefers-reduced-motion:reduce){.ck.ck-input{transition:none}}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}@media (prefers-reduced-motion:reduce){.ck.ck-input.ck-error{animation:none}}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}",""]);const r=n},4606:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}",""]);const r=n},6365:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".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-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--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;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0;transform:translate(calc(var(--ck-spacing-medium)*-1),-6px) scale(.75);transform-origin:100% 0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}@media (prefers-reduced-motion:reduce){.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transition:none}}.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-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.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):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.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):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.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):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));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))}",""]);const r=n},6048:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.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)}:root{--ck-list-button-padding:calc(var(--ck-line-height-base)*0.11*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.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{background:var(--ck-color-list-background);list-style-type:none}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item>.ck-button{border-radius:0;min-height:unset;width:100%}[dir=ltr] .ck.ck-list__item>.ck-button{text-align:left}[dir=rtl] .ck.ck-list__item>.ck-button{text-align:right}.ck.ck-list__item>.ck-button{padding:var(--ck-list-button-padding)}.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-switchbutton):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-list .ck-list__group{padding-top:var(--ck-spacing-medium);:not(.ck-hidden)~&{border-top:1px solid var(--ck-color-base-border)}}.ck-list .ck-list__group>.ck-label{font-size:11px;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-medium) 0 var(--ck-spacing-medium)}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;width:100%}",""]);const r=n},4782:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-menu-bar{background:var(--ck-color-base-background);border:1px solid var(--ck-color-toolbar-border);display:flex;flex-wrap:wrap;gap:var(--ck-spacing-small);justify-content:flex-start;padding:var(--ck-spacing-small);width:100%}",""]);const r=n},55:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-menu-bar__menu{display:block;font-size:inherit;position:relative}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level{max-width:100%}",""]);const r=n},5667:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button{padding:var(--ck-list-button-padding);width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button{min-height:unset;padding:var(--ck-spacing-small) var(--ck-spacing-medium)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-button__label{line-height:unset;width:unset}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-icon{display:none}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button{border-radius:0}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button:focus{border-color:transparent;box-shadow:none}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button:not(:has(.ck-button__icon))>.ck-button__label{margin-left:calc(var(--ck-icon-size) - var(--ck-spacing-small))}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{transform:rotate(-90deg)}[dir=rtl] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{transform:rotate(90deg)}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button.ck-disabled>.ck-menu-bar__menu__button__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}",""]);const r=n},1214:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-menu-bar-menu-item-min-width:18em}.ck.ck-menu-bar__menu .ck.ck-menu-bar__menu__item{min-width:var(--ck-menu-bar-menu-item-min-width)}",""]);const r=n},5078:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button{border-radius:0}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container,.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button:focus{border-color:transparent;box-shadow:none}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__panel>ul>.ck-menu-bar__menu__item>.ck-menu-bar__menu__item__button:not(:has(.ck-button__icon))>.ck-button__label{margin-left:calc(var(--ck-icon-size) - var(--ck-spacing-small))}",""]);const r=n},4873:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-menu-bar-menu-max-width:75vw;--ck-menu-bar-nested-menu-horizontal-offset:5px}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{max-width:var(--ck-menu-bar-menu-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw{bottom:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{bottom:auto;top:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{left:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{right:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{left:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en{bottom:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{right:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{bottom:0}:root{--ck-menu-bar-menu-panel-max-width:75vw}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{border-radius:0}.ck-rounded-corners .ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;height:fit-content;max-width:var(--ck-menu-bar-menu-panel-max-width)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{border-top-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{border-top-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne{border-bottom-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{border-bottom-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel:focus{outline:none}",""]);const r=n},5615:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,':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-panel)}.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-border-width:1px;--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{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.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{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;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)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}',""]);const r=n},9938:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;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-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}",""]);const r=n},3579:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 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{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width: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}",""]);const r=n},7289:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}",""]);const r=n},871:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.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-width)*.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-number,.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:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){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}[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)}}',""]);const r=n},5540:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{position:absolute;top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{left:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{right:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view .ck-search__reset{position:absolute;top:50%;transform:translateY(-50%)}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{display:block}.ck.ck-search>.ck-search__results>.ck-search__info:not(.ck-hidden)~*{display:none}:root{--ck-search-field-view-horizontal-spacing:calc(var(--ck-icon-size) + var(--ck-spacing-medium))}.ck.ck-search>.ck-labeled-field-view .ck-input{width:100%}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon{--ck-labeled-field-label-default-position-x:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon>.ck-labeled-field-view__input-wrapper>.ck-icon{opacity:.5;pointer-events:none}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input,[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input:not(.ck-input-text_empty){padding-left:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset{--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset.ck-labeled-field-view_empty{--ck-labeled-field-empty-unfocused-max-width:100% - var(--ck-search-field-view-horizontal-spacing) - var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{background:none;min-height:auto;min-width:auto;opacity:.5;padding:0}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{left:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset:hover{opacity:1}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input:not(.ck-input-text_empty),[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{padding-right:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-search__results{min-width:100%}.ck.ck-search>.ck-search__results>.ck-search__info{padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-search>.ck-search__results>.ck-search__info *{white-space:normal}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{font-weight:700}.ck.ck-search>.ck-search__results>.ck-search__info>span:last-child{margin-top:var(--ck-spacing-medium)}",""]);const r=n},5706:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-spinner-container{display:block;position:relative}.ck.ck-spinner{left:0;margin:0 auto;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:1}:root{--ck-toolbar-spinner-size:18px}.ck.ck-spinner-container{animation:rotate 1.5s linear infinite;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@media (prefers-reduced-motion:reduce){.ck.ck-spinner-container{animation-duration:3s}}.ck.ck-spinner{border:2px solid var(--ck-color-text);border-radius:50%;border-top:2px solid transparent;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@keyframes rotate{to{transform:rotate(1turn)}}",""]);const r=n},8368:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-textarea{overflow-x:hidden}",""]);const r=n},9939:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}",""]);const r=n},66:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;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);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;background:var(--ck-color-toolbar-border);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.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-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.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.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.ck.ck-toolbar:focus{outline:none}.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.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{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.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}",""]);const r=n},4650:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 100);--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-tooltip-text-padding:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);padding:0 var(--ck-spacing-medium)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip.ck-tooltip_multi-line .ck-tooltip__text{display:inline-block;max-width:200px;padding:var(--ck-tooltip-text-padding) 0;white-space:break-spaces}.ck.ck-balloon-panel.ck-tooltip{box-shadow:none}.ck.ck-balloon-panel.ck-tooltip:before{display:none}",""]);const r=n},601:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck-hidden{display:none!important}:root{--ck-z-default:1;--ck-z-panel:calc(var(--ck-z-default) + 999);--ck-z-dialog:9999}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-line-height:10px;--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:7.5px;font-weight:700;letter-spacing:-.2px;line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-dialog-background:var(--ck-custom-background);--ck-color-dialog-form-header-border:var(--ck-custom-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-color-light-red:#fcc;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{background:transparent;border:0;box-sizing:border-box;height:auto;margin:0;padding:0;position:static;text-decoration:none;transition:none;vertical-align:middle;width:auto;word-wrap:break-word}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}",""]);const r=n},1216:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.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);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.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{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top: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)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}: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-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget{transition:none}}.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{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}@media (forced-colors:none){.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background)}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{transition:none}}.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{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.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:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.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{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}",""]);const r=n},2060:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}",""]);const r=n},6779:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var o=i(6314),n=i.n(o)()((function(e){return e[1]}));n.push([e.id,'.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.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;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;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{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.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{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;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);width:var(--ck-widget-type-around-button-size)}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button svg{transition:none}}.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}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button:hover,.ck .ck-widget .ck-widget__type-around__button:hover svg line,.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:none}}.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{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.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{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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[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}}',""]);const r=n},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,o){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(o)for(var r=0;r{"use strict";var o,n=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),r=[];function s(e){for(var t=-1,i=0;i{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(i,o){if(1&o&&(i=this(i)),8&o)return i;if("object"==typeof i&&i){if(4&o&&i.__esModule)return i;if(16&o&&"function"==typeof i.then)return i}var r=Object.create(null);n.r(r);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&o&&i;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>i[e]));return s.default=()=>i,n.d(r,s),r},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,(()=>{"use strict";let e;try{e={window,document}}catch(t){e={window:{},document:{}}}const t=e,i=function(){try{return navigator.userAgent.toLowerCase()}catch(e){return""}}(),o={isMac:s(i),isWindows:function(e){return e.indexOf("windows")>-1}(i),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(i),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(i),isiOS:function(e){return!!e.match(/iphone|ipad/i)||s(e)&&navigator.maxTouchPoints>0}(i),isAndroid:function(e){return e.indexOf("android")>-1}(i),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(i),get isMediaForcedColors(){return!!t.window.matchMedia&&t.window.matchMedia("(forced-colors: active)").matches},get isMotionReduced(){return!!t.window.matchMedia&&t.window.matchMedia("(prefers-reduced-motion)").matches},features:{isRegExpUnicodePropertySupported:function(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}},r=o;function s(e){return e.indexOf("macintosh")>-1}function a(e,t,i,o){i=i||function(e,t){return e===t};const n=Array.isArray(e)?e:Array.prototype.slice.call(e),r=Array.isArray(t)?t:Array.prototype.slice.call(t),s=function(e,t,i){const o=c(e,t,i);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const n=c(l(e,o),l(t,o),i);return{firstIndex:o,lastIndexOld:e.length-n,lastIndexNew:t.length-n}}(n,r,i),a=o?function(e,t){const{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=e;if(-1===i)return Array(t).fill("equal");let r=[];return i>0&&(r=r.concat(Array(i).fill("equal"))),n-i>0&&(r=r.concat(Array(n-i).fill("insert"))),o-i>0&&(r=r.concat(Array(o-i).fill("delete"))),n0&&i.push({index:o,type:"insert",values:e.slice(o,r)}),n-o>0&&i.push({index:o+(r-o),type:"delete",howMany:n-o}),i}(r,s);return a}function c(e,t,i){for(let o=0;o200||n>200||o+n>300)return d.fastDiff(e,t,i,!0);let r,s;if(nl?-1:1;u[o+d]&&(u[o]=u[o+d].slice(0)),u[o]||(u[o]=[]),u[o].push(n>l?r:s);let m=Math.max(n,l),g=m-o;for(;gl;g--)h[g]=m(g);h[l]=m(l),p++}while(h[l]!==c);return u[l].slice(1)}d.fastDiff=a;class u{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const h=new Array(256).fill("").map(((e,t)=>("0"+t.toString(16)).slice(-2)));function m(){const e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0;return"e"+h[255&e]+h[e>>8&255]+h[e>>16&255]+h[e>>24&255]+h[255&t]+h[t>>8&255]+h[t>>16&255]+h[t>>24&255]+h[255&i]+h[i>>8&255]+h[i>>16&255]+h[i>>24&255]+h[255&o]+h[o>>8&255]+h[o>>16&255]+h[o>>24&255]}const g={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function p(e,t){const i=g.get(t.priority);for(let o=0;o{if("object"==typeof t&&null!==t){if(i.has(t))return`[object ${t.constructor.name}]`;i.add(t)}return t}))}`:"")+w(e)}(e,i)),this.name="CKEditorError",this.context=t,this.data=i}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const i=new k(e.message,t);throw i.stack=e.stack,i}}function b(e,t){console.warn(...function(e,t){const i=w(e);return t?[e,t,i]:[e,i]}(e,t))}function w(e){return`\nRead more: ${f}#error-${e}`}const _=new Date(2024,4,17);if(globalThis.CKEDITOR_VERSION)throw new k("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION="41.4.2";const v=Symbol("listeningTo"),y=Symbol("emitterId"),x=Symbol("delegations"),A=C(Object);function C(e){return e?class extends e{on(e,t,i){this.listenTo(this,e,t,i)}once(e,t,i){let o=!1;this.listenTo(this,e,((e,...i)=>{o||(o=!0,e.off(),t.call(this,e,...i))}),i)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,i,o={}){let n,r;this[v]||(this[v]={});const s=this[v];E(e)||T(e);const a=E(e);(n=s[a])||(n=s[a]={emitter:e,callbacks:{}}),(r=n.callbacks[t])||(r=n.callbacks[t]=[]),r.push(i),function(e,t,i,o,n){t._addEventListener?t._addEventListener(i,o,n):e._addEventListener.call(t,i,o,n)}(this,e,t,i,o)}stopListening(e,t,i){const o=this[v];let n=e&&E(e);const r=o&&n?o[n]:void 0,s=r&&t?r.callbacks[t]:void 0;if(!(!o||e&&!r||t&&!s))if(i)V(this,e,t,i),-1!==s.indexOf(i)&&(1===s.length?delete r.callbacks[t]:V(this,e,t,i));else if(s){for(;i=s.pop();)V(this,e,t,i);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete o[n]}else{for(n in o)this.stopListening(o[n].emitter);delete this[v]}}fire(e,...t){try{const i=e instanceof u?e:new u(this,e),o=i.name;let n=I(this,o);if(i.path.push(this),n){const e=[i,...t];n=Array.from(n);for(let t=0;t{this[x]||(this[x]=new Map),e.forEach((e=>{const o=this[x].get(e);o?o.set(t,i):this[x].set(e,new Map([[t,i]]))}))}}}stopDelegating(e,t){if(this[x])if(e)if(t){const i=this[x].get(e);i&&i.delete(t)}else this[x].delete(e);else this[x].clear()}_addEventListener(e,t,i){!function(e,t){const i=S(e);if(i[t])return;let o=t,n=null;const r=[];for(;""!==o&&!i[o];)i[o]={callbacks:[],childEvents:[]},r.push(i[o]),n&&i[o].childEvents.push(n),n=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const e of r)e.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}(this,e);const o=M(this,e),n={callback:t,priority:g.get(i.priority)};for(const e of o)p(e,n)}_removeEventListener(e,t){const i=M(this,e);for(const e of i)for(let i=0;i-1?I(e,t.substr(0,t.lastIndexOf(":"))):null}function P(e,t,i){for(let[o,n]of e){n?"function"==typeof n&&(n=n(t.name)):n=t.name;const e=new u(t.source,n);e.path=[...t.path],o.fire(e,...i)}}function V(e,t,i,o){t._removeEventListener?t._removeEventListener(i,o):e._removeEventListener.call(t,i,o)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{C[e]=A.prototype[e]}));const N=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},L=Symbol("observableProperties"),O=Symbol("boundObservables"),R=Symbol("boundProperties"),D=Symbol("decoratedMethods"),B=Symbol("decoratedOriginal"),z=j(C());function j(e){return e?class extends e{set(e,t){if(N(e))return void Object.keys(e).forEach((t=>{this.set(t,e[t])}),this);F(this);const i=this[L];if(e in this&&!i.has(e))throw new k("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>i.get(e),set(t){const o=i.get(e);let n=this.fire(`set:${e}`,e,t,o);void 0===n&&(n=t),o===n&&i.has(e)||(i.set(e,n),this.fire(`change:${e}`,e,n,o))}}),this[e]=t}bind(...e){if(!e.length||!$(e))throw new k("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new k("observable-bind-duplicate-properties",this);F(this);const t=this[R];e.forEach((e=>{if(t.has(e))throw new k("observable-bind-rebind",this)}));const i=new Map;return e.forEach((e=>{const o={property:e,to:[]};t.set(e,o),i.set(e,o)})),{to:H,toMany:U,_observable:this,_bindProperties:e,_to:[],_bindings:i}}unbind(...e){if(!this[L])return;const t=this[R],i=this[O];if(e.length){if(!$(e))throw new k("observable-unbind-wrong-properties",this);e.forEach((e=>{const o=t.get(e);o&&(o.to.forEach((([e,t])=>{const n=i.get(e),r=n[t];r.delete(o),r.size||delete n[t],Object.keys(n).length||(i.delete(e),this.stopListening(e,"change"))})),t.delete(e))}))}else i.forEach(((e,t)=>{this.stopListening(t,"change")})),i.clear(),t.clear()}decorate(e){F(this);const t=this[e];if(!t)throw new k("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,((e,i)=>{e.return=t.apply(this,i)})),this[e]=function(...t){return this.fire(e,t)},this[e][B]=t,this[D]||(this[D]=[]),this[D].push(e)}stopListening(e,t,i){if(!e&&this[D]){for(const e of this[D])this[e]=this[e][B];delete this[D]}super.stopListening(e,t,i)}}:z}function F(e){e[L]||(Object.defineProperty(e,L,{value:new Map}),Object.defineProperty(e,O,{value:new Map}),Object.defineProperty(e,R,{value:new Map}))}function H(...e){const t=function(...e){if(!e.length)throw new k("observable-bind-to-parse-error",null);const t={to:[]};let i;return"function"==typeof e[e.length-1]&&(t.callback=e.pop()),e.forEach((e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new k("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i)}})),t}(...e),i=Array.from(this._bindings.keys()),o=i.length;if(!t.callback&&t.to.length>1)throw new k("observable-bind-to-no-callback",this);if(o>1&&t.callback)throw new k("observable-bind-to-extra-callback",this);var n;t.to.forEach((e=>{if(e.properties.length&&e.properties.length!==o)throw new k("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),n=this._observable,this._to.forEach((e=>{const t=n[O];let i;t.get(e.observable)||n.listenTo(e.observable,"change",((o,r)=>{i=t.get(e.observable)[r],i&&i.forEach((e=>{q(n,e.property)}))}))})),function(e){let t;e._bindings.forEach(((i,o)=>{e._to.forEach((n=>{t=n.properties[i.callback?0:e._bindProperties.indexOf(o)],i.to.push([n.observable,t]),function(e,t,i,o){const n=e[O],r=n.get(i),s=r||{};s[o]||(s[o]=new Set),s[o].add(t),r||n.set(i,s)}(e._observable,i,n.observable,t)}))}))}(this),this._bindProperties.forEach((e=>{q(this._observable,e)}))}function U(e,t,i){if(this._bindings.size>1)throw new k("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const i=e.map((e=>[e,t]));return Array.prototype.concat.apply([],i)}(e,t),i)}function $(e){return e.every((e=>"string"==typeof e))}function q(e,t){const i=e[R].get(t);let o;i.callback?o=i.callback.apply(e,i.to.map((e=>e[0][e[1]]))):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=o:e.set(t,o)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{j[e]=z.prototype[e]}));class W{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach((({element:e,newElement:t})=>{e.style.display="",t&&t.remove()})),this._replacedElements=[]}}function Z(e){let t=0;for(const i of e)t++;return t}function G(e,t){const i=Math.min(e.length,t.length);for(let o=0;o-1},ye.prototype.set=function(e,t){var i=this.__data__,o=_e(i,e);return o<0?(++this.size,i.push([e,t])):i[o][1]=t,this};const xe=ye,Ae=function(e){if(!N(e))return!1;var t=se(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ce=J["__core-js_shared__"];var Te=function(){var e=/[^.]+$/.exec(Ce&&Ce.keys&&Ce.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var Ee=Function.prototype.toString;const Se=function(e){if(null!=e){try{return Ee.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Me=/^\[object .+?Constructor\]$/,Ie=Function.prototype,Pe=Object.prototype,Ve=Ie.toString,Ne=Pe.hasOwnProperty,Le=RegExp("^"+Ve.call(Ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Oe=function(e){return!(!N(e)||(t=e,Te&&Te in t))&&(Ae(e)?Le:Me).test(Se(e));var t},Re=function(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return Oe(i)?i:void 0},De=Re(J,"Map"),Be=Re(Object,"create");var ze=Object.prototype.hasOwnProperty;var je=Object.prototype.hasOwnProperty;function Fe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};var ut={};ut["[object Float32Array]"]=ut["[object Float64Array]"]=ut["[object Int8Array]"]=ut["[object Int16Array]"]=ut["[object Int32Array]"]=ut["[object Uint8Array]"]=ut["[object Uint8ClampedArray]"]=ut["[object Uint16Array]"]=ut["[object Uint32Array]"]=!0,ut["[object Arguments]"]=ut["[object Array]"]=ut["[object ArrayBuffer]"]=ut["[object Boolean]"]=ut["[object DataView]"]=ut["[object Date]"]=ut["[object Error]"]=ut["[object Function]"]=ut["[object Map]"]=ut["[object Number]"]=ut["[object Object]"]=ut["[object RegExp]"]=ut["[object Set]"]=ut["[object String]"]=ut["[object WeakMap]"]=!1;const ht=function(e){return function(t){return e(t)}};var mt="object"==typeof exports&&exports&&!exports.nodeType&&exports,gt=mt&&"object"==typeof module&&module&&!module.nodeType&&module,pt=gt&>.exports===mt&&Y.process;const ft=function(){try{return gt&>.require&>.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}();var kt=ft&&ft.isTypedArray;const bt=kt?ht(kt):function(e){return ce(e)&&dt(e.length)&&!!ut[se(e)]};var wt=Object.prototype.hasOwnProperty;const _t=function(e,t){var i=ae(e),o=!i&&ot(e),n=!i&&!o&&at(e),r=!i&&!o&&!n&&bt(e),s=i||o||n||r,a=s?function(e,t){for(var i=-1,o=Array(e);++i{this._setToTarget(e,o,t[o],i)}))}}function Ii(e){return Ei(e,Pi)}function Pi(e){return Si(e)||"function"==typeof e?e:void 0}function Vi(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}function Ni(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const Li=Oi(C());function Oi(e){return e?class extends e{listenTo(e,t,i,o={}){if(Vi(e)||Ni(e)){const n={capture:!!o.useCapture,passive:!!o.usePassive},r=this._getProxyEmitter(e,n)||new Ri(e,n);this.listenTo(r,t,i,o)}else super.listenTo(e,t,i,o)}stopListening(e,t,i){if(Vi(e)||Ni(e)){const o=this._getAllProxyEmitters(e);for(const e of o)this.stopListening(e,t,i)}else super.stopListening(e,t,i)}_getProxyEmitter(e,t){return function(e,t){const i=e[v];return i&&i[t]?i[t].emitter:null}(this,Di(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((t=>this._getProxyEmitter(e,t))).filter((e=>!!e))}}:Li}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{Oi[e]=Li.prototype[e]}));class Ri extends(C()){constructor(e,t){super(),T(this,Di(e,t)),this._domNode=e,this._options=t}attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,i){this.attach(e),C().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){C().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function Di(e,t){let i=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=m())}(e);for(const e of Object.keys(t).sort())t[e]&&(i+="-"+e);return i}function Bi(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function zi(e){return"[object Text]"==Object.prototype.toString.call(e)}function ji(e){return"[object Range]"==Object.prototype.toString.apply(e)}function Fi(e){return e&&e.parentNode?e.offsetParent===t.document.body?null:e.offsetParent:null}const Hi=["top","right","bottom","left","width","height"];class Ui{constructor(e){const t=ji(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Wi(e)||t)if(t){const t=Ui.getDomRangeRects(e);$i(this,Ui.getBoundingRect(t))}else $i(this,e.getBoundingClientRect());else if(Ni(e)){const{innerWidth:t,innerHeight:i}=e;$i(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else $i(this,e)}clone(){return new Ui(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};if(t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0)return null;{const e=new Ui(t);return e._source=this._source,e}}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(qi(e))return t;let i,o=e,n=e.parentNode||e.commonAncestorContainer;for(;n&&!qi(n);){const e="visible"===((r=n)instanceof HTMLElement?r.ownerDocument.defaultView.getComputedStyle(r).overflow:"visible");o instanceof HTMLElement&&"absolute"===Zi(o)&&(i=o);const s=Zi(n);if(e||i&&("relative"===s&&e||"relative"!==s)){o=n,n=n.parentNode;continue}const a=new Ui(n),c=t.getIntersection(a);if(!c)return null;c.getArea(){for(const t of e){const e=Gi._getElementCallbacks(t.target);if(e)for(const i of e)i(t)}}))}}Gi._observerInstance=null,Gi._elementCallbacks=null;const Ki=Gi;function Yi(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function Qi(e){return t=>t+e}function Ji(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function Xi(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function eo(e){return e&&e.nodeType===Node.COMMENT_NODE}function to(e){return!!(e&&e.getClientRects&&e.getClientRects().length)}function io({element:e,target:i,positions:o,limiter:n,fitInViewport:r,viewportOffsetConfig:s}){Ae(i)&&(i=i()),Ae(n)&&(n=n());const a=Fi(e),c=function(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const i=new Ui(t.window);return i.top+=e.top,i.height-=e.top,i.bottom-=e.bottom,i.height-=e.bottom,i}(s),l=new Ui(e),d=oo(i,c);let u;if(!d||!c.getIntersection(d))return null;const h={targetRect:d,elementRect:l,positionedElementAncestor:a,viewportRect:c};if(n||r){if(n){const e=oo(n,c);e&&(h.limiterRect=e)}u=function(e,t){const{elementRect:i}=t,o=i.getArea(),n=e.map((e=>new no(e,t))).filter((e=>!!e.name));let r=0,s=null;for(const e of n){const{limiterIntersectionArea:t,viewportIntersectionArea:i}=e;if(t===o)return e;const n=i**2+t**2;n>r&&(r=n,s=e)}return s}(o,h)}else u=new no(o[0],h);return u}function oo(e,t){const i=new Ui(e).getVisible();return i?i.getIntersection(t):null}class no{constructor(e,t){const i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;const{left:o,top:n,name:r,config:s}=i;this.name=r,this.config=s,this._positioningFunctionCoordinates={left:o,top:n},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function ro(e){const t=e.parentNode;t&&t.removeChild(e)}function so({window:e,rect:t,alignToTop:i,forceScroll:o,viewportOffset:n}){const r=t.clone().moveBy(0,n.bottom),s=t.clone().moveBy(0,-n.top),a=new Ui(e).excludeScrollbarsAndBorders(),c=i&&o,l=[s,r].every((e=>a.contains(e)));let{scrollX:d,scrollY:u}=e;const h=d,m=u;c?u-=a.top-t.top+n.top:l||(lo(s,a)?u-=a.top-t.top+n.top:co(r,a)&&(u+=i?t.top-a.top-n.top:t.bottom-a.bottom+n.bottom)),l||(uo(t,a)?d-=a.left-t.left+n.left:ho(t,a)&&(d+=t.right-a.right+n.right)),d==h&&u===m||e.scrollTo(d,u)}function ao({parent:e,getRect:t,alignToTop:i,forceScroll:o,ancestorOffset:n=0,limiterElement:r}){const s=mo(e),a=i&&o;let c,l,d;const u=r||s.document.body;for(;e!=u;)l=t(),c=new Ui(e).excludeScrollbarsAndBorders(),d=c.contains(l),a?e.scrollTop-=c.top-l.top+n:d||(lo(l,c)?e.scrollTop-=c.top-l.top+n:co(l,c)&&(e.scrollTop+=i?l.top-c.top-n:l.bottom-c.bottom+n)),d||(uo(l,c)?e.scrollLeft-=c.left-l.left+n:ho(l,c)&&(e.scrollLeft+=l.right-c.right+n)),e=e.parentNode}function co(e,t){return e.bottom>t.bottom}function lo(e,t){return e.topt.right}function mo(e){return ji(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function go(e){if(ji(e)){let t=e.commonAncestorContainer;return zi(t)&&(t=t.parentNode),t}return e.parentNode}function po(e,t){const i=mo(e),o=new Ui(e);if(i===t)return o;{let e=i;for(;e!=t;){const t=e.frameElement,i=new Ui(t).excludeScrollbarsAndBorders();o.moveBy(i.left,i.top),e=e.parent}}return o}const fo={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},ko={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},bo={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},wo=function(){const e={pageup:33,pagedown:34,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++)e[String.fromCharCode(t).toLowerCase()]=t;for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}(),_o=Object.fromEntries(Object.entries(wo).map((([e,t])=>{let i;return i=t in bo?bo[t]:e.charAt(0).toUpperCase()+e.slice(1),[t,i]})));function vo(e){let t;if("string"==typeof e){if(t=wo[e.toLowerCase()],!t)throw new k("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?wo.alt:0)+(e.ctrlKey?wo.ctrl:0)+(e.shiftKey?wo.shift:0)+(e.metaKey?wo.cmd:0);return t}function yo(e){return"string"==typeof e&&(e=function(e){return e.split("+").map((e=>e.trim()))}(e)),e.map((e=>"string"==typeof e?function(e){if(e.endsWith("!"))return vo(e.slice(0,-1));const t=vo(e);return(r.isMac||r.isiOS)&&t==wo.ctrl?wo.cmd:t}(e):e)).reduce(((e,t)=>t+e),0)}function xo(e){let t=yo(e);return Object.entries(r.isMac||r.isiOS?fo:ko).reduce(((e,[i,o])=>(t&wo[i]&&(t&=~wo[i],e+=o),e)),"")+(t?_o[t]:"")}function Ao(e,t){const i="ltr"===t;switch(e){case wo.arrowleft:return i?"left":"right";case wo.arrowright:return i?"right":"left";case wo.arrowup:return"up";case wo.arrowdown:return"down"}}function Co(e){return Array.isArray(e)?e:[e]}const To=function(e,t,i){(void 0!==i&&!we(e[t],i)||void 0===i&&!(t in e))&&Ke(e,t,i)},Eo=function(e,t,i){for(var o=-1,n=Object(e),r=i(e),s=r.length;s--;){var a=r[++o];if(!1===t(n[a],a,n))break}return e},So=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Mo=function(e,t,i,o,n,r,s){var a,c=So(e,i),l=So(t,i),d=s.get(l);if(d)To(e,i,d);else{var u=r?r(c,l,i+"",e,t,s):void 0,h=void 0===u;if(h){var m=ae(l),g=!m&&at(l),p=!m&&!g&&bt(l);u=l,m||g||p?ae(c)?u=c:ce(a=c)&&Ct(a)?u=Ot(c):g?(h=!1,u=Lt(l,!0)):p?(h=!1,u=mi(l,!0)):u=[]:be(l)||ot(l)?(u=c,ot(c)?u=function(e){return Je(e,Mt(e))}(c):N(c)&&!Ae(c)||(u=ki(l))):h=!1}h&&(s.set(l,u),n(u,l,o,r,s),s.delete(l)),To(e,i,u)}},Io=function e(t,i,o,n,r){t!==i&&Eo(i,(function(s,a){if(r||(r=new Ze),N(s))Mo(t,i,a,o,e,n,r);else{var c=n?n(So(t,a),s,a+"",t,i,r):void 0;void 0===c&&(c=s),To(t,a,c)}}),Mt)},Po=function(e){return e};var Vo=Math.max;const No=Ge?function(e,t){return Ge(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Po;var Lo=Date.now;const Oo=function(e){var t=0,i=0;return function(){var o=Lo(),n=16-(o-i);if(i=o,n>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(No),Ro=function(e,t){return Oo(function(e,t,i){return t=Vo(void 0===t?e.length-1:t,0),function(){for(var o=arguments,n=-1,r=Vo(o.length-t,0),s=Array(r);++n1?i[n-1]:void 0,s=n>2?i[2]:void 0;for(r=e.length>3&&"function"==typeof r?(n--,r):void 0,s&&function(e,t,i){if(!N(i))return!1;var o=typeof t;return!!("number"==o?Ct(i)&<(t,i.length):"string"==o&&t in i)&&we(i[t],e)}(i[0],i[1],s)&&(r=n<3?void 0:r,n=1),t=Object(t);++oBo(e,t))):e}(i),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,i=[]){i=Co(i),"string"==typeof e&&(e={string:e});const o=e.plural?i[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,i)=>i1===e?0:1),d=c[a];return"string"==typeof d?d:d[Number(l(o))]}(this.uiLanguage,e,o,this.translations),i)}}class Ho extends(C()){constructor(e={},t={}){super();const i=K(e);if(i||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const t of e)this._items.push(t),this._itemMap.set(this._getItemIdBeforeAdding(t),t)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new k("collection-add-item-invalid-index",this);let i=0;for(const o of e){const e=this._getItemIdBeforeAdding(o),n=t+i;this._items.splice(n,0,o),this._itemMap.set(e,o),this.fire("add",o,n),i++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new k("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new k("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding((t=>new e(t)))},using:e=>{"function"==typeof e?this._setUpBindToBinding(e):this._setUpBindToBinding((t=>t[e]))}}}_setUpBindToBinding(e){const t=this._bindToCollection,i=(i,o,n)=>{const r=t._bindToCollection==this,s=t._bindToInternalToExternalMap.get(o);if(r&&s)this._bindToExternalToInternalMap.set(o,s),this._bindToInternalToExternalMap.set(s,o);else{const i=e(o);if(!i)return void this._skippedIndexesFromExternal.push(n);let r=n;for(const e of this._skippedIndexesFromExternal)n>e&&r--;for(const e of t._skippedIndexesFromExternal)r>=e&&r++;this._bindToExternalToInternalMap.set(o,i),this._bindToInternalToExternalMap.set(i,o),this.add(i,r);for(let e=0;e{const o=this._bindToExternalToInternalMap.get(t);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((e,t)=>(it&&e.push(t),e)),[])}))}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){if(i=e[t],"string"!=typeof i)throw new k("collection-add-invalid-id",this);if(this.get(i))throw new k("collection-add-item-already-exists",this)}else e[t]=i=m();return i}_remove(e){let t,i,o,n=!1;const r=this._idProperty;if("string"==typeof e?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):"number"==typeof e?(t=e,o=this._items[t],n=!o,o&&(i=o[r])):(o=e,i=o[r],t=this._items.indexOf(o),n=-1==t||!this._itemMap.get(i)),n)throw new k("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(s),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Uo(e){const t=e.next();return t.done?null:t.value}class $o extends(Oi(j())){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(e){if(this._elements.has(e))throw new k("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",(()=>this._focus(e)),{useCapture:!0}),this.listenTo(e,"blur",(()=>this._blur()),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0)}}class qo{constructor(){this._listener=new(Oi())}listenTo(e){this._listener.listenTo(e,"keydown",((e,t)=>{this._listener.fire("_keydown:"+vo(t),t)}))}set(e,t,i={}){const o=yo(e),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,((e,i)=>{t(i,(()=>{i.preventDefault(),i.stopPropagation(),e.stop()})),e.return=!0}),{priority:n})}press(e){return!!this._listener.fire("_keydown:"+vo(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function Wo(e){return K(e)?new Map(e):function(e){const t=new Map;for(const i in e)t.set(i,e[i]);return t}(e)}function Zo(e,t){let i;function o(...n){o.cancel(),i=setTimeout((()=>e(...n)),t)}return o.cancel=()=>{clearTimeout(i)},o}function Go(e,t){return!!(i=e.charAt(t-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var i}function Ko(e,t){return!!(i=e.charAt(t))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}const Yo=function(){const e=/\p{Regional_Indicator}{2}/u.source,t="(?:"+[/\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,/\p{Emoji}\u{FE0F}?\u{20E3}/u,/\p{Emoji}\u{FE0F}/u,/(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u].map((e=>e.source)).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}();function Qo(e,t){const i=String(e).matchAll(Yo);return Array.from(i).some((e=>e.index{this._renderViewIntoCollectionParent(t,i)})),this.on("remove",((e,t)=>{t.element&&this._parentElement&&t.element.remove()})),this._parentElement=null}destroy(){this.map((e=>e.destroy()))}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!e.every((e=>"string"==typeof e)))throw new k("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const o of e)i.delegate(o).to(t);this.on("add",((i,o)=>{for(const i of e)o.delegate(i).to(t)})),this.on("remove",((i,o)=>{for(const i of e)o.stopDelegating(i,t)}))}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class Xo extends(C()){constructor(e){super(),Object.assign(this,dn(ln(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new k("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)fn(i)?yield i:kn(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,o)=>new tn({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o}),if:(i,o,n)=>new on({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}static extend(e,t){if(e._isRendered)throw new k("template-extend-render",[this,e]);gn(e,dn(ln(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new k("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),nn(this.text)?this._bindToObservable({schema:this.text,updater:sn(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const o in this.attributes){const n=t.getAttribute(o),r=this.attributes[o];i&&(i.attributes[o]=n);const s=wn(r)?r[0].ns:null;if(nn(r)){const a=wn(r)?r[0].value:r;i&&_n(o)&&a.unshift(n),this._bindToObservable({schema:a,updater:an(t,o,s),data:e})}else if("style"==o&&"string"!=typeof r[0])this._renderStyleAttribute(r[0],e);else{i&&n&&_n(o)&&r.unshift(n);const e=r.map((e=>e&&e.value||e)).reduce(((e,t)=>e.concat(t)),[]).reduce(hn,"");pn(e)||t.setAttributeNS(s,o,e)}}}_renderStyleAttribute(e,t){const i=t.node;for(const o in e){const n=e[o];nn(n)?this._bindToObservable({schema:[n],updater:cn(i,o),data:t}):i.style[o]=n}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let n=0;for(const r of this.children)if(bn(r)){if(!o){r.setParent(t);for(const e of r)i.appendChild(e.element)}}else if(fn(r))o||(r.isRendered||r.render(),i.appendChild(r.element));else if(Vi(r))i.appendChild(r);else if(o){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),r._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:t})}else i.appendChild(r.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map((i=>{const[o,n]=t.split("@");return i.activateDomEventListener(o,n,e)}));e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const o=i.revertData;rn(e,t,i);const n=e.filter((e=>!pn(e))).filter((e=>e.observable)).map((o=>o.activateAttributeListener(e,t,i)));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)return void(e.textContent=t.text);const i=e;for(const e in t.attributes){const o=t.attributes[e];null===o?i.removeAttribute(e):i.setAttribute(e,o)}for(let e=0;ern(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}}class tn extends en{constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const o=(e,i)=>{t&&!i.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}}class on extends en{constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!pn(super.getValue(e))&&(this.valueIfTrue||!0)}}function nn(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(nn):e instanceof en)}function rn(e,t,{node:i}){const o=function(e,t){return e.map((e=>e instanceof en?e.getValue(t):e))}(e,i);let n;n=1==e.length&&e[0]instanceof on?o[0]:o.reduce(hn,""),pn(n)?t.remove():t.set(n)}function sn(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function an(e,t,i){return{set(o){e.setAttributeNS(i,t,o)},remove(){e.removeAttributeNS(i,t)}}}function cn(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}function ln(e){return Ei(e,(e=>{if(e&&(e instanceof en||kn(e)||fn(e)||bn(e)))return e}))}function dn(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Co(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)un(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Co(e[t].value)),un(e,t)}(e.attributes);const t=[];if(e.children)if(bn(e.children))t.push(e.children);else for(const i of e.children)kn(i)||fn(i)||Vi(i)?t.push(i):t.push(new Xo(i));e.children=t}return e}function un(e,t){e[t]=Co(e[t])}function hn(e,t){return pn(t)?e:pn(e)?t:`${e} ${t}`}function mn(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function gn(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),mn(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),mn(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new k("ui-template-extend-children-mismatch",e);let i=0;for(const o of t.children)gn(e.children[i++],o)}}function pn(e){return!e&&0!==e}function fn(e){return e instanceof An}function kn(e){return e instanceof Xo}function bn(e){return e instanceof Jo}function wn(e){return N(e[0])&&e[0].ns}function _n(e){return"class"==e||"style"==e}var vn=n(5072),yn=n.n(vn),xn=n(601);yn()(xn.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),xn.A.locals;class An extends(Oi(j())){constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Ho,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((t,i)=>{i.locale=e,i.t=e&&e.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Xo.bind(this,this)}createCollection(e){const t=new Jo(e);return this._viewCollections.add(t),t}registerChild(e){K(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){K(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Xo(e)}extendTemplate(e){Xo.extend(this.template,e)}render(){if(this.isRendered)throw new k("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((e=>e.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}function Cn({emitter:e,activator:t,callback:i,contextElements:o}){e.listenTo(document,"mousedown",((e,n)=>{if(!t())return;const r="function"==typeof n.composedPath?n.composedPath():[],s="function"==typeof o?o():o;for(const e of s)if(e.contains(n.target)||r.includes(e))return;i()}))}function Tn(e){return class extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function En({view:e}){e.listenTo(e.element,"submit",((t,i)=>{i.preventDefault(),e.fire("submit")}),{useCapture:!0})}function Sn({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:o,uiLanguageDirection:n}){const r="number"==typeof o?()=>o:o;function s(e){return o=>{const n=i.find((e=>e.element===t.focusedElement)),r=i.getIndex(n),s=e(r,i);i.get(s).focus(),o.stopPropagation(),o.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function c(e,t){return 0===e?t-1:e-1}e.set("arrowright",s(((e,t)=>"rtl"===n?c(e,t.length):a(e,t.length)))),e.set("arrowleft",s(((e,t)=>"rtl"===n?a(e,t.length):c(e,t.length)))),e.set("arrowup",s(((e,t)=>{let i=e-r();return i<0&&(i=e+r()*Math.floor(t.length/r()),i>t.length-1&&(i-=r())),i}))),e.set("arrowdown",s(((e,t)=>{let i=e+r();return i>t.length-1&&(i=e%r()),i})))}class Mn extends(j()){constructor(e){super(),this._disableStack=new Set,this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",In,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",In),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function In(e){e.return=!1,e.stop()}class Pn extends(j()){constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.listenTo(e,"change:isReadOnly",(()=>{this.refresh()})),this.on("set:isEnabled",(t=>{if(!this.affectsData)return;const i=e.model.document.selection,o=!("$graveyard"==i.getFirstPosition().root.rootName)&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(t.return=!1,t.stop())}),{priority:"highest"}),this.on("execute",(e=>{this.isEnabled||e.stop()}),{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Vn,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Vn),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function Vn(e){e.return=!1,e.stop()}class Nn extends Pn{constructor(){super(...arguments),this._childCommandsDefinitions=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){p(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",(()=>this._checkEnabled())),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find((({command:e})=>e.isEnabled));return e&&e.command}}class Ln extends(C()){constructor(e,t=[],i=[]){super(),this._plugins=new Map,this._context=e,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of i)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new k("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[],i=[]){const o=this,n=this._context;!function e(t,i=new Set){t.forEach((t=>{a(t)&&(i.has(t)||(i.add(t),t.pluginName&&!o._availablePlugins.has(t.pluginName)&&o._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,i)))}))}(e),u(e);const r=[...function e(t,i=new Set){return t.map((e=>a(e)?e:o._availablePlugins.get(e))).reduce(((t,o)=>i.has(o)?t:(i.add(o),o.requires&&(u(o.requires,o),e(o.requires,i).forEach((e=>t.add(e)))),t.add(o))),new Set)}(e.filter((e=>!l(e,t))))];!function(e,t){for(const i of t){if("function"!=typeof i)throw new k("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const t=i.pluginName;if(!t)throw new k("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new k("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const n=o._availablePlugins.get(t);if(!n)throw new k("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const r=e.indexOf(n);if(-1===r){if(o._contextPlugins.has(n))return;throw new k("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(n.requires&&n.requires.length)throw new k("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(r,1,i),o._availablePlugins.set(t,i)}}(r,i);const s=function(e){return e.map((e=>{let t=o._contextPlugins.get(e);return t=t||new e(n),o._add(e,t),t}))}(r);return h(s,"init").then((()=>h(s,"afterInit"))).then((()=>s));function a(e){return"function"==typeof e}function c(e){return a(e)&&!!e.isContextPlugin}function l(e,t){return t.some((t=>t===e||d(e)===t||d(t)===e))}function d(e){return a(e)?e.pluginName||e.name:e}function u(e,i=null){e.map((e=>a(e)?e:o._availablePlugins.get(e)||e)).forEach((e=>{!function(e,t){if(!a(e)){if(t)throw new k("plugincollection-soft-required",n,{missingPlugin:e,requiredBy:d(t)});throw new k("plugincollection-plugin-not-found",n,{plugin:e})}}(e,i),function(e,t){if(c(t)&&!c(e))throw new k("plugincollection-context-required",n,{plugin:d(e),requiredBy:d(t)})}(e,i),function(e,i){if(i&&l(e,t))throw new k("plugincollection-required",n,{plugin:d(e),requiredBy:d(i)})}(e,i)}))}function h(e,t){return e.reduce(((e,i)=>i[t]?o._contextPlugins.has(i)?e:e.then(i[t].bind(i)):e),Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new k("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class On{constructor(e){this._contextOwner=null;const{translations:t,...i}=e||{};this.config=new Mi(i,this.constructor.defaultConfig);const o=this.constructor.builtinPlugins;this.config.define("plugins",o),this.plugins=new Ln(this,o);const n=this.config.get("language")||{};this.locale=new Fo({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new Ho}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if("function"!=typeof i)throw new k("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new k("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,(e=>e.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(e,t){if(this._contextOwner)throw new k("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise((t=>{const i=new this(e);t(i.initPlugins().then((()=>i)))}))}}class Rn extends(j()){constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}var Dn=n(1111);yn()(Dn.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Dn.A.locals;const Bn=new WeakMap;let zn=!1;function jn({view:e,element:t,text:i,isDirectHost:o=!0,keepOnFocus:n=!1}){const r=e.document;function s(i){Bn.get(r).set(t,{text:i,isDirectHost:o,keepOnFocus:n,hostElement:o?t:null}),e.change((e=>Fn(r,e)))}Bn.has(r)||(Bn.set(r,new Map),r.registerPostFixer((e=>Fn(r,e))),r.on("change:isComposing",(()=>{e.change((e=>Fn(r,e)))}),{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",((e,t,i)=>{s(i)})),t.placeholder?s(t.placeholder):i&&s(i),i&&(zn||b("enableplaceholder-deprecated-text-option"),zn=!0)}function Fn(e,t){const i=Bn.get(e),o=[];let n=!1;for(const[e,r]of i)r.isDirectHost&&(o.push(e),Hn(t,e,r)&&(n=!0));for(const[e,r]of i){if(r.isDirectHost)continue;const i=Un(e);i&&(o.includes(i)||(r.hostElement=i,Hn(t,e,r)&&(n=!0)))}return n}function Hn(e,t,i){const{text:o,isDirectHost:n,hostElement:r}=i;let s=!1;return r.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,r),s=!0),(n||1==t.childCount)&&function(e,t){if(!e.isAttached())return!1;const i=Array.from(e.getChildren()).some((e=>!e.is("uiElement")));if(i)return!1;const o=e.document,n=o.selection.anchor;return!(o.isComposing&&n&&n.parent===e||!t&&o.isFocused&&(!n||n.parent===e))}(r,i.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,r)&&(s=!0):function(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}(e,r)&&(s=!0),s}function Un(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}class $n{is(){throw new Error("is() method is abstract")}}const qn=function(e){return Ti(e,4)};class Wn extends(C($n)){constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new k("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=G(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]e.data.length)throw new k("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new k("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const t=[];let i=e.includeSelf?this.textNode:this.parent;for(;null!==i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}}Gn.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};class Kn{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const i=Yn(t,e);if(i)return{element:t,pattern:e,match:i}}return null}matchAll(...e){const t=[];for(const i of e)for(const e of this._patterns){const o=Yn(i,e);o&&t.push({element:i,pattern:e,match:o})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function Yn(e,t){if("function"==typeof t)return t(e);const i={};return t.name&&(i.name=function(e,t){return e instanceof RegExp?!!t.match(e):e===t}(t.name,e.name),!i.name)||t.attributes&&(i.attributes=function(e,t){const i=new Set(t.getAttributeKeys());return be(e)?(void 0!==e.style&&b("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&b("matcher-pattern-deprecated-attributes-class-key",e)):(i.delete("style"),i.delete("class")),Qn(e,i,(e=>t.getAttribute(e)))}(t.attributes,e),!i.attributes)||t.classes&&(i.classes=function(e,t){return Qn(e,t.getClassNames(),(()=>{}))}(t.classes,e),!i.classes)||t.styles&&(i.styles=function(e,t){return Qn(e,t.getStyleNames(!0),(e=>t.getStyle(e)))}(t.styles,e),!i.styles)?null:i}function Qn(e,t,i){const o=function(e){return Array.isArray(e)?e.map((e=>be(e)?(void 0!==e.key&&void 0!==e.value||b("matcher-pattern-missing-key-or-value",e),[e.key,e.value]):[e,!0])):be(e)?Object.entries(e):[[e,!0]]}(e),n=Array.from(t),r=[];if(o.forEach((([e,t])=>{n.forEach((o=>{(function(e,t){return!0===e||e===t||e instanceof RegExp&&t.match(e)})(e,o)&&function(e,t,i){if(!0===e)return!0;const o=i(t);return e===o||e instanceof RegExp&&!!String(o).match(e)}(t,o,i)&&r.push(o)}))})),o.length&&!(r.lengthn?0:n+t),(i=i>n?n:i)<0&&(i+=n),n=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(n);++ot===e));return Array.isArray(t)}set(e,t){if(N(e))for(const[t,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=vr(e);(function(e,t){null==e||fr(e,t)})(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map((e=>e.join(":"))).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!N(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find((([t])=>t===e));return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?this._styleProcessor.getStyleNames(this._styles):this.getStylesEntries().map((([e])=>e))}clear(){this._styles={}}getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const i=t.splice(0,t.length-1).join("."),o=kr(this._styles,i);o&&!Object.keys(o).length&&this.remove(i)}}class _r{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(N(t))yr(i,vr(e),t);else if(this._normalizers.has(e)){const o=this._normalizers.get(e),{path:n,value:r}=o(t);yr(i,n,r)}else yr(i,e,t)}getNormalized(e,t){if(!e)return Bo({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if("string"==typeof i)return kr(t,i);const o=i(e,t);if(o)return o}return kr(t,vr(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);return void 0===i?[]:this._reducers.has(e)?this._reducers.get(e)(i):[[e,i]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter((t=>{const i=this.getNormalized(t,e);return i&&"object"==typeof i?Object.keys(i).length:i})),i=new Set([...t,...Object.keys(e)]);return Array.from(i)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function vr(e){return e.replace("-",".")}function yr(e,t,i){let o=i;N(i)&&(o=Bo({},kr(e,t),i)),br(e,t,o)}class xr extends Wn{constructor(e,t,i,o){if(super(e),this._unsafeAttributesToRender=[],this._customProperties=new Map,this.name=t,this._attrs=function(e){const t=Wo(e);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],o&&this._insertChild(0,o),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");Ar(this._classes,e),this._attrs.delete("class")}this._styles=new wr(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style"))}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof xr))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,i]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==i)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Kn(...e);let i=this.parent;for(;i&&!i.is("documentFragment");){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),i=Array.from(this._attrs).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let i=0;const o=function(e,t){return"string"==typeof t?[new Zn(e,t)]:(K(t)||(t=[t]),Array.from(t).map((t=>"string"==typeof t?new Zn(e,t):t instanceof Gn?new Zn(e,t.data):t)))}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Co(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Co(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),"string"!=typeof e?this._styles.set(e):this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Co(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Ar(e,t){const i=t.split(/\s+/);e.clear(),i.forEach((t=>e.add(t)))}xr.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Cr extends xr{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Tr}}function Tr(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const t of e)if(!t.is("uiElement"))return null;return this.childCount}Cr.prototype.is=function(e,t){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Er extends(j(Cr)){constructor(e,t,i,o){super(e,t,i,o),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",(t=>t&&e.selection.editableElement==this)),this.listenTo(e.selection,"change",(()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this}))}destroy(){this.stopListening()}}Er.prototype.is=function(e,t){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};const Sr=Symbol("rootName");class Mr extends Er{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Sr)}set rootName(e){this._setCustomProperty(Sr,e)}set _name(e){this.name=e}}Mr.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Ir{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new k("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new k("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=Pr._createAt(e.startPosition):this._position=Pr._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i;do{i=this.position,t=this.next()}while(!t.done&&e(t.value));t.done||(this._position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o;if(i instanceof Zn){if(e.isAtEnd)return this._position=Pr._createAfter(i),this._next();o=i.data[e.offset]}else o=i.getChild(e.offset);if(o instanceof xr){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e=new Pr(o,0);return this._position=e,this._formatReturnValue("elementStart",o,t,e,1)}if(o instanceof Zn){if(this.singleCharacters)return e=new Pr(o,0),this._position=e,this._next();let i,n=o.data.length;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new Gn(o,0,n),e=Pr._createAfter(i)):(i=new Gn(o,0,o.data.length),e.offset++),this._position=e,this._formatReturnValue("text",i,t,e,n)}if("string"==typeof o){let o;o=this.singleCharacters?1:(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset;const n=new Gn(i,e.offset,o);return e.offset+=o,this._position=e,this._formatReturnValue("text",n,t,e,o)}return e=Pr._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&0===e.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let o;if(i instanceof Zn){if(e.isAtStart)return this._position=Pr._createBefore(i),this._previous();o=i.data[e.offset-1]}else o=i.getChild(e.offset-1);if(o instanceof xr)return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new Pr(o,o.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o instanceof Zn){if(this.singleCharacters)return e=new Pr(o,o.data.length),this._position=e,this._previous();let i,n=o.data.length;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new Gn(o,t,o.data.length-t),n=i.data.length,e=Pr._createBefore(i)}else i=new Gn(o,0,o.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",i,t,e,n)}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}e.offset-=o;const n=new Gn(i,e.offset,o);return this._position=e,this._formatReturnValue("text",n,t,e,o)}return e=Pr._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,o,n){return t instanceof Gn&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=Pr._createAfter(t.textNode):(o=Pr._createAfter(t.textNode),this._position=o)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=Pr._createBefore(t.textNode):(o=Pr._createBefore(t.textNode),this._position=o))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}}class Pr extends $n{constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof Er);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=Pr._createAt(this),i=t.offset+e;return t.offset=i<0?0:i,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new Ir(t);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let o=0;for(;t[o]==i[o]&&t[o];)o++;return 0===o?null:t[o-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),i.push(e.offset);const o=G(t,i);switch(o){case"prefix":return"before";case"extension":return"after";default:return t[o]0?new this(i,o):new this(o,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(Pr._createBefore(e),t)}}function Nr(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}Vr.prototype.is=function(e){return"range"===e||"view:range"===e};class Lr extends(C($n)){constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=Z(this.getRanges());if(t!=Z(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let i=!1;for(let o of e.getRanges())if(o=o.getTrimmed(),t.start.isEqual(o.start)&&t.end.isEqual(o.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]),this._setFakeOptions(o);else if(t instanceof Lr||t instanceof Or)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Vr)this._setRanges([t],o&&o.backward),this._setFakeOptions(o);else if(t instanceof Pr)this._setRanges([new Vr(t)]),this._setFakeOptions(o);else if(t instanceof Wn){const e=!!o&&!!o.backward;let n;if(void 0===i)throw new k("view-selection-setto-required-second-parameter",this);n="in"==i?Vr._createIn(t):"on"==i?Vr._createOn(t):new Vr(Pr._createAt(t,i)),this._setRanges([n],e),this._setFakeOptions(o)}else{if(!K(t))throw new k("view-selection-setto-not-selectable",this);this._setRanges(t,o&&o.backward),this._setFakeOptions(o)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new k("view-selection-setfocus-no-ranges",this);const i=Pr._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==i.compareWith(o)?this._addRange(new Vr(i,o),!0):this._addRange(new Vr(o,i)),this.fire("change")}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Vr))throw new k("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new k("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Vr(e.start,e.end))}}Lr.prototype.is=function(e){return"selection"===e||"view:selection"===e};class Or extends(C($n)){constructor(...e){super(),this._selection=new Lr,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}Or.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class Rr extends u{constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Dr=Symbol("bubbling contexts");function Br(e){return class extends e{fire(e,...t){try{const i=e instanceof u?e:new u(this,e),o=Hr(this);if(!o.size)return;if(zr(i,"capturing",this),jr(o,"$capture",i,...t))return i.return;const n=i.startRange||this.selection.getFirstRange(),r=n?n.getContainedElement():null,s=!!r&&Boolean(Fr(o,r));let a=r||function(e){if(!e)return null;const t=e.start.parent,i=e.end.parent,o=t.getPath(),n=i.getPath();return o.length>n.length?t:i}(n);if(zr(i,"atTarget",a),!s){if(jr(o,"$text",i,...t))return i.return;zr(i,"bubbling",a)}for(;a;){if(a.is("rootElement")){if(jr(o,"$root",i,...t))return i.return}else if(a.is("element")&&jr(o,a.name,i,...t))return i.return;if(jr(o,a,i,...t))return i.return;a=a.parent,zr(i,"bubbling",a)}return zr(i,"bubbling",this),jr(o,"$document",i,...t),i.return}catch(e){k.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,i){const o=Co(i.context||"$document"),n=Hr(this);for(const r of o){let o=n.get(r);o||(o=new(C()),n.set(r,o)),this.listenTo(o,e,t,i)}}_removeEventListener(e,t){const i=Hr(this);for(const o of i.values())this.stopListening(o,e,t)}}}{const e=Br(Object);["fire","_addEventListener","_removeEventListener"].forEach((t=>{Br[t]=e.prototype[t]}))}function zr(e,t,i){e instanceof Rr&&(e._eventPhase=t,e._currentTarget=i)}function jr(e,t,i,...o){const n="string"==typeof t?e.get(t):Fr(e,t);return!!n&&(n.fire(i,...o),i.stop.called)}function Fr(e,t){for(const[i,o]of e)if("function"==typeof i&&i(t))return o;return null}function Hr(e){return e[Dr]||(e[Dr]=new Map),e[Dr]}class Ur extends(Br(j())){constructor(e){super(),this._postFixers=new Set,this.selection=new Or,this.roots=new Ho({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach((e=>e.destroy())),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(t=i(e),t)break}while(t)}}class $r extends xr{constructor(e,t,i,o){super(e,t,i,o),this._priority=10,this._id=null,this._clonesGroup=null,this.getFillerOffset=Wr}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new k("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}$r.DEFAULT_PRIORITY=10;const qr=$r;function Wr(){if(Zr(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Zr(e)>1)return null;e=e.parent}return!e||Zr(e)>1?null:this.childCount}function Zr(e){return Array.from(e.getChildren()).filter((e=>!e.is("uiElement"))).length}$r.prototype.is=function(e,t){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Gr extends xr{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Kr}_insertChild(e,t){if(t&&(t instanceof Wn||Array.from(t).length>0))throw new k("view-emptyelement-cannot-add",[this,t]);return 0}}function Kr(){return null}Gr.prototype.is=function(e,t){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Yr extends xr{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Qr}_insertChild(e,t){if(t&&(t instanceof Wn||Array.from(t).length>0))throw new k("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}}function Qr(){return null}Yr.prototype.is=function(e,t){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Jr extends xr{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Xr}_insertChild(e,t){if(t&&(t instanceof Wn||Array.from(t).length>0))throw new k("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function Xr(){return null}Jr.prototype.is=function(e,t){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class es extends(C($n)){constructor(e,t){super(),this._children=[],this._customProperties=new Map,this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let i=0;const o=function(e,t){return"string"==typeof t?[new Zn(e,t)]:(K(t)||(t=[t]),Array.from(t).map((t=>"string"==typeof t?new Zn(e,t):t instanceof Gn?new Zn(e,t.data):t)))}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i{const i=e[e.length-1],o=!t.is("uiElement");return i&&i.breakAttributes==o?i.nodes.push(t):e.push({breakAttributes:o,nodes:[t]}),e}),[]);let o=null,n=e;for(const{nodes:e,breakAttributes:t}of i){const i=this._insertNodes(n,e,t);o||(o=i.start),n=i.end}return o?new Vr(o,n):new Vr(e)}remove(e){const t=e instanceof Vr?e:Vr._createOn(e);if(ls(t,this.document),t.isCollapsed)return new es(this.document);const{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,r=o.offset-i.offset,s=n._removeChildren(i.offset,r);for(const e of s)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new es(this.document,s)}clear(e,t){ls(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of i){const i=o.item;let n;if(i.is("element")&&t.isSimilar(i))n=Vr._createOn(i);else if(!o.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find((e=>e.is("element")&&t.isSimilar(e)));e&&(n=Vr._createIn(e))}n&&(n.end.isAfter(e.end)&&(n.end=e.end),n.start.isBefore(e.start)&&(n.start=e.start),this.remove(n))}}move(e,t){let i;if(t.isAfter(e.end)){const o=(t=this._breakAttributes(t,!0)).parent,n=o.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=o.childCount-n}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof qr))throw new k("view-writer-wrap-invalid-attribute",this.document);if(ls(e,this.document),e.isCollapsed){let o=e.start;o.parent.is("element")&&(i=o.parent,!Array.from(i.getChildren()).some((e=>!e.is("uiElement"))))&&(o=o.getLastMatchingPosition((e=>e.item.is("uiElement")))),o=this._wrapPosition(o,t);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(e.start)&&this.setSelection(o),new Vr(o)}return this._wrapRange(e,t);var i}unwrap(e,t){if(!(t instanceof qr))throw new k("view-writer-unwrap-invalid-attribute",this.document);if(ls(e,this.document),e.isCollapsed)return e;const{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,r=this._unwrapChildren(n,i.offset,o.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new Vr(s,a)}rename(e,t){const i=new Cr(this.document,e,t.getAttributes());return this.insert(Pr._createAfter(t),i),this.move(Vr._createIn(t),Pr._createAt(i,0)),this.remove(Vr._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return Pr._createAt(e,t)}createPositionAfter(e){return Pr._createAfter(e)}createPositionBefore(e){return Pr._createBefore(e)}createRange(e,t){return new Vr(e,t)}createRangeOn(e){return Vr._createOn(e)}createRangeIn(e){return Vr._createIn(e)}createSelection(...e){return new Lr(...e)}createSlot(e="children"){if(!this._slotFactory)throw new k("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,i){let o,n;if(o=i?is(e):e.parent.is("$text")?e.parent.parent:e.parent,!o)throw new k("view-writer-invalid-position-container",this.document);n=i?this._breakAttributes(e,!0):e.parent.is("$text")?ns(e):e;const r=o._insertChild(n.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const s=n.getShiftedBy(r),a=this.mergeAttributes(n);a.isEqual(n)||s.offset--;const c=this.mergeAttributes(s);return new Vr(a,c)}_wrapChildren(e,t,i,o){let n=t;const r=[];for(;na.priority)&&s.getIdentity()!1,e.parent._insertChild(e.offset,i);const o=new Vr(e,e.getShiftedBy(1));this.wrap(o,t);const n=new Pr(i.parent,i.index);i._remove();const r=n.nodeBefore,s=n.nodeAfter;return r instanceof Zn&&s instanceof Zn?rs(r,s):os(n)}_wrapAttributeElement(e,t){if(!ds(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const i of e.getAttributeKeys())if("class"!==i&&"style"!==i&&t.hasAttribute(i)&&t.getAttribute(i)!==e.getAttribute(i))return!1;for(const i of e.getStyleNames())if(t.hasStyle(i)&&t.getStyle(i)!==e.getStyle(i))return!1;for(const i of e.getAttributeKeys())"class"!==i&&"style"!==i&&(t.hasAttribute(i)||this.setAttribute(i,e.getAttribute(i),t));for(const i of e.getStyleNames())t.hasStyle(i)||this.setStyle(i,e.getStyle(i),t);for(const i of e.getClassNames())t.hasClass(i)||this.addClass(i,t);return!0}_unwrapAttributeElement(e,t){if(!ds(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const i of e.getAttributeKeys())if("class"!==i&&"style"!==i&&(!t.hasAttribute(i)||t.getAttribute(i)!==e.getAttribute(i)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const i of e.getStyleNames())if(!t.hasStyle(i)||t.getStyle(i)!==e.getStyle(i))return!1;for(const i of e.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const i=e.start,o=e.end;if(ls(e,this.document),e.isCollapsed){const i=this._breakAttributes(e.start,t);return new Vr(i,i)}const n=this._breakAttributes(o,t),r=n.parent.childCount,s=this._breakAttributes(i,t);return n.offset+=n.parent.childCount-r,new Vr(s,n)}_breakAttributes(e,t=!1){const i=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new k("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new k("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new k("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&cs(o.parent))return e.clone();if(cs(o))return e.clone();if(o.is("$text"))return this._breakAttributes(ns(e),t);if(i==o.childCount){const e=new Pr(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===i){const e=new Pr(o.parent,o.index);return this._breakAttributes(e,t)}{const e=o.index+1,n=o._clone();o.parent._insertChild(e,n),this._addToClonedElementsGroup(n);const r=o.childCount-i,s=o._removeChildren(i,r);n._appendChild(s);const a=new Pr(o.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const i=this._cloneGroups.get(t);i&&i.delete(e)}}function is(e){let t=e.parent;for(;!cs(t);){if(!t)return;t=t.parent}return t}function os(e){const t=e.nodeBefore;if(t&&t.is("$text"))return new Pr(t,t.data.length);const i=e.nodeAfter;return i&&i.is("$text")?new Pr(i,0):e}function ns(e){if(e.offset==e.parent.data.length)return new Pr(e.parent.parent,e.parent.index+1);if(0===e.offset)return new Pr(e.parent.parent,e.parent.index);const t=e.parent.data.slice(e.offset);return e.parent._data=e.parent.data.slice(0,e.offset),e.parent.parent._insertChild(e.parent.index+1,new Zn(e.root.document,t)),new Pr(e.parent.parent,e.parent.index+1)}function rs(e,t){const i=e.data.length;return e._data+=t.data,t._remove(),new Pr(e,i)}const ss=[Zn,qr,Cr,Gr,Jr,Yr];function as(e,t){for(const i of e){if(!ss.some((e=>i instanceof e)))throw new k("view-writer-insert-invalid-node-type",t);i.is("$text")||as(i.getChildren(),t)}}function cs(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function ls(e,t){const i=is(e.start),o=is(e.end);if(!i||!o||i!==o)throw new k("view-writer-invalid-range-container",t)}function ds(e,t){return null===e.id&&null===t.id}const us=e=>e.createTextNode(" "),hs=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},ms=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},gs=7,ps="⁠".repeat(gs);function fs(e){return"string"==typeof e?e.substr(0,gs)===ps:zi(e)&&e.data.substr(0,gs)===ps}function ks(e){return e.data.length==gs&&fs(e)}function bs(e){const t="string"==typeof e?e:e.data;return fs(e)?t.slice(gs):t}function ws(e,t){if(t.keyCode==wo.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;fs(t)&&i<=gs&&e.collapse(t,0)}}}var _s=n(6531);yn()(_s.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_s.A.locals;class vs extends(j()){constructor(e,t){super(),this.domDocuments=new Set,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this._inlineFiller=null,this._fakeSelectionContainer=null,this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),r.isBlink&&!r.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()})),this.set("isComposing",!1),this.on("change:isComposing",(()=>{this.isComposing||this.render()}))}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new k("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!r.isAndroid)return;let e=null;const t=!(r.isBlink&&!r.isAndroid&&this.isSelecting);for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=Pr._createBefore(e.parent)));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),i=t.parent.ownerDocument;fs(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=ys(i,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const i=Array.from(t.childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),n=this._diffNodeLists(i,o),r=this._findUpdateActions(n,i,o,xs);if(-1!==r.indexOf("update")){const t={equal:0,insert:0,delete:0};for(const n of r)if("update"===n){const n=t.equal+t.insert,r=t.equal+t.delete,s=e.getChild(n);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[r]),ro(o[n]),t.equal++}else t[n]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?Pr._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&zi(t.parent)&&fs(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!fs(e))throw new k("view-renderer-filler-was-lost",this);ks(e)?e.remove():e.data=e.data.substr(gs),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor((e=>e.hasAttribute("contenteditable")));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;const o=e.nodeBefore,n=e.nodeAfter;return!(o instanceof Zn||n instanceof Zn||!(i!==t.getFillerOffset()||o&&o.is("element","br"))||r.isAndroid&&(o||n))}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);let o=this.domConverter.viewToDom(e).data;const n=t.inlineFillerPosition;n&&n.parent==e.parent&&n.offset==e.index&&(o=ps+o),Ts(i,o)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const i=Array.from(t.attributes).map((e=>e.name)),o=e.getAttributeKeys();for(const i of o)this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e);for(const o of i)e.hasAttribute(o)||this.domConverter.removeDomElementAttribute(t,o)}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i)return;if(r.isAndroid){let e=null;for(const t of Array.from(i.childNodes)){if(e&&zi(e)&&zi(t)){i.normalize();break}e=t}}const o=t.inlineFillerPosition,n=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));o&&o.parent===e&&ys(i.ownerDocument,s,o.offset);const a=this._diffNodeLists(n,s),c=this._findUpdateActions(a,n,s,As);let l=0;const d=new Set;for(const e of c)"delete"===e?(d.add(n[l]),ro(n[l])):"equal"!==e&&"update"!==e||l++;l=0;for(const e of c)"insert"===e?(Xi(i,l,s[l]),l++):"update"===e?(Ts(n[l],s[l].data),l++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(const e of d)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return d(e=function(e,t){const i=Array.from(e);if(0==i.length||!t)return i;return i[i.length-1]==t&&i.pop(),i}(e,this._fakeSelectionContainer),t,Cs.bind(null,this.domConverter))}_findUpdateActions(e,t,i,o){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let n=[],r=[],s=[];const a={equal:0,insert:0,delete:0};for(const c of e)"insert"===c?s.push(i[a.equal+a.insert]):"delete"===c?r.push(t[a.equal+a.delete]):(n=n.concat(d(r,s,o).map((e=>"equal"===e?"update":e))),n.push("equal"),r=[],s=[]),a[c]++;return n.concat(d(r,s,o).map((e=>"equal"===e?"update":e)))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(r.isBlink&&!r.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&r.isAndroid||this._updateDomSelection(e))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;i.parentElement&&i.parentElement==e||e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const o=t.getSelection(),n=t.createRange();o.removeAllRanges(),n.selectNodeContents(i),o.addRange(n)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,o.parent,o.offset),r.isGecko&&function(e,t){let i=e.parent,o=e.offset;if(zi(i)&&ks(i)&&(o=Ji(i)+1,i=i.parentNode),i.nodeType!=Node.ELEMENT_NODE||o!=i.childNodes.length-1)return;const n=i.childNodes[o];n&&"BR"==n.tagName&&t.addRange(t.getRangeAt(0))}(o,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return!(t&&this.selection.isEqual(t)||!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,i=e.ownerDocument.getSelection();return!t||t.parentElement!==e||i.anchorNode!==t&&!t.contains(i.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const i=e.activeElement,o=this.domConverter.mapDomToView(i);i&&o&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function ys(e,t,i){const o=t instanceof Array?t:t.childNodes,n=o[i];if(zi(n))return n.data=ps+n.data,n;{const n=e.createTextNode(ps);return Array.isArray(t)?o.splice(i,0,n):Xi(t,i,n),n}}function xs(e,t){return Vi(e)&&Vi(t)&&!zi(e)&&!zi(t)&&!eo(e)&&!eo(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function As(e,t){return Vi(e)&&Vi(t)&&zi(e)&&zi(t)}function Cs(e,t,i){return t===i||(zi(t)&&zi(i)?t.data===i.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(i)))}function Ts(e,t){const i=e.data;if(i==t)return;const o=a(i,t);for(const t of o)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}const Es=ms(t.document),Ss=us(t.document),Ms=hs(t.document),Is="data-ck-unsafe-attribute-",Ps="data-ck-unsafe-element";class Vs{constructor(e,{blockFillerMode:i,renderingMode:o="editing"}={}){this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Kn,this._inlineObjectElementMatcher=new Kn,this._elementsWithTemporaryCustomProperties=new Set,this.document=e,this.renderingMode=o,this.blockFillerMode=i||("editing"===o?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?t.document:t.document.implementation.createHTMLDocument("")}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Lr(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of Array.from(e.children))this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===i&&("src"===e||"srcset"===e)||"source"===i&&"srcset"===e||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const i=(new DOMParser).parseFromString(t,"text/html"),o=i.createDocumentFragment(),n=i.body.childNodes;for(;n.length>0;)o.appendChild(n[0]);const r=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT),s=[];let a;for(;a=r.nextNode();)s.push(a);for(const e of s){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(Rs(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(o)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{const i=e;if(this.mapViewToDom(i)){if(!i.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(i);this._elementsWithTemporaryCustomProperties.add(i)}let o;if(i.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,i);else{if(i.is("uiElement"))return o="$comment"===i.name?this._domDocument.createComment(i.getCustomProperty("$rawContent")):i.render(this._domDocument,this),t.bind&&this.bindElements(o,i),o;this._shouldRenameElement(i.name)?(Rs(i.name),o=this._createReplacementDomElement(i.name)):o=i.hasAttribute("xmlns")?this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(o,this),t.bind&&this.bindElements(o,i);for(const e of i.getAttributeKeys())this.setDomElementAttribute(o,e,i.getAttribute(e),i)}if(!1!==t.withChildren)for(const e of this.viewChildrenToDom(i,t))o instanceof HTMLTemplateElement?o.content.appendChild(e):o.appendChild(e);return o}}setDomElementAttribute(e,i,o,n){const r=this.shouldRenderAttribute(i,o,e.tagName.toLowerCase())||n&&n.shouldRenderUnsafeAttribute(i);r||b("domconverter-unsafe-attribute-detected",{domElement:e,key:i,value:o}),function(e){try{t.document.createAttribute(e)}catch(e){return!1}return!0}(i)?(e.hasAttribute(i)&&!r?e.removeAttribute(i):e.hasAttribute(Is+i)&&r&&e.removeAttribute(Is+i),e.setAttribute(r?i:Is+i,o)):b("domconverter-invalid-attribute-detected",{domElement:e,key:i,value:o})}removeDomElementAttribute(e,t){t!=Ps&&(e.removeAttribute(t),e.removeAttribute(Is+t))}*viewChildrenToDom(e,t={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const n of e.getChildren()){i===o&&(yield this._getBlockFiller());const e=n.is("element")&&!!n.getCustomProperty("dataPipeline:transparentRendering")&&!Uo(n.getAttributes());e&&"data"==this.renderingMode?yield*this.viewChildrenToDom(n,t):(e&&b("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:n}),yield this.viewToDom(n,t)),o++}i===o&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),o=this._domDocument.createRange();return o.setStart(t.parent,t.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i)return null;let o=e.offset;return fs(i)&&(o+=gs),{parent:i,offset:o}}{let i,o,n;if(0===e.offset){if(i=this.mapViewToDom(t),!i)return null;n=i.childNodes[0]}else{const t=e.nodeBefore;if(o=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!o)return null;i=o.parentNode,n=o.nextSibling}return zi(n)&&fs(n)?{parent:n,offset:gs}:{parent:i,offset:o?Ji(o)+1:0}}}domToView(e,t={}){const i=[],o=this._domToView(e,t,i),n=o.next().value;return n?(o.next(),this._processDomInlineNodes(null,i,t),n.is("$text")&&0==n.data.length?null:n):null}*domChildrenToView(e,t={},i=[]){let o=[];o=e instanceof HTMLTemplateElement?[...e.content.childNodes]:[...e.childNodes];for(let n=0;n{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])})),i.focus(),Ls(i,(e=>{const[t,i]=n.shift();e.scrollLeft=t,e.scrollTop=i})),t.window.scrollTo(e,o)}}_clearDomSelection(){const e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;const t=e.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(Es):!("BR"!==e.tagName||!Os(e,this.blockElements)||1!==e.parentNode.childNodes.length)||e.isEqualNode(Ms)||function(e,t){return e.isEqualNode(Ss)&&Os(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch(e){return!1}const i=t.collapsed;return t.detach(),i}getHostViewElement(e){const t=function(e){const t=[];let i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}(e);for(t.pop();t.length;){const e=t.pop(),i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(const e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return us(this._domDocument);case"markedNbsp":return hs(this._domDocument);case"br":return ms(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(zi(e)&&fs(e)&&t0?t[e-1]:null,c=e+1this.preElements.includes(e.name))))return t;if(" "==t.charAt(0)){const i=this._getTouchingInlineViewNode(e,!1);!(i&&i.is("$textProxy")&&this._nodeEndsWithSpace(i))&&i||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const i=this._getTouchingInlineViewNode(e,!0),o=i&&i.is("$textProxy")&&" "==i.data.charAt(0);" "!=t.charAt(t.length-2)&&i&&!o||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some((e=>this.preElements.includes(e.name))))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_getTouchingInlineViewNode(e,t){const i=new Ir({startPosition:t?Pr._createAfter(e):Pr._createBefore(e),direction:t?"forward":"backward"});for(const e of i){if(e.item.is("element","br"))return null;if(this._isInlineObjectElement(e.item))return e.item;if(e.item.is("containerElement"))return null;if(e.item.is("$textProxy"))return e.item}return null}_isBlockDomElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isBlockViewElement(e){return e.is("element")&&this.blockElements.includes(e.name)}_isInlineObjectElement(e){return!!e.is("element")&&("br"==e.name||this.inlineObjectElements.includes(e.name)||!!this._inlineObjectElementMatcher.match(e))}_createViewElement(e,t){if(eo(e))return new Yr(this.document,"$comment");const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new xr(this.document,i)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&e.is("element")&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const i=this._domDocument.createElement("span");if(i.setAttribute(Ps,e),t){for(;t.firstChild;)i.appendChild(t.firstChild);for(const e of t.getAttributeNames())i.setAttribute(e,t.getAttribute(e))}return i}}function Ns(e,t){return e.getAncestors().some((e=>e.is("element")&&t.includes(e.name)))}function Ls(e,t){let i=e;for(;i;)t(i),i=i.parentElement}function Os(e,t){const i=e.parentNode;return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function Rs(e){"script"===e&&b("domconverter-unsafe-script-element-detected"),"style"===e&&b("domconverter-unsafe-style-element-detected")}class Ds extends(Oi()){constructor(e){super(),this._isEnabled=!1,this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}const Bs=Do((function(e,t){Je(t,Mt(t),e)}));class zs{constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Bs(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class js extends Ds{constructor(){super(...arguments),this.useCapture=!1}observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach((t=>{this.listenTo(e,t,((e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)}),{useCapture:this.useCapture})}))}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new zs(this.view,t,i))}}class Fs extends js{constructor(){super(...arguments),this.domEventType=["keydown","keyup"]}onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return vo(this)}};this.fire(e.type,e,t)}}const Hs=function(){return J.Date.now()};var Us=/\s/;var $s=/^\s+/;const qs=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Us.test(e.charAt(t)););return t}(e)+1).replace($s,""):e};var Ws=/^[-+]0x[0-9a-f]+$/i,Zs=/^0b[01]+$/i,Gs=/^0o[0-7]+$/i,Ks=parseInt;const Ys=function(e){if("number"==typeof e)return e;if(Jn(e))return NaN;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qs(e);var i=Zs.test(e);return i||Gs.test(e)?Ks(e.slice(2),i?2:8):Ws.test(e)?NaN:+e};var Qs=Math.max,Js=Math.min;const Xs=function(e,t,i){var o,n,r,s,a,c,l=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var i=o,r=n;return o=n=void 0,l=t,s=e.apply(r,i)}function g(e){var i=e-c;return void 0===c||i>=t||i<0||u&&e-l>=r}function p(){var e=Hs();if(g(e))return f(e);a=setTimeout(p,function(e){var i=t-(e-c);return u?Js(i,r-(e-l)):i}(e))}function f(e){return a=void 0,h&&o?m(e):(o=n=void 0,s)}function k(){var e=Hs(),i=g(e);if(o=arguments,n=this,c=e,i){if(void 0===a)return function(e){return l=e,a=setTimeout(p,t),d?m(e):s}(c);if(u)return clearTimeout(a),a=setTimeout(p,t),m(c)}return void 0===a&&(a=setTimeout(p,t)),s}return t=Ys(t)||0,N(i)&&(d=!!i.leading,r=(u="maxWait"in i)?Qs(Ys(i.maxWait)||0,t):r,h="trailing"in i?!!i.trailing:h),k.cancel=function(){void 0!==a&&clearTimeout(a),l=0,o=c=n=a=void 0},k.flush=function(){return void 0===a?s:f(Hs())},k};class ea extends Ds{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Xs((e=>{this.document.fire("selectionChangeDone",e)}),200)}observe(){const e=this.document;e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()}),{context:"$capture"}),e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)}),{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,i=new Lr(t.getRanges(),{backward:t.isBackward,fake:!1});e!=wo.arrowleft&&e!=wo.arrowup||i.setTo(i.getFirstPosition()),e!=wo.arrowright&&e!=wo.arrowdown||i.setTo(i.getLastPosition());const o={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}function ta(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new qe;++ta))return!1;var l=r.get(e),d=r.get(t);if(l&&d)return l==t&&d==e;var u=-1,h=!0,m=2&i?new ia:void 0;for(r.set(e,t),r.set(t,e);++u{this._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{this.flush(),e.change((()=>{}))}),50)})),t.on("blur",((i,o)=>{const n=t.selection.editableElement;null!==n&&n!==o.target||(t.isFocused=!1,this._isFocusChanging=!1,e.change((()=>{})))}))}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class _a extends Ds{constructor(e){super(e),this.mutationObserver=e.getObserver(ka),this.focusObserver=e.getObserver(wa),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Xs((e=>{this.document.fire("selectionChangeDone",e)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Xs((()=>this.document.isSelecting=!1),5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,i=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(e,"keydown",i,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",i,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",i,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",((e,i)=>{this.document.isComposing&&!r.isAndroid||(this._handleSelectionChange(i,t),this._documentIsSelectingInactivityTimeoutDebounced())})),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e,t){if(!this.isEnabled)return;const i=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(i.anchorNode))return;this.mutationObserver.flush();const o=this.domConverter.domSelectionToView(i);if(0!=o.rangeCount){if(this.view.hasDomSelection=!0,this.focusObserver.flush(),!this.selection.isEqual(o)||!this.domConverter.isDomSelectionCorrect(i))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(this.selection.isSimilar(o))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:o,domSelection:i};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class va extends js{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",(()=>{t.isComposing=!0}),{priority:"low"}),t.on("compositionend",(()=>{t.isComposing=!1}),{priority:"low"})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class ya{constructor(e,t={}){this._files=t.cacheFiles?xa(e):null,this._native=e}get files(){return this._files||(this._files=xa(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}function xa(e){const t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter((e=>"file"===e.kind)).map((e=>e.getAsFile()))}class Aa extends js{constructor(){super(...arguments),this.domEventType="beforeinput"}onDomEvent(e){const t=e.getTargetRanges(),i=this.view,o=i.document;let n=null,s=null,a=[];if(e.dataTransfer&&(n=new ya(e.dataTransfer)),null!==e.data?s=e.data:n&&(s=n.getData("text/plain")),o.selection.isFake)a=Array.from(o.selection.getRanges());else if(t.length)a=t.map((e=>{const t=i.domConverter.domPositionToView(e.startContainer,e.startOffset),o=i.domConverter.domPositionToView(e.endContainer,e.endOffset);return t?i.createRange(t,o):o?i.createRange(o):void 0})).filter((e=>!!e));else if(r.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();a=Array.from(i.domConverter.domSelectionToView(t).getRanges())}if(r.isAndroid&&"insertCompositionText"==e.inputType&&s&&s.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(a[0].end)]});else if("insertText"==e.inputType&&s&&s.includes("\n")){const t=s.split(/\n{1,2}/g);let i=a;for(let r=0;r{if(this.isEnabled&&((i=t.keyCode)==wo.arrowright||i==wo.arrowleft||i==wo.arrowup||i==wo.arrowdown)){const i=new Rr(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,t),i.stop.called&&e.stop()}var i}))}observe(){}stopObserving(){}}class Ta extends Ds{constructor(e){super(e);const t=this.document;t.on("keydown",((e,i)=>{if(!this.isEnabled||i.keyCode!=wo.tab||i.ctrlKey)return;const o=new Rr(t,"tab",t.selection.getFirstRange());t.fire(o,i),o.stop.called&&e.stop()}))}observe(){}stopObserving(){}}const Ea=function(e){return Ti(e,5)};class Sa extends(j()){constructor(e){var t;super(),this.domRoots=new Map,this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this.document=new Ur(e),this.domConverter=new Vs(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new vs(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new ts(this.document),this.addObserver(ka),this.addObserver(wa),this.addObserver(_a),this.addObserver(Fs),this.addObserver(ea),this.addObserver(va),this.addObserver(Ca),this.addObserver(Aa),this.addObserver(Ta),this.document.on("arrowKey",ws,{priority:"low"}),(t=this).document.on("arrowKey",((e,i)=>function(e,t,i){if(t.keyCode==wo.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode,n=e.focusOffset,r=i.domPositionToView(t,n);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition((e=>(e.item.is("uiElement")&&(s=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement")))));if(s){const t=i.viewPositionToDom(a);o?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,i,t.domConverter)),{priority:"low"}),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0})),r.isiOS&&this.listenTo(this.document,"blur",((e,t)=>{this.domConverter.mapDomToView(t.domEvent.relatedTarget)||this.domConverter._clearDomSelection()}))}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const o={};for(const{name:t,value:n}of Array.from(e.attributes))o[t]=n,"class"===t?this._writer.addClass(n.split(" "),i):this._writer.setAttribute(t,n,i);this._initialDomRootAttributes.set(e,o);const n=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",((e,t)=>this._renderer.markToSync("children",t))),i.on("change:attributes",((e,t)=>this._renderer.markToSync("attributes",t))),i.on("change:text",((e,t)=>this._renderer.markToSync("text",t))),i.on("change:isReadOnly",(()=>this.change(n))),i.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const i of this._observers.values())i.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach((({name:e})=>t.removeAttribute(e)));const i=this._initialDomRootAttributes.get(t);for(const e in i)t.setAttribute(e,i[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const e of this._observers.values())e.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,i]of this.domRoots)t.observe(i,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:o=20}={}){const n=this.document.selection.getFirstRange();if(!n)return;const r=Ea({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:o});"number"==typeof i&&(i={top:i,bottom:i,left:i,right:i});const s={target:this.domConverter.viewRangeToDom(n),viewportOffset:i,ancestorOffset:o,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",s,r),function({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:o,forceScroll:n}){const r=mo(e);let s=r,a=null;for(t=function(e){return"number"==typeof e?{top:e,bottom:e,left:e,right:e}:e}(t);s;){let c;c=go(s==r?e:a),ao({parent:c,getRect:()=>po(e,s),alignToTop:o,ancestorOffset:i,forceScroll:n});const l=po(e,s);if(so({window:s,rect:l,viewportOffset:t,alignToTop:o,forceScroll:n}),s.parent!=s){if(a=s.frameElement,s=s.parent,!a)return}else s=null}}(s)}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new k("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){k.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(wa).flush(),this.change((()=>{}))}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return Pr._createAt(e,t)}createPositionAfter(e){return Pr._createAfter(e)}createPositionBefore(e){return Pr._createBefore(e)}createRange(e,t){return new Vr(e,t)}createRangeOn(e){return Vr._createOn(e)}createRangeIn(e){return Vr._createIn(e)}createSelection(...e){return new Lr(...e)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class Ma{is(){throw new Error("is() method is abstract")}}class Ia extends Ma{constructor(e){super(),this.parent=null,this._attrs=Wo(e)}get document(){return null}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new k("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new k("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return null!==this.parent&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=G(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o](e[t[0]]=t[1],e)),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Wo(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}Ia.prototype.is=function(e){return"node"===e||"model:node"===e};class Pa{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce(((e,t)=>e+t.offsetSize),0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce(((e,t)=>e+t.offsetSize),0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new k("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const i of this._nodes){if(e>=t&&e1e4)return e.slice(0,i).concat(t).concat(e.slice(i+0,e.length));{const o=Array.from(e);return o.splice(i,0,...t),o}}(this._nodes,Array.from(t),e)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map((e=>e.toJSON()))}}class Va extends Ia{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Va(this.data,this.getAttributes())}static fromJSON(e){return new Va(e.data,e.attributes)}}Va.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};class Na extends Ma{constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new k("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new k("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}Na.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class La extends Ia{constructor(e,t,i){super(t),this._children=new Pa,this.name=e,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e)t=t.getChild(t.offsetToIndex(i));return t}findAncestor(e,t={}){let i=t.includeSelf?this:this.parent;for(;i;){if(i.name===e)return i;i=i.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map((e=>e._clone(!0))):void 0;return new La(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){return"string"==typeof e?[new Va(e)]:(K(e)||(e=[e]),Array.from(e).map((e=>"string"==typeof e?new Va(e):e instanceof Na?new Va(e.data,e.getAttributes()):e)))}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}static fromJSON(e){let t;if(e.children){t=[];for(const i of e.children)i.name?t.push(La.fromJSON(i)):t.push(Va.fromJSON(i))}return new La(e.name,e.attributes,t)}}La.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e};class Oa{constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new k("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new k("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=Da._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i,o,n;do{o=this.position,n=this._visitedParent,({done:t,value:i}=this.next())}while(!t&&e(i));t||(this._position=o,this._visitedParent=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const o=Ba(t,i),n=o||za(t,i,o);if(n instanceof La){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t.path.push(0),this._visitedParent=n;return this._position=t,Ra("elementStart",n,e,t,1)}if(n instanceof Va){let o;if(this.singleCharacters)o=1;else{let e=n.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),o=t.offset-e}const n=t.offset-r.startOffset,s=new Na(r,n-o,o);return t.offset-=o,this._position=t,Ra("text",s,e,t,o)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,Ra("elementStart",i,e,t,1)}}function Ra(e,t,i,o,n){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}class Da extends Ma{constructor(e,t,i="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new k("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new k("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t1)return!1;if(1===t)return Fa(e,this,i);if(-1===t)return Fa(this,e,i)}return this.path.length===e.path.length||(this.path.length>e.path.length?Ha(this.path,t):Ha(e.path,t))}hasSameParentAs(e){return this.root===e.root&&"same"==G(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=Da._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let i;return t.containsPosition(this)||t.start.isEqual(this)?(i=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(i=i._getTransformedByDeletion(e.deletionPosition,1))):i=this.isEqual(e.deletionPosition)?Da._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),i}_getTransformedByDeletion(e,t){const i=Da._createAt(this);if(this.root!=e.root)return i;if("same"==G(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;i.offset-=t}}else if("prefix"==G(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;i.path[o]-=t}}return i}_getTransformedByInsertion(e,t){const i=Da._createAt(this);if(this.root!=e.root)return i;if("same"==G(e.getParentPath(),this.getParentPath()))(e.offset=t;){if(e.path[o]+n!==i.maxOffset)return!1;n=1,o--,i=i.parent}return!0}(e,i+1)}function Ha(e,t){for(;tt+1;){const t=o.maxOffset-i.offset;0!==t&&e.push(new Ua(i,i.getShiftedBy(t))),i.path=i.path.slice(0,-1),i.offset++,o=o.parent}for(;i.path.length<=this.end.path.length;){const t=this.end.path[i.path.length-1],o=t-i.offset;0!==o&&e.push(new Ua(i,i.getShiftedBy(o))),i.offset=t,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Oa(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Oa(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Oa(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new Ua(this.start,this.end)]}getTransformedByOperations(e){const t=[new Ua(this.start,this.end)];for(const i of e)for(let e=0;e0?new this(i,o):new this(o,i)}static _createIn(e){return new this(Da._createAt(e,0),Da._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Da._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new k("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort(((e,t)=>e.start.isAfter(t.start)?1:-1));const i=e.indexOf(t),o=new this(t.start,t.end);if(i>0)for(let t=i-1;e[t].end.isEqual(o.start);t++)o.start=Da._createAt(e[t].start);for(let t=i+1;t{if(t.viewPosition)return;const i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new k("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((e,t)=>{if(t.modelPosition)return;const i=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=Da._createAt(o,n)}),{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);i&&(i.delete(e),0==i.size&&this._markerNameToElements.delete(t));const o=this._elementToMarkerNames.get(e);o&&(o.delete(t),0==o.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Ua(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Vr(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const i=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())i.add(t);else i.add(e);return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,i){if(i!=e)return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let o=0;for(let i=0;i1?t[0]+":"+t[1]:t[0]}class Za extends(C()){constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){const o=this._createConversionApi(i,e.getRefreshedItems());for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,o);const n=this._reduceChanges(e.getChanges());for(const e of n)"insert"===e.type?this._convertInsert(Ua._createFromPositionAndShift(e.position,e.length),o):"reinsert"===e.type?this._convertReinsert(Ua._createFromPositionAndShift(e.position,e.length),o):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,o):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,o);o.mapper.flushDeferredBindings();for(const e of o.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this._convertMarkerRemove(e,i,o),this._convertMarkerAdd(e,i,o)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,o);o.consumable.verifyAllConsumed("insert")}convert(e,t,i,o={}){const n=this._createConversionApi(i,void 0,o);this._convertInsert(e,n);for(const[e,i]of t)this._convertMarkerAdd(e,i,n);n.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){const o=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},o);const n=e.getFirstPosition().root;if(!o.mapper.toViewElement(n))return;const r=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(o.consumable,e,r),this.fire("selection",{selection:e},o),e.isCollapsed){for(const t of r)if(o.consumable.test(e,"addMarker:"+t.name)){const i=t.getRange();if(!Ga(e.getFirstPosition(),t,o.mapper))continue;const n={item:e,markerName:t.name,markerRange:i};this.fire(`addMarker:${t.name}`,n,o)}for(const t of e.getAttributeKeys())if(o.consumable.test(e,"attribute:"+t)){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.fire(`attribute:${t}:$text`,i,o)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(const i of Array.from(e.getWalker({shallow:!0})).map(Ka))this._testAndFire("insert",i,t)}_convertRemove(e,t,i,o){this.fire(`remove:${i}`,{position:e,length:t},o)}_convertAttribute(e,t,i,o,n){this._addConsumablesForRange(n.consumable,e,`attribute:${t}`);for(const r of e){const e={item:r.item,range:Ua._createFromPositionAndShift(r.previousPosition,r.length),attributeKey:t,attributeOldValue:i,attributeNewValue:o};this._testAndFire(`attribute:${t}`,e,n)}}_convertReinsert(e,t){const i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(const e of i.map(Ka))this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if("$graveyard"==t.root.rootName)return;const o=`addMarker:${e}`;if(i.consumable.add(t,o),this.fire(o,{markerName:e,markerRange:t},i),i.consumable.consume(t,o)){this._addConsumablesForRange(i.consumable,t,o);for(const n of t.getItems()){if(!i.consumable.test(n,o))continue;const r={item:n,range:Ua._createOn(n),markerName:e,markerRange:t};this.fire(o,r,i)}}}_convertMarkerRemove(e,t,i){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const i of t){const t=i.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}}return e}_addConsumablesForRange(e,t,i){for(const o of t.getItems())e.add(o,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(const o of i)e.add(t,"addMarker:"+o.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,i){const o=function(e,t){return`${e}:${t.item.is("element")?t.item.name:"$text"}`}(e,t),n=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,r=this._firedEventsMap.get(i),s=r.get(n);if(s){if(s.has(o))return;s.add(o)}else r.set(n,new Set([o]));this.fire(o,t,i)}_testAndFireAddAttributes(e,t){const i={item:e,range:Ua._createOn(e)};for(const e of i.item.getAttributeKeys())i.attributeKey=e,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(e),this._testAndFire(`attribute:${e}`,i,t)}_createConversionApi(e,t=new Set,i={}){const o={...this._conversionApi,consumable:new qa,writer:e,options:i,convertItem:e=>this._convertInsert(Ua._createOn(e),o),convertChildren:e=>this._convertInsert(Ua._createIn(e),o,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,o),canReuseView:e=>!t.has(o.mapper.toModelElement(e))};return this._firedEventsMap.set(o,new Map),o}}function Ga(e,t,i){const o=t.getRange(),n=Array.from(e.getAncestors());return n.shift(),n.reverse(),!n.some((e=>{if(o.containsItem(e))return!!i.toViewElement(e).getCustomProperty("addHighlight")}))}function Ka(e){return{item:e.item,range:Ua._createFromPositionAndShift(e.previousPosition,e.length)}}class Ya extends(C(Ma)){constructor(...e){super(),this._lastRangeBackward=!1,this._attrs=new Map,this._ranges=[],e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Ua(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new Ua(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new Ua(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[t,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]);else if(t instanceof Ya)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Ua)this._setRanges([t],!!o&&!!o.backward);else if(t instanceof Da)this._setRanges([new Ua(t)]);else if(t instanceof Ia){const e=!!o&&!!o.backward;let n;if("in"==i)n=Ua._createIn(t);else if("on"==i)n=Ua._createOn(t);else{if(void 0===i)throw new k("model-selection-setto-required-second-parameter",[this,t]);n=new Ua(Da._createAt(t,i))}this._setRanges([n],e)}else{if(!K(t))throw new k("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,o&&!!o.backward)}}_setRanges(e,t=!1){const i=Array.from(e),o=i.some((t=>{if(!(t instanceof Ua))throw new k("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every((e=>!e.isEqual(t)))}));(i.length!==this._ranges.length||o)&&(this._replaceAllRanges(i),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new k("model-selection-setfocus-no-ranges",[this,e]);const i=Da._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(o)?(this._pushRange(new Ua(i,o)),this._lastRangeBackward=!0):(this._pushRange(new Ua(o,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=Xa(t.start,e);tc(i,t)&&(yield i);for(const i of t.getWalker()){const o=i.item;"elementEnd"==i.type&&Ja(o,e,t)&&(yield o)}const o=Xa(t.end,e);ic(o,t)&&(yield o)}}containsEntireContent(e=this.anchor.root){const t=Da._createAt(e,0),i=Da._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new Ua(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function Qa(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function Ja(e,t,i){return Qa(e,t)&&ec(e,i)}function Xa(e,t){const i=e.parent.root.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;const r=o.find((e=>!n&&(n=i.isLimit(e),!n&&Qa(e,t))));return o.forEach((e=>t.add(e))),r}function ec(e,t){const i=function(e){const t=e.root.document.model.schema;let i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}(e);return!i||!t.containsRange(Ua._createOn(i),!0)}function tc(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.start.isTouching(Da._createAt(e,e.maxOffset))&&ec(e,t))}function ic(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.end.isTouching(Da._createAt(e,0))&&ec(e,t))}Ya.prototype.is=function(e){return"selection"===e||"model:selection"===e};class oc extends(C(Ua)){constructor(e,t){super(e,t),nc.call(this)}detach(){this.stopListening()}toRange(){return new Ua(this.start,this.end)}static fromRange(e){return new oc(e.start,e.end)}}function nc(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&rc.call(this,i)}),{priority:"low"})}function rc(e){const t=this.getTransformedByOperation(e),i=Ua._createFromRanges(t),o=!i.isEqual(this),n=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let r=null;if(o){"$graveyard"==i.root.rootName&&(r="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",t,{deletionPosition:r})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:r})}oc.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};const sc="selection:";class ac extends(C(Ma)){constructor(e){super(),this._selection=new cc(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return sc+e}static _isStoreAttributeKey(e){return e.startsWith(sc)}}ac.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class cc extends Ya{constructor(e){super(),this.markers=new Ho({idProperty:"name"}),this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.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",(()=>{this._validateSelectionRanges(this.getRanges())})),this.listenTo(this._model.markers,"update",((e,t,i,o)=>{this._updateMarker(t,o)})),this.listenTo(this._document,"change",((e,t)=>{!function(e,t){const i=e.document.differ;for(const o of i.getChanges()){if("insert"!=o.type)continue;const i=o.position.parent;o.length===i.maxOffset&&e.enqueueChange(t,(e=>{const t=Array.from(i.getAttributeKeys()).filter((e=>e.startsWith(sc)));for(const o of t)e.removeAttribute(o,i)}))}}(this._model,t)}))}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}})),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const o=t.getRange();for(const i of this.getRanges())o.containsRange(i,!i.isCollapsed)&&e.push(t)}const i=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1;const n=Array.from(this.markers),r=this.markers.has(e);if(t){let i=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){i=!0;break}i&&!r?(this.markers.add(e),o=!0):!i&&r&&(this.markers.remove(e),o=!0)}else r&&(this.markers.remove(e),o=!0);o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(e){const t=Wo(this._getSurroundingAttributes()),i=Wo(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const o=[];for(const[e,t]of this.getAttributes())i.has(e)&&i.get(e)===t||o.push(e);for(const[e]of i)this.hasAttribute(e)||o.push(e);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,i=!0){const o=i?"normal":"low";return("low"!=o||"normal"!=this._attributePriority.get(e))&&(super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0))}_removeAttribute(e,t=!0){const i=t?"normal":"low";return!("low"==i&&"normal"==this._attributePriority.get(e)||(this._attributePriority.set(e,i),!super.hasAttribute(e)||(this._attrs.delete(e),0)))}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes())e.get(t)!==i&&this._removeAttribute(t,!1);for(const[i,o]of e)this._setAttribute(i,o,!1)&&t.add(i);return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(sc)){const i=t.substr(10);yield[i,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;if("$graveyard"==e.root.rootName)return null;let i=null;if(this.isCollapsed){const o=e.textNode?e.textNode:e.nodeBefore,n=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(i=lc(o,t)),i||(i=lc(n,t)),!this.isGravityOverridden&&!i){let e=o;for(;e&&!i;)e=e.previousSibling,i=lc(e,t)}if(!i){let e=n;for(;e&&!i;)e=e.nextSibling,i=lc(e,t)}i||(i=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const o of e){if(o.item.is("element")&&t.isObject(o.item)){i=lc(o.item,t);break}if("text"==o.type){i=o.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function lc(e,t){if(!e)return null;if(e instanceof Na||e instanceof Va)return e.getAttributes();if(!t.isInline(e))return null;if(!t.isObject(e))return[];const i=[];for(const[o,n]of e.getAttributes())t.checkAttribute("$text",o)&&!1!==t.getAttributeProperties(o).copyFromObject&&i.push([o,n]);return i}class dc{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}class uc extends dc{elementToElement(e){return this.add(function(e){const t=gc(e.model),i=pc(e.view,"container");return t.attributes.length&&(t.children=!0),o=>{o.on(`insert:${t.name}`,function(e,t=xc){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;const r=e(o.item,n,o);if(!r)return;t(o.item,n.consumable);const s=n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,r),n.writer.insert(s,r),n.convertAttributes(o.item),vc(r,o.item.getChildren(),n,{reconversion:o.reconversion})}}(i,_c(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&o.on("reduceChanges",wc(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=gc(e.model),i=pc(e.view,"container");return t.children=!0,o=>{if(o._conversionApi.schema.checkChild(t.name,"$text"))throw new k("conversion-element-to-structure-disallowed-text",o,{elementName:t.name});var n,r;o.on(`insert:${t.name}`,(n=i,r=_c(t),(e,t,i)=>{if(!r(t.item,i.consumable,{preflight:!0}))return;const o=new Map;i.writer._registerSlotFactory(function(e,t,i){return(o,n)=>{const r=o.createContainerElement("$slot");let s=null;if("children"===n)s=Array.from(e.getChildren());else{if("function"!=typeof n)throw new k("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:n});s=Array.from(e.getChildren()).filter((e=>n(e)))}return t.set(r,s),r}}(t.item,o,i));const s=n(t.item,i,t);if(i.writer._clearSlotFactory(),!s)return;!function(e,t,i){const o=Array.from(t.values()).flat(),n=new Set(o);if(n.size!=o.length)throw new k("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(n.size!=e.childCount)throw new k("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}(t.item,o,i),r(t.item,i.consumable);const a=i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,s),i.writer.insert(a,s),i.convertAttributes(t.item),function(e,t,i,o){i.mapper.on("modelToViewPosition",s,{priority:"highest"});let n=null,r=null;for([n,r]of t)vc(e,r,i,o),i.writer.move(i.writer.createRangeIn(n),i.writer.createPositionBefore(n)),i.writer.remove(n);function s(e,t){const i=t.modelPosition.nodeAfter,o=r.indexOf(i);o<0||(t.viewPosition=t.mapper.findPositionIn(n,o))}i.mapper.off("modelToViewPosition",s)}(s,o,i,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),o.on("reduceChanges",wc(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){let t=(e=Ea(e)).model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(const i of t.values)e.view[i]=pc(e.view[i],"attribute");else e.view=pc(e.view,"attribute");const o=fc(e);return t=>{t.on(i,function(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;const n=e(i.attributeOldValue,o,i),r=e(i.attributeNewValue,o,i);if(!n&&!r)return;o.consumable.consume(i.item,t.name);const s=o.writer,a=s.document.selection;if(i.item instanceof Ya||i.item instanceof ac)s.wrap(a.getFirstRange(),r);else{let e=o.mapper.toViewRange(i.range);null!==i.attributeOldValue&&n&&(e=s.unwrap(e,n)),null!==i.attributeNewValue&&r&&s.wrap(e,r)}}}(o),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=(e=Ea(e)).model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(const i of t.values)e.view[i]=kc(e.view[i]);else e.view=kc(e.view);const o=fc(e);return t=>{var n;t.on(i,(n=o,(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const o=n(t.attributeOldValue,i,t),r=n(t.attributeNewValue,i,t);if(!o&&!r)return;i.consumable.consume(t.item,e.name);const s=i.mapper.toViewElement(t.item),a=i.writer;if(!s)throw new k("conversion-attribute-to-attribute-on-text",i.dispatcher,t);if(null!==t.attributeOldValue&&o)if("class"==o.key){const e="string"==typeof o.value?o.value.split(/\s+/):o.value;for(const t of e)a.removeClass(t,s)}else if("style"==o.key)if("string"==typeof o.value){const e=new wr(a.document.stylesProcessor);e.setTo(o.value);for(const[t]of e.getStylesEntries())a.removeStyle(t,s)}else{const e=Object.keys(o.value);for(const t of e)a.removeStyle(t,s)}else a.removeAttribute(o.key,s);if(null!==t.attributeNewValue&&r)if("class"==r.key){const e="string"==typeof r.value?r.value.split(/\s+/):r.value;for(const t of e)a.addClass(t,s)}else if("style"==r.key)if("string"==typeof r.value){const e=new wr(a.document.stylesProcessor);e.setTo(r.value);for(const[t,i]of e.getStylesEntries())a.setStyle(t,i,s)}else{const e=Object.keys(r.value);for(const t of e)a.setStyle(t,r.value[t],s)}else a.setAttribute(r.key,r.value,s)}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=pc(e.view,"ui");return i=>{var o;i.on(`addMarker:${e.model}`,(o=t,(e,t,i)=>{t.isOpening=!0;const n=o(t,i);t.isOpening=!1;const r=o(t,i);if(!n||!r)return;const s=t.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,e.name))return;for(const t of s)if(!i.consumable.consume(t.item,e.name))return;const a=i.mapper,c=i.writer;c.insert(a.toViewPosition(s.start),n),i.mapper.bindElementToMarker(n,t.markerName),s.isCollapsed||(c.insert(a.toViewPosition(s.end),r),i.mapper.bindElementToMarker(r,t.markerName)),e.stop()}),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,((e,t,i)=>{const o=i.mapper.markerNameToElements(t.markerName);if(o){for(const e of o)i.mapper.unbindElementFromMarkerName(e,t.markerName),i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var i;t.on(`addMarker:${e.model}`,(i=e.view,(e,t,o)=>{if(!t.item)return;if(!(t.item instanceof Ya||t.item instanceof ac||t.item.is("$textProxy")))return;const n=bc(i,t,o);if(!n)return;if(!o.consumable.consume(t.item,e.name))return;const r=o.writer,s=hc(r,n),a=r.document.selection;if(t.item instanceof Ya||t.item instanceof ac)r.wrap(a.getFirstRange(),s);else{const e=o.mapper.toViewRange(t.range),i=r.wrap(e,s);for(const e of i.getItems())if(e.is("attributeElement")&&e.isSimilar(s)){o.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,i,o)=>{if(!i.item)return;if(!(i.item instanceof La))return;const n=bc(e,i,o);if(!n)return;if(!o.consumable.test(i.item,t.name))return;const r=o.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){o.consumable.consume(i.item,t.name);for(const e of Ua._createIn(i.item))o.consumable.consume(e.item,t.name);r.getCustomProperty("addHighlight")(r,n,o.writer),o.mapper.bindElementToMarker(r,i.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,i,o)=>{if(i.markerRange.isCollapsed)return;const n=bc(e,i,o);if(!n)return;const r=hc(o.writer,n),s=o.mapper.markerNameToElements(i.markerName);if(s){for(const e of s)o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(e),r):e.getCustomProperty("removeHighlight")(e,n.id,o.writer);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){const t=(e=Ea(e)).model;let i=e.view;return i||(i=i=>({group:t,name:i.substr(e.model.length+1)})),o=>{var n;o.on(`addMarker:${t}`,(n=i,(e,t,i)=>{const o=n(t.markerName,i);if(!o)return;const r=t.markerRange;i.consumable.consume(r,e.name)&&(mc(r,!1,i,t,o),mc(r,!0,i,t,o),e.stop())}),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${t}`,function(e){return(t,i,o)=>{const n=e(i.markerName,o);if(!n)return;const r=o.mapper.markerNameToElements(i.markerName);if(r){for(const e of r)o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("containerElement")?(s(`data-${n.group}-start-before`,e),s(`data-${n.group}-start-after`,e),s(`data-${n.group}-end-before`,e),s(`data-${n.group}-end-after`,e)):o.writer.clear(o.writer.createRangeOn(e),e);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}function s(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(n.name),0==i.size?o.writer.removeAttribute(e,t):o.writer.setAttribute(e,Array.from(i).join(","),t)}}}}(i),{priority:e.converterPriority||"normal"})}}(e))}}function hc(e,t){const i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),"number"==typeof t.priority&&(i._priority=t.priority),i._id=t.id,i}function mc(e,t,i,o,n){const r=t?e.start:e.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let e,r;t&&s||!t&&!a?(e=s,r=!0):(e=a,r=!1);const c=i.mapper.toViewElement(e);if(c)return void function(e,t,i,o,n,r){const s=`data-${r.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name),o.writer.setAttribute(s,a.join(","),e),o.mapper.bindElementToMarker(e,n.markerName)}(c,t,r,i,o,n)}!function(e,t,i,o,n){const r=`${n.group}-${t?"start":"end"}`,s=n.name?{name:n.name}:null,a=i.writer.createUIElement(r,s);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,o.markerName)}(i.mapper.toViewPosition(r),t,i,o,n)}function gc(e){return"string"==typeof e&&(e={name:e}),{name:e.name,attributes:e.attributes?Co(e.attributes):[],children:!!e.children}}function pc(e,t){return"function"==typeof e?e:(i,o)=>function(e,t,i){let o;"string"==typeof e&&(e={name:e});const n=t.writer,r=Object.assign({},e.attributes);if("container"==i)o=n.createContainerElement(e.name,r);else if("attribute"==i){const t={priority:e.priority||qr.DEFAULT_PRIORITY};o=n.createAttributeElement(e.name,r,t)}else o=n.createUIElement(e.name,r);if(e.styles){const t=Object.keys(e.styles);for(const i of t)n.setStyle(i,e.styles[i],o)}if(e.classes){const t=e.classes;if("string"==typeof t)n.addClass(t,o);else for(const e of t)n.addClass(e,o)}return o}(e,o,t)}function fc(e){return e.model.values?(t,i,o)=>{const n=e.view[t];return n?n(t,i,o):null}:e.view}function kc(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function bc(e,t,i){const o="function"==typeof e?e(t,i):e;return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}function wc(e){const t=function(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if("attribute"==i.type){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,i)=>{const o=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const e of i.changes){const n="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(n&&t(n,e)){if(!i.reconvertedElements.has(n)){i.reconvertedElements.add(n);const e=Da._createBefore(n);let t=o.length;for(let i=o.length-1;i>=0;i--){const n=o[i],r=("attribute"==n.type?n.range.start:n.position).compareWith(e);if("before"==r||"remove"==n.type&&"same"==r)break;t=i}o.splice(t,0,{type:"remove",name:n.name,position:e,length:1},{type:"reinsert",name:n.name,position:e,length:1})}}else o.push(e)}i.changes=o}}function _c(e){return(t,i,o={})=>{const n=["insert"];for(const i of e.attributes)t.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((e=>i.test(t,e)))&&(o.preflight||n.forEach((e=>i.consume(t,e))),!0)}}function vc(e,t,i,o){for(const n of t)yc(e.root,n,i,o)||i.convertItem(n)}function yc(e,t,i,o){const{writer:n,mapper:r}=i;if(!o.reconversion)return!1;const s=r.toViewElement(t);return!(!s||s.root==e||!i.canReuseView(s)||(n.move(n.createRangeOn(s),r.toViewPosition(Da._createBefore(t))),0))}function xc(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}function Ac(e){const{schema:t,document:i}=e.model;for(const o of i.getRoots())if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0;return!1}function Cc(e,t,i){const o=i.createContext(e);return!!i.checkChild(o,"paragraph")&&!!i.checkChild(o.push("paragraph"),t)}function Tc(e,t){const i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}class Ec extends dc{elementToElement(e){return this.add(Sc(e))}elementToAttribute(e){return this.add(function(e){Pc(e=Ea(e));const t=Vc(e,!1),i=Mc(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=null;("string"==typeof(e=Ea(e)).view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key,i=void 0===e.view.value?/[\s\S]*/:e.view.value;let o;if("class"==t||"style"==t){const e="class"==t?"classes":"styles";o={[e]:i}}else o={attributes:{[t]:i}};return e.view.name&&(o.name=e.view.name),e.view=o,t}(e)),Pc(e,t);const i=Vc(e,!0);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,i)=>{const o="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}(e.model);return Sc({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){(e=Ea(e)).model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},i=Ic(Nc(t,"start")),o=Ic(Nc(t,"end"));return n=>{n.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),n.on(`element:${e.view}-end`,o,{priority:e.converterPriority||"normal"});const r=g.low,s=g.highest,a=g.get(e.converterPriority)/s;n.on("element",function(e){return(t,i,o)=>{const n=`data-${e.view}`;function r(t,n){for(const r of n){const n=e.model(r,o),s=o.writer.createElement("$marker",{"data-name":n});o.writer.insert(s,t),i.modelCursor.isEqual(t)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1),i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}(o.consumable.test(i.viewItem,{attributes:n+"-end-after"})||o.consumable.test(i.viewItem,{attributes:n+"-start-after"})||o.consumable.test(i.viewItem,{attributes:n+"-end-before"})||o.consumable.test(i.viewItem,{attributes:n+"-start-before"}))&&(i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(",")))}}(t),{priority:r+a})}}(e))}}function Sc(e){const t=Ic(e=Ea(e)),i=Mc(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"normal"})}}function Mc(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function Ic(e){const t=new Kn(e.view);return(i,o,n)=>{const r=t.match(o.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!n.consumable.test(o.viewItem,s))return;const a=function(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}(e.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,s),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function Pc(e,t=null){const i=null===t||(e=>e.getAttribute(t)),o="object"!=typeof e.model?e.model:e.model.key,n="object"!=typeof e.model||void 0===e.model.value?i:e.model.value;e.model={key:o,value:n}}function Vc(e,t){const i=new Kn(e.view);return(o,n,r)=>{if(!n.modelRange&&t)return;const s=i.match(n.viewItem);if(!s)return;if(function(e,t){const i="function"==typeof e?e(t):e;return!("object"==typeof i&&!Mc(i))&&(!i.classes&&!i.attributes&&!i.styles)}(e.view,n.viewItem)?s.match.name=!0:delete s.match.name,!r.consumable.test(n.viewItem,s.match))return;const a=e.model.key,c="function"==typeof e.model.value?e.model.value(n.viewItem,r):e.model.value;if(null===c)return;n.modelRange||Object.assign(n,r.convertChildren(n.viewItem,n.modelCursor));const l=function(e,t,i,o){let n=!1;for(const r of Array.from(e.getItems({shallow:i})))o.schema.checkAttribute(r,t.key)&&(n=!0,r.hasAttribute(t.key)||o.writer.setAttribute(t.key,t.value,r));return n}(n.modelRange,{key:a,value:c},t,r);l&&(r.consumable.test(n.viewItem,{name:!0})&&(s.match.name=!0),r.consumable.consume(n.viewItem,s.match))}}function Nc(e,t){return{view:`${e.view}-${t}`,model:(t,i)=>{const o=t.getAttribute("name"),n=e.model(o,i);return i.writer.createElement("$marker",{"data-name":n})}}}function Lc(e,t){return e.isCollapsed?function(e,t){const i=e.start,o=t.getNearestSelectionRange(i);if(!o){const e=i.getAncestors().reverse().find((e=>t.isObject(e)));return e?Ua._createOn(e):null}if(!o.isCollapsed)return o;const n=o.start;return i.isEqual(n)?null:new Ua(n)}(e,t):function(e,t){const{start:i,end:o}=e,n=t.checkChild(i,"$text"),r=t.checkChild(o,"$text"),s=t.getLimitElement(i),a=t.getLimitElement(o);if(s===a){if(n&&r)return null;if(function(e,t,i){const o=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),n=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return o||n}(i,o,t)){const e=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),n=o.nodeBefore&&t.isSelectable(o.nodeBefore)?null:t.getNearestSelectionRange(o,"backward"),r=e?e.start:i,s=n?n.end:o;return new Ua(r,s)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const e=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,n=c&&(!e||!Rc(i.nodeAfter,t)),r=l&&(!e||!Rc(o.nodeBefore,t));let d=i,u=o;return n&&(d=Da._createBefore(Oc(s,t))),r&&(u=Da._createAfter(Oc(a,t))),new Ua(d,u)}return null}(e,t)}function Oc(e,t){let i=e,o=i;for(;t.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function Rc(e,t){return e&&t.isSelectable(e)}class Dc extends(j()){constructor(e,t){super(),this.model=e,this.view=new Sa(t),this.mapper=new $a,this.downcastDispatcher=new Za({mapper:this.mapper,schema:e.schema});const i=this.model.document,o=i.selection,n=this.model.markers;var s,a,c;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(i,"change",(()=>{this.view.change((e=>{this.downcastDispatcher.convertChanges(i.differ,n,e),this.downcastDispatcher.convertSelection(o,n,e)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(i,o)=>{const n=o.newSelection,r=[];for(const e of n.getRanges())r.push(t.toModelRange(e));const s=e.createSelection(r,{backward:n.isBackward});s.isEqual(e.document.selection)||e.change((e=>{e.setSelection(s)}))}}(this.model,this.mapper)),this.listenTo(this.view.document,"beforeinput",(s=this.mapper,a=this.model.schema,c=this.view,(e,t)=>{if(!c.document.isComposing||r.isAndroid)for(let e=0;e{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),r=o.createText(t.item.data);o.insert(n,r)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((e,t,i)=>{const o=i.mapper.toViewPosition(t.position),n=t.position.getShiftedBy(t.length),r=i.mapper.toViewPosition(n,{isPhantom:!0}),s=i.writer.createRange(o,r),a=i.writer.remove(s.getTrimmed());for(const e of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(e,{defer:!0})}),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",((e,t,i)=>{const o=i.writer,n=o.document.selection;for(const e of n.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&i.writer.mergeAttributes(e.start);o.setSelection(null)})),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=[];for(const e of o.getRanges())n.push(i.mapper.toViewRange(e));i.writer.setSelection(n,{backward:o.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(!o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=i.writer,r=o.getFirstPosition(),s=i.mapper.toViewPosition(r),a=n.breakAttributes(s);n.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((e=>{if("$graveyard"==e.rootName)return null;const t=new Mr(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t}))}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,i=this.model.markers.get(t);if(!i)throw new k("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change((()=>{this.model.markers._refresh(i)}))}reconvertItem(e){this.model.change((()=>{this.model.document.differ._refreshItem(e)}))}}class Bc{constructor(){this._consumables=new Map}add(e,t){let i;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?i=this._consumables.get(e):(i=new jc(e),this._consumables.set(e,i)),i.add(t))}test(e,t){const i=this._consumables.get(e);return void 0===i?null:e.is("$text")||e.is("documentFragment")?i:i.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const i=this._consumables.get(e);void 0!==i&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},i=e.getAttributeKeys();for(const e of i)"style"!=e&&"class"!=e&&t.attributes.push(e);const o=e.getClassNames();for(const e of o)t.classes.push(e);const n=e.getStyleNames();for(const e of n)t.styles.push(e);return t}static createFrom(e,t){if(t||(t=new Bc),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Bc.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const i of e.getChildren())t=Bc.createFrom(i,t);return t}}const zc=["attributes","classes","styles"];class jc{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t of zc)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t of zc)if(t in e){const i=this._test(t,e[t]);if(!0!==i)return i}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t of zc)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t of zc)t in e&&this._revert(t,e[t])}_add(e,t){const i=Co(t),o=this._consumables[e];for(const t of i){if("attributes"===e&&("class"===t||"style"===t))throw new k("viewconsumable-invalid-attribute",this);if(o.set(t,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))o.set(e,!0)}}_test(e,t){const i=Co(t),o=this._consumables[e];for(const t of i)if("attributes"!==e||"class"!==t&&"style"!==t){const e=o.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",i=this._test(e,[...this._consumables[e].keys()]);if(!0!==i)return i}return!0}_consume(e,t){const i=Co(t),o=this._consumables[e];for(const t of i)if("attributes"!==e||"class"!==t&&"style"!==t){if(o.set(t,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))o.set(e,!1)}else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const i=Co(t),o=this._consumables[e];for(const t of i)if("attributes"!==e||"class"!==t&&"style"!==t)!1===o.get(t)&&o.set(t,!0);else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Fc extends(j()){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((e,t)=>{t[0]=new Hc(t[0])}),{priority:"highest"}),this.on("checkChild",((e,t)=>{t[0]=new Hc(t[0]),t[1]=this.getDefinition(t[1])}),{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new k("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new k("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!(!t||!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!(!t||!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!(!t||!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const i=this.getDefinition(e.last);return!!i&&i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof Da){const t=e.nodeBefore,i=e.nodeAfter;if(!(t instanceof La))throw new k("schema-check-merge-no-element-before",this);if(!(i instanceof La))throw new k("schema-check-merge-no-element-after",this);return this.checkMerge(t,i)}for(const i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e){this.on("checkChild",((t,[i,o])=>{if(!o)return;const n=e(i,o);"boolean"==typeof n&&(t.stop(),t.return=n)}),{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",((t,[i,o])=>{const n=e(i,o);"boolean"==typeof n&&(t.stop(),t.return=n)}),{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(t=e instanceof Da?e.parent:(e instanceof Ua?[e]:Array.from(e.getRanges())).reduce(((e,t)=>{const i=t.getCommonAncestor();return e?e.getCommonAncestor(i,{includeSelf:!0}):i}),null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=[...e.getFirstPosition().getAncestors(),new Va("",e.getAttributes())];return this.checkAttribute(i,t)}{const i=e.getRanges();for(const e of i)for(const i of e)if(this.checkAttribute(i.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const i of e)yield*this._getValidRangesForRange(i,t)}getNearestSelectionRange(e,t="both"){if("$graveyard"==e.root.rootName)return null;if(this.checkChild(e,"$text"))return new Ua(e);let i,o;const n=e.getAncestors().reverse().find((e=>this.isLimit(e)))||e.root;"both"!=t&&"backward"!=t||(i=new Oa({boundaries:Ua._createIn(n),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(o=new Oa({boundaries:Ua._createIn(n),startPosition:e}));for(const e of function*(e,t){let i=!1;for(;!i;){if(i=!0,e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}}}(i,o)){const t=e.walker==i?"elementEnd":"elementStart",o=e.value;if(o.type==t&&this.isObject(o.item))return Ua._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new Ua(o.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){const o=i.model;for(const[n,r]of Object.entries(t))o.schema.checkAttribute(e,n)&&i.setAttribute(n,r,e)}removeDisallowedAttributes(e,t){for(const i of e)if(i.is("$text"))tl(this,i,t);else{const e=Ua._createIn(i).getPositions();for(const i of e)tl(this,i.nodeBefore||i.parent,t)}}getAttributesWithProperty(e,t,i){const o={};for(const[n,r]of e.getAttributes()){const e=this.getAttributeProperties(n);void 0!==e[t]&&(void 0!==i&&i!==e[t]||(o[n]=r))}return o}createContext(e){return new Hc(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,i=Object.keys(t);for(const o of i)e[o]=Uc(t[o],o);for(const t of i)$c(e,t);for(const t of i)qc(e,t);for(const t of i)Wc(e,t);for(const t of i)Zc(e,t),Gc(e,t);for(const t of i)Kc(e,t),Yc(e,t),Qc(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,i=t.length-1){const o=t.getItem(i);if(e.allowIn.includes(o.name)){if(0==i)return!0;{const e=this.getDefinition(o);return this._checkContextMatch(e,t,i-1)}}return!1}*_getValidRangesForRange(e,t){let i=e.start,o=e.start;for(const n of e.getItems({shallow:!0}))n.is("element")&&(yield*this._getValidRangesForRange(Ua._createIn(n),t)),this.checkAttribute(n,t)||(i.isEqual(o)||(yield new Ua(i,o)),i=Da._createAfter(n)),o=Da._createAfter(n);i.isEqual(o)||(yield new Ua(i,o))}findOptimalInsertionRange(e,t){const i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return"before"==t||"after"==t?new Ua(Da._createAt(i,t)):Ua._createOn(i);const o=Uo(e.getSelectedBlocks());if(!o)return new Ua(e.focus);if(o.isEmpty)return new Ua(Da._createAt(o,0));const n=Da._createAfter(o);return e.focus.isTouching(n)?new Ua(n):new Ua(Da._createBefore(o))}}class Hc{constructor(e){if(e instanceof Hc)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(el)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Hc([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map((e=>e.name))}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function Uc(e,t){const i={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(e,t){for(const i of e){const e=Object.keys(i).filter((e=>e.startsWith("is")));for(const o of e)t[o]=!!i[o]}}(e,i),Jc(e,i,"allowIn"),Jc(e,i,"allowContentOf"),Jc(e,i,"allowWhere"),Jc(e,i,"allowAttributes"),Jc(e,i,"allowAttributesOf"),Jc(e,i,"allowChildren"),Jc(e,i,"inheritTypesFrom"),function(e,t){for(const i of e){const e=i.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,i),i}function $c(e,t){const i=e[t];for(const o of i.allowChildren){const i=e[o];i&&i.allowIn.push(t)}i.allowChildren.length=0}function qc(e,t){for(const i of e[t].allowContentOf)e[i]&&Xc(e,i).forEach((e=>{e.allowIn.push(t)}));delete e[t].allowContentOf}function Wc(e,t){for(const i of e[t].allowWhere){const o=e[i];if(o){const i=o.allowIn;e[t].allowIn.push(...i)}}delete e[t].allowWhere}function Zc(e,t){for(const i of e[t].allowAttributesOf){const o=e[i];if(o){const i=o.allowAttributes;e[t].allowAttributes.push(...i)}}delete e[t].allowAttributesOf}function Gc(e,t){const i=e[t];for(const t of i.inheritTypesFrom){const o=e[t];if(o){const e=Object.keys(o).filter((e=>e.startsWith("is")));for(const t of e)t in i||(i[t]=o[t])}}delete i.inheritTypesFrom}function Kc(e,t){const i=e[t],o=i.allowIn.filter((t=>e[t]));i.allowIn=Array.from(new Set(o))}function Yc(e,t){const i=e[t];for(const o of i.allowIn)e[o].allowChildren.push(t)}function Qc(e,t){const i=e[t];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function Jc(e,t,i){for(const o of e){const e=o[i];"string"==typeof e?t[i].push(e):Array.isArray(e)&&t[i].push(...e)}}function Xc(e,t){const i=e[t];return(o=e,Object.keys(o).map((e=>o[e]))).filter((e=>e.allowIn.includes(i.name)));var o}function el(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function tl(e,t,i){for(const o of t.getAttributeKeys())e.checkAttribute(t,o)||i.removeAttribute(o,t)}class il extends(C()){constructor(e){super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(e,t)=>this._convertItem(e,t),convertChildren:(e,t)=>this._convertChildren(e,t),safeInsert:(e,t)=>this._safeInsert(e,t),updateConversionResult:(e,t)=>this._updateConversionResult(e,t),splitToAllowedParent:(e,t)=>this._splitToAllowedParent(e,t),getSplitParts:e=>this._getSplitParts(e),keepEmptyElement:e=>this._keepEmptyElement(e)}}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let i;for(const o of new Hc(e)){const e={};for(const t of o.getAttributeKeys())e[t]=o.getAttribute(t);const n=t.createElement(o.name,e);i&&t.insert(n,i),i=Da._createAt(n,0)}return i}(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=Bc.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),n=t.createDocumentFragment();if(o){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,n);n.markers=function(e,t){const i=new Set,o=new Map,n=Ua._createIn(e).getItems();for(const e of n)e.is("element","$marker")&&i.add(e);for(const e of i){const i=e.getAttribute("data-name"),n=t.createPositionBefore(e);o.has(i)?o.get(i).end=n.clone():o.set(i,new Ua(n.clone())),t.remove(e)}return o}(n,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(e,t){const i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof Ua))throw new k("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:Da._createAt(t,0);const o=new Ua(i);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,i);e.modelRange instanceof Ua&&(o.end=e.modelRange.end,i=e.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(e,t){const i=this._splitToAllowedParent(e,t);return!!i&&(this.conversionApi.writer.insert(e,i.position),!0)}_updateConversionResult(e,t){const i=this._getSplitParts(e),o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(i[i.length-1])));const n=this._cursorParents.get(e);t.modelCursor=n?o.createPositionAt(n,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:i,writer:o}=this.conversionApi;let n=i.findAllowedParent(t,e);if(n){if(n===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return Cc(t,e,i)?{position:Tc(t,o)}:null;const r=this.conversionApi.writer.split(t,n),s=[];for(const e of r.range.getWalker())if("elementEnd"==e.type)s.push(e.item);else{const t=s.pop(),i=e.item;this._registerSplitPair(t,i)}const a=r.range.end.parent;return this._cursorParents.set(e,a),{position:r.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}class ol{getHtml(e){const i=t.document.implementation.createHTMLDocument("").createElement("div");return i.appendChild(e),i.innerHTML}}class nl{constructor(e){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new Vs(e,{renderingMode:"data"}),this.htmlWriter=new ol}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){e.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),i=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}}class rl extends(C()){constructor(e,t){super(),this.model=e,this.mapper=new $a,this.downcastDispatcher=new Za({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),r=o.createText(t.item.data);o.insert(n,r)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.upcastDispatcher=new il({schema:e.schema}),this.viewDocument=new Ur(t),this.stylesProcessor=t,this.htmlProcessor=new nl(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new ts(this.viewDocument),this.upcastDispatcher.on("text",((e,t,{schema:i,consumable:o,writer:n})=>{let r=t.modelCursor;if(!o.test(t.viewItem))return;if(!i.checkChild(r,"$text")){if(!Cc(r,"$text",i))return;if(0==t.viewItem.data.trim().length)return;const e=r.nodeBefore;r=Tc(r,n),e&&e.is("element","$marker")&&(n.move(n.createRangeOn(e),r),r=n.createPositionAfter(e))}o.consume(t.viewItem);const s=n.createText(t.viewItem.data);n.insert(s,r),t.modelRange=n.createRange(r,r.getShiftedBy(s.offsetSize)),t.modelCursor=t.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),j().prototype.decorate.call(this,"init"),j().prototype.decorate.call(this,"set"),j().prototype.decorate.call(this,"get"),j().prototype.decorate.call(this,"toView"),j().prototype.decorate.call(this,"toModel"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},Ac)}),{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new k("datacontroller-get-non-existent-root",this);const o=this.model.document.getRoot(t);return o.isAttached()||b("datacontroller-get-detached-root",this),"empty"!==i||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o,e):""}stringify(e,t={}){const i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){const i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();const n=Ua._createIn(e),r=new es(i);this.mapper.bindElements(e,r);const s=e.is("documentFragment")?e.markers:function(e){const t=[],i=e.root.document;if(!i)return new Map;const o=Ua._createIn(e);for(const e of i.model.markers){const i=e.getRange(),n=i.isCollapsed,r=i.start.isEqual(o.start)||i.end.isEqual(o.end);if(n&&r)t.push([e.name,i]);else{const n=o.getIntersection(i);n&&t.push([e.name,n])}}return t.sort((([e,t],[i,o])=>{if("after"!==t.end.compareWith(o.start))return 1;if("before"!==t.start.compareWith(o.end))return-1;switch(t.start.compareWith(o.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(o.end)){case"before":return 1;case"after":return-1;default:return i.localeCompare(e)}}})),new Map(t)}(e);return this.downcastDispatcher.convert(n,s,o,t),r}init(e){if(this.model.document.version)throw new k("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new k("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(e=>{for(const i of Object.keys(t)){const o=this.model.document.getRoot(i);e.insert(this.parse(t[i],o),o,0)}})),Promise.resolve()}set(e,t={}){let i={};if("string"==typeof e?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new k("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},(e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(i)){const o=this.model.document.getRoot(t);e.remove(e.createRangeIn(o)),e.insert(this.parse(i[t],o),o,0)}}))}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change((i=>this.upcastDispatcher.convert(e,i,t)))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRoot(t))return!1;return!0}}class sl{constructor(e,t){this._helpers=new Map,this._downcast=Co(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Co(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new k("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new k("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of al(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of al(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of al(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new k("conversion-group-exists",this);const o=i?new uc(t):new Ec(t);this._helpers.set(e,o)}}function*al(e){if(e.model.values)for(const t of e.model.values){const i={key:e.model.key,value:t},o=e.view[t],n=e.upcastAlso?e.upcastAlso[t]:void 0;yield*cl(i,o,n)}else yield*cl(e.model,e.view,e.upcastAlso)}function*cl(e,t,i){if(yield{model:e,view:t},i)for(const t of Co(i))yield{model:e,view:t}}class ll{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function dl(e,t){const i=ml(t),o=i.reduce(((e,t)=>e+t.offsetSize),0),n=e.parent;pl(e);const r=e.index;return n._insertChild(r,i),gl(n,r+i.length),gl(n,r),new Ua(e,e.getShiftedBy(o))}function ul(e){if(!e.isFlat)throw new k("operation-utils-remove-range-not-flat",this);const t=e.start.parent;pl(e.start),pl(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);return gl(t,e.start.index),i}function hl(e,t){if(!e.isFlat)throw new k("operation-utils-move-range-not-flat",this);const i=ul(e);return dl(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),i)}function ml(e){const t=[];!function e(i){if("string"==typeof i)t.push(new Va(i));else if(i instanceof Na)t.push(new Va(i.data,i.getAttributes()));else if(i instanceof Ia)t.push(i);else if(K(i))for(const t of i)e(t)}(e);for(let e=1;ee.maxOffset)throw new k("move-operation-nodes-do-not-exist",this);if(e===t&&i=i&&this.targetPosition.path[e]e._clone(!0)))),t=new bl(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new Da(e,[0]);return new kl(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0)))),dl(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const t of e.nodes)t.name?i.push(La.fromJSON(t)):i.push(Va.fromJSON(t));const o=new bl(Da.fromJSON(e.position,t),i,e.baseVersion);return o.shouldReceiveAttributes=e.shouldReceiveAttributes,o}}class wl extends ll{constructor(e,t,i,o,n){super(n),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=i,this.graveyardPosition=o?o.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new Da(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Ua(this.splitPosition,e)}get affectedSelectable(){const e=[Ua._createFromPositionAndShift(this.splitPosition,0),Ua._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(Ua._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new wl(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new Da(e,[0]);return new _l(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof vl){const i=e.newRange;if(!i)return;if(t instanceof kl){const o=Ua._createFromPositionAndShift(t.sourcePosition,t.howMany),n=o.containsPosition(i.start)||o.start.isEqual(i.start),r=o.containsPosition(i.end)||o.end.isEqual(i.end);!n&&!r||o.containsRange(i)||this._setRelation(e,t,{side:n?"left":"right",path:n?i.start.path.slice():i.end.path.slice()})}else if(t instanceof _l){const o=i.start.isEqual(t.targetPosition),n=i.start.isEqual(t.deletionPosition),r=i.end.isEqual(t.deletionPosition),s=i.end.isEqual(t.sourcePosition);(o||n||r||s)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:n,wasEndBeforeMergedElement:r,wasInRightElement:s})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const i=this.originalOperations.get(t),o=this._history.getUndoneOperation(i);if(!o)return null;const n=this.originalOperations.get(e),r=this._relations.get(n);return r&&r.get(o)||null}_setRelation(e,t,i){const o=this.originalOperations.get(e),n=this.originalOperations.get(t);let r=this._relations.get(o);r||(r=new Map,this._relations.set(o,r)),r.set(n,i)}}function Rl(e,t){for(const i of e)i.baseVersion=t++}function Dl(e,t){for(let i=0;i{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const o=e.range.getDifference(t.range).map((t=>new xl(t,e.key,e.oldValue,e.newValue,0))),n=e.range.getIntersection(t.range);return n&&i.aIsStrong&&o.push(new xl(n,t.key,t.newValue,e.newValue,0)),0==o.length?[new Al(0)]:o}return[e]})),Pl(xl,bl,((e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map((t=>new xl(t,e.key,e.oldValue,e.newValue,e.baseVersion)));if(t.shouldReceiveAttributes){const o=Bl(t,e.key,e.oldValue);o&&i.unshift(o)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]})),Pl(xl,_l,((e,t)=>{const i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(Ua._createFromPositionAndShift(t.graveyardPosition,1));const o=e.range._getTransformedByMergeOperation(t);return o.isCollapsed||i.push(o),i.map((t=>new xl(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),Pl(xl,kl,((e,t)=>{const i=function(e,t){const i=Ua._createFromPositionAndShift(t.sourcePosition,t.howMany);let o=null,n=[];i.containsRange(e,!0)?o=e:e.start.hasSameParentAs(i.start)?(n=e.getDifference(i),o=e.getIntersection(i)):n=[e];const r=[];for(let e of n){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart(),o=e.start.hasSameParentAs(i),n=e._getTransformedByInsertion(i,t.howMany,o);r.push(...n)}return o&&r.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),r}(e.range,t);return i.map((t=>new xl(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),Pl(xl,wl,((e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();return i.range=new Ua(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]})),Pl(bl,xl,((e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const o=Bl(e,t.key,t.newValue);o&&i.push(o)}return i})),Pl(bl,bl,((e,t,i)=>(e.position.isEqual(t.position)&&i.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e]))),Pl(bl,kl,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Pl(bl,wl,((e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]))),Pl(bl,_l,((e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Pl(vl,bl,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]))),Pl(vl,vl,((e,t,i)=>{if(e.name==t.name){if(!i.aIsStrong)return[new Al(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]})),Pl(vl,_l,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]))),Pl(vl,kl,((e,t,i)=>{if(e.oldRange&&(e.oldRange=Ua._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(i.abRelation){const o=Ua._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==i.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.end=o.end,e.newRange.start.path=i.abRelation.path,[e];if("right"==i.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=o.start,e.newRange.end.path=i.abRelation.path,[e]}e.newRange=Ua._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]})),Pl(vl,wl,((e,t,i)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){const o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?e.newRange.start=Da._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement&&(e.newRange.start=Da._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement?e.newRange.end=Da._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=Da._createAt(t.insertionPosition):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]})),Pl(_l,bl,((e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]))),Pl(_l,_l,((e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(i.bWasUndone){const i=t.graveyardPosition.path.slice();return i.push(0),e.sourcePosition=new Da(t.graveyardPosition.root,i),e.howMany=0,[e]}return[new Al(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const o="$graveyard"==e.targetPosition.root.rootName,n="$graveyard"==t.targetPosition.root.rootName;if(n&&!o||(!o||n)&&i.aIsStrong){const i=t.targetPosition._getTransformedByMergeOperation(t),o=e.targetPosition._getTransformedByMergeOperation(t);return[new kl(i,e.howMany,o,0)]}return[new Al(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&i.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Pl(_l,kl,((e,t,i)=>{const o=Ua._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!i.bWasUndone&&!i.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new Al(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&"mergeSourceAffected"==i.abRelation?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&"mergeTargetWasBefore"==i.abRelation?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany)),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])})),Pl(_l,wl,((e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const o=0!=t.howMany,n=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(o||n||"mergeTargetNotMoved"==i.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==i.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),Pl(kl,bl,((e,t)=>{const i=Ua._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),Pl(kl,kl,((e,t,i)=>{const o=Ua._createFromPositionAndShift(e.sourcePosition,e.howMany),n=Ua._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),zl(e,t)&&zl(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),jl([o],r);if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),jl([o],r);const c=G(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),jl([o],r);"remove"!=e.type||"remove"==t.type||i.aWasUndone||i.forceWeakRemove?"remove"==e.type||"remove"!=t.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const l=[],d=o.getDifference(n);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i="same"==G(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),o=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);l.push(...o)}const u=o.getIntersection(n);return null!==u&&s&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===l.length?l.push(u):1==l.length?n.start.isBefore(o.start)||n.start.isEqual(o.start)?l.unshift(u):l.push(u):l.splice(1,0,u)),0===l.length?[new Al(e.baseVersion)]:jl(l,r)})),Pl(kl,wl,((e,t,i)=>{let o=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(o=e.targetPosition._getTransformedBySplitOperation(t));const n=Ua._createFromPositionAndShift(e.sourcePosition,e.howMany);if(n.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=o,[e];if(n.start.hasSameParentAs(t.splitPosition)&&n.containsPosition(t.splitPosition)){let e=new Ua(t.splitPosition,n.end);return e=e._getTransformedBySplitOperation(t),jl([new Ua(n.start,t.splitPosition),e],o)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==i.abRelation&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==i.abRelation&&(o=e.targetPosition);const r=[n._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const o=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);e.howMany>1&&o&&!i.aWasUndone&&r.push(Ua._createFromPositionAndShift(t.insertionPosition,1))}return jl(r,o)})),Pl(kl,_l,((e,t,i)=>{const o=Ua._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition))if("remove"!=e.type||i.forceWeakRemove){if(1==e.howMany)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Al(0)]}else if(!i.aWasUndone){const i=[];let o=t.graveyardPosition.clone(),n=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(i.push(new kl(e.sourcePosition,e.howMany-1,e.targetPosition,0)),o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),n=n._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const r=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),s=new kl(o,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Da(s.targetPosition.root,a);n=n._getTransformedByMove(o,r,1);const l=new kl(n,t.howMany,c,0);return i.push(s),i.push(l),i}const n=Ua._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),Pl(Cl,bl,((e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]))),Pl(Cl,_l,((e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Pl(Cl,kl,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Pl(Cl,Cl,((e,t,i)=>{if(e.position.isEqual(t.position)){if(!i.aIsStrong)return[new Al(0)];e.oldName=t.newName}return[e]})),Pl(Cl,wl,((e,t)=>{if("same"==G(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new Cl(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),Pl(Tl,Tl,((e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue)return[new Al(0)];e.oldValue=t.newValue}return[e]})),Pl(El,El,((e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new Al(0)]:[e])),Pl(wl,bl,((e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const o=new Da(t.graveyardPosition.root,i),n=wl.getInsertionPosition(new Da(t.graveyardPosition.root,i)),r=new wl(o,0,n,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=wl.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=wl.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Pl(wl,kl,((e,t,i)=>{const o=Ua._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&n){const i=e.splitPosition._getTransformedByMoveOperation(t),o=e.graveyardPosition._getTransformedByMoveOperation(t),n=o.path.slice();n.push(0);const r=new Da(o.root,n);return[new kl(i,e.howMany,r,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const n=e.splitPosition.isEqual(t.targetPosition);if(n&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=wl.getInsertionPosition(e.splitPosition),[e];if(n&&i.abRelation&&i.abRelation.howMany){const{howMany:t,offset:o}=i.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(o),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=i,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new Al(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new Al(0)];if("splitBefore"==i.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const o="$graveyard"==e.splitPosition.root.rootName,n="$graveyard"==t.splitPosition.root.rootName;if(n&&!o||(!o||n)&&i.aIsStrong){const i=[];return t.howMany&&i.push(new kl(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&i.push(new kl(e.splitPosition,e.howMany,e.moveTargetPosition,0)),i}return[new Al(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.baRelation){const i=t.insertionPosition.path.slice();i.push(0);const o=new Da(t.insertionPosition.root,i);return[e,new kl(e.insertionPosition,1,o,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset{const i=t[0];i.isDocumentOperation&&Ul.call(this,i)}),{priority:"low"})}function Ul(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}Fl.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class $l{constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},b("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:i=!0,isUndo:o=!1,isTyping:n=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=i,this.isUndo=o,this.isTyping=n}get type(){return b("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class ql{constructor(e){this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changedRoots=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set,this._markerCollection=e}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size&&0==this._changedRoots.size}bufferOperation(e){const t=e;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),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||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=Ua._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}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);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const o=t.targetPosition.parent;this._isInInsertedElement(o)||this._markInsert(o,t.targetPosition.offset,e.maxOffset);break}case"detachRoot":case"addRoot":{const e=t.affectedSelectable;if(!e._isLoaded)return;if(e.isAttached()==t.isAdd)return;this._bufferRootStateChange(t.rootName,t.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!t.root._isLoaded)return;const e=t.root.rootName;this._bufferRootAttributeChange(e,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,i){t.range&&t.range.root.is("rootElement")&&!t.range.root._isLoaded&&(t.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let o=this._changedMarkers.get(e);o?o.newMarkerData=i:(o={newMarkerData:i,oldMarkerData:t},this._changedMarkers.set(e,o)),null==o.oldMarkerData.range&&null==i.range&&this._changedMarkers.delete(e)}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.oldMarkerData.range&&e.push({name:t,range:i.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.newMarkerData.range&&e.push({name:t,range:i.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map((([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}})))}hasDataChanges(){if(this.getChanges().length)return!0;if(this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const i=e.range&&!t.range,o=!e.range&&t.range,n=e.range&&t.range&&!e.range.isEqual(t.range);if(i||o||n)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort(((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee));for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(Gl),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map((e=>{const t={...e};return void 0!==t.state&&delete t.attributes,t}))}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const i=this._changedRoots.get(e);void 0!==i.state?(delete i.state,void 0===i.attributes&&this._changedRoots.delete(e)):i.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,i,o){const n=this._changedRoots.get(e)||{name:e},r=n.attributes||{};if(r[t]){const e=r[t];o===e.oldValue?delete r[t]:e.newValue=o}else r[t]={oldValue:i,newValue:o};0===Object.entries(r).length?(delete n.attributes,void 0===n.state&&this._changedRoots.delete(e)):(n.attributes=r,this._changedRoots.set(e,n))}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e);const t=Ua._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_bufferRootLoad(e){if(e.isAttached()){this._bufferRootStateChange(e.rootName,!0),this._markInsert(e,0,e.maxOffset);for(const t of e.getAttributeKeys())this._bufferRootAttributeChange(e.rootName,t,null,e.getAttribute(t));for(const t of this._markerCollection)if(t.getRange().root==e){const e=t.getData();this.bufferMarkerChange(t.name,{...e,range:null},e)}}}_markInsert(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"insert",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o)}_markRemove(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"remove",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o),this._removeAllNestedChanges(e,t,i)}_markAttribute(e){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const i=this._getChangesForElement(e);this._handleChange(t,i),i.push(t);for(let e=0;ei.offset){if(o>n){const e={type:"attribute",offset:n,howMany:o-n,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=i.offset&&e.offsetn?(e.nodesToHandle=o-n,e.offset=n):e.nodesToHandle=0);if("remove"==i.type&&e.offseti.offset){const n={type:"attribute",offset:i.offset,howMany:o-i.offset,count:this._changeCount++};this._handleChange(n,t),t.push(n),e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==i.type&&(e.offset>=i.offset&&o<=n?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=i.offset&&o>=n&&(i.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,i){return{type:"insert",position:Da._createAt(e,t),name:i.name,attributes:new Map(i.attributes),length:1,changeCount:this._changeCount++,_element:i.element}}_getRemoveDiff(e,t,i){return{type:"remove",position:Da._createAt(e,t),name:i.name,attributes:new Map(i.attributes),length:1,changeCount:this._changeCount++,_element:i.element}}_getAttributesDiff(e,t,i){const o=[];i=new Map(i);for(const[n,r]of t){const t=i.has(n)?i.get(n):null;t!==r&&o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:n,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++}),i.delete(n)}for(const[t,n]of i)o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:n,changeCount:this._changeCount++});return o}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const i=this._changesInElement.get(t),o=e.startOffset;if(i)for(const e of i)if("insert"==e.type&&o>=e.offset&&oo){for(let t=0;tthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new k("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const i=this._operations[0];void 0===e&&(e=i.baseVersion);let o=t-1;for(const[t,i]of this._gaps)e>t&&et&&othis.lastOperation.baseVersion)return[];let n=this._baseVersionToOperationIndex.get(e);void 0===n&&(n=0);let r=this._baseVersionToOperationIndex.get(o);return void 0===r&&(r=this._operations.length-1),this._operations.slice(n,r+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(void 0!==t)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Yl extends La{constructor(e,t,i="main"){super(t),this._isAttached=!0,this._isLoaded=!0,this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Yl.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e};const Ql="$graveyard";class Jl extends(C()){constructor(e){super(),this.model=e,this.history=new Kl,this.selection=new ac(this),this.roots=new Ho({idProperty:"rootName"}),this.differ=new ql(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Ql),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.differ.bufferOperation(i)}),{priority:"high"}),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.history.addOperation(i)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(e.markers,"update",((e,t,i,o,n)=>{const r={...t.getData(),range:o};this.differ.bufferMarkerChange(t.name,n,r),null===i&&t.on("change",((e,i)=>{const o=t.getData();this.differ.bufferMarkerChange(t.name,{...o,range:i},o)}))})),this.registerPostFixer((e=>{let t=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),t=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),t=!0);return t}))}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Ql)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new k("model-document-createroot-name-exists",this,{name:t});const i=new Yl(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map((e=>e.rootName))}getRoots(e=!1){return this.roots.filter((t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded))}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=qn(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,i=t.schema,o=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return Xl(e.start)&&Xl(e.end)}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break}while(t)}}function Xl(e){const t=e.textNode;if(t){const i=t.data,o=e.offset-t.startOffset;return!Go(i,o)&&!Ko(i,o)}return!0}class ed extends(C()){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof td?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,o=!1){const n=e instanceof td?e.name:e;if(n.includes(","))throw new k("markercollection-incorrect-marker-name",this);const r=this._markers.get(n);if(r){const e=r.getData(),s=r.getRange();let a=!1;return s.isEqual(t)||(r._attachLiveRange(oc.fromRange(t)),a=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,a=!0),"boolean"==typeof o&&o!=r.affectsData&&(r._affectsData=o,a=!0),a&&this.fire(`update:${n}`,r,s,t,e),r}const s=oc.fromRange(t),a=new td(n,s,i,o);return this._markers.set(n,a),this.fire(`update:${n}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof td?e.name:e,i=this._markers.get(t);return!!i&&(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0)}_refresh(e){const t=e instanceof td?e.name:e,i=this._markers.get(t);if(!i)throw new k("markercollection-refresh-marker-not-exists",this);const o=i.getRange();this.fire(`update:${t}`,i,o,o,i.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class td extends(C(Ma)){constructor(e,t,i,o){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new k("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new k("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new k("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new k("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new k("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}td.prototype.is=function(e){return"marker"===e||"model:marker"===e};class id extends ll{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new k("detach-operation-on-document-node",this)}_execute(){ul(Ua._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class od extends Ma{constructor(e){super(),this.markers=new Map,this._children=new Pa,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const i of e)t=t.getChild(t.offsetToIndex(i));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const i of e)i.name?t.push(La.fromJSON(i)):t.push(Va.fromJSON(i));return new od(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){return"string"==typeof e?[new Va(e)]:(K(e)||(e=[e]),Array.from(e).map((e=>"string"==typeof e?new Va(e):e instanceof Na?new Va(e.data,e.getAttributes()):e)))}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}}od.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class nd{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Va(e,t)}createElement(e,t){return new La(e,t)}createDocumentFragment(){return new od}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof Va&&""==e.data)return;const o=Da._createAt(t,i);if(e.parent){if(ld(e.root,o.root))return void this.move(Ua._createOn(e),o);if(e.root.document)throw new k("model-writer-insert-forbidden-move",this);this.remove(e)}const n=o.root.document?o.root.document.version:null,r=new bl(o,e,n);if(e instanceof Va&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),e instanceof od)for(const[t,i]of e.markers){const e=Da._createAt(i.root,0),n={range:new Ua(i.start._getCombined(e,o),i.end._getCombined(e,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,n):this.addMarker(t,n)}}insertText(e,t,i,o){t instanceof od||t instanceof La||t instanceof Da?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,o)}insertElement(e,t,i,o){t instanceof od||t instanceof La||t instanceof Da?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof od||t instanceof La?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof od||t instanceof La?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof Ua){const o=i.getMinimalFlatRanges();for(const i of o)rd(this,e,t,i)}else sd(this,e,t,i)}setAttributes(e,t){for(const[i,o]of Wo(e))this.setAttribute(i,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof Ua){const i=t.getMinimalFlatRanges();for(const t of i)rd(this,e,null,t)}else sd(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof Ua)for(const i of e.getItems())t(i);else t(e)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof Ua))throw new k("writer-move-invalid-range",this);if(!e.isFlat)throw new k("writer-move-range-not-flat",this);const o=Da._createAt(t,i);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!ld(e.root,o.root))throw new k("writer-move-different-document",this);const n=e.root.document?e.root.document.version:null,r=new kl(e.start,e.end.offset-e.start.offset,o,n);this.batch.addOperation(r),this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof Ua?e:Ua._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),cd(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof La))throw new k("writer-merge-no-element-before",this);if(!(i instanceof La))throw new k("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,i=e.nodeAfter;this.move(Ua._createIn(i),Da._createAt(t,"end")),this.remove(i)}_merge(e){const t=Da._createAt(e.nodeBefore,"end"),i=Da._createAt(e.nodeAfter,0),o=e.root.document.graveyard,n=new Da(o,[0]),r=e.root.document.version,s=new _l(i,e.nodeAfter.maxOffset,t,n,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof La))throw new k("writer-rename-not-element-instance",this);const i=e.root.document?e.root.document.version:null,o=new Cl(Da._createBefore(e),e.name,t,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let i,o,n=e.parent;if(!n.parent)throw new k("writer-split-element-no-parent",this);if(t||(t=n.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new k("writer-split-invalid-limit-element",this);do{const t=n.root.document?n.root.document.version:null,r=n.maxOffset-e.offset,s=wl.getInsertionPosition(e),a=new wl(e,r,s,null,t);this.batch.addOperation(a),this.model.applyOperation(a),i||o||(i=n,o=e.parent.nextSibling),n=(e=this.createPositionAfter(e.parent)).parent}while(n!==t);return{position:e,range:new Ua(Da._createAt(i,"end"),Da._createAt(o,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new k("writer-wrap-range-not-flat",this);const i=t instanceof La?t:new La(t);if(i.childCount>0)throw new k("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new k("writer-wrap-element-attached",this);this.insert(i,e.start);const o=new Ua(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,Da._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new k("writer-unwrap-element-no-parent",this);this.move(Ua._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new k("writer-addmarker-no-usingoperation",this);const i=t.usingOperation,o=t.range,n=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new k("writer-addmarker-marker-exists",this);if(!o)throw new k("writer-addmarker-no-range",this);return i?(ad(this,e,null,o,n),this.model.markers.get(e)):this.model.markers._set(e,o,i,n)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i="string"==typeof e?e:e.name,o=this.model.markers.get(i);if(!o)throw new k("writer-updatemarker-marker-not-exists",this);if(!t)return b("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),void this.model.markers._refresh(o);const n="boolean"==typeof t.usingOperation,r="boolean"==typeof t.affectsData,s=r?t.affectsData:o.affectsData;if(!n&&!t.range&&!r)throw new k("writer-updatemarker-wrong-options",this);const a=o.getRange(),c=t.range?t.range:a;n&&t.usingOperation!==o.managedUsingOperations?t.usingOperation?ad(this,i,null,c,s):(ad(this,i,a,null,s),this.model.markers._set(i,c,void 0,s)):o.managedUsingOperations?ad(this,i,a,c,s):this.model.markers._set(i,c,void 0,s)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new k("writer-removemarker-no-marker",this);const i=this.model.markers.get(t);i.managedUsingOperations?ad(this,t,i.getRange(),null,i.affectsData):this.model.markers._remove(t)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new k("writer-addroot-root-exists",this);const o=this.model.document,n=new El(e,t,!0,o,o.version);return this.batch.addOperation(n),this.model.applyOperation(n),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new k("writer-detachroot-no-root",this);for(const e of this.model.markers)e.getRange().root===t&&this.removeMarker(e);for(const e of t.getAttributeKeys())this.removeAttribute(e,t);this.remove(this.createRangeIn(t));const i=this.model.document,o=new El(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(o),this.model.applyOperation(o)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,i]of Wo(e))this._setSelectionAttribute(t,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const o=ac._getStoreAttributeKey(e);this.setAttribute(o,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=ac._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new k("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const o=i.getRange();let n=!1;if("move"===e){const e=t;n=e.containsPosition(o.start)||e.start.isEqual(o.start)||e.containsPosition(o.end)||e.end.isEqual(o.end)}else{const e=t,i=e.nodeBefore,r=e.nodeAfter,s=o.start.parent==i&&o.start.isAtEnd,a=o.end.parent==r&&0==o.end.offset,c=o.end.nodeAfter==r,l=o.start.nodeAfter==r;n=s||a||c||l}n&&this.updateMarker(i.name,{range:o})}}}function rd(e,t,i,o){const n=e.model,r=n.document;let s,a,c,l=o.start;for(const e of o.getWalker({shallow:!0}))c=e.item.getAttribute(t),s&&a!=c&&(a!=i&&d(),l=s),s=e.nextPosition,a=c;function d(){const o=new Ua(l,s),c=o.root.document?r.version:null,d=new xl(o,t,a,i,c);e.batch.addOperation(d),n.applyOperation(d)}s instanceof Da&&s!=l&&a!=i&&d()}function sd(e,t,i,o){const n=e.model,r=n.document,s=o.getAttribute(t);let a,c;if(s!=i){if(o.root===o){const e=o.document?r.version:null;c=new Tl(o,t,s,i,e)}else{a=new Ua(Da._createBefore(o),e.createPositionAfter(o));const n=a.root.document?r.version:null;c=new xl(a,t,s,i,n)}e.batch.addOperation(c),n.applyOperation(c)}}function ad(e,t,i,o,n){const r=e.model,s=r.document,a=new vl(t,i,o,r.markers,!!n,s.version);e.batch.addOperation(a),r.applyOperation(a)}function cd(e,t,i,o){let n;if(e.root.document){const i=o.document,r=new Da(i.graveyard,[0]);n=new kl(e,t,r,i.version)}else n=new id(e,t);i.addOperation(n),o.applyOperation(n)}function ld(e,t){return e===t||e instanceof Yl&&t instanceof Yl}function dd(e,t,i={}){if(t.isCollapsed)return;const o=t.getFirstRange();if("$graveyard"==o.root.rootName)return;const n=e.schema;e.change((e=>{if(!i.doNotResetEntireContent&&function(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;const o=t.getFirstRange();return o.start.parent!=o.end.parent&&e.checkChild(i,"paragraph")}(n,t))return void function(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),gd(e,e.createPositionAt(i,0),t)}(e,t);const r={};if(!i.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(r,n.getAttributesWithProperty(e,"copyOnReplace",!0))}const[s,a]=function(e){const t=e.root.document.model,i=e.start;let o=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const i=function(e){const t=e.parent,i=t.root.document.model.schema,o=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of o){if(i.isLimit(e))return null;if(i.isBlock(e))return e}}(o);if(i&&o.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});const n=i.getLastPosition(),r=t.createRange(n,o);t.hasContent(r,{ignoreMarkers:!0})||(o=n)}}return[Fl.fromPosition(i,"toPrevious"),Fl.fromPosition(o,"toNext")]}(o);s.isTouching(a)||e.remove(e.createRange(s,a)),i.leaveUnmerged||(function(e,t,i){const o=e.model;if(!md(e.model.schema,t,i))return;const[n,r]=function(e,t){const i=e.getAncestors(),o=t.getAncestors();let n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}(t,i);n&&r&&(!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(r,{ignoreMarkers:!0})?hd(e,t,i,n.parent):ud(e,t,i,n.parent))}(e,s,a),n.removeDisallowedAttributes(s.parent.getChildren(),e)),pd(e,t,s),!i.doNotAutoparagraph&&function(e,t){const i=e.checkChild(t,"$text"),o=e.checkChild(t,"paragraph");return!i&&o}(n,s)&&gd(e,s,t,r),s.detach(),a.detach()}))}function ud(e,t,i,o){const n=t.parent,r=i.parent;if(n!=o&&r!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(r)).isEqual(t)||e.insert(r,t),e.merge(t);i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}md(e.model.schema,t,i)&&ud(e,t,i,o)}}function hd(e,t,i,o){const n=t.parent,r=i.parent;if(n!=o&&r!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(r)).isEqual(t)||e.insert(n,i);t.parent.isEmpty;){const i=t.parent;t=e.createPositionBefore(i),e.remove(i)}i=e.createPositionBefore(r),function(e,t){const i=t.nodeBefore,o=t.nodeAfter;i.name!=o.name&&e.rename(i,o.name),e.clearAttributes(i),e.setAttributes(Object.fromEntries(o.getAttributes()),i),e.merge(t)}(e,i),md(e.model.schema,t,i)&&hd(e,t,i,o)}}function md(e,t,i){const o=t.parent,n=i.parent;return o!=n&&!e.isLimit(o)&&!e.isLimit(n)&&function(e,t,i){const o=new Ua(e,t);for(const e of o.getWalker())if(i.isLimit(e.item))return!1;return!0}(t,i,e)}function gd(e,t,i,o={}){const n=e.createElement("paragraph");e.model.schema.setAllowedAttributes(n,o,e),e.insert(n,t),pd(e,i,e.createPositionAt(n,0))}function pd(e,t,i){t instanceof ac?e.setSelection(i):t.setTo(i)}function fd(e,t){const i=[];Array.from(e.getItems({direction:"backward"})).map((e=>t.createRangeOn(e))).filter((t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end)))).forEach((e=>{i.push(e.start.parent),t.remove(e)})),i.forEach((e=>{let i=e;for(;i.parent&&i.isEmpty;){const e=t.createRangeOn(i);i=i.parent,t.remove(e)}}))}class kd{constructor(e,t,i){this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null,this._nodeToSelect=null,this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new k("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?Ua._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Ua(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Fl.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new k("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Fl.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Fl.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof La))return;if(!this._canMergeLeft(e))return;const t=Fl._createBefore(e);t.stickiness="toNext";const i=Fl.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Fl._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Fl._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof La))return;if(!this._canMergeRight(e))return;const t=Fl._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new k("insertcontent-invalid-insertion-position",this);this.position=Da._createAt(t.nodeBefore,"end");const i=Fl.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Fl._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Fl._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof La&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof La&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}const bd=' ,.?!:;"-()';function wd(e,t){const{isForward:i,walker:o,unit:n,schema:r,treatEmojiAsSingleUnit:s}=e,{type:a,item:c,nextPosition:l}=t;if("text"==a)return"word"===e.unit?function(e,t){let i=e.position.textNode;for(i||(i=t?e.position.nodeAfter:e.position.nodeBefore);i&&i.is("$text");){const o=e.position.offset-i.startOffset;if(yd(i,o,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(vd(i.data,o,t))break;e.next()}}return e.position}(o,i):function(e,t,i){const o=e.position.textNode;if(o){const n=o.data;let r=e.position.offset-o.startOffset;for(;Go(n,r)||"character"==t&&Ko(n,r)||i&&Qo(n,r);)e.next(),r=e.position.offset-o.startOffset}return e.position}(o,n,s);if(a==(i?"elementStart":"elementEnd")){if(r.isSelectable(c))return Da._createAt(c,i?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(c))return void o.skip((()=>!0));if(r.checkChild(l,"$text"))return l}}function _d(e,t){const i=e.root,o=Da._createAt(i,t?"end":0);return t?new Ua(e,o):new Ua(o,e)}function vd(e,t,i){const o=t+(i?0:-1);return bd.includes(e.charAt(o))}function yd(e,t,i){return t===(i?e.offsetSize:0)}class xd extends(j()){constructor(){var e;super(),this.markers=new ed,this.document=new Jl(this),this.schema=new Fc,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((e=>this.decorate(e))),this.on("applyOperation",((e,t)=>{t[0]._validate()}),{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(((e,t)=>{if("$marker"===t.name)return!0})),(e=this).document.registerPostFixer((t=>function(e,t){const i=t.document.selection,o=t.schema,n=[];let r=!1;for(const e of i.getRanges()){const t=Lc(e,o);t&&!t.isEqual(e)?(n.push(t),r=!0):n.push(e)}return r&&e.setSelection(function(e){const t=[...e],i=new Set;let o=1;for(;o!i.has(t)))}(n),{backward:i.isBackward}),!1}(t,e))),this.document.registerPostFixer(Ac),this.on("insertContent",((e,[t,i])=>{e.return=function(e,t,i){return e.change((o=>{const n=i||e.document.selection;n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});const r=new kd(e,o,n.anchor),s=[];let a;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[i,o]of t.markers){const{start:t,end:n}=o,r=t.isEqual(n);e.push({position:t,name:i,isCollapsed:r},{position:n,name:i,isCollapsed:r})}e.sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:i,name:n,isCollapsed:r}of e){let e=null,a=null;const c=i.parent===t&&i.isAtStart,l=i.parent===t&&i.isAtEnd;c||l?r&&(a=c?"start":"end"):(e=o.createElement("$marker"),o.insert(e,i)),s.push({name:n,element:e,collapsed:a})}}a=t.getChildren()}else a=[t];r.handleNodes(a);let c=r.getSelectionRange();if(t.is("documentFragment")&&s.length){const e=c?oc.fromRange(c):null,t={};for(let e=s.length-1;e>=0;e--){const{name:i,element:n,collapsed:a}=s[e],c=!t[i];if(c&&(t[i]=[]),n){const e=o.createPositionAt(n,"before");t[i].push(e),o.remove(n)}else{const e=r.getAffectedRange();if(!e){a&&t[i].push(r.position);continue}a?t[i].push(e[a]):t[i].push(c?e.start:e.end)}}for(const[e,[i,n]]of Object.entries(t))i&&n&&i.root===n.root&&i.root.document&&!o.model.markers.has(e)&&o.addMarker(e,{usingOperation:!0,affectsData:!0,range:new Ua(i,n)});e&&(c=e.toRange(),e.detach())}c&&(n instanceof ac?o.setSelection(c):n.setTo(c));const l=r.getAffectedRange()||e.createRange(n.anchor);return r.destroy(),l}))}(this,t,i)})),this.on("insertObject",((e,[t,i,o])=>{e.return=function(e,t,i,o={}){if(!e.schema.isObject(t))throw new k("insertobject-element-not-an-object",e,{object:t});const n=i||e.document.selection;let r=n;o.findOptimalPosition&&e.schema.isBlock(t)&&(r=e.createSelection(e.schema.findOptimalInsertionRange(n,o.findOptimalPosition)));const s=Uo(n.getSelectedBlocks()),a={};return s&&Object.assign(a,e.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),e.change((i=>{r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});let n=t;const s=r.anchor.parent;!e.schema.checkChild(s,t)&&e.schema.checkChild(s,"paragraph")&&e.schema.checkChild("paragraph",t)&&(n=i.createElement("paragraph"),i.insert(t,n)),e.schema.setAllowedAttributes(n,a,i);const c=e.insertContent(n,r);return c.isCollapsed||o.setSelection&&function(e,t,i,o){const n=e.model;if("on"==i)return void e.setSelection(t,"on");if("after"!=i)throw new k("insertobject-invalid-place-parameter-value",n);let r=t.nextSibling;n.schema.isInline(t)?e.setSelection(t,"after"):(!(r&&n.schema.checkChild(r,"$text"))&&n.schema.checkChild(t.parent,"paragraph")&&(r=e.createElement("paragraph"),n.schema.setAllowedAttributes(r,o,e),n.insertContent(r,e.createPositionAfter(t))),r&&e.setSelection(r,0))}(i,t,o.setSelection,a),c}))}(this,t,i,o)})),this.on("canEditAt",(e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()}))}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new $l,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){k.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new $l):e instanceof $l||(e=new $l(e)):e=new $l,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){k.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...o){const n=Ad(t,i);return this.fire("insertContent",[e,n,i,...o])}insertObject(e,t,i,o,...n){const r=Ad(t,i);return this.fire("insertObject",[e,r,o,o,...n])}deleteContent(e,t){dd(this,e,t)}modifySelection(e,t){!function(e,t,i={}){const o=e.schema,n="backward"!=i.direction,r=i.unit?i.unit:"character",s=!!i.treatEmojiAsSingleUnit,a=t.focus,c=new Oa({boundaries:_d(a,n),singleCharacters:!0,direction:n?"forward":"backward"}),l={walker:c,schema:o,isForward:n,unit:r,treatEmojiAsSingleUnit:s};let d;for(;d=c.next();){if(d.done)return;const i=wd(l,d.value);if(i)return void(t instanceof ac?e.change((e=>{e.setSelectionFocus(i)})):t.setFocus(i))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change((e=>{const i=e.createDocumentFragment(),o=t.getFirstRange();if(!o||o.isCollapsed)return i;const n=o.start.root,r=o.start.getCommonPath(o.end),s=n.getNodeByPath(r);let a;a=o.start.parent==o.end.parent?o:e.createRange(e.createPositionAt(s,o.start.path[r.length]),e.createPositionAt(s,o.end.path[r.length]+1));const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),i):e.append(e.cloneElement(t,!0),i);if(a!=o){const t=o._getTransformedByMove(a.start,e.createPositionAt(i,0),c)[0],n=e.createRange(e.createPositionAt(i,0),t.start);fd(e.createRange(t.end,e.createPositionAt(i,"end")),e),fd(n,e)}return i}))}(this,e)}hasContent(e,t={}){const i=e instanceof Ua?e:Ua._createIn(e);if(i.isCollapsed)return!1;const{ignoreWhitespaces:o=!1,ignoreMarkers:n=!1}=t;if(!n)for(const e of this.markers.getMarkersIntersectingRange(i))if(e.affectsData)return!0;for(const e of i.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!o)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}canEditAt(e){const t=Ad(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new Da(e,t,i)}createPositionAt(e,t){return Da._createAt(e,t)}createPositionAfter(e){return Da._createAfter(e)}createPositionBefore(e){return Da._createBefore(e)}createRange(e,t){return new Ua(e,t)}createRangeIn(e){return Ua._createIn(e)}createRangeOn(e){return Ua._createOn(e)}createSelection(...e){return new Ya(...e)}createBatch(e){return new $l(e)}createOperationFromJSON(e){return Ml.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new nd(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function Ad(e,t){if(e)return e instanceof Ya||e instanceof ac?e:e instanceof Ia?t||0===t?new Ya(e,t):e.is("rootElement")?new Ya(e,"in"):new Ya(e,"on"):new Ya(e)}class Cd extends js{constructor(){super(...arguments),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Td extends js{constructor(){super(...arguments),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Ed{constructor(e){this.document=e}createDocumentFragment(e){return new es(this.document,e)}createElement(e,t,i){return new xr(this.document,e,t,i)}createText(e){return new Zn(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const i=e.parent;if(i){const o=i.getChildIndex(e);return this.removeChildren(o,1,i),this.insertChild(o,t,i),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new xr(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){be(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return Pr._createAt(e,t)}createPositionAfter(e){return Pr._createAfter(e)}createPositionBefore(e){return Pr._createBefore(e)}createRange(e,t){return new Vr(e,t)}createRangeOn(e){return Vr._createOn(e)}createRangeIn(e){return Vr._createIn(e)}createSelection(...e){return new Lr(...e)}}const Sd=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Md=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Id=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Pd=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Vd=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Nd=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,Ld=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","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function Od(e){return e.startsWith("#")?Sd.test(e):e.startsWith("rgb")?Md.test(e)||Id.test(e):e.startsWith("hsl")?Pd.test(e)||Vd.test(e):Ld.has(e.toLowerCase())}const Rd=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;const Dd=/^[+-]?[0-9]*([.][0-9]+)?%$/;const Bd=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const zd=["center","top","bottom","left","right"];function jd(e){return zd.includes(e)}const Fd=["fixed","scroll","local"];function Hd(e){return Fd.includes(e)}const Ud=/^url\(/;function $d(e){return Ud.test(e)}function qd(e){e.setNormalizer("background",(e=>{const t={},i=function(e){const t=e.matchAll(Nd);return Array.from(t).map((e=>e[0]))}(e);for(const e of i)o=e,Bd.includes(o)?(t.repeat=t.repeat||[],t.repeat.push(e)):jd(e)?(t.position=t.position||[],t.position.push(e)):Hd(e)?t.attachment=e:Od(e)?t.color=e:$d(e)&&(t.image=e);var o;return{path:"background",value:t}})),e.setNormalizer("background-color",(e=>({path:"background.color",value:e}))),e.setReducer("background",(e=>{const t=[];return t.push(["background-color",e.color]),t})),e.setStyleRelation("background",["background-color"])}class Wd{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new k("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class Zd extends qo{constructor(e){super(),this.editor=e}set(e,t,i={}){if("string"==typeof t){const e=t;t=(t,i)=>{this.editor.execute(e),i()}}super.set(e,t,i)}}const Gd="contentEditing",Kd="common";class Yd{constructor(e){this.keystrokeInfos=new Map,this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:Gd,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const o=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&o.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:o}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:o}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:Kd}),o&&o.forEach((t=>{this.addKeystrokeInfoGroup({categoryId:e,...t})}))}addKeystrokeInfoGroup({categoryId:e=Gd,id:t,label:i,keystrokes:o}){const n=this.keystrokeInfos.get(e);if(!n)throw new k("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});n.groups.set(t,{id:t,label:i,keystrokes:o||[]})}addKeystrokeInfos({categoryId:e=Gd,groupId:t=Kd,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new k("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const o=this.keystrokeInfos.get(e);if(!o.groups.has(t))throw new k("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});o.groups.get(t).keystrokes.push(...i)}}class Qd extends(j()){constructor(e={}){super();const t=this.constructor,{translations:i,...o}=t.defaultConfig||{},{translations:n=i,...r}=e,s=e.language||o.language;this._context=e.context||new On({language:s,translations:n}),this._context._addEditor(this,!e.context);const a=Array.from(t.builtinPlugins||[]);this.config=new Mi(r,o),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),this.plugins=new Ln(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new Wd,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new xd,this.on("change:isReadOnly",(()=>{this.model.document.isReadOnly=this.isReadOnly}));const c=new _r;this.data=new rl(this.model,c),this.editing=new Dc(this.model,c),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new sl([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 Zd(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new Yd(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new k("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new k("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new k("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],n=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(o),i,n)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise((e=>this.once("ready",e)))),e.then((()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()})).then((()=>this.plugins.destroy())).then((()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})).then((()=>this._context._removeEditor(this)))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(e){k.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}}function Jd(e){return class extends e{updateSourceElement(e){if(!this.sourceElement)throw new k("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),i=this.sourceElement instanceof HTMLTextAreaElement;if(!t&&!i)return void Yi(this.sourceElement,"");const o="string"==typeof e?e:this.data.get();Yi(this.sourceElement,o)}}}Jd.updateSourceElement=Jd(Object).prototype.updateSourceElement;class Xd extends Rn{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Ho({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new k("pendingactions-add-invalid-message",this);const t=new(j());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const eu={bold:'',cancel:'',caption:'',check:'',cog:'',colorPalette:'',eraser:'',history:'',image:'',imageUpload:'',imageAssetManager:'',imageUrl:'',lowVision:'',textAlternative:'',loupe:'',previousArrow:'',nextArrow:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeCustom:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:'',dragIndicator:'',redo:'',undo:'',bulletedList:'',numberedList:'',todoList:'',codeBlock:'',browseFiles:'',heading1:'',heading2:'',heading3:'',heading4:'',heading5:'',heading6:'',horizontalLine:'',html:'',indent:'',outdent:'',table:''};var tu=n(4606);yn()(tu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),tu.A.locals;class iu extends An{constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${m()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class ou extends An{constructor(e,t){super(e);const i=e.t,o=new iu;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[de(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map((e=>{const t=[de(document,"h3",{},e.label),...Array.from(e.groups.values()).map((e=>this._createGroup(e))).flat()];return e.description&&t.splice(1,0,de(document,"p",{},e.description)),de(document,"section",{},t)}))}_createGroup(e){const t=e.keystrokes.sort(((e,t)=>e.label.localeCompare(t.label))).map((e=>this._createGroupRow(e))).flat(),i=[de(document,"dl",{},t)];return e.label&&i.unshift(de(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=de(document,"dt"),o=de(document,"dd"),n="string"==typeof(a=e.keystroke)?[[a]]:"string"==typeof a[0]?[a]:a,s=[];var a;for(const e of n)s.push(e.map(nu).join(""));return i.innerHTML=e.label,o.innerHTML=s.join(", ")+(e.mayRequireFn&&r.isMac?` ${t("(may require Fn)")}`:""),[i,o]}}function nu(e){return xo(e).split("+").map((e=>`${e}`)).join("+")}const ru='';var su=n(9550);yn()(su.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),su.A.locals;class au extends Mn{constructor(){super(...arguments),this.contentView=null}static get requires(){return[bm]}static get pluginName(){return"AccessibilityHelp"}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",(()=>{const e=this._createButton(gu);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e})),e.ui.componentFactory.add("menuBar:accessibilityHelp",(()=>{const e=this._createButton($g);return e.label=t("Accessibility"),e})),e.keystrokes.set("Alt+0",((e,t)=>{this._showDialog(),t()})),this._setupRootLabels()}_createButton(e){const t=new e(this.editor.locale);return t.set({keystroke:"Alt+0",icon:ru}),t.on("execute",(()=>this._showDialog())),t}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;function o(e,t){const o=`${t.getAttribute("aria-label")}. ${i("Press %0 for help.",[xo("Alt+0")])}`;e.setAttribute("aria-label",o,t)}e.ui.on("ready",(()=>{t.change((e=>{for(const i of t.document.roots)o(e,i)})),e.on("addRoot",((i,n)=>{const r=e.editing.view.document.getRoot(n.rootName);t.change((e=>o(e,r)))}),{priority:"low"})}))}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new ou(e.locale,e.accessibility.keystrokeInfos)),t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:ru,hasCloseButton:!0,content:this.contentView})}}class cu extends Jo{constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new Xo({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=de(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}var lu=n(4106);yn()(lu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),lu.A.locals;class du extends An{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",(e=>!e)),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",(()=>{this._updateXMLContent(),this._colorFillPaths()})),this.on("change:fillColor",(()=>{this._colorFillPaths()}))}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:t,value:i}of Array.from(e.attributes))du.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,i);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((e=>{e.style.fill=this.fillColor}))}}du.presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];const uu=du;class hu extends An{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}var mu=n(8948);yn()(mu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mu.A.locals;class gu extends An{constructor(e,t=new hu){super(e),this._focusDelayed=null;const i=this.bindTemplate,o=m();this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new uu,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));const n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",(e=>!e)),i.if("isVisible","ck-hidden",(e=>!e)),i.to("isOn",(e=>e?"ck-on":"ck-off")),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",(e=>e||"button")),tabindex:i.to("tabindex"),"aria-checked":i.to("ariaChecked"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,(e=>!e)),"aria-pressed":i.to("isOn",(e=>!!this.isToggleable&&String(!!e))),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to((e=>{this.isEnabled?this.fire("execute"):e.preventDefault()}))}};r.isSafari&&(this._focusDelayed||(this._focusDelayed=Zo((()=>this.focus()),0)),n.on.mousedown=i.to((()=>{this._focusDelayed()})),n.on.mouseup=i.to((()=>{this._focusDelayed.cancel()}))),this.setTemplate(n)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new An;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(e=>xo(e)))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(i=xo(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}var pu=n(9624);yn()(pu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pu.A.locals;class fu extends gu{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new An;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class ku extends gu{constructor(e){super(e),this.buttonView=this,this._fileInputView=new bu(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",(()=>{this._fileInputView.open()})),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}class bu extends An{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to((()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""}))}})}open(){this.element.click()}}const wu='';var _u=n(1750);yn()(_u.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_u.A.locals;class vu extends An{constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new gu(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:wu}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",(e=>!e)),e.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),e}}function yu(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class xu extends gu{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",(e=>r.isMediaForcedColors?null:e))},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}var Au=n(7962);yn()(Au.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Au.A.locals;class Cu extends An{constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t&&t.columns?t.columns:5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new $o,this.keystrokes=new qo,this.items.on("add",((e,t)=>{t.isOn=t.color===this.selectedColor})),i.forEach((e=>{const t=new xu;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",(()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})})),this.items.add(t)})),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",((e,t,i)=>{for(const e of this.items)e.isOn=e.color===i}))}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",((e,t)=>{this.focusTracker.add(t.element)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t.element)})),this.keystrokes.listenTo(this.element),Sn({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}var Tu=n(8156);const Eu=function(e){var t,i,o=[],n=1;if("string"==typeof e)if(Tu[e])o=Tu[e].slice(),i="rgb";else if("transparent"===e)n=0,i="rgb",o=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var r=e.slice(1);n=1,(c=r.length)<=4?(o=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],4===c&&(n=parseInt(r[3]+r[3],16)/255)):(o=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],8===c&&(n=parseInt(r[6]+r[7],16)/255)),o[0]||(o[0]=0),o[1]||(o[1]=0),o[2]||(o[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var s=t[1],a="rgb"===s;i=r=s.replace(/a$/,"");var c="cmyk"===r?4:"gray"===r?1:3;o=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===c?parseFloat(e)/100:"rgb"===r?255*parseFloat(e)/100:parseFloat(e);if("h"===r[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==Su[e])return Su[e]}return parseFloat(e)})),s===r&&o.push(1),n=a||void 0===o[c]?1:o[c],o=o.slice(0,c)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(o=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(o=[e[0],e[1],e[2]],i="rgb",n=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(i="rgb",o=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",o=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),n=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(n/=100)):(i="rgb",o=[e>>>16,(65280&e)>>>8,255&e]);return{space:i,values:o,alpha:n}};var Su={red:0,orange:60,yellow:120,green:180,blue:240,purple:300},Mu=n(8847),Iu=n.t(Mu,2);function Pu(e,t){if(!e)return"";const i=Vu(e);if(!i)return"";if(i.space===t)return e;if(o=i,!Object.keys(Iu).includes(o.space))return"";var o;const n=Iu[i.space][t];return n?function(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb( ${e[0]}, ${e[1]}, ${e[2]} )`;case"hsl":return`hsl( ${e[0]}, ${e[1]}%, ${e[2]}% )`;case"hwb":return`hwb( ${e[0]}, ${e[1]}, ${e[2]} )`;case"lab":return`lab( ${e[0]}% ${e[1]} ${e[2]} )`;case"lch":return`lch( ${e[0]}% ${e[1]} ${e[2]} )`;default:return""}}(n("hex"===i.space?i.hexValue:i.values),t):""}function Vu(e){if(e.startsWith("#")){const t=Eu(e);return{space:"hex",values:t.values,hexValue:e,alpha:t.alpha}}const t=Eu(e);return t.space?t:null}var Nu=n(6365);yn()(Nu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Nu.A.locals;class Lu extends An{constructor(e,t){super(e);const i=`ck-labeled-field-view-${m()}`,o=`ck-labeled-field-view-status-${m()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",((e,t)=>e||t));const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",(e=>!e)),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new iu(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new An(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",(e=>!e))],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Ou extends An{constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new $o,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to(((...e)=>{this.fire("input",...e),this._updateIsEmpty()})),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}var Ru=n(1546);yn()(Ru.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ru.A.locals;class Du extends Ou{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Bu extends Du{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}var zu=n(8368);yn()(zu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),zu.A.locals;class ju extends An{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",(e=>`ck-dropdown__panel_${e}`)),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(){if(this.children.length){const e=this.children.first;"function"==typeof e.focus?e.focus():b("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}var Fu=n(426);yn()(Fu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Fu.A.locals;class Hu extends An{constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new qo,this.focusTracker=new $o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",(e=>!e))],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen})),this.on("change:isOpen",((e,t,i)=>{if(i)if("auto"===this.panelPosition){const e=Hu._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._panelPositions[0].name}else this.panelView.position=this.panelPosition})),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",((e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())})),this.keystrokes.set("arrowright",((e,t)=>{this.isOpen&&t()})),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:o,northEast:n,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=Hu.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,o,s,a,e,n,r,c,l,t]:[o,i,a,s,e,r,n,l,c,t]}}Hu.defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})},Hu._getOptimalPosition=io;const Uu=Hu;class $u extends gu{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e)))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new uu;return e.content=wu,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class qu extends(C()){constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];"string"==typeof i&&(i=[i]);for(const o of i)e.keystrokeHandler.set(o,((e,i)=>{this[t](),i()}))}this.on("forwardCycle",(()=>this.focusFirst()),{priority:"low"}),this.on("backwardCycle",(()=>this.focusLast()),{priority:"low"})}get first(){return this.focusables.find(Wu)||null}get last(){return this.focusables.filter(Wu).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((t,i)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o})),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;e&&this.focusables.getIndex(e)===this.current||e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;e&&this.focusables.getIndex(e)===this.current||e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(null===i)return this[1===e?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{const i=this.focusables.get(n);if(Wu(i)){o=i;break}n=(n+t+e)%t}while(n!==i);return o}}function Wu(e){return Zu(e)&&to(e.element)}function Zu(e){return!(!("focus"in e)||"function"!=typeof e.focus)}class Gu extends An{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Ku extends An{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Yu(e){if(Array.isArray(e))return{items:e,removeItems:[]};const t={items:[],removeItems:[]};return e?{...t,...e}:t}var Qu=n(66);yn()(Qu.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Qu.A.locals;const Ju={alignLeft:eu.alignLeft,bold:eu.bold,importExport:eu.importExport,paragraph:eu.paragraph,plus:eu.plus,text:eu.text,threeVerticalDots:eu.threeVerticalDots,pilcrow:eu.pilcrow,dragIndicator:eu.dragIndicator};class Xu extends An{constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new $o,this.keystrokes=new qo,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new eh(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n="rtl"===e.uiLanguageDirection;this._focusCycler=new qu({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var s;this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(s=this,s.bindTemplate.to((e=>{e.target===s.element&&e.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new ih(this):new th(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",((e,t)=>{this.focusTracker.add(t.element)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t.element)})),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}_buildItemsFromConfig(e,t,i){const o=Yu(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map((e=>N(e)?this._createNestedToolbarDropdown(e,t,n):"|"===e?new Gu:"-"===e?new Ku:t.create(e))).filter((e=>!!e))}_cleanItemsConfiguration(e,t,i){const o=e.filter(((e,o,n)=>"|"===e||-1===i.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(b("toolbarview-line-break-ignored-when-grouping-items",n),!1):!(!N(e)&&!t.has(e)&&(b("toolbarview-item-unavailable",{item:e}),1)))));return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,i=e.length,o=e.findIndex(t);if(-1===o)return[];const n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter(((e,i,o)=>!!t(e)||!(i>0&&o[i-1]===e)))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:r,tooltip:s=!0,withText:a=!1}=e;if(r=this._cleanItemsConfiguration(r,t,i),!r.length)return null;const c=hh(this.locale);return o||b("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:o,tooltip:s,withText:!!a}),!1!==n?c.buttonView.icon=Ju[n]||n||eu.threeVerticalDots:c.buttonView.withText=!0,mh(c,(()=>c.toolbarView._buildItemsFromConfig(r,t,i))),c}}class eh extends An{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class th{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using((e=>e)),e.focusables.bindTo(e.items).using((e=>Zu(e)?e:null)),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class ih{constructor(e){this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using((e=>e)),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",((e,t)=>{const i=t.index,o=Array.from(t.added);for(const e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;ethis.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,e)}this._updateGrouping()})),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!to(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,i=this.viewLocale.uiLanguageDirection,o=new Ui(e.lastChild),n=new Ui(e);if(!this.cachedPadding){const o=t.window.getComputedStyle(e),n="ltr"===i?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[n])}return"ltr"===i?o.right>n.right-this.cachedPadding:o.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Gu),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,i=hh(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",mh(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:eu.threeVerticalDots}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((e=>{Zu(e)&&this.viewFocusables.add(e)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class oh extends An{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",(e=>!e))],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class nh extends An{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class rh extends An{constructor(e,t=new iu){super(e);const i=this.bindTemplate,o=new ah(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",(e=>!e))]},children:this.children})}focus(){if(this.items){const e=this.items.find((e=>!(e instanceof nh)));e&&e.focus()}}}var sh=n(6048);yn()(sh.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),sh.A.locals;class ah extends An{constructor(e){super(e),this._listItemGroupToChangeListeners=new WeakMap;const t=this.bindTemplate;this.focusables=new Jo,this.items=this.createCollection(),this.focusTracker=new $o,this.keystrokes=new qo,this._focusCycler=new qu({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof rh?this._registerFocusableItemsGroup(e):e instanceof oh&&this._registerFocusableListItem(e);this.items.on("change",((e,t)=>{for(const e of t.removed)e instanceof rh?this._deregisterFocusableItemsGroup(e):e instanceof oh&&this._deregisterFocusableListItem(e);for(const e of Array.from(t.added).reverse())e instanceof rh?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const e of i.removed)this._deregisterFocusableListItem(e);for(const t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach(((e,i)=>{const o=void 0!==t?t+i:void 0;this._registerFocusableListItem(e,o)}));const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}var ch=n(7133);yn()(ch.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ch.A.locals;class lh extends An{constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new qo,this.focusTracker=new $o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",(e=>!e)),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",((e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())})),this.keystrokes.set("arrowleft",((e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new gu;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new gu,t=e.bindTemplate;return e.icon=wu,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}var dh=n(7475);yn()(dh.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),dh.A.locals;var uh=n(2454);function hh(e,i=$u){const o="function"==typeof i?new i(e):i,n=new ju(e),r=new Uu(e,o,n);return o.bind("isEnabled").to(r),o instanceof lh?o.arrowView.bind("isOn").to(r,"isOpen"):o.bind("isOn").to(r,"isOpen"),function(e){(function(e){e.on("render",(()=>{Cn({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...e.focusTracker._elements]})}))})(e),function(e){e.on("execute",(t=>{t.source instanceof fu||(e.isOpen=!1)}))}(e),function(e){e.focusTracker.on("change:isFocused",((t,i,o)=>{e.isOpen&&!o&&(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",((t,i)=>{e.isOpen&&(e.panelView.focus(),i())})),e.keystrokes.set("arrowup",((t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())}))}(e),function(e){e.on("change:isOpen",((i,o,n)=>{if(n)return;const r=e.panelView.element;r&&r.contains(t.document.activeElement)&&e.buttonView.focus()}))}(e),function(e){e.on("change:isOpen",((t,i,o)=>{o&&e.panelView.focus()}),{priority:"low"})}(e)}(r),r}function mh(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?gh(e,t,i):e.once("change:isOpen",(()=>gh(e,t,i)),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&kh(e,(()=>e.toolbarView.items.find((e=>e.isOn))))}function gh(e,t,i){const o=e.locale,n=o.t,r=e.toolbarView=new Xu(o),s="function"==typeof t?t():t;r.ariaLabel=i.ariaLabel||n("Dropdown toolbar"),i.maxWidth&&(r.maxWidth=i.maxWidth),i.class&&(r.class=i.class),i.isCompact&&(r.isCompact=i.isCompact),i.isVertical&&(r.isVertical=!0),s instanceof Jo?r.items.bindTo(s).using((e=>e)):r.items.addMany(s),e.panelView.children.add(r),r.items.delegate("execute").to(e)}function ph(e,t,i={}){e.isOpen?fh(e,t,i):e.once("change:isOpen",(()=>fh(e,t,i)),{priority:"highest"}),kh(e,(()=>e.listView.items.find((e=>e instanceof oh&&e.children.first.isOn))))}function fh(e,t,i){const o=e.locale,n=e.listView=new ah(o),r="function"==typeof t?t():t;n.ariaLabel=i.ariaLabel,n.role=i.role,bh(e,n.items,r,o),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function kh(e,t){e.on("change:isOpen",(()=>{if(!e.isOpen)return;const i=t();i&&("function"==typeof i.focus?i.focus():b("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))}),{priority:g.low-10})}function bh(e,t,i,o){t.bindTo(i).using((t=>{if("separator"===t.type)return new nh(o);if("group"===t.type){const i=new rh(o);return i.set({label:t.label}),bh(e,i.items,t.items,o),i.items.delegate("execute").to(e),i}if("button"===t.type||"switchbutton"===t.type){const e=new oh(o);let i;return"button"===t.type?(i=new gu(o),i.bind("ariaChecked").to(i,"isOn")):i=new fu(o),i.bind(...Object.keys(t.model)).to(t.model),i.delegate("execute").to(e),e.children.add(i),e}return null}))}yn()(uh.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),uh.A.locals;const wh=(e,t,i)=>{const o=new Bu(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),o.bind("hasError").to(e,"errorText",(e=>!!e)),o.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(o),o},_h=(e,t=0,i=1)=>e>i?i:eMath.round(i*e)/i,yh=(Math.PI,e=>("#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?vh(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?vh(parseInt(e.substring(6,8),16)/255,2):1})),xh=e=>{const{h:t,s:i,l:o}=(({h:e,s:t,v:i,a:o})=>{const n=(200-t)*i/100;return{h:vh(e),s:vh(n>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0),l:vh(n/2),a:vh(o,2)}})(e);return`hsl(${t}, ${i}%, ${o}%)`},Ah=e=>{const t=e.toString(16);return t.length<2?"0"+t:t},Ch=(e,t)=>{if(e===t)return!0;for(const i in e)if(e[i]!==t[i])return!1;return!0},Th={},Eh=e=>{let t=Th[e];return t||(t=document.createElement("template"),t.innerHTML=e,Th[e]=t),t},Sh=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))};let Mh=!1;const Ih=e=>"touches"in e,Ph=(e,t)=>{const i=Ih(t)?t.touches[0]:t,o=e.el.getBoundingClientRect();Sh(e.el,"move",e.getMove({x:_h((i.pageX-(o.left+window.pageXOffset))/o.width),y:_h((i.pageY-(o.top+window.pageYOffset))/o.height)}))};class Vh{constructor(e,t,i,o){const n=Eh(`
`);e.appendChild(n.content.cloneNode(!0));const r=e.querySelector(`[part=${t}]`);r.addEventListener("mousedown",this),r.addEventListener("touchstart",this),r.addEventListener("keydown",this),this.el=r,this.xy=o,this.nodes=[r.firstChild,r]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(Mh?"touchmove":"mousemove",this),t(Mh?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!(e=>!(Mh&&!Ih(e)||(Mh||(Mh=Ih(e)),0)))(e)||!Mh&&0!=e.button)return;this.el.focus(),Ph(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),Ph(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((e,t)=>{const i=t.keyCode;i>40||e.xy&&i<37||i<33||(t.preventDefault(),Sh(e.el,"move",e.getMove({x:39===i?.01:37===i?-.01:34===i?.05:33===i?-.05:35===i?1:36===i?-1:0,y:40===i?.01:38===i?-.01:0},!0)))})(this,e)}}style(e){e.forEach(((e,t)=>{for(const i in e)this.nodes[t].style.setProperty(i,e[i])}))}}class Nh extends Vh{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:e/360*100+"%",color:xh({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${vh(e)}`)}getMove(e,t){return{h:t?_h(this.h+360*e.x,0,360):360*e.x}}}class Lh extends Vh{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:100-e.v+"%",left:`${e.s}%`,color:xh(e)},{"background-color":xh({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${vh(e.s)}%, Brightness ${vh(e.v)}%`)}getMove(e,t){return{s:t?_h(this.hsva.s+100*e.x,0,100):100*e.x,v:t?_h(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const Oh=Symbol("same"),Rh=Symbol("color"),Dh=Symbol("hsva"),Bh=Symbol("update"),zh=Symbol("parts"),jh=Symbol("css"),Fh=Symbol("sliders");class Hh extends HTMLElement{static get observedAttributes(){return["color"]}get[jh](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[Fh](){return[Lh,Nh]}get color(){return this[Rh]}set color(e){if(!this[Oh](e)){const t=this.colorModel.toHsva(e);this[Bh](t),this[Rh]=e}}constructor(){super();const e=Eh(``),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[zh]=this[Fh].map((e=>new e(t)))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,i){const o=this.colorModel.fromAttr(i);this[Oh](o)||(this.color=o)}handleEvent(e){const t=this[Dh],i={...t,...e.detail};let o;this[Bh](i),Ch(i,t)||this[Oh](o=this.colorModel.fromHsva(i))||(this[Rh]=o,Sh(this,"color-changed",{value:o}))}[Oh](e){return this.color&&this.colorModel.equal(e,this.color)}[Bh](e){this[Dh]=e,this[zh].forEach((t=>t.update(e)))}}const Uh={defaultColor:"#000",toHsva:e=>(({r:e,g:t,b:i,a:o})=>{const n=Math.max(e,t,i),r=n-Math.min(e,t,i),s=r?n===e?(t-i)/r:n===t?2+(i-e)/r:4+(e-t)/r:0;return{h:vh(60*(s<0?s+6:s)),s:vh(n?r/n*100:0),v:vh(n/255*100),a:o}})(yh(e)),fromHsva:({h:e,s:t,v:i})=>(({r:e,g:t,b:i,a:o})=>{const n=o<1?Ah(vh(255*o)):"";return"#"+Ah(e)+Ah(t)+Ah(i)+n})((({h:e,s:t,v:i,a:o})=>{e=e/360*6,t/=100,i/=100;const n=Math.floor(e),r=i*(1-t),s=i*(1-(e-n)*t),a=i*(1-(1-e+n)*t),c=n%6;return{r:vh(255*[i,s,r,r,a,i][c]),g:vh(255*[a,i,i,s,r,r][c]),b:vh(255*[r,r,a,i,i,s][c]),a:vh(o,2)}})({h:e,s:t,v:i,a:1})),equal:(e,t)=>e.toLowerCase()===t.toLowerCase()||Ch(yh(e),yh(t)),fromAttr:e=>e};class $h extends Hh{get colorModel(){return Uh}}var qh=n(3086);yn()(qh.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qh.A.locals;class Wh extends An{constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=Xs((e=>{this.set("color",e),this.fire("colorSelected",{color:this.color})}),150,{leading:!0}),this.on("set:color",((e,t,i)=>{e.return=Pu(i,this._config.format||"hsl")})),this.on("change:color",(()=>{this._hexColor=Zh(this.color)})),this.on("change:_hexColor",(()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),Zh(this.color)!=Zh(this._hexColor)&&(this.color=this._hexColor)}))}render(){var e,i;if(super.render(),e="hex-color-picker",i=$h,void 0===customElements.get(e)&&customElements.define(e,i),this.picker=t.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",(e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)}))}focus(){!this._config.hideInput&&(r.isGecko||r.isiOS||r.isSafari)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){const e=[...this.picker.shadowRoot.children].filter((e=>"slider"===e.getAttribute("role"))).map((e=>new Gh(e)));this.slidersView=this.createCollection(),e.forEach((e=>{this.slidersView.add(e)}))}_createInputRow(){const e=this._createColorInput();return new Yh(this.locale,e)}_createColorInput(){const e=new Lu(this.locale,wh),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",(t=>e.isFocused?e.fieldView.value:t.startsWith("#")?t.substring(1):t)),e.fieldView.on("input",(()=>{const t=e.fieldView.element.value;if(t){const e=Qh(t);e&&this._debounceColorPickerEvent(e)}})),e}isValid(){const{t:e}=this.locale;return this.resetValidationStatus(),!!this.hexInputRow.getParsedColor()||(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1)}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function Zh(e){let t=function(e){if(!e)return"";const t=Vu(e);return t?"hex"===t.space?t.hexValue:Pu(e,"hex"):"#000"}(e);return t||(t="#000"),4===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}class Gh extends An{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class Kh extends An{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class Yh extends An{constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new Kh,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return Qh(this.inputView.fieldView.element.value)}}function Qh(e){if(!e)return null;const t=e.trim().replace(/^#/,"");return[3,4,6,8].includes(t.length)&&/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?`#${t}`:null}class Jh extends(j(Ho)){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",(()=>{this.set("isEmpty",0===this.length)}))}add(e,t){return this.find((t=>t.color===e.color))?this:super.add(e,t)}hasColor(e){return!!this.find((t=>t.color===e))}}const{eraser:Xh,colorPalette:em}=eu;class tm extends An{constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:s,focusTracker:a,focusables:c}){super(e);const l=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new Jh,this.documentColorsCount=r,this._focusables=c,this._removeButtonLabel=o,this._colorPickerLabel=s,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",l.if("isVisible","ck-hidden",(e=>!e))]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRoots()){const i=e.createRangeIn(n);for(const e of i.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=Xo.bind(this.documentColors,this.documentColors),t=new iu(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new gu,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:em,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",(()=>{this.fire("colorPicker:show")}))}_createRemoveColorButton(){const e=new gu;return e.set({withText:!0,icon:Xh,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",(()=>{this.fire("execute",{value:null,source:"removeColorButton"})})),e.render(),e}_createStaticColorsGrid(){const e=new Cu(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",((e,t)=>{this.fire("execute",{value:t.value,source:"staticColorsGrid"})})),e}_createDocumentColorsGrid(){const e=Xo.bind(this.documentColors,this.documentColors),t=new Cu(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using((e=>{const t=new xu;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",(()=>{this.fire("execute",{value:e.color,source:"documentColorsGrid"})})),t})),this.documentColors.on("change:isEmpty",((e,i,o)=>{o&&(t.selectedColor=null)})),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find((t=>t.color===e));t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class im extends An{constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;const r=this.bindTemplate,{saveButtonView:s,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=s,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:s,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",r.if("isVisible","ck-hidden",(e=>!e))]},children:this.items})}render(){super.render();const e=new Wh(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",((t,i,o)=>{e.color=o})),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",(e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())}))}_stopPropagationOnArrowsKeys(){const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const e of this.colorPickerView.slidersView)this.focusTracker.add(e.element),this._focusables.add(e);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new An,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new gu(e),o=new gu(e);return i.set({icon:eu.check,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:eu.cancel,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",(()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})})),o.on("execute",(()=>{this.fire("colorPicker:cancel")})),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",((e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)}))}}var om=n(2922);yn()(om.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),om.A.locals;class nm extends An{constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:s,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new $o,this.keystrokes=new qo,this._focusables=new Jo,this._colorPickerViewConfig=a,this._focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new tm(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:s,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new im(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",((e,t,i)=>{this.colorGridsFragmentView.set("selectedColor",i),this.colorPickerFragmentView.set("selectedColor",i)})),this.colorGridsFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.colorPickerFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){this.colorPickerFragmentView.colorPickerView&&!this._isColorPickerFragmentVisible&&(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){2!==this.items.length&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{this.showColorPickerFragment()})),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class rm{constructor(e){this._components=new Map,this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(sm(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new k("componentfactory-item-missing",this,{name:e});return this._components.get(sm(e)).callback(this.editor.locale)}has(e){return this._components.has(sm(e))}}function sm(e){return String(e).toLowerCase()}var am=n(4866);yn()(am.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),am.A.locals;class cm extends An{constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new uu,this.iconView.content=t.icon,this.children.add(this.iconView));const o=new An(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}}var lm=n(8091);yn()(lm.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),lm.A.locals;class dm extends An{constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new qo,this._focusTracker=new $o,this._focusables=new Jo,this.focusCycler=new qu({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const e=new gu(this.locale);let i;for(i in e.on("execute",(()=>t.onExecute())),t.onCreate&&t.onCreate(e),t)"onExecute"!=i&&"onCreate"!=i&&e.set(i,t[i]);this.children.add(e)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach((e=>{this._focusables.add(e),this._focusTracker.add(e.element)}))}}class um extends An{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}var hm=n(880);yn()(hm.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),hm.A.locals;const mm="screen-center",gm="editor-center",pm=Qi("px");class fm extends(function(e){return class extends e{constructor(...e){super(...e),this._onDragBound=this._onDrag.bind(this),this._onDragEndBound=this._onDragEnd.bind(this),this._lastDraggingCoordinates={x:0,y:0},this.on("render",(()=>{this._attachListeners()})),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(t.document,"mouseup",this._onDragEndBound),this.listenTo(t.document,"touchend",this._onDragEndBound),this.listenTo(t.document,"mousemove",this._onDragBound),this.listenTo(t.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(t.document,"mouseup",this._onDragEndBound),this.stopListening(t.document,"touchend",this._onDragEndBound),this.stopListening(t.document,"mousemove",this._onDragBound),this.stopListening(t.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:o},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging)return void this._detachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(o-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:o}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}}(An)){constructor(e,{getCurrentDomRoot:t,getViewportOffset:i}){super(e),this.wasMoved=!1;const o=this.bindTemplate,n=e.t;this.set("className",""),this.set("ariaLabel",n("Editor dialog")),this.set("isModal",!1),this.set("position",mm),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new qo,this.focusTracker=new $o,this._focusables=new Jo,this._focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",o.if("isModal","ck-dialog-overlay__transparent",(e=>!e)),o.if("_isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",o.to("className")],role:"dialog","aria-label":o.to("ariaLabel"),style:{top:o.to("_top",(e=>pm(e))),left:o.to("_left",(e=>pm(e))),visibility:o.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",((e,t)=>{this.fire("close",{source:"escKeyPress"}),t()})),this.on("drag",((e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)})),this.listenTo(t.window,"resize",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.listenTo(t.document,"scroll",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.on("change:_isVisible",((e,t,i)=>{i&&(this._isTransparent=!0,setTimeout((()=>{this.updatePosition(),this._isTransparent=!1,this.focus()}),10))})),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:n}){t&&(this.headerView=new cm(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),o&&(o instanceof An&&(o=[o]),this.contentView=new um(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),n&&(this.actionsView=new dm(this.locale),this.actionsView.setButtons(n),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e{var t;this._focusables.add(e),this.focusTracker.add(e.element),Zu(t=e)&&"focusCycler"in t&&t.focusCycler instanceof qu&&(this.listenTo(e.focusCycler,"forwardCycle",(e=>{this._focusCycler.focusNext(),this._focusCycler.next!==this._focusCycler.focusables.get(this._focusCycler.current)&&e.stop()})),this.listenTo(e.focusCycler,"backwardCycle",(e=>{this._focusCycler.focusPrevious(),this._focusCycler.previous!==this._focusCycler.focusables.get(this._focusCycler.current)&&e.stop()})))}))}_createCloseButton(){const e=new gu(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:eu.cancel}),e.on("execute",(()=>this.fire("close",{source:"closeButton"}))),e}}fm.defaultOffset=15;const km=fm;class bm extends Mn{static get pluginName(){return"Dialog"}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set("id",null),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}_initShowHideListeners(){this.on("show",((e,t)=>{this._show(t)})),this.on("show",((e,t)=>{t.onShow&&t.onShow(this)}),{priority:"low"}),this.on("hide",(()=>{bm._visibleDialogPlugin&&bm._visibleDialogPlugin._hide()})),this.on("hide",(()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)}),{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",((t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())}))}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",(()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const e of t)e.state&&this.view.updatePosition()}))}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:r,className:s,isModal:a,position:c,onHide:l}){const d=this.editor;this.view=new km(d.locale,{getCurrentDomRoot:()=>d.editing.view.getDomRoot(d.model.document.selection.anchor.root.rootName),getViewportOffset:()=>d.ui.viewportOffset});const u=this.view;u.on("close",(()=>{this.hide()})),d.ui.view.body.add(u),d.ui.focusTracker.add(u.element),d.keystrokes.listenTo(u.element),c||(c=a?mm:gm),u.set({position:c,_isVisible:!0,className:s,isModal:a}),u.setupParts({icon:t,title:i,hasCloseButton:o,content:n,actionButtons:r}),this.id=e,l&&(this._onHide=l),this.isOpen=!0,bm._visibleDialogPlugin=this}hide(){bm._visibleDialogPlugin&&bm._visibleDialogPlugin.fire(`hide:${bm._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,bm._visibleDialogPlugin=null}}var wm=n(5615);yn()(wm.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wm.A.locals;const _m=Qi("px"),vm=t.document.body,ym={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class xm extends An{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",(e=>`ck-balloon-panel_${e}`)),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",_m),left:t.to("left",_m)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=xm.defaultPositions,i=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast,t.viewportStickyNorth],limiter:vm,fitInViewport:!0},e),o=xm._getOptimalPosition(i)||ym,n=parseInt(o.left),r=parseInt(o.top),s=o.name,a=o.config||{},{withArrow:c=!0}=a;this.top=r,this.left=n,this.position=s,this.withArrow=c}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const i=Cm(e.target),o=e.limiter?Cm(e.limiter):vm;this.listenTo(t.document,"scroll",((t,n)=>{const r=n.target,s=i&&r.contains(i),a=o&&r.contains(o);!s&&!a&&i&&o||this.attachTo(e)}),{useCapture:!0}),this.listenTo(t.window,"resize",(()=>{this.attachTo(e)}))}_stopPinning(){this.stopListening(t.document,"scroll"),this.stopListening(t.window,"resize")}}xm.arrowSideOffset=25,xm.arrowHeightOffset=10,xm.stickyVerticalOffset=20,xm._getOptimalPosition=io,xm.defaultPositions=Tm();const Am=xm;function Cm(e){return Si(e)?e:ji(e)?e.commonAncestorContainer:"function"==typeof e?Cm(e()):null}function Tm(e={}){const{sideOffset:t=xm.arrowSideOffset,heightOffset:i=xm.arrowHeightOffset,stickyVerticalOffset:o=xm.stickyVerticalOffset,config:n}=e;return{northWestArrowSouthWest:(e,i)=>({top:r(e,i),left:e.left-t,name:"arrow_sw",...n&&{config:n}}),northWestArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.left-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northWestArrowSouth:(e,t)=>({top:r(e,t),left:e.left-t.width/2,name:"arrow_s",...n&&{config:n}}),northWestArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.left-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northWestArrowSouthEast:(e,i)=>({top:r(e,i),left:e.left-i.width+t,name:"arrow_se",...n&&{config:n}}),northArrowSouthWest:(e,i)=>({top:r(e,i),left:e.left+e.width/2-t,name:"arrow_sw",...n&&{config:n}}),northArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.left+e.width/2-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northArrowSouth:(e,t)=>({top:r(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...n&&{config:n}}),northArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.left+e.width/2-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northArrowSouthEast:(e,i)=>({top:r(e,i),left:e.left+e.width/2-i.width+t,name:"arrow_se",...n&&{config:n}}),northEastArrowSouthWest:(e,i)=>({top:r(e,i),left:e.right-t,name:"arrow_sw",...n&&{config:n}}),northEastArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.right-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northEastArrowSouth:(e,t)=>({top:r(e,t),left:e.right-t.width/2,name:"arrow_s",...n&&{config:n}}),northEastArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.right-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northEastArrowSouthEast:(e,i)=>({top:r(e,i),left:e.right-i.width+t,name:"arrow_se",...n&&{config:n}}),southWestArrowNorthWest:e=>({top:s(e),left:e.left-t,name:"arrow_nw",...n&&{config:n}}),southWestArrowNorthMiddleWest:(e,i)=>({top:s(e),left:e.left-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southWestArrowNorth:(e,t)=>({top:s(e),left:e.left-t.width/2,name:"arrow_n",...n&&{config:n}}),southWestArrowNorthMiddleEast:(e,i)=>({top:s(e),left:e.left-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southWestArrowNorthEast:(e,i)=>({top:s(e),left:e.left-i.width+t,name:"arrow_ne",...n&&{config:n}}),southArrowNorthWest:e=>({top:s(e),left:e.left+e.width/2-t,name:"arrow_nw",...n&&{config:n}}),southArrowNorthMiddleWest:(e,i)=>({top:s(e),left:e.left+e.width/2-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southArrowNorth:(e,t)=>({top:s(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...n&&{config:n}}),southArrowNorthMiddleEast:(e,i)=>({top:s(e),left:e.left+e.width/2-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southArrowNorthEast:(e,i)=>({top:s(e),left:e.left+e.width/2-i.width+t,name:"arrow_ne",...n&&{config:n}}),southEastArrowNorthWest:e=>({top:s(e),left:e.right-t,name:"arrow_nw",...n&&{config:n}}),southEastArrowNorthMiddleWest:(e,i)=>({top:s(e),left:e.right-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southEastArrowNorth:(e,t)=>({top:s(e),left:e.right-t.width/2,name:"arrow_n",...n&&{config:n}}),southEastArrowNorthMiddleEast:(e,i)=>({top:s(e),left:e.right-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southEastArrowNorthEast:(e,i)=>({top:s(e),left:e.right-i.width+t,name:"arrow_ne",...n&&{config:n}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-i,name:"arrow_e",...n&&{config:n}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+i,name:"arrow_w",...n&&{config:n}}),viewportStickyNorth:(e,t,i,r)=>{const s=r||i;return e.getIntersection(s)?s.height-e.height>o?null:{top:s.top+o,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...n}}:null}};function r(e,t){return e.top-t.height-i}function s(e){return e.bottom+i}}var Em=n(4650);yn()(Em.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Em.A.locals;const Sm="ck-tooltip";class Mm extends(Oi()){constructor(e){if(super(),this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver=null,this._mutationObserver=null,Mm._editors.add(e),Mm._instance)return Mm._instance;Mm._instance=this,this.tooltipTextView=new An(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new Am(e.locale),this.balloonPanelView.class=Sm,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){const t=new MutationObserver((()=>{e()}));return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}((()=>{this._updateTooltipPosition()})),this._pinTooltipDebounced=Xs(this._pinTooltip,600),this._unpinTooltipDebounced=Xs(this._unpinTooltip,400),this.listenTo(t.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(t.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(t.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(t.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(t.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(t.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;Mm._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),Mm._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Mm._instance=null)}static getPositioningFunctions(e){const t=Mm.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=Pm(t);i?i!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(i,Vm(i))):"focus"===e.name&&this._unpinTooltip()}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!Si(t))return;const e=this.balloonPanelView.element,o=e&&(e===i||e.contains(i)),n=!o&&t===e;if(o)return void this._unpinTooltipDebounced.cancel();if(!n&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const r=Pm(t),s=Pm(i);(n||r&&r!==s)&&this._unpinTooltipDebounced()}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();const n=Uo(Mm._editors.values()).ui.view.body;n.has(this.balloonPanelView)||n.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.pin({target:e,positions:Mm.getPositioningFunctions(i)}),this._resizeObserver=new Ki(e,(()=>{to(e)||this._unpinTooltip()})),this._mutationObserver.attach(e),this.balloonPanelView.class=[Sm,o].filter((e=>e)).join(" ");for(const e of Mm._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of Mm._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._resizeObserver&&this._resizeObserver.destroy(),this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=Vm(this._currentElementWithTooltip);to(this._currentElementWithTooltip)&&e.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Mm.getPositioningFunctions(e.position)}):this._unpinTooltip()}}Mm.defaultBalloonPositions=Tm({heightOffset:5,sideOffset:13}),Mm._editors=new Set,Mm._instance=null;const Im=Mm;function Pm(e){return Si(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function Vm(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}const Nm=function(e,t,i){var o=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return N(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),Xs(e,t,{leading:o,maxWait:t,trailing:n})};class Lm extends(Oi()){constructor(e){super(),this.editor=e,this._balloonView=null,this._lastFocusedEditableElement=null,this._showBalloonThrottled=Nm(this._showBalloon.bind(this),50,{leading:!0}),e.on("ready",this._handleEditorReady.bind(this))}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;(e.config.get("ui.poweredBy.forceVisible")||"VALID"!==function(e){function t(e){return e.length>=40&&e.length<=255?"VALID":"INVALID"}if(!e)return"INVALID";let i="";try{i=atob(e)}catch(e){return"INVALID"}const o=i.split("-"),n=o[0],r=o[1];if(!r)return t(e);try{atob(r)}catch(i){try{if(atob(n),!atob(n).length)return t(e)}catch(i){return t(e)}}if(n.length<40||n.length>255)return"INVALID";let s="";try{atob(n),s=atob(r)}catch(e){return"INVALID"}if(8!==s.length)return"INVALID";const a=Number(s.substring(0,4)),c=Number(s.substring(4,6))-1,l=Number(s.substring(6,8)),d=new Date(a,c,l);return d<_||isNaN(Number(d))?"INVALID":"VALID"}(e.config.get("licenseKey")))&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",((e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()})),e.ui.focusTracker.on("change:focusedElement",((e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()})),e.ui.on("update",(()=>{this._showBalloonThrottled()})))}_createBalloonView(){const e=this.editor,t=this._balloonView=new Am,i=Dm(e),o=new Om(e.locale,i.label);t.content.add(o),t.set({class:"ck-powered-by-balloon"}),e.ui.view.body.add(t),e.ui.focusTracker.add(t.element),this._balloonView=t}_showBalloon(){if(!this._lastFocusedEditableElement)return;const e=function(e,t){const i=Dm(e),o="right"===i.side?function(e,t){return Rm(e,t,((e,i)=>e.left+e.width-i.width-t.horizontalOffset))}(t,i):function(e,t){return Rm(e,t,(e=>e.left+t.horizontalOffset))}(t,i);return{target:t,positions:[o]}}(this.editor,this._lastFocusedEditableElement);e&&(this._balloonView||this._createBalloonView(),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i)return void(this._lastFocusedEditableElement=null);const o=Array.from(e.ui.getEditableElementsNames()).map((t=>e.ui.getEditableElement(t)));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}}class Om extends An{constructor(e,t){super(e);const i=new uu,o=this.bindTemplate;i.set({content:'\n',isColorInherited:!1}),i.extendTemplate({attributes:{style:{width:"53px",height:"10px"}}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to((e=>e.preventDefault()))}}]})}}function Rm(e,t,i){return(o,n)=>{const r=new Ui(e);if(r.width<350||r.height<50)return null;let s;s="inside"===t.position?r.bottom-n.height:r.bottom-n.height/2,s-=t.verticalOffset;const a=i(r,n),c=o.clone().moveTo(a,s).getIntersection(n.clone().moveTo(a,s)).getVisible();return!c||c.getArea(){for(const e of Object.values(zm))this.announce("",e)}))}announce(e,t=zm.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new Fm(i.locale),i.ui.view.body.add(this.view));const{politeness:o,isUnsafeHTML:n}="string"==typeof t?{politeness:t}:t;let r=this.view.regionViews.find((e=>e.politeness===o));r||(r=new Hm(i,o),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:n})}}class Fm extends An{constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class Hm extends An{constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{role:"region","aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",(()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)})),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval((()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()}),5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}class Um extends(j()){constructor(e){super(),this.isReady=!1,this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[];const t=e.editing.view;this.editor=e,this.componentFactory=new rm(e),this.focusTracker=new $o,this.tooltipManager=new Im(e),this.poweredBy=new Lm(e),this.ariaLiveAnnouncer=new jm(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",(()=>{this.isReady=!0})),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)):e.once("render",(()=>{this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)})),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}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}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor,t=e.editing.view;let i,o;e.keystrokes.set("Alt+F10",((e,n)=>{const r=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(r)&&!Array.from(t.domRoots.values()).includes(r)&&(i=r);const s=this._getCurrentFocusedToolbarDefinition();s&&o||(o=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e{const n=this._getCurrentFocusedToolbarDefinition();n&&(i?(i.focus(),i=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),o())}))}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:o}=t;(to(i.element)||o.beforeFocus)&&e.push(t)}return e.sort(((e,t)=>$m(e)-$m(t))),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),!!to(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}}function $m(e){const{toolbarView:t,options:i}=e;let o=10;return to(t.element)&&o--,i.isContextual&&o--,o}var qm=n(178);yn()(qm.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qm.A.locals;class Wm extends An{constructor(e){super(e),this.body=new cu(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class Zm extends Wm{constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new iu;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class Gm extends An{constructor(e,t,i){super(e),this.name=null,this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change((i=>{const o=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",o),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",o)}))}e.isRenderingInProgress?function i(o){e.once("change:isRenderingInProgress",((e,n,r)=>{r?i(o):t(o)}))}(this):t(this)}}class Km extends Gm{constructor(e,t,i,o={}){super(e,t,i);const n=e.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=o.label||(()=>n("Editor editing area: %0",this.name))}render(){super.render();const e=this._editingView;e.change((t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this._generateLabel(this),i)}))}}class Ym extends Rn{static get pluginName(){return"Notification"}init(){this.on("show:warning",((e,t)=>{window.alert(t.message)}),{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Qm extends(j()){constructor(e,t){super(),t&&Bs(this,t),e&&this.set(e)}}var Jm=n(9938);yn()(Jm.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Jm.A.locals;var Xm=n(3579);yn()(Xm.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Xm.A.locals;const eg=Qi("px");class tg extends Mn{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this._viewToStack=new Map,this._idToStack=new Map,this._view=null,this._rotatorView=null,this._fakePanelsView=null,this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new k("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new k("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new k("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new Am(this.editor.locale),this.editor.ui.view.body.add(this._view),this.editor.ui.focusTracker.add(this._view.element),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find((t=>t[1]===e))[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new ig(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>1)),e.on("change:isNavigationVisible",(()=>this.updatePosition()),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",((e,i)=>{if(i<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[o,i])})),e.buttonNextView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),e.buttonPrevView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),e}_createFakePanelsView(){const e=new og(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>=2?Math.min(e-1,2):0)),e.listenTo(this.view,"change:top",(()=>e.updatePosition())),e.listenTo(this.view,"change:left",(()=>e.updatePosition())),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}}class ig extends An{constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new $o,this.buttonPrevView=this._createButtonView(t("Previous"),eu.previousArrow),this.buttonNextView=this._createButtonView(t("Next"),eu.nextArrow),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(e=>e?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new gu(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class og extends An{constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(e=>e?"":"ck-hidden"))],style:{top:i.to("top",eg),left:i.to("left",eg),width:i.to("width",eg),height:i.to("height",eg)}},children:this.content}),this.on("change:numberOfPanels",((e,t,i,o)=>{i>o?this._addPanels(i-o):this._removePanels(o-i),this.updatePosition()}))}_addPanels(e){for(;e--;){const e=new An;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new Ui(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}var ng=n(7289);yn()(ng.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ng.A.locals;const rg=Qi("px");class sg extends An{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new Xo({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",(e=>e?"block":"none")),height:t.to("isSticky",(e=>e?rg(this._contentPanelRect.height):null))}}}).render(),this.contentPanelElement=new Xo({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",(e=>e?rg(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:t.to("_stickyTopOffset",(e=>e?rg(e):e)),bottom:t.to("_stickyBottomOffset",(e=>e?rg(e):e)),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(t.document,"scroll",(()=>{this.checkIfShouldBeSticky()}),{useCapture:!0}),this.listenTo(this,"change:isActive",(()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const e=new Ui(this.limiterElement);let i=e.getVisible();if(i){const e=new Ui(t.window);e.top+=this.viewportTopOffset,e.height-=this.viewportTopOffset,i=i.getIntersection(e)}if(i&&e.topi.bottom){const t=Math.max(e.bottom-i.bottom,0)+this.limiterBottomOffset;e.bottom-t>e.top+this._contentPanelRect.height?this._stickToBottomOfLimiter(t):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset{this.reset(),this.focus(),this.fire("reset")})),this.resetButtonView.bind("isVisible").to(this.fieldView,"isEmpty",(e=>!e)),this.fieldWrapperChildren.add(this.resetButtonView),this.extendTemplate({attributes:{class:"ck-search__query_with-reset"}}))}reset(){this.fieldView.reset(),this._viewConfig.showResetButton&&(this.resetButtonView.isVisible=!1)}}class cg extends An{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,primaryText:"",secondaryText:""}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__info",e.if("isVisible","ck-hidden",(e=>!e))],tabindex:-1},children:[{tag:"span",children:[{text:[e.to("primaryText")]}]},{tag:"span",children:[{text:[e.to("secondaryText")]}]}]})}focus(){this.element.focus()}}class lg extends An{constructor(e){super(e),this.children=this.createCollection(),this.focusTracker=new $o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new qu({focusables:this.children,focusTracker:this.focusTracker})}render(){super.render();for(const e of this.children)this.focusTracker.add(e.element)}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}var dg=/[\\^$.*+?()[\]{}|]/g,ug=RegExp(dg.source);const hg=function(e){return(e=ur(e))&&ug.test(e)?e.replace(dg,"\\$&"):e};var mg=n(5540);yn()(mg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mg.A.locals;class gg extends An{constructor(e,t){super(e),this._config=t,this.filteredView=t.filteredView,this.queryView=this._createSearchTextQueryView(),this.focusTracker=new $o,this.keystrokes=new qo,this.resultsView=new lg(e),this.children=this.createCollection(),this.focusableChildren=this.createCollection([this.queryView,this.resultsView]),this.set("isEnabled",!0),this.set("resultsCount",0),this.set("totalItemsCount",0),t.infoView&&t.infoView.instance?this.infoView=t.infoView.instance:(this.infoView=new cg,this._enableDefaultInfoViewBehavior(),this.on("render",(()=>{this.search("")}))),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new qu({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",((e,{resultsCount:t,totalItemsCount:i})=>{this.resultsCount=t,this.totalItemsCount=i})),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search",t.class||null],tabindex:"-1"},children:this.children})}render(){super.render(),this.children.addMany([this.queryView,this.resultsView]);const e=e=>e.stopPropagation();for(const e of this.focusableChildren)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}focus(){this.queryView.focus()}reset(){this.queryView.reset(),this.search("")}search(e){const t=e?new RegExp(hg(e),"ig"):null,i=this.filteredView.filter(t);this.fire("search",{query:e,...i})}_createSearchTextQueryView(){const e=new ag(this.locale,this._config.queryView);return this.listenTo(e.fieldView,"input",(()=>{this.search(e.fieldView.element.value)})),e.on("reset",(()=>this.reset())),e.bind("isEnabled").to(this),e}_enableDefaultInfoViewBehavior(){const e=this.locale.t,t=this.infoView;function i(e,{query:t,resultsCount:i,totalItemsCount:o}){return"function"==typeof e?e(t,i,o):e}this.on("search",((o,n)=>{if(n.resultsCount)t.set({isVisible:!1});else{const o=this._config.infoView&&this._config.infoView.text;let r,s;n.totalItemsCount?o&&o.notFound?(r=o.notFound.primary,s=o.notFound.secondary):(r=e("No results found"),s=""):o&&o.noSearchableItems?(r=o.noSearchableItems.primary,s=o.noSearchableItems.secondary):(r=e("No searchable items"),s=""),t.set({primaryText:i(r,n),secondaryText:i(s,n),isVisible:!0})}}))}}var pg=n(2688);yn()(pg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pg.A.locals;class fg extends gg{constructor(e,i){super(e,i),this._config=i;const o=Qi("px");this.extendTemplate({attributes:{class:["ck-autocomplete"]}});const n=this.resultsView.bindTemplate;this.resultsView.set("isVisible",!1),this.resultsView.set("_position","s"),this.resultsView.set("_width",0),this.resultsView.extendTemplate({attributes:{class:[n.if("isVisible","ck-hidden",(e=>!e)),n.to("_position",(e=>`ck-search__results_${e}`))],style:{width:n.to("_width",o)}}}),this.focusTracker.on("change:isFocused",((e,t,o)=>{this._updateResultsVisibility(),o?this.resultsView.element.scrollTop=0:i.resetOnBlur&&this.queryView.reset()})),this.on("search",(()=>{this._updateResultsVisibility(),this._updateResultsViewWidthAndPosition()})),this.keystrokes.set("esc",((e,t)=>{this.resultsView.isVisible&&(this.queryView.focus(),this.resultsView.isVisible=!1,t())})),this.listenTo(t.document,"scroll",(()=>{this._updateResultsViewWidthAndPosition()})),this.on("change:isEnabled",(()=>{this._updateResultsVisibility()})),this.filteredView.on("execute",((e,{value:t})=>{this.focus(),this.reset(),this.queryView.fieldView.value=this.queryView.fieldView.element.value=t,this.resultsView.isVisible=!1})),this.resultsView.on("change:isVisible",(()=>{this._updateResultsViewWidthAndPosition()}))}_updateResultsViewWidthAndPosition(){if(!this.resultsView.isVisible)return;this.resultsView._width=new Ui(this.queryView.fieldView.element).width;const e=fg._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:fg.defaultResultsPositions});this.resultsView._position=e?e.name:"s"}_updateResultsVisibility(){const e=void 0===this._config.queryMinChars?0:this._config.queryMinChars,t=this.queryView.fieldView.element.value.length;this.resultsView.isVisible=this.focusTracker.isFocused&&this.isEnabled&&t>=e}}fg.defaultResultsPositions=[e=>({top:e.bottom,left:e.left,name:"s"}),(e,t)=>({top:e.top-t.height,left:e.left,name:"n"})],fg._getOptimalPosition=io;RegExp(/[&<>"']/g.source);var kg=n(1998);yn()(kg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),kg.A.locals;var bg=n(5706);yn()(bg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),bg.A.locals,Qi("px");var wg=n(9939);yn()(wg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wg.A.locals,Qi("px"),Qi("px");var _g=n(5667);yn()(_g.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_g.A.locals;class vg extends gu{constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e))),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new uu;return e.content=wu,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}var yg=n(1214);yn()(yg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),yg.A.locals;class xg extends oh{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const Ag={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",(t=>{if(e.isOpen){for(const i of e.menus){const e=t.path[0],o=e instanceof xg&&e.children.first===i;i.isOpen=(t.path.includes(i)||o)&&i.isEnabled}t.source.focus()}}))},focusCycleMenusOnArrows(e){const t="rtl"===e.locale.uiLanguageDirection;function i(t,i){const o=e.children.getIndex(t),n=t.isOpen,r=e.children.length,s=e.children.get((o+r+i)%r);t.isOpen=!1,n&&(s.isOpen=!0),s.buttonView.focus()}e.on("menu:arrowright",(e=>{i(e.source,t?-1:1)})),e.on("menu:arrowleft",(e=>{i(e.source,t?1:-1)}))},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",(()=>{e.isOpen||e.menus.forEach((e=>{e.isOpen=!1}))}))},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",((t,i,o)=>{o&&e.menus.filter((e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen)).forEach((e=>{e.isOpen=!1}))}))},closeOnClickOutside(e){Cn({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map((e=>e.element))})}},Cg={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnArrowRightKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!0,e.panelView.focus()}))},toggleOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!e.isOpen,e.isOpen&&e.panelView.focus()}))},closeOnArrowLeftKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnEscKey(e){e.keystrokes.set("esc",((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",((t,i,o)=>{o||t.source!==e.parentMenuView||(e.isOpen=!1)}))}},Tg={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},Eg=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:uploadImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable"]},{groupId:"insertInline",items:["menuBar:link","menuBar:comment"]},{groupId:"insertMinorWidgets",items:["menuBar:insertTemplate","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Sg({normalizedConfig:e,locale:t,componentFactory:i}){const o=Ea(e);return function(e,t){const i=t.removeItems,o=[];t.items=t.items.filter((({menuId:e})=>!i.includes(e)||(o.push(e),!1))),Vg(t.items,(e=>{e.groups=e.groups.filter((({groupId:e})=>!i.includes(e)||(o.push(e),!1)));for(const t of e.groups)t.items=t.items.filter((e=>{const t=Og(e);return!i.includes(t)||(o.push(t),!1)}))}));for(const t of i)o.includes(t)||b("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:t})}(e,o),function(e,t){const i=t.addItems,o=[];for(const e of i){const i=(r=e.position).startsWith("start")?"start":r.startsWith("end")?"end":r.startsWith("after")?"after":"before",s=Lg(e.position);if("object"==typeof(n=e)&&"menu"in n)if(s){const n=t.items.findIndex((e=>e.menuId===s));-1!=n?"before"===i?(t.items.splice(n,0,e.menu),o.push(e)):"after"===i&&(t.items.splice(n+1,0,e.menu),o.push(e)):Mg(t,e.menu,s,i)&&o.push(e)}else"start"===i?(t.items.unshift(e.menu),o.push(e)):"end"===i&&(t.items.push(e.menu),o.push(e));else Ng(e)?Vg(t.items,(t=>{if(t.menuId===s)"start"===i?(t.groups.unshift(e.group),o.push(e)):"end"===i&&(t.groups.push(e.group),o.push(e));else{const n=t.groups.findIndex((e=>e.groupId===s));-1!==n&&("before"===i?(t.groups.splice(n,0,e.group),o.push(e)):"after"===i&&(t.groups.splice(n+1,0,e.group),o.push(e)))}})):Mg(t,e.item,s,i)&&o.push(e)}var n,r;for(const t of i)o.includes(t)||b("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}(e,o),function(e,t,i){Vg(t.items,(o=>{for(const n of o.groups)n.items=n.items.filter((n=>{const r="string"==typeof n&&!i.has(n);return r&&!t.isUsingDefaultConfig&&b("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:Ea(o),componentName:n}),!r}))}))}(e,o,i),Ig(e,o),function(e,t){const i=t.t,o={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};Vg(e.items,(e=>{e.label in o&&(e.label=o[e.label])}))}(o,t),o}function Mg(e,t,i,o){let n=!1;return Vg(e.items,(e=>{for(const{groupId:r,items:s}of e.groups){if(n)return;if(r===i)"start"===o?(s.unshift(t),n=!0):"end"===o&&(s.push(t),n=!0);else{const e=s.findIndex((e=>Og(e)===i));-1!==e&&("before"===o?(s.splice(e,0,t),n=!0):"after"===o&&(s.splice(e+1,0,t),n=!0))}}})),n}function Ig(e,t){const i=t.isUsingDefaultConfig;let o=!1;t.items=t.items.filter((t=>!!t.groups.length||(Pg(e,t,i),!1))),t.items.length?(Vg(t.items,(t=>{t.groups=t.groups.filter((e=>!!e.items.length||(o=!0,!1)));for(const n of t.groups)n.items=n.items.filter((t=>!(Rg(t)&&!t.groups.length&&(Pg(e,t,i),o=!0,1))))})),o&&Ig(e,t)):Pg(e,e,i)}function Pg(e,t,i){i||b("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function Vg(e,t){if(Array.isArray(e))for(const t of e)i(t);function i(e){t(e);for(const t of e.groups)for(const e of t.items)Rg(e)&&i(e)}}function Ng(e){return"object"==typeof e&&"group"in e}function Lg(e){const t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function Og(e){return"string"==typeof e?e:e.menuId}function Rg(e){return"object"==typeof e&&"menuId"in e}var Dg=n(4873);yn()(Dg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Dg.A.locals;class Bg extends An{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",(e=>`ck-menu-bar__menu__panel_position_${e}`)),t.if("isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}var zg=n(55);yn()(zg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),zg.A.locals;class jg extends An{constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new vg(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Bg(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new qo,this.focusTracker=new $o,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",(e=>!e)),t.if("parentMenuView","ck-menu-bar__menu_top-level",(e=>!e))]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),Cg.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(Cg.openOnButtonClick(this),Cg.openOnArrowRightKey(this),Cg.closeOnArrowLeftKey(this),Cg.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),Cg.openAndFocusPanelOnArrowDownKey(this),Cg.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",((e,t)=>{this.fire("arrowright"),t()})),this.keystrokes.set("arrowleft",((e,t)=>{this.fire("arrowleft"),t()}))}_repositionPanelOnOpen(){this.on("change:isOpen",((e,t,i)=>{if(!i)return;const o=jg._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._panelPositions[0].name}))}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:n,eastSouth:r,westNorth:s,eastNorth:a}=Tg;return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?[r,a,n,s]:[e,t,i,o]:this.parentMenuView?[n,s,r,a]:[t,e,o,i]}}jg._getOptimalPosition=io;const Fg=jg;class Hg extends ah{constructor(e){super(e),this.role="menu"}}var Ug=n(5078);yn()(Ug.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ug.A.locals;class $g extends gu{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class qg extends ku{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}var Wg=n(4782);yn()(Wg.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Wg.A.locals;const Zg=["mouseenter","arrowleft","arrowright","change:isOpen"];class Gg extends An{constructor(e){super(e),this.menus=[];const t=e.t;this.set("isOpen",!1),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar"],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t){const i=Sg({normalizedConfig:e,locale:this.locale,componentFactory:t}).items.map((e=>this._createMenu({componentFactory:t,menuDefinition:e})));this.children.addMany(i)}render(){super.render(),Ag.toggleMenusAndFocusItemsOnHover(this),Ag.closeMenusWhenTheBarCloses(this),Ag.closeMenuWhenAnotherOnTheSameLevelOpens(this),Ag.focusCycleMenusOnArrows(this),Ag.closeOnClickOutside(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}registerMenu(e,t=null){t?(e.delegate(...Zg).to(t),e.parentMenuView=t):e.delegate(...Zg).to(this,(e=>"menu:"+e)),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const o=this.locale,n=new Fg(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",(()=>{const i=new Hg(o);i.ariaLabel=t.label,n.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))})),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const o=this.locale,n=[];for(const r of e.groups){for(const e of r.items){const r=new xg(o,t);if(N(e))r.children.add(this._createMenu({componentFactory:i,menuDefinition:e,parentMenuView:t}));else{const o=this._createMenuItemContentFromFactory({componentName:e,componentFactory:i,parentMenuView:t});if(!o)continue;r.children.add(o)}n.push(r)}r!==e.groups[e.groups.length-1]&&n.push(new nh(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const o=i.create(e);return o instanceof Fg||o instanceof $g||o instanceof qg?(this._registerMenuTree(o,t),o.on("execute",(()=>{this.close()})),o):(b("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof Fg))return void e.delegate("mouseenter").to(t);this.registerMenu(e,t);const i=e.panelView.children.filter((e=>e instanceof Hg))[0];if(!i)return void e.delegate("mouseenter").to(t);const o=i.items.filter((e=>e instanceof oh));for(const t of o)this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",((t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout((()=>{this.isOpen=Array.from(this.children).some((e=>e.isOpen))}),0)}))}}class Kg extends Um{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Yu(e.config.get("toolbar")),this._elementReplacer=new W,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(e){const t=this.editor,i=this.view,o=t.editing.view,n=i.editable,r=o.document.getRoot();n.name=r.rootName,i.render();const s=n.element;this.setEditableElement(n.name,s),i.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(s),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),i.menuBarView&&function(e,t){const i=t.element;e.ui.focusTracker.add(i),e.keystrokes.listenTo(i);const o=function(e){let t;return t="items"in e&&e.items?{items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e}:{items:Ea(Eg),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e},t}(e.config.get("menuBar")||{});t.fillFromConfig(o,e.ui.componentFactory),e.keystrokes.set("Esc",((t,o)=>{i.contains(e.ui.focusTracker.focusedElement)&&(e.editing.view.focus(),o())})),e.keystrokes.set("Alt+F9",((o,n)=>{i.contains(e.ui.focusTracker.focusedElement)||(t.focus(),n())}))}(t,i.menuBarView),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:e})=>e||0)),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,i=t.document.getRoot(),o=e.sourceElement;let n;const r=e.config.get("placeholder");r&&(n="string"==typeof r?r:r[this.view.editable.name]),!n&&o&&"textarea"===o.tagName.toLowerCase()&&(n=o.getAttribute("placeholder")),n&&(i.placeholder=n),jn({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(e,t,i){const o=this.view.stickyPanel;if(o.isSticky){const e=new Ui(o.element).height;t.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(o,"change:isSticky",e),setTimeout((()=>{this.stopListening(o,"change:isSticky",e)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,t=this.editor.plugins.get("Dialog");t.on("show",(()=>{const i=t.view;i.on("moveTo",((t,o)=>{if(!e.isSticky||i.wasMoved)return;const n=new Ui(e.contentPanelElement);o[1]{const t="error"in e?e.error:e.reason;t instanceof Error&&this._handleError(t,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter((e=>e!==t))}_fire(e,...t){const i=this._listeners[e]||[];for(const e of i)e.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&void 0!==e.context&&null!==e.context&&"ready"===this.state&&this._isErrorComingFromThisItem(e)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit||(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function Xg(e,t=new Set){const i=[e],o=new Set;let n=0;for(;i.length>n;){const e=i[n++];if(!o.has(e)&&ep(e)&&!t.has(e))if(o.add(e),Symbol.iterator in e)try{for(const t of e)i.push(t)}catch(e){}else for(const t in e)"defaultValue"!==t&&i.push(e[t])}return o}function ep(e){const t=Object.prototype.toString.call(e),i=typeof e;return!("number"===i||"boolean"===i||"string"===i||"symbol"===i||"function"===i||"[object Date]"===t||"[object RegExp]"===t||"[object Module]"===t||null==e||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}function tp(e,t,i=new Set){if(e===t&&"object"==typeof(o=e)&&null!==o)return!0;var o;const n=Xg(e,i),r=Xg(t,i);for(const e of n)if(r.has(e))return!0;return!1}class ip extends Jg{constructor(e,t={}){super(t),this._editor=null,this._lifecyclePromise=null,this._initUsingData=!0,this._editables={},this._throttledSave=Nm(this._save.bind(this),"number"==typeof t.saveInterval?t.saveInterval:5e3),e&&(this._creator=(t,i)=>e.create(t,i)),this._destructor=e=>e.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then((()=>(this.state="initializing",this._fire("stateChange"),this._destroy()))).catch((e=>{console.error("An error happened during the editor destroying.",e)})).then((()=>{const e={},t=[],i=this._config.rootsAttributes||{},o={};for(const[n,r]of Object.entries(this._data.roots))r.isLoaded?(e[n]="",o[n]=i[n]||{}):t.push(n);const n={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:t,rootsAttributes:o,_watchdogInitialData:this._data};return delete n.initialData,n.extraPlugins.push(op),this._initUsingData?this.create(e,n,n.context):Si(this._elementOrData)?this.create(this._elementOrData,n,n.context):this.create(this._editables,n,n.context)})).then((()=>{this._fire("restart")}))}create(e=this._elementOrData,t=this._config,i){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(super._startErrorHandling(),this._elementOrData=e,this._initUsingData="string"==typeof e||Object.keys(e).length>0&&"string"==typeof Object.values(e)[0],this._config=this._cloneEditorConfiguration(t)||{},this._config.context=i,this._creator(e,this._config)))).then((e=>{this._editor=e,e.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=e.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")})).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)}))}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,t=e.model.document.roots.filter((e=>e.isAttached()&&"$graveyard"!=e.rootName)),{plugins:i}=e,o=i.has("CommentsRepository")&&i.get("CommentsRepository"),n=i.has("TrackChanges")&&i.get("TrackChanges"),r={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};t.forEach((e=>{r.roots[e.rootName]={content:JSON.stringify(Array.from(e.getChildren())),attributes:JSON.stringify(Array.from(e.getAttributes())),isLoaded:e._isLoaded}}));for(const t of e.model.markers)t._affectsData&&(r.markers[t.name]={rangeJSON:t.getRange().toJSON(),usingOperation:t._managedUsingOperations,affectsData:t._affectsData});return o&&(r.commentThreads=JSON.stringify(o.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),n&&(r.suggestions=JSON.stringify(n.getSuggestions({toJSON:!0,skipNotAttached:!0}))),r}_getEditables(){const e={};for(const t of this.editor.model.document.getRootNames()){const i=this.editor.ui.getEditableElement(t);i&&(e[t]=i)}return e}_isErrorComingFromThisItem(e){return tp(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return Ei(e,((e,t)=>Si(e)||"context"===t?e:void 0))}}class op{constructor(e){this.editor=e,this._data=e.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",(e=>{e.stop(),this.editor.model.enqueueChange({isUndoable:!1},(e=>{this._restoreCollaborationData(),this._restoreEditorData(e)})),this.editor.data.fire("ready")}),{priority:999})}_createNode(e,t){if("name"in t){const i=e.createElement(t.name,t.attributes);if(t.children)for(const o of t.children)i._appendChild(this._createNode(e,o));return i}return e.createText(t.data,t.attributes)}_restoreEditorData(e){const t=this.editor;Object.entries(this._data.roots).forEach((([i,{content:o,attributes:n}])=>{const r=JSON.parse(o),s=JSON.parse(n),a=t.model.document.getRoot(i);for(const[t,i]of s)e.setAttribute(t,i,a);for(const t of r){const i=this._createNode(e,t);e.insert(i,a,"end")}})),Object.entries(this._data.markers).forEach((([i,o])=>{const{document:n}=t.model,{rangeJSON:{start:r,end:s},...a}=o,c=n.getRoot(r.root),l=e.createPositionFromPath(c,r.path,r.stickiness),d=e.createPositionFromPath(c,s.path,s.stickiness),u=e.createRange(l,d);e.addMarker(i,{range:u,...a})}))}_restoreCollaborationData(){const e=JSON.parse(this._data.commentThreads),t=JSON.parse(this._data.suggestions);e.forEach((e=>{const t=this.editor.config.get("collaboration.channelId"),i=this.editor.plugins.get("CommentsRepository");i.hasCommentThread(e.threadId)&&i.getCommentThread(e.threadId).remove(),i.addCommentThread({channelId:t,...e})})),t.forEach((e=>{const t=this.editor.plugins.get("TrackChangesEditing");t.hasSuggestion(e.id)?t.getSuggestion(e.id).attributes=e.attributes:t.addSuggestionData(e)}))}}const np=Symbol("MainQueueId");class rp{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._activeActions=0}onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const i=e===np;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const o=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(np),this._queues.get(e)])).then(t),n=o.catch((()=>{}));return this._queues.set(e,n),o.finally((()=>{this._activeActions--,this._queues.get(e)===n&&0===this._activeActions&&this._onEmptyCallbacks.forEach((e=>e()))}))}}function sp(e){return Array.isArray(e)?e:[e]}class ap extends(Jd(Qd)){constructor(e,t={}){if(!lp(e)&&void 0!==t.initialData)throw new k("editor-create-initial-data",null);super(t),this.config.define("menuBar.isVisible",!1),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return lp(e)?(t=e)instanceof HTMLTextAreaElement?t.value:t.innerHTML:e;var t}(e)),lp(e)&&(this.sourceElement=e),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=this.config.get("menuBar"),n=new Qg(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,useMenuBar:o.isVisible});this.ui=new Kg(this,n),function(e){if(!Ae(e.updateSourceElement))throw new k("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(function(e){return!!e&&"textarea"===e.tagName.toLowerCase()}(t)&&t.form){let i;const o=t.form,n=()=>e.updateSourceElement();Ae(o.submit)&&(i=o.submit,o.submit=()=>{n(),i.apply(o)}),o.addEventListener("submit",n),e.on("destroy",(()=>{o.removeEventListener("submit",n),i&&(o.submit=i)}))}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise((i=>{const o=new this(e,t);i(o.initPlugins().then((()=>o.ui.init(lp(e)?e:null))).then((()=>o.data.init(o.config.get("initialData")))).then((()=>o.fire("ready"))).then((()=>o)))}))}}ap.Context=On,ap.EditorWatchdog=ip,ap.ContextWatchdog=class extends Jg{constructor(e,t={}){super(t),this._watchdogs=new Map,this._context=null,this._contextProps=new Set,this._actionQueues=new rp,this._watchdogConfig=t,this._creator=t=>e.create(t),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty((()=>{"initializing"===this.state&&(this.state="ready",this._fire("stateChange"))}))}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(np,(()=>(this._contextConfig=e,this._create())))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const t=sp(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e.id,(()=>{if("destroyed"===this.state)throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let t;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if("editor"===e.type)return t=new ip(null,this._watchdogConfig),t.setCreator(e.creator),t._setExcludedProperties(this._contextProps),e.destructor&&t.setDestructor(e.destructor),this._watchdogs.set(e.id,t),t.on("error",((i,{error:o,causesRestart:n})=>{this._fire("itemError",{itemId:e.id,error:o}),n&&this._actionQueues.enqueue(e.id,(()=>new Promise((i=>{const o=()=>{t.off("restart",o),this._fire("itemRestart",{itemId:e.id}),i()};t.on("restart",o)}))))})),t.create(e.sourceElementOrData,e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))))}remove(e){const t=sp(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e,(()=>{const t=this._getWatchdog(e);return this._watchdogs.delete(e),t.destroy()})))))}destroy(){return this._actionQueues.enqueue(np,(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())))}_restart(){return this._actionQueues.enqueue(np,(()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch((e=>{console.error("An error happened during destroying the context or items.",e)})).then((()=>this._create())).then((()=>this._fire("restart"))))))}_create(){return Promise.resolve().then((()=>(this._startErrorHandling(),this._creator(this._contextConfig)))).then((e=>(this._context=e,this._contextProps=Xg(this._context),Promise.all(Array.from(this._watchdogs.values()).map((e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))))}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map((e=>e.destroy()))).then((()=>this._destructor(e)))}))}_getWatchdog(e){const t=this._watchdogs.get(e);if(!t)throw new Error(`Item with the given id was not registered: ${e}.`);return t}_isErrorComingFromThisItem(e){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(e))return!1;return tp(this._context,e.context)}};const cp=ap;function lp(e){return Si(e)}const dp=["left","right","center","justify"];function up(e){return dp.includes(e)}function hp(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function mp(e){const t=e.map((e=>{let t;return t="string"==typeof e?{name:e}:e,t})).filter((e=>{const t=dp.includes(e.name);return t||b("alignment-config-name-not-recognized",{option:e}),t})),i=t.filter((e=>Boolean(e.className))).length;if(i&&i{const n=o.slice(i+1);if(n.some((e=>e.name==t.name)))throw new k("alignment-config-name-already-defined",{option:t,configuredOptions:e});if(t.className&&n.some((e=>e.className==t.className)))throw new k("alignment-config-classname-already-defined",{option:t,configuredOptions:e})})),t}const gp="alignment";class pp extends Pn{refresh(){const e=this.editor.locale,t=Uo(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=Boolean(t)&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,i=t.locale,o=t.model,n=o.document,r=e.value;o.change((e=>{const t=Array.from(n.selection.getSelectedBlocks()).filter((e=>this._canBeAligned(e))),o=t[0].getAttribute("alignment");hp(r,i)||o===r||!r?function(e,t){for(const i of e)t.removeAttribute(gp,i)}(t,e):function(e,t,i){for(const o of e)t.setAttribute(gp,i,o)}(t,e,r)}))}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,gp)}}class fp extends Mn{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:dp.map((e=>({name:e})))})}init(){const e=this.editor,t=e.locale,i=e.model.schema,o=mp(e.config.get("alignment.options")).filter((e=>up(e.name)&&!hp(e.name,t))),n=o.some((e=>!!e.className));i.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),n?e.conversion.attributeToAttribute(function(e){const t={};for(const i of e)t[i.name]={key:"class",value:i.className};return{model:{key:"alignment",values:e.map((e=>e.name))},view:t}}(o)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={};for(const{name:i}of e)t[i]={key:"style",value:{"text-align":i}};return{model:{key:"alignment",values:e.map((e=>e.name))},view:t}}(o));const r=function(e){const t=[];for(const{name:i}of e)t.push({view:{key:"style",value:{"text-align":i}},model:{key:"alignment",value:i}});return t}(o);for(const t of r)e.conversion.for("upcast").attributeToAttribute(t);const s=function(e){const t=[];for(const{name:i}of e)t.push({view:{key:"align",value:i},model:{key:"alignment",value:i}});return t}(o);for(const t of s)e.conversion.for("upcast").attributeToAttribute(t);e.commands.add("alignment",new pp(e))}}const kp=new Map([["left",eu.alignLeft],["right",eu.alignRight],["center",eu.alignCenter],["justify",eu.alignJustify]]);class bp extends Mn{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=mp(this.editor.config.get("alignment.options"));e.map((e=>e.name)).filter(up).forEach((e=>this._addButton(e))),this._addToolbarDropdown(e),this._addMenuBarMenu(e)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,(t=>this._createButton(t,e)))}_createButton(e,t,i={}){const o=this.editor,n=o.commands.get("alignment"),r=new gu(e);return r.set({label:this.localizedOptionTitles[t],icon:kp.get(t),tooltip:!0,isToggleable:!0,...i}),r.bind("isEnabled").to(n),r.bind("isOn").to(n,"value",(e=>e===t)),this.listenTo(r,"execute",(()=>{o.execute("alignment",{value:t}),o.editing.view.focus()})),r}_addToolbarDropdown(e){const t=this.editor;t.ui.componentFactory.add("alignment",(i=>{const o=hh(i),n="rtl"===i.uiLanguageDirection?"w":"e",r=i.t;mh(o,(()=>e.map((e=>this._createButton(i,e.name,{tooltipPosition:n})))),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:r("Text alignment toolbar")}),o.buttonView.set({label:r("Text alignment"),tooltip:!0}),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===i.contentLanguageDirection?kp.get("right"):kp.get("left"),a=t.commands.get("alignment");return o.buttonView.bind("icon").to(a,"value",(e=>kp.get(e)||s)),o.bind("isEnabled").to(a,"isEnabled"),this.listenTo(o,"execute",(()=>{t.editing.view.focus()})),o}))}_addMenuBarMenu(e){const t=this.editor;t.ui.componentFactory.add("menuBar:alignment",(i=>{const o=t.commands.get("alignment"),n=i.t,r=new Fg(i),s=new Hg(i);r.bind("isEnabled").to(o),s.set({ariaLabel:n("Text alignment"),role:"menu"}),r.buttonView.set({label:n("Text alignment")});for(const n of e){const e=new xg(i,r),a=new $g(i);a.extendTemplate({attributes:{"aria-checked":a.bindTemplate.to("isOn")}}),a.delegate("execute").to(r),a.set({label:this.localizedOptionTitles[n.name],icon:kp.get(n.name)}),a.on("execute",(()=>{t.execute("alignment",{value:n.name}),t.editing.view.focus()})),a.bind("isOn").to(o,"value",(e=>e===n.name)),a.bind("isEnabled").to(o,"isEnabled"),e.children.add(a),s.items.add(e)}return r.panelView.children.add(s),r}))}}class wp extends Mn{static get requires(){return[fp,bp]}static get pluginName(){return"Alignment"}}class _p{constructor(e,t=20){this._batch=null,this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class vp extends Pn{constructor(e,t){super(e),this._buffer=new _p(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,i=t.document,o=e.text||"",n=o.length;let r=i.selection;if(e.selection?r=e.selection:e.range&&(r=t.createSelection(e.range)),!t.canEditAt(r))return;const s=e.resultRange;t.enqueueChange(this._buffer.batch,(e=>{this._buffer.lock();const a=Array.from(i.selection.getAttributes());t.deleteContent(r),o&&t.insertContent(e.createText(o,a),r),s?e.setSelection(s):r.is("documentSelection")||e.setSelection(r),this._buffer.unlock(),this._buffer.input(n)}))}}const yp=["insertText","insertReplacementText"];class xp extends Ds{constructor(e){super(e),this.focusObserver=e.getObserver(wa),r.isAndroid&&yp.push("insertCompositionText");const t=e.document;t.on("beforeinput",((i,o)=>{if(!this.isEnabled)return;const{data:n,targetRanges:r,inputType:s,domEvent:a}=o;if(!yp.includes(s))return;this.focusObserver.flush();const c=new u(t,"insertText");t.fire(c,new zs(e,a,{text:n,selection:e.createSelection(r)})),c.stop.called&&i.stop()})),t.on("compositionend",((i,{data:o,domEvent:n})=>{this.isEnabled&&!r.isAndroid&&o&&t.fire("insertText",new zs(e,n,{text:o,selection:t.selection}))}),{priority:"lowest"})}observe(){}stopObserving(){}}class Ap extends Mn{static get pluginName(){return"Input"}init(){const e=this.editor,t=e.model,i=e.editing.view,o=t.document.selection;i.addObserver(xp);const n=new vp(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",n),e.commands.add("input",n),this.listenTo(i.document,"insertText",((o,n)=>{i.document.isComposing||n.preventDefault();const{text:s,selection:a,resultRange:c}=n,l=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));let d=s;if(r.isAndroid){const e=Array.from(l[0].getItems()).reduce(((e,t)=>e+(t.is("$textProxy")?t.data:"")),"");e&&(e.length<=d.length?d.startsWith(e)&&(d=d.substring(e.length),l[0].start=l[0].start.getShiftedBy(e.length)):e.startsWith(d)&&(l[0].start=l[0].start.getShiftedBy(d.length),d=""))}const u={text:d,selection:t.createSelection(l)};c&&(u.resultRange=e.editing.mapper.toModelRange(c)),e.execute("insertText",u),i.scrollToTheSelection()})),r.isAndroid?this.listenTo(i.document,"keydown",((e,r)=>{!o.isCollapsed&&229==r.keyCode&&i.document.isComposing&&Cp(t,n)})):this.listenTo(i.document,"compositionstart",(()=>{o.isCollapsed||Cp(t,n)}))}}function Cp(e,t){if(!t.isEnabled)return;const i=t.buffer;i.lock(),e.enqueueChange(i.batch,(()=>{e.deleteContent(e.document.selection)})),i.unlock()}class Tp extends Pn{constructor(e,t){super(e),this.direction=t,this._buffer=new _p(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,(o=>{this._buffer.lock();const n=o.createSelection(e.selection||i.selection);if(!t.canEditAt(n))return;const r=e.sequence||1,s=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(o);if(this._shouldReplaceFirstBlockWithParagraph(n,r))return void this.editor.execute("paragraph",{selection:n});if(n.isCollapsed)return;let a=0;n.getFirstRange().getMinimalFlatRanges().forEach((e=>{a+=Z(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),t.deleteContent(n,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),o.setSelection(n),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i);if(!i.isCollapsed||!i.containsEntireContent(o))return!1;if(!t.schema.checkChild(o,"paragraph"))return!1;const n=o.getChild(0);return!n||!n.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i),n=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(n,o),e.setSelection(n,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const i=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const o=e.getFirstPosition(),n=i.schema.getLimitElement(o),r=n.getChild(0);return o.parent==r&&!!e.containsEntireContent(r)&&!!i.schema.checkChild(n,"paragraph")&&"paragraph"!=r.name}}const Ep="word",Sp="selection",Mp="backward",Ip="forward",Pp={deleteContent:{unit:Sp,direction:Mp},deleteContentBackward:{unit:"codePoint",direction:Mp},deleteWordBackward:{unit:Ep,direction:Mp},deleteHardLineBackward:{unit:Sp,direction:Mp},deleteSoftLineBackward:{unit:Sp,direction:Mp},deleteContentForward:{unit:"character",direction:Ip},deleteWordForward:{unit:Ep,direction:Ip},deleteHardLineForward:{unit:Sp,direction:Ip},deleteSoftLineForward:{unit:Sp,direction:Ip}};class Vp extends Ds{constructor(e){super(e);const t=e.document;let i=0;t.on("keydown",(()=>{i++})),t.on("keyup",(()=>{i=0})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:c}=n,l=Pp[c];if(!l)return;const d={direction:l.direction,unit:l.unit,sequence:i};d.unit==Sp&&(d.selectionToRemove=e.createSelection(s[0])),"deleteContentBackward"===c&&(r.isAndroid&&(d.sequence=1),function(e){if(1!=e.length||e[0].isCollapsed)return!1;const t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let i=0;for(const{nextPosition:e,item:o}of t){if(e.parent.is("$text")){const t=e.parent.data,o=e.offset;if(Go(t,o)||Ko(t,o)||Qo(t,o))continue;i++}else(o.is("containerElement")||o.is("emptyElement"))&&i++;if(i>1)return!0}return!1}(s)&&(d.unit=Sp,d.selectionToRemove=e.createSelection(s)));const u=new Rr(t,"delete",s[0]);t.fire(u,new zs(e,a,d)),u.stop.called&&o.stop()})),r.isBlink&&function(e){const t=e.view,i=t.document;let o=null,n=!1;function r(e){return e==wo.backspace||e==wo.delete}function s(e){return e==wo.backspace?Mp:Ip}i.on("keydown",((e,{keyCode:t})=>{o=t,n=!1})),i.on("keyup",((a,{keyCode:c,domEvent:l})=>{const d=i.selection,u=e.isEnabled&&c==o&&r(c)&&!d.isCollapsed&&!n;if(o=null,u){const e=d.getFirstRange(),o=new Rr(i,"delete",e),n={unit:Sp,direction:s(c),selectionToRemove:d};i.fire(o,new zs(t,l,n))}})),i.on("beforeinput",((e,{inputType:t})=>{const i=Pp[t];r(o)&&i&&i.direction==s(o)&&(n=!0)}),{priority:"high"}),i.on("beforeinput",((e,{inputType:t,data:i})=>{o==wo.delete&&"insertText"==t&&""==i&&e.stop()}),{priority:"high"})}(this)}observe(){}stopObserving(){}}class Np extends Mn{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.model.document;t.addObserver(Vp),this._undoOnBackspace=!1;const n=new Tp(e,"forward");e.commands.add("deleteForward",n),e.commands.add("forwardDelete",n),e.commands.add("delete",new Tp(e,"backward")),this.listenTo(i,"delete",((o,n)=>{i.isComposing||n.preventDefault();const{direction:r,sequence:s,selectionToRemove:a,unit:c}=n,l="forward"===r?"deleteForward":"delete",d={sequence:s};if("selection"==c){const t=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));d.selection=e.model.createSelection(t)}else d.unit=c;e.execute(l,d),t.scrollToTheSelection()}),{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",((t,i)=>{this._undoOnBackspace&&"backward"==i.direction&&1==i.sequence&&"codePoint"==i.unit&&(this._undoOnBackspace=!1,e.execute("undo"),i.preventDefault(),t.stop())}),{context:"$capture"}),this.listenTo(o,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Lp extends Mn{static get requires(){return[Ap,Np]}static get pluginName(){return"Typing"}}function Op(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce(((e,{item:o})=>o.is("$text")||o.is("$textProxy")?e+o.data:(i=t.createPositionAfter(o),"")),""),range:t.createRange(i,e.end)}}class Rp extends(j()){constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))})),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",((t,{directChange:i})=>{i&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))})),this.listenTo(e,"change:data",((e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})}))}_evaluateTextBeforeSelection(e,t={}){const i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:r,range:s}=Op(n,i),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const i=Object.assign(t,{text:r,range:s});"object"==typeof a&&Object.assign(i,a),this.fire(`matched:${e}`,i)}}}class Dp extends Mn{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,i=e.editing.view,o=e.locale,n=t.document.selection;this.listenTo(i.document,"arrowKey",((e,t)=>{if(!n.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const i=t.keyCode==wo.arrowright,r=t.keyCode==wo.arrowleft;if(!i&&!r)return;const s=o.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&r?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()}),{context:"$text",priority:"highest"}),this.listenTo(n,"change:range",((e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Up(n.getFirstPosition(),this.attributes)||this._restoreGravity())})),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return!(this._isGravityOverridden||n.isAtStart&&Bp(o,t)||!Up(n,t)||(Fp(e),Bp(o,t)&&Up(n,t,!0)?jp(i,t):this._overrideGravity(),0))}_handleBackwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(Fp(e),this._restoreGravity(),Up(n,t,!0)?jp(i,t):zp(i,t,n),!0):n.isAtStart?!!Bp(o,t)&&(Fp(e),zp(i,t,n),!0):!Bp(o,t)&&Up(n,t,!0)?(Fp(e),zp(i,t,n),!0):!!Hp(n,t)&&(n.isAtEnd&&!Bp(o,t)&&Up(n,t)?(Fp(e),zp(i,t,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(Td);let n=!1;this.listenTo(o,"mousedown",(()=>{n=!0})),this.listenTo(o,"selectionChange",(()=>{const e=this.attributes;if(!n)return;if(n=!1,!i.isCollapsed)return;if(!Bp(i,e))return;const o=i.getFirstPosition();Up(o,e)&&(o.isAtStart||Up(o,e,!0)?jp(t,e):this._isGravityOverridden||this._overrideGravity())}))}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",(()=>{const o=t.getFirstPosition();Bp(t,i)&&Up(o,i)&&jp(e,i)}),{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view;let n=!1,r=!1;this.listenTo(o.document,"delete",((e,t)=>{n="backward"===t.direction}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{if(!n)return;const e=i.getFirstPosition();r=Bp(i,this.attributes)&&!Hp(e,this.attributes)}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{n&&(n=!1,r||e.model.enqueueChange((()=>{const e=i.getFirstPosition();Bp(i,this.attributes)&&Up(e,this.attributes)&&(e.isAtStart||Up(e,this.attributes,!0)?jp(t,this.attributes):this._isGravityOverridden||this._overrideGravity())})))}),{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change((e=>e.overrideSelectionGravity()))}_restoreGravity(){this.editor.model.change((e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null}))}}function Bp(e,t){for(const i of t)if(e.hasAttribute(i))return!0;return!1}function zp(e,t,i){const o=i.nodeBefore;e.change((i=>{if(o){const t=[],n=e.schema.isObject(o)&&e.schema.isInline(o);for(const[i,r]of o.getAttributes())!e.schema.checkAttribute("$text",i)||n&&!1===e.schema.getAttributeProperties(i).copyFromObject||t.push([i,r]);i.setSelectionAttribute(t)}else i.removeSelectionAttribute(t)}))}function jp(e,t){e.change((e=>{e.removeSelectionAttribute(t)}))}function Fp(e){e.preventDefault()}function Hp(e,t){return Up(e.getShiftedBy(-1),t)}function Up(e,t,i=!1){const{nodeBefore:o,nodeAfter:n}=e;for(const e of t){const t=o?o.getAttribute(e):void 0,r=n?n.getAttribute(e):void 0;if((!i||void 0!==t&&void 0!==r)&&r!==t)return!0}return!1}const $p={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Gp('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Gp("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Gp("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Gp('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Gp('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Gp("'"),to:[null,"‚",null,"’"]}},qp={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},Wp=["symbols","mathematical","typography","quotes"];class Zp extends Mn{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}constructor(e){super(e),e.config.define("typing",{transformations:{include:Wp}})}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTransformationWatchers()}_enableTransformationWatchers(){const e=this.editor,t=e.model,i=e.plugins.get("Delete"),o=function(e){const t=e.extra||[],i=e.remove||[],o=e=>!i.includes(e);return function(e){const t=new Set;for(const i of e)if("string"==typeof i&&qp[i])for(const e of qp[i])t.add(e);else t.add(i);return Array.from(t)}(e.include.concat(t).filter(o)).filter(o).map((e=>"string"==typeof e&&$p[e]?$p[e]:e)).filter((e=>"object"==typeof e)).map((e=>{return{from:(i=e.from,"string"==typeof i?new RegExp(`(${hg(i)})$`):i),to:(t=e.to,"string"==typeof t?()=>[t]:t instanceof Array?()=>t:t)};var t,i}))}(e.config.get("typing.transformations")),n=new Rp(e.model,(e=>{for(const t of o)if(t.from.test(e))return{normalizedTransformation:t}}));n.on("matched:data",((e,o)=>{if(!o.batch.isTyping)return;const{from:n,to:r}=o.normalizedTransformation,s=n.exec(o.text),a=r(s.slice(1)),c=o.range;let l=s.index;t.enqueueChange((e=>{for(let i=1;i{i.requestUndoOnBackspace()}))}))})),n.bind("isEnabled").to(this)}}function Gp(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function Kp(e,t,i,o){return o.createRange(Yp(e,t,i,!0,o),Yp(e,t,i,!1,o))}function Yp(e,t,i,o,n){let r=e.textNode||(o?e.nodeBefore:e.nodeAfter),s=null;for(;r&&r.getAttribute(t)==i;)s=r,r=o?r.previousSibling:r.nextSibling;return s?n.createPositionAt(s,o?"before":"after"):e}function Qp(e,t,i,o){const n=e.editing.view,r=new Set;n.document.registerPostFixer((n=>{const s=e.model.document.selection;let a=!1;if(s.hasAttribute(t)){const c=Kp(s.getFirstPosition(),t,s.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(c);for(const e of l.getItems())e.is("element",i)&&!e.hasClass(o)&&(n.addClass(o,e),r.add(e),a=!0)}return a})),e.conversion.for("editingDowncast").add((e=>{function t(){n.change((e=>{for(const t of r.values())e.removeClass(o,t),r.delete(t)}))}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})}))}function Jp(e,t,i,o){let n,r=null;"function"==typeof o?n=o:(r=e.commands.get(o),n=()=>{e.execute(o)}),e.model.document.on("change:data",((s,a)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const c=Uo(e.model.document.selection.getRanges());if(!c.isCollapsed)return;if(a.isUndo||!a.isLocal)return;const l=Array.from(e.model.document.differ.getChanges()),d=l[0];if(1!=l.length||"insert"!==d.type||"$text"!=d.name||1!=d.length)return;const u=d.position.parent;if(u.is("element","codeBlock"))return;if(u.is("element","listItem")&&"function"!=typeof o&&!["numberedList","bulletedList","todoList"].includes(o))return;if(r&&!0===r.value)return;const h=u.getChild(0),m=e.model.createRangeOn(h);if(!m.containsRange(c)&&!c.end.isEqual(m.end))return;const g=i.exec(h.data.substr(0,c.end.offset));g&&e.model.enqueueChange((t=>{const i=t.createPositionAt(u,0),o=t.createPositionAt(u,g[0].length),r=new oc(i,o);if(!1!==n({match:g})){t.remove(r);const i=e.model.document.selection.getFirstRange(),o=t.createRangeIn(u);!u.isEmpty||o.isEqual(i)||o.containsRange(i,!0)||t.remove(u)}r.detach(),e.model.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function Xp(e,t,i,o){let n,r;i instanceof RegExp?n=i:r=i,r=r||(e=>{let t;const i=[],o=[];for(;null!==(t=n.exec(e))&&!(t&&t.length<4);){let{index:e,1:n,2:r,3:s}=t;const a=n+r+s;e+=t[0].length-a.length;const c=[e,e+n.length],l=[e+n.length+r.length,e+n.length+r.length+s.length];i.push(c),i.push(l),o.push([e+n.length,e+n.length+r.length])}return{remove:i,format:o}}),e.model.document.on("change:data",((i,n)=>{if(n.isUndo||!n.isLocal||!t.isEnabled)return;const s=e.model,a=s.document.selection;if(!a.isCollapsed)return;const c=Array.from(s.document.differ.getChanges()),l=c[0];if(1!=c.length||"insert"!==l.type||"$text"!=l.name||1!=l.length)return;const d=a.focus,u=d.parent,{text:h,range:m}=function(e,t){let i=e.start;return{text:Array.from(e.getItems()).reduce(((e,o)=>!o.is("$text")&&!o.is("$textProxy")||o.getAttribute("code")?(i=t.createPositionAfter(o),""):e+o.data),""),range:t.createRange(i,e.end)}}(s.createRange(s.createPositionAt(u,0),d),s),g=r(h),p=ef(m.start,g.format,s),f=ef(m.start,g.remove,s);p.length&&f.length&&s.enqueueChange((t=>{if(!1!==o(t,p)){for(const e of f.reverse())t.remove(e);s.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}}))}))}function ef(e,t,i){return t.filter((e=>void 0!==e[0]&&void 0!==e[1])).map((t=>i.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1]))))}class tf extends Mn{static get requires(){return[Np]}static get pluginName(){return"Autoformat"}afterInit(){const e=this.editor,t=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&Jp(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&Jp(this.editor,this,/^1[.|)]\s$/,"numberedList"),e.get("todoList")&&Jp(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Jp(this.editor,this,/^\[\s?x\s?\]\s$/,(()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")}))}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const e=of(this.editor,"bold");Xp(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),Xp(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(e.get("italic")){const e=of(this.editor,"italic");Xp(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),Xp(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(e.get("code")){const e=of(this.editor,"code");Xp(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get("strikethrough")){const e=of(this.editor,"strikethrough");Xp(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter((e=>e.match(/^heading[1-6]$/))).forEach((t=>{const i=t[7],o=new RegExp(`^(#{${i}})\\s$`);Jp(this.editor,this,o,(()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})}))}))}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Jp(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&Jp(e,this,/^```$/,(()=>{if(t.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})}))}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Jp(this.editor,this,/^---$/,"horizontalLine")}}function of(e,t){return(i,o)=>{if(!e.commands.get(t).isEnabled)return!1;const n=e.model.schema.getValidRanges(o,t);for(const e of n)i.setAttribute(t,!0,e);i.removeSelectionAttribute(t)}}class nf extends Pn{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,o=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(i.isCollapsed)o?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of n)o?e.setAttribute(this.attributeKey,o,t):e.removeAttribute(this.attributeKey,t)}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const e of i.getRanges())for(const i of e.getItems())if(t.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const rf="bold";class sf extends Mn{static get pluginName(){return"BoldEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:rf}),e.model.schema.setAttributeProperties(rf,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:rf,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t&&("bold"==t||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(rf,new nf(e,rf)),e.keystrokes.set("CTRL+B",rf),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function af({editor:e,commandName:t,plugin:i,icon:o,label:n,keystroke:r}){return s=>{const a=e.commands.get(t),c=new s(e.locale);return c.set({label:n,icon:o,keystroke:r,isToggleable:!0}),c.bind("isEnabled").to(a,"isEnabled"),i.listenTo(c,"execute",(()=>{e.execute(t),e.editing.view.focus()})),c}}const cf="bold";class lf extends Mn{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.locale.t,i=e.commands.get(cf),o=af({editor:e,commandName:cf,plugin:this,icon:eu.bold,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(cf,(()=>{const e=o(gu);return e.set({tooltip:!0}),e.bind("isOn").to(i,"value"),e})),e.ui.componentFactory.add("menuBar:"+cf,(()=>o($g)))}}class df extends Mn{static get requires(){return[sf,lf]}static get pluginName(){return"Bold"}}const uf="code";class hf extends Mn{static get pluginName(){return"CodeEditing"}static get requires(){return[Dp]}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:uf}),e.model.schema.setAttributeProperties(uf,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:uf,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),e.commands.add(uf,new nf(e,uf)),e.plugins.get(Dp).registerAttribute(uf),Qp(e,uf,"code","ck-code_selected"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}var mf=n(9248);yn()(mf.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mf.A.locals;const gf="code";class pf extends Mn{static get pluginName(){return"CodeUI"}init(){const e=this.editor,t=e.locale.t,i=af({editor:e,commandName:gf,plugin:this,icon:'',label:t("Code")});e.ui.componentFactory.add(gf,(()=>{const t=i(gu),o=e.commands.get(gf);return t.set({tooltip:!0}),t.bind("isOn").to(o,"value"),t})),e.ui.componentFactory.add("menuBar:"+gf,(()=>i($g)))}}class ff extends Mn{static get requires(){return[hf,pf]}static get pluginName(){return"Code"}}const kf="italic";class bf extends Mn{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:kf}),e.model.schema.setAttributeProperties(kf,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:kf,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(kf,new nf(e,kf)),e.keystrokes.set("CTRL+I",kf),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const wf="italic";class _f extends Mn{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.commands.get(wf),i=e.locale.t,o=af({editor:e,commandName:wf,plugin:this,icon:'',keystroke:"CTRL+I",label:i("Italic")});e.ui.componentFactory.add(wf,(()=>{const e=o(gu);return e.set({tooltip:!0}),e.bind("isOn").to(t,"value"),e})),e.ui.componentFactory.add("menuBar:"+wf,(()=>o($g)))}}class vf extends Mn{static get requires(){return[bf,_f]}static get pluginName(){return"Italic"}}const yf="strikethrough";class xf extends Mn{static get pluginName(){return"StrikethroughEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:yf}),e.model.schema.setAttributeProperties(yf,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:yf,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(yf,new nf(e,yf)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const Af="strikethrough";class Cf extends Mn{static get pluginName(){return"StrikethroughUI"}init(){const e=this.editor,t=e.locale.t,i=af({editor:e,commandName:Af,plugin:this,icon:'',keystroke:"CTRL+SHIFT+X",label:t("Strikethrough")});e.ui.componentFactory.add(Af,(()=>{const t=i(gu),o=e.commands.get(Af);return t.set({tooltip:!0}),t.bind("isOn").to(o,"value"),t})),e.ui.componentFactory.add("menuBar:"+Af,(()=>i($g)))}}class Tf extends Mn{static get requires(){return[xf,Cf]}static get pluginName(){return"Strikethrough"}}const Ef="subscript";class Sf extends Mn{static get pluginName(){return"SubscriptEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Ef}),e.model.schema.setAttributeProperties(Ef,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Ef,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),e.commands.add(Ef,new nf(e,Ef))}}const Mf="subscript";class If extends Mn{static get pluginName(){return"SubscriptUI"}init(){const e=this.editor,t=e.locale.t,i=af({editor:e,commandName:Mf,plugin:this,icon:'',label:t("Subscript")});e.ui.componentFactory.add(Mf,(()=>{const t=i(gu),o=e.commands.get(Mf);return t.set({tooltip:!0}),t.bind("isOn").to(o,"value"),t})),e.ui.componentFactory.add("menuBar:"+Mf,(()=>i($g)))}}class Pf extends Mn{static get requires(){return[Sf,If]}static get pluginName(){return"Subscript"}}const Vf="superscript";class Nf extends Mn{static get pluginName(){return"SuperscriptEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Vf}),e.model.schema.setAttributeProperties(Vf,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Vf,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),e.commands.add(Vf,new nf(e,Vf))}}const Lf="superscript";class Of extends Mn{static get pluginName(){return"SuperscriptUI"}init(){const e=this.editor,t=e.locale.t,i=af({editor:e,commandName:Lf,plugin:this,icon:'',label:t("Superscript")});e.ui.componentFactory.add(Lf,(()=>{const t=i(gu),o=e.commands.get(Lf);return t.set({tooltip:!0}),t.bind("isOn").to(o,"value"),t})),e.ui.componentFactory.add("menuBar:"+Lf,(()=>i($g)))}}class Rf extends Mn{static get requires(){return[Nf,Of]}static get pluginName(){return"Superscript"}}const Df="underline";class Bf extends Mn{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Df}),e.model.schema.setAttributeProperties(Df,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Df,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(Df,new nf(e,Df)),e.keystrokes.set("CTRL+U","underline"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Underline text"),keystroke:"CTRL+U"}]})}}const zf="underline";class jf extends Mn{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.commands.get(zf),i=e.locale.t,o=af({editor:e,commandName:zf,plugin:this,icon:'',label:i("Underline"),keystroke:"CTRL+U"});e.ui.componentFactory.add(zf,(()=>{const e=o(gu);return e.set({tooltip:!0}),e.bind("isOn").to(t,"value"),e})),e.ui.componentFactory.add("menuBar:"+zf,(()=>o($g)))}}class Ff extends Mn{static get requires(){return[Bf,jf]}static get pluginName(){return"Underline"}}function*Hf(e,t){for(const i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class Uf extends Pn{execute(){this.editor.model.change((e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})}))}enterBlock(e){const t=this.editor.model,i=t.document.selection,o=t.schema,n=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(o.isLimit(s)||o.isLimit(a))return n||s!=a||t.deleteContent(i),!1;if(n){const t=Hf(e.model.schema,i.getAttributes());return $f(e,r.start),e.setSelectionAttribute(t),!0}{const o=!(r.start.isAtStart&&r.end.isAtEnd),n=s==a;if(t.deleteContent(i,{leaveUnmerged:o}),o){if(n)return $f(e,i.focus),!0;e.setSelection(a,0)}}return!1}}function $f(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}const qf={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Wf extends Ds{constructor(e){super(e);const t=this.document;let i=!1;t.on("keydown",((e,t)=>{i=t.shiftKey})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;let s=n.inputType;r.isSafari&&i&&"insertParagraph"==s&&(s="insertLineBreak");const a=n.domEvent,c=qf[s];if(!c)return;const l=new Rr(t,"enter",n.targetRanges[0]);t.fire(l,new zs(e,a,{isSoft:c.isSoft})),l.stop.called&&o.stop()}))}observe(){}stopObserving(){}}class Zf extends Mn{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,i=t.document,o=this.editor.t;t.addObserver(Wf),e.commands.add("enter",new Uf(e)),this.listenTo(i,"enter",((o,n)=>{i.isComposing||n.preventDefault(),n.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class Gf extends Pn{execute(){const e=this.editor.model,t=e.document;e.change((i=>{!function(e,t,i){const o=i.isCollapsed,n=i.getFirstRange(),r=n.start.parent,s=n.end.parent,a=r==s;if(o){const o=Hf(e.schema,i.getAttributes());Kf(e,t,n.end),t.removeSelectionAttribute(i.getAttributeKeys()),t.setSelectionAttribute(o)}else{const o=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:o}),a?Kf(e,t,i.focus):o&&t.setSelection(s,0)}}(e,i,t.selection),this.fire("afterExecute",{writer:i})}))}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;const o=t.getFirstRange(),n=o.start.parent,r=o.end.parent;return!Yf(n,e)&&!Yf(r,e)||n===r}(e.schema,t.selection)}}function Kf(e,t,i){const o=t.createElement("softBreak");e.insertContent(o,i),t.setSelection(o,"after")}function Yf(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Yf(e.parent,t))}class Qf extends Mn{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,r=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),o.addObserver(Wf),e.commands.add("shiftEnter",new Gf(e)),this.listenTo(n,"enter",((t,i)=>{n.isComposing||i.preventDefault(),i.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:r("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class Jf extends Pn{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,o=t.document.selection,n=Array.from(o.getSelectedBlocks()),r=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(r){const t=n.filter((e=>Xf(e)||tk(i,e)));this._applyQuote(e,t)}else this._removeQuote(e,n.filter(Xf))}))}_getValue(){const e=Uo(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Xf(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=Uo(e.getSelectedBlocks());return!!i&&tk(t,i)}_removeQuote(e,t){ek(e,t).reverse().forEach((t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);return void e.move(t,i)}t.end.isAtEnd||e.split(t.end);const i=e.createPositionAfter(t.end.parent);e.move(t,i)}))}_applyQuote(e,t){const i=[];ek(e,t).reverse().forEach((t=>{let o=Xf(t.start);o||(o=e.createElement("blockQuote"),e.wrap(t,o)),i.push(o)})),i.reverse().reduce(((t,i)=>t.nextSibling==i?(e.merge(e.createPositionAfter(t)),t):i))}}function Xf(e){return"blockQuote"==e.parent.name?e.parent:null}function ek(e,t){let i,o=0;const n=[];for(;o{const o=e.model.document.differ.getChanges();for(const e of o)if("insert"==e.type){const o=e.position.nodeAfter;if(!o)continue;if(o.is("element","blockQuote")&&o.isEmpty)return i.remove(o),!0;if(o.is("element","blockQuote")&&!t.checkChild(e.position,o))return i.unwrap(o),!0;if(o.is("element")){const e=i.createRangeIn(o);for(const o of e.getItems())if(o.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(o),o))return i.unwrap(o),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return i.remove(t),!0}return!1}));const i=this.editor.editing.view.document,o=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(i,"enter",((t,i)=>{o.isCollapsed&&n.value&&o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"}),this.listenTo(i,"delete",((t,i)=>{if("backward"!=i.direction||!o.isCollapsed||!n.value)return;const r=o.getLastPosition().parent;r.isEmpty&&!r.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"})}}var ok=n(1501);yn()(ok.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ok.A.locals;class nk extends Mn{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.commands.get("blockQuote");e.ui.componentFactory.add("blockQuote",(()=>{const e=this._createButton(gu);return e.set({tooltip:!0}),e.bind("isOn").to(t,"value"),e})),e.ui.componentFactory.add("menuBar:blockQuote",(()=>this._createButton($g)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("blockQuote"),n=new e(t.locale),r=i.t;return n.set({label:r("Block quote"),icon:eu.quote,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),n}}class rk extends Mn{static get requires(){return[ik,nk]}static get pluginName(){return"BlockQuote"}}function sk(e){const t=e.t,i=e.config.get("codeBlock.languages");for(const e of i)"Plain text"===e.label&&(e.label=t("Plain text")),void 0===e.class&&(e.class=`language-${e.language}`);return i}function ak(e,t,i){const o={};for(const n of e)"class"===t?o[n[t].split(" ").shift()]=n[i]:o[n[t]]=n[i];return o}function ck(e){return e.data.match(/^(\s*)/)[0]}function lk(e){const t=e.document.selection,i=[];if(t.isCollapsed)return[t.anchor];const o=t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:t}of o){if(!t.is("$textProxy"))continue;const{parent:o,startOffset:n}=t.textNode;if(!o.is("element","codeBlock"))continue;const r=ck(t.textNode),s=e.createPositionAt(o,n+r.length);i.push(s)}return i}function dk(e){const t=Uo(e.getSelectedBlocks());return!!t&&t.is("element","codeBlock")}function uk(e,t){return!t.is("rootElement")&&!e.isLimit(t)&&e.checkChild(t.parent,"codeBlock")}function hk(e,t,i,o){const n=ak(t,"language","label"),r=i.getAttribute("language");if(r in n){return e("enter"===o?"Entering %0 code snippet":"Leaving %0 code snippet",n[r])}return e("enter"===o?"Entering code snippet":"Leaving code snippet")}class mk extends Pn{constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor,i=t.model,o=i.document.selection,n=sk(t)[0],r=Array.from(o.getSelectedBlocks()),s=null==e.forceValue?!this.value:e.forceValue,a=function(e,t,i){return e.language?e.language:e.usePreviousLanguageChoice&&t?t:i}(e,this._lastLanguage,n.language);i.change((e=>{s?this._applyCodeBlock(e,r,a):this._removeCodeBlock(e,r)}))}_getValue(){const e=Uo(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!e.is("element","codeBlock"))&&e.getAttribute("language")}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=Uo(e.getSelectedBlocks());return!!i&&uk(t,i)}_applyCodeBlock(e,t,i){this._lastLanguage=i;const o=this.editor.model.schema,n=t.filter((e=>uk(o,e)));for(const t of n)e.rename(t,"codeBlock"),e.setAttribute("language",i,t),o.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter((e=>!o.checkChild(t,e))).forEach((t=>e.remove(t)));n.reverse().forEach(((t,i)=>{const o=n[i+1];t.previousSibling===o&&(e.appendElement("softBreak",o),e.merge(e.createPositionBefore(t)))}))}_removeCodeBlock(e,t){const i=t.filter((e=>e.is("element","codeBlock")));for(const t of i){const i=e.createRangeOn(t);for(const t of Array.from(i.getItems()).reverse())if(t.is("element","softBreak")&&t.parent.is("element","codeBlock")){const{position:i}=e.split(e.createPositionBefore(t)),o=i.nodeAfter;e.rename(o,"paragraph"),e.removeAttribute("language",o),e.remove(t)}e.rename(t,"paragraph"),e.removeAttribute("language",t)}}}class gk extends Pn{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((t=>{const i=lk(e);for(const o of i){const i=t.createText(this._indentSequence);e.insertContent(i,o)}}))}_checkEnabled(){return!!this._indentSequence&&dk(this.editor.model.document.selection)}}class pk extends Pn{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((()=>{const t=lk(e);for(const i of t){const t=fk(e,i,this._indentSequence);t&&e.deleteContent(e.createSelection(t))}}))}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return!!dk(e.document.selection)&&lk(e).some((t=>fk(e,t,this._indentSequence)))}}function fk(e,t,i){const o=function(e){let t=e.parent.getChild(e.index);return t&&!t.is("element","softBreak")||(t=e.nodeBefore),!t||t.is("element","softBreak")?null:t}(t);if(!o)return null;const n=ck(o),r=n.lastIndexOf(i);if(r+i.length!==n.length)return null;if(-1===r)return null;const{parent:s,startOffset:a}=o;return e.createRange(e.createPositionAt(s,a+r),e.createPositionAt(s,a+r+i.length))}function kk(e,t,i=!1){const o=ak(t,"language","class"),n=ak(t,"language","label");return(t,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,"insert"))return;const d=r.item.getAttribute("language"),u=c.toViewPosition(e.createPositionBefore(r.item)),h={};i&&(h["data-language"]=n[d],h.spellcheck="false");const m=o[d]?{class:o[d]}:void 0,g=a.createContainerElement("code",m),p=a.createContainerElement("pre",h,g);a.insert(u,p),c.bindElements(r.item,g)}}const bk="paragraph";class wk extends Mn{static get pluginName(){return"CodeBlockEditing"}static get requires(){return[Qf]}constructor(e){super(e),e.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:"\t"})}init(){const e=this.editor,t=e.model.schema,i=e.model,o=e.editing.view,n=e.plugins.has("ListEditing")?e.plugins.get("ListEditing"):null,r=sk(e);e.commands.add("codeBlock",new mk(e)),e.commands.add("indentCodeBlock",new gk(e)),e.commands.add("outdentCodeBlock",new pk(e)),this.listenTo(o.document,"tab",((t,i)=>{const o=i.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(o).isEnabled&&(e.execute(o),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"pre"}),t.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",isBlock:!0,allowAttributes:["language"]}),t.addAttributeCheck(((e,t)=>!!(e.endsWith("codeBlock")&&n&&n.getListAttributeNames().includes(t))||!e.endsWith("codeBlock $text")&&void 0)),e.model.schema.addChildCheck(((e,t)=>{if(e.endsWith("codeBlock")&&t.isObject)return!1})),e.editing.downcastDispatcher.on("insert:codeBlock",kk(i,r,!0)),e.data.downcastDispatcher.on("insert:codeBlock",kk(i,r)),e.data.downcastDispatcher.on("insert:softBreak",function(e){return(t,i,o)=>{if("codeBlock"!==i.item.parent.name)return;const{writer:n,mapper:r,consumable:s}=o;if(!s.consume(i.item,"insert"))return;const a=r.toViewPosition(e.createPositionBefore(i.item));n.insert(a,n.createText("\n"))}}(i),{priority:"high"}),e.data.upcastDispatcher.on("element:code",function(e,t){const i=ak(t,"class","language"),o=t[0].language;return(e,t,n)=>{const r=t.viewItem,s=r.parent;if(!s||!s.is("element","pre"))return;if(t.modelCursor.findAncestor("codeBlock"))return;const{consumable:a,writer:c}=n;if(!a.test(r,{name:!0}))return;const l=c.createElement("codeBlock"),d=[...r.getClassNames()];d.length||d.push("");for(const e of d){const t=i[e];if(t){c.setAttribute("language",t,l);break}}l.hasAttribute("language")||c.setAttribute("language",o,l),n.convertChildren(r,l),n.safeInsert(l,t.modelCursor)&&(a.consume(r,{name:!0}),n.updateConversionResult(l,t))}}(0,r)),e.data.upcastDispatcher.on("text",((e,t,{consumable:i,writer:o})=>{let n=t.modelCursor;if(!i.test(t.viewItem))return;if(!n.findAncestor("codeBlock"))return;i.consume(t.viewItem);const r=t.viewItem.data.split("\n").map((e=>o.createText(e))),s=r[r.length-1];for(const e of r)if(o.insert(e,n),n=n.getShiftedBy(e.offsetSize),e!==s){const e=o.createElement("softBreak");o.insert(e,n),n=o.createPositionAfter(e)}t.modelRange=o.createRange(t.modelCursor,n),t.modelCursor=n})),e.data.upcastDispatcher.on("element:pre",((e,t,{consumable:i})=>{const o=t.viewItem;if(o.findAncestor("pre"))return;const n=Array.from(o.getChildren()),r=n.find((e=>e.is("element","code")));if(r)for(const e of n)e!==r&&e.is("$text")&&i.consume(e,{name:!0})}),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,o)=>{let n=i.createRange(i.document.selection.anchor);if(o.targetRanges&&(n=e.editing.mapper.toModelRange(o.targetRanges[0])),!n.start.parent.is("element","codeBlock"))return;const r=o.dataTransfer.getData("text/plain"),s=new Ed(e.editing.view.document);o.content=function(e,t){const i=e.createDocumentFragment(),o=t.split("\n"),n=o.reduce(((t,i,n)=>(t.push(i),n{const n=o.anchor;!o.isCollapsed&&n.parent.is("element","codeBlock")&&n.hasSameParentAs(o.focus)&&i.change((i=>{const r=e.return;if(n.parent.is("element")&&(r.childCount>1||o.containsEntireContent(n.parent))){const t=i.createElement("codeBlock",n.parent.getAttributes());i.append(r,t);const o=i.createDocumentFragment();return i.append(t,o),void(e.return=o)}const s=r.getChild(0);t.checkAttribute(s,"code")&&i.setAttribute("code",!0,s)}))}))}afterInit(){const e=this.editor,t=e.commands,i=t.get("indent"),o=t.get("outdent");i&&i.registerChildCommand(t.get("indentCodeBlock"),{priority:"highest"}),o&&o.registerChildCommand(t.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",((t,i)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(function(e,t){const i=e.model.document,o=e.editing.view,n=i.selection.getLastPosition(),r=n.nodeAfter;return!(t||!i.selection.isCollapsed||!n.isAtStart)&&(!!vk(r)&&(e.model.change((t=>{e.execute("enter");const o=i.selection.anchor.parent.previousSibling;t.rename(o,bk),t.setSelection(o,"in"),e.model.schema.removeDisallowedAttributes([o],t),t.remove(r)})),o.scrollToTheSelection(),!0))}(e,i.isSoft)||function(e,t){const i=e.model,o=i.document,n=e.editing.view,r=o.selection.getLastPosition(),s=r.nodeBefore;let a;if(t||!o.selection.isCollapsed||!r.isAtEnd||!s||!s.previousSibling)return!1;if(vk(s)&&vk(s.previousSibling))a=i.createRange(i.createPositionBefore(s.previousSibling),i.createPositionAfter(s));else if(_k(s)&&vk(s.previousSibling)&&vk(s.previousSibling.previousSibling))a=i.createRange(i.createPositionBefore(s.previousSibling.previousSibling),i.createPositionAfter(s));else{if(!(_k(s)&&vk(s.previousSibling)&&_k(s.previousSibling.previousSibling)&&s.previousSibling.previousSibling&&vk(s.previousSibling.previousSibling.previousSibling)))return!1;a=i.createRange(i.createPositionBefore(s.previousSibling.previousSibling.previousSibling),i.createPositionAfter(s))}return e.model.change((t=>{t.remove(a),e.execute("enter");const i=o.selection.anchor.parent;t.rename(i,bk),e.model.schema.removeDisallowedAttributes([i],t)})),n.scrollToTheSelection(),!0}(e,i.isSoft)||function(e){const t=e.model.document,i=t.selection.getLastPosition(),o=i.nodeBefore||i.textNode;let n;o&&o.is("$text")&&(n=ck(o)),e.model.change((i=>{e.execute("shiftEnter"),n&&i.insertText(n,t.selection.anchor)}))}(e),i.preventDefault(),t.stop())}),{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){const{model:e,ui:t,t:i}=this.editor,o=sk(this.editor);let n=null;e.document.selection.on("change:range",(()=>{const r=e.document.selection.focus.parent;t&&n!==r&&r.is("element")&&(n&&n.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(hk(i,o,n,"leave")),r.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(hk(i,o,r,"enter")),n=r)}))}}function _k(e){return e&&e.is("$text")&&!e.data.match(/\S/)}function vk(e){return e&&e.is("element","softBreak")}var yk=n(2291);yn()(yk.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),yk.A.locals;class xk extends Mn{static get pluginName(){return"CodeBlockUI"}init(){const e=this.editor,t=e.t,i=e.ui.componentFactory,o=sk(e),n=this._getLanguageListItemDefinitions(o),r=e.commands.get("codeBlock");i.add("codeBlock",(i=>{const o=hh(i,lh),s=o.buttonView,a=t("Insert code block");return s.set({label:a,tooltip:!0,icon:eu.codeBlock,isToggleable:!0}),s.bind("isOn").to(r,"value",(e=>!!e)),s.on("execute",(()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()})),o.on("execute",(t=>{e.execute("codeBlock",{language:t.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()})),o.class="ck-code-block-dropdown",o.bind("isEnabled").to(r),ph(o,n,{role:"menu",ariaLabel:a}),o})),i.add("menuBar:codeBlock",(i=>{const o=new Fg(i);o.buttonView.set({label:t("Code block"),icon:eu.codeBlock}),o.bind("isEnabled").to(r);const s=new Hg(i);s.set({ariaLabel:t("Insert code block")});for(const t of n){const n=new xg(i,o),a=new $g(i);a.bind(...Object.keys(t.model)).to(t.model),a.bind("ariaChecked").to(a,"isOn"),a.delegate("execute").to(o),a.on("execute",(()=>{e.execute("codeBlock",{language:t.model._codeBlockLanguage,forceValue:r.value!=t.model._codeBlockLanguage}),e.editing.view.focus()})),n.children.add(a),s.items.add(n)}return o.panelView.children.add(s),o}))}_getLanguageListItemDefinitions(e){const t=this.editor.commands.get("codeBlock"),i=new Ho;for(const o of e){const e={type:"button",model:new Qm({_codeBlockLanguage:o.language,label:o.label,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(t=>t===e.model._codeBlockLanguage)),i.add(e)}return i}}class Ak extends Mn{static get requires(){return[wk,xk]}static get pluginName(){return"CodeBlock"}}class Ck extends js{constructor(e){super(e),this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];const t=this.document;function i(e){return(i,o)=>{o.preventDefault();const n=o.dropRange?[o.dropRange]:null,r=new u(t,e);t.fire(r,{dataTransfer:o.dataTransfer,method:i.name,targetRanges:n,target:o.target,domEvent:o.domEvent}),r.stop.called&&o.stopPropagation()}}this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,i="drop"==e.type||"paste"==e.type,o={dataTransfer:new ya(t,{cacheFiles:i})};"drop"!=e.type&&"dragover"!=e.type||(o.dropRange=function(e,t){const i=t.target.ownerDocument,o=t.clientX,n=t.clientY;let r;return i.caretRangeFromPoint&&i.caretRangeFromPoint(o,n)?r=i.caretRangeFromPoint(o,n):t.rangeParent&&(r=i.createRange(),r.setStart(t.rangeParent,t.rangeOffset),r.collapse(!0)),r?e.domConverter.domRangeToView(r):null}(this.view,e)),this.fire(e.type,e,o)}}const Tk=["figcaption","li"],Ek=["ol","ul"];function Sk(e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(e.is("element","img")&&e.hasAttribute("alt"))return e.getAttribute("alt");if(e.is("element","br"))return"\n";let t="",i=null;for(const r of e.getChildren())t+=(o=r,((n=i)?o.is("element","li")&&!o.isEmpty&&o.getChild(0).is("containerElement")||Ek.includes(o.name)&&Ek.includes(n.name)?"\n\n":o.is("containerElement")||n.is("containerElement")?Tk.includes(o.name)||Tk.includes(n.name)?"\n":"\n\n":"":"")+Sk(r)),i=r;var o,n;return t}const Mk=function(e,t){return e&&Eo(e,t,Tt)},Ik=function(e){return e==e&&!N(e)},Pk=function(e,t){return function(i){return null!=i&&i[e]===t&&(void 0!==t||e in Object(i))}},Vk=function(e){var t=function(e){for(var t=Tt(e),i=t.length;i--;){var o=t[i],n=e[o];t[i]=[o,n,Ik(n)]}return t}(e);return 1==t.length&&t[0][2]?Pk(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,o){var n=i.length,r=n,s=!o;if(null==e)return!r;for(e=Object(e);n--;){var a=i[n];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++ne.model.getSelectedContent(e.model.document.selection))){return this.editor.model.change((o=>{const n=o.model.document.selection;o.setSelection(t);const r=this._insertFakeMarkersIntoSelection(o,o.model.document.selection,e),s=i(o),a=this._removeFakeMarkersInsideElement(o,s);for(const[e,t]of Object.entries(r)){a[e]||(a[e]=o.createRangeIn(s));for(const e of t)o.remove(e)}s.markers.clear();for(const[e,t]of Object.entries(a))s.markers.set(e,t);return o.setSelection(n),s}))}_pasteMarkersIntoTransformedElement(e,t){const i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change((e=>{const o=this._insertFakeMarkersElements(e,i),n=t(e),r=this._removeFakeMarkersInsideElement(e,n);for(const t of Object.values(o).flat())e.remove(t);for(const[t,i]of Object.entries(r))e.model.markers.has(t)||e.addMarker(t,{usingOperation:!0,affectsData:!0,range:i});return n}))}_pasteFragmentWithMarkers(e){const t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const o=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),o?this._markersToCopy.set(e,o):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){const i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;const{allowedActions:o}=i;return"all"===o||o.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){const o=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,o)}_getCopyableMarkersFromSelection(e,t,i){const o=Array.from(t.getRanges()),n=new Set(o.flatMap((t=>Array.from(e.model.markers.getMarkersIntersectingRange(t)))));return Array.from(n).filter((e=>{if(!this._isMarkerCopyable(e.name,i))return!1;const{copyPartiallySelected:t}=this._getMarkerClipboardConfig(e.name);if(!t){const t=e.getRange();return o.some((e=>e.containsRange(t,!0)))}return!0})).map((e=>({name:"dragstart"===i?this._getUniqueMarkerName(e.name):e.name,range:e.getRange()})))}_getPasteMarkersFromRangeMap(e,t=null){const{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap((([e,o])=>{if(!this._hasMarkerConfiguration(e))return[{name:e,range:o}];if(this._isMarkerCopyable(e,t)){const t=this._getMarkerClipboardConfig(e),n=i.markers.has(e)&&"$graveyard"===i.markers.get(e).getRange().root.rootName;return(t.duplicateOnPaste||n)&&(e=this._getUniqueMarkerName(e)),[{name:e,range:o}]}return[]}))}_insertFakeMarkersElements(e,t){const i={},o=t.flatMap((e=>{const{start:t,end:i}=e.range;return[{position:t,marker:e,type:"start"},{position:i,marker:e,type:"end"}]})).sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:t,marker:n,type:r}of o){const o=e.createElement("$marker",{"data-name":n.name,"data-type":r});i[n.name]||(i[n.name]=[]),i[n.name].push(o),e.insert(o,t)}return i}_removeFakeMarkersInsideElement(e,t){return function(e,t){var i={};return t=Rk(t),Mk(e,(function(e,o,n){Ke(i,o,t(e,o,n))})),i}(this._getAllFakeMarkersFromElement(e,t).reduce(((t,i)=>{const o=i.markerElement&&e.createPositionBefore(i.markerElement);let n=t[i.name],r=!1;return n&&n.start&&n.end&&(this._getMarkerClipboardConfig(i.name).duplicateOnPaste?t[this._getUniqueMarkerName(i.name)]=t[i.name]:r=!0,n=null),r||(t[i.name]={...n,[i.type]:o}),i.markerElement&&e.remove(i.markerElement),t}),{}),(i=>new Ua(i.start||e.createPositionFromPath(t,[0]),i.end||e.createPositionAt(t,"end"))))}_getAllFakeMarkersFromElement(e,t){const i=Array.from(e.createRangeIn(t)).flatMap((({item:e})=>{if(!e.is("element","$marker"))return[];const t=e.getAttribute("data-name"),i=e.getAttribute("data-type");return[{markerElement:e,name:t,type:i}]})),o=[],n=[];for(const e of i)"end"===e.type&&(i.some((t=>t.name===e.name&&"start"===t.type))||o.push({markerElement:null,name:e.name,type:"start"})),"start"===e.type&&(i.some((t=>t.name===e.name&&"end"===t.type))||n.unshift({markerElement:null,name:e.name,type:"end"}));return[...o,...i,...n]}_getUniqueMarkerName(e){const t=e.split(":"),i=m().substring(1,6);return 3===t.length?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}}class Bk extends Mn{static get pluginName(){return"ClipboardPipeline"}static get requires(){return[Dk]}init(){this.editor.editing.view.addObserver(Ck),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){const o=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:"cut"===i},(()=>{const n=o._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:n,method:i})}))}_setupPasteDrop(){const e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(o,"clipboardInput",((t,i)=>{"paste"!=i.method||e.model.canEditAt(e.model.document.selection)||t.stop()}),{priority:"highest"}),this.listenTo(o,"clipboardInput",((e,t)=>{const o=t.dataTransfer;let n;if(t.content)n=t.content;else{let e="";o.getData("text/html")?e=function(e){return e.replace(/(\s+)<\/span>/g,((e,t)=>1==t.length?" ":t)).replace(//g,"")}(o.getData("text/html")):o.getData("text/plain")&&(((r=(r=o.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

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

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

${r}

`),e=r),n=this.editor.data.htmlProcessor.toView(e)}var r;const s=new u(this,"inputTransformation");this.fire(s,{content:n,dataTransfer:o,targetRanges:t.targetRanges,method:t.method}),s.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,i)=>{if(i.content.isEmpty)return;const o=this.editor.data.toModel(i.content,"$clipboardHolder");0!=o.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:o,method:i.method,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,t)=>{t.resultRange=n._pasteFragmentWithMarkers(t.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,o=(e,i)=>{const o=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(o,t.selection,e.name)};this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",((t,i)=>{e.model.canEditAt(e.model.document.selection)?o(t,i):i.preventDefault()}),{priority:"low"}),this.listenTo(this,"outputTransformation",((t,o)=>{const n=e.data.toView(o.content);i.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:n,method:o.method})}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",Sk(o.content))),"cut"==o.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}class zk extends(C()){constructor(){super(...arguments),this._stack=[]}add(e,t){const i=this._stack,o=i[0];this._insertDescriptor(e);const n=i[0];o===n||jk(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}remove(e,t){const i=this._stack,o=i[0];this._removeDescriptor(e);const n=i[0];o===n||jk(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e.id));if(jk(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&(n=t[o],r=e,n.priority>r.priority||!(n.priorityFk(r.classes));)o++;var n,r;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e));i>-1&&t.splice(i,1)}}function jk(e,t){return e&&t&&e.priority==t.priority&&Fk(e.classes)==Fk(t.classes)}function Fk(e){return Array.isArray(e)?e.sort().join(","):e}const Hk='',Uk="ck-widget",$k="ck-widget_selected";function qk(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Wk(e,t,i={}){if(!e.is("containerElement"))throw new k("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass(Uk,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Jk,t.setCustomProperty("widgetLabel",[],e),i.label&&function(e,t){e.getCustomProperty("widgetLabel").push(t)}(e,i.label),i.hasSelectionHandle&&function(e,t){const i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),i=new uu;return i.set("content",Hk),i.render(),t.appendChild(i.element),t}));t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),Kk(e,t),e}function Zk(e,t,i){if(t.classes&&i.addClass(Co(t.classes),e),t.attributes)for(const o in t.attributes)i.setAttribute(o,t.attributes[o],e)}function Gk(e,t,i){if(t.classes&&i.removeClass(Co(t.classes),e),t.attributes)for(const o in t.attributes)i.removeAttribute(o,e)}function Kk(e,t,i=Zk,o=Gk){const n=new zk;n.on("change:top",((t,n)=>{n.oldDescriptor&&o(e,n.oldDescriptor,n.writer),n.newDescriptor&&i(e,n.newDescriptor,n.writer)})),t.setCustomProperty("addHighlight",((e,t,i)=>n.add(t,i)),e),t.setCustomProperty("removeHighlight",((e,t,i)=>n.remove(t,i)),e)}function Yk(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),t.setAttribute("role","textbox",e),t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",((i,o,n)=>{t.setAttribute("contenteditable",n?"false":"true",e)})),e.on("change:isFocused",((i,o,n)=>{n?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),Kk(e,t),e}function Qk(e,t){const i=e.getSelectedElement();if(i){const o=tb(e);if(o)return t.createRange(t.createPositionAt(i,o))}return t.schema.findOptimalInsertionRange(e)}function Jk(){return null}const Xk="widget-type-around";function eb(e,t,i){return!!e&&qk(e)&&!i.isInline(t)}function tb(e){return e.getAttribute(Xk)}var ib=n(6779);yn()(ib.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ib.A.locals;const ob=["before","after"],nb=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,rb="ck-widget__type-around_disabled";class sb extends Mn{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Zf,Np]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",((i,o,n)=>{t.change((e=>{for(const i of t.document.roots)n?e.removeClass(rb,i):e.addClass(rb,i)})),n||e.model.change((e=>{e.removeSelectionAttribute(Xk)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,o=i.editing.view,n=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:n}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,((...e)=>{this.isEnabled&&i(...e)}),o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=tb(e);if(!t)return!1;const i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",((e,n,r)=>{const s=r.mapper.toViewElement(n.item);s&&eb(s,n.item,t)&&(!function(e,t,i){const o=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const i=this.toDomElement(e);return function(e,t){for(const i of ob){const o=new Xo({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(nb,!0)]});e.appendChild(o.render())}}(i,t),function(e){const t=new Xo({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(i),i}));e.insert(e.createPositionAt(i,"end"),o)}(r.writer,o,s),s.getCustomProperty("widgetLabel").push((()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):"")))}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,o=t.schema,n=e.editing.view;function r(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(n.document,"arrowKey",((e,t)=>{this._handleArrowKeyPress(e,t)}),{context:[qk,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",((t,i)=>{i.directChange&&e.model.change((e=>{e.removeSelectionAttribute(Xk)}))})),this._listenToIfEnabled(t.document,"change:data",(()=>{const t=i.getSelectedElement();t&&eb(e.editing.mapper.toViewElement(t),t,o)||e.model.change((e=>{e.removeSelectionAttribute(Xk)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,t,i)=>{const n=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(n.removeClass(ob.map(r),e),this._currentFakeCaretModelElement=null)}const s=t.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!eb(a,s,o))return;const c=tb(t.selection);c&&(n.addClass(r(c),a),this._currentFakeCaretModelElement=s)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,i,o)=>{o||e.model.change((e=>{e.removeSelectionAttribute(Xk)}))}))}_handleArrowKeyPress(e,t){const i=this.editor,o=i.model,n=o.document.selection,r=o.schema,s=i.editing.view,a=function(e,t){const i=Ao(e,t);return"down"===i||"right"===i}(t.keyCode,i.locale.contentLanguageDirection),c=s.document.selection.getSelectedElement();let l;eb(c,i.editing.mapper.toModelElement(c),r)?l=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed?l=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(l=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),l&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,i=tb(t.document.selection);return t.change((t=>i?i!==(e?"after":"before")&&(t.removeSelectionAttribute(Xk),!0):(t.setSelectionAttribute(Xk,e?"after":"before"),!0)))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,o=i.schema,n=t.plugins.get("Widget"),r=n._getObjectElementNextToSelection(e);return!!eb(t.editing.mapper.toViewElement(r),r,o)&&(i.change((t=>{n._setSelectionOverElement(r),t.setSelectionAttribute(Xk,e?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,o=i.schema,n=t.editing.mapper,r=i.document.selection,s=e?r.getLastPosition().nodeBefore:r.getFirstPosition().nodeAfter;return!!eb(n.toViewElement(s),s,o)&&(i.change((t=>{t.setSelection(s,"on"),t.setSelectionAttribute(Xk,e?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",((i,o)=>{const n=o.domTarget.closest(".ck-widget__type-around__button");if(!n)return;const r=n.classList.contains("ck-widget__type-around__button_before")?"before":"after",s=function(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}(n,t.domConverter),a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r),o.preventDefault(),i.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",((i,o)=>{if("atTarget"!=i.eventPhase)return;const n=t.getSelectedElement(),r=e.editing.mapper.toViewElement(n),s=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:eb(r,n,s)&&(this._insertParagraph(n,o.isSoft?"before":"after"),a=!0),a&&(o.preventDefault(),i.stop())}),{context:qk})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)}),{priority:"high"}),r.isAndroid?this._listenToIfEnabled(e,"keydown",((e,t)=>{229==t.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",((t,n)=>{if("atTarget"!=t.eventPhase)return;const r=tb(i.document.selection);if(!r)return;const s=n.direction,a=i.document.selection.getSelectedElement(),c="forward"==s;if("before"===r===c)e.execute("delete",{selection:i.createSelection(a,"on")});else{const t=o.getNearestSelectionRange(i.createPositionAt(a,r),s);if(t)if(t.isCollapsed){const n=i.createSelection(t.start);if(i.modifySelection(n,{direction:s}),n.focus.isEqual(t.start)){const e=function(e,t){let i=t;for(const o of t.getAncestors({parentFirst:!0})){if(o.childCount>1||e.isLimit(o))break;i=o}return i}(o,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:!0})}else i.change((i=>{i.setSelection(t),e.execute(c?"deleteForward":"delete")}))}else i.change((i=>{i.setSelection(t),e.execute(c?"deleteForward":"delete")}))}n.preventDefault(),t.stop()}),{context:qk})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",((e,[o,n])=>{if(n&&!n.is("documentSelection"))return;const r=tb(i);return r?(e.stop(),t.change((e=>{const n=i.getSelectedElement(),s=t.createPositionAt(n,r),a=e.createSelection(s),c=t.insertContent(o,a);return e.setSelection(a),c}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",((e,i)=>{const[,o,n={}]=i;if(o&&!o.is("documentSelection"))return;const r=tb(t);r&&(n.findOptimalPosition=r,i[3]=n)}),{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",((e,[i])=>{i&&!i.is("documentSelection")||tb(t)&&e.stop()}),{priority:"high"})}}function ab(e,t,i){const o=e.schema,n=e.createRangeIn(t.root),r="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:e,item:s,type:a}of n.getWalker({startPosition:t,direction:i})){if(o.isLimit(s)&&!o.isInline(s))return e;if(a==r&&o.isBlock(s))return null}return null}function cb(e,t,i){const o="backward"==i?t.end:t.start;if(e.checkChild(o,"$text"))return o;for(const{nextPosition:o}of t.getWalker({direction:i}))if(e.checkChild(o,"$text"))return o;return null}var lb=n(1216);yn()(lb.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),lb.A.locals;class db extends Mn{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[sb,Np]}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",((t,i,o)=>{const n=o.writer,r=i.selection;if(r.isCollapsed)return;const s=r.getSelectedElement();if(!s)return;const a=e.editing.mapper.toViewElement(s);var c;qk(a)&&o.consumable.consume(r,"selection")&&n.setSelection(n.createRangeOn(a),{fake:!0,label:(c=a,c.getCustomProperty("widgetLabel").reduce(((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t),""))})})),this.editor.editing.downcastDispatcher.on("selection",((e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const o=i.writer,n=o.document.selection;let r=null;for(const e of n.getRanges())for(const t of e){const e=t.item;qk(e)&&(s=e,!(a=r)||!Array.from(s.getAncestors()).includes(a))&&(o.addClass($k,e),this._previouslySelected.add(e),r=e)}var s,a}),{priority:"low"}),t.addObserver(Td),this.listenTo(i,"mousedown",((...e)=>this._onMousedown(...e))),this.listenTo(i,"arrowKey",((...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)}),{context:[qk,"$text"]}),this.listenTo(i,"arrowKey",((...e)=>{this._preventDefaultOnArrowKeyPress(...e)}),{context:"$root"}),this.listenTo(i,"arrowKey",function(e){const t=e.model;return(i,o)=>{const n=o.keyCode==wo.arrowup,r=o.keyCode==wo.arrowdown,s=o.shiftKey,a=t.document.selection;if(!n&&!r)return;const c=r;if(s&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,c))return;const l=function(e,t,i){const o=e.model;if(i){const e=t.isCollapsed?t.focus:t.getLastPosition(),i=ab(o,e,"forward");if(!i)return null;const n=o.createRange(e,i),r=cb(o.schema,n,"backward");return r?o.createRange(e,r):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),i=ab(o,e,"backward");if(!i)return null;const n=o.createRange(i,e),r=cb(o.schema,n,"forward");return r?o.createRange(r,e):null}}(e,a,c);if(l){if(l.isCollapsed){if(a.isCollapsed)return;if(s)return}(l.isCollapsed||function(e,t,i){const o=e.model,n=e.view.domConverter;if(i){const e=o.createSelection(t.start);o.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=o.createRange(e.focus,t.end))}const r=e.mapper.toViewRange(t),s=n.viewRangeToDom(r),a=Ui.getDomRangeRects(s);let c;for(const e of a)if(void 0!==c){if(Math.round(e.top)>=c)return!1;c=Math.max(c,Math.round(e.bottom))}else c=Math.round(e.bottom);return!0}(e,l,c))&&(t.change((e=>{const i=c?l.end:l.start;if(s){const o=t.createSelection(a.anchor);o.setFocus(i),e.setSelection(o)}else e.setSelection(i)})),i.stop(),o.preventDefault(),o.stopPropagation())}}}(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",((e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())}),{context:"$root"}),this.listenTo(i,"tab",((e,t)=>{"atTarget"==e.eventPhase&&(t.shiftKey||this._selectFirstNestedEditable()&&(t.preventDefault(),e.stop()))}),{context:qk,priority:"low"}),this.listenTo(i,"tab",((e,t)=>{t.shiftKey&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{priority:"low"}),this.listenTo(i,"keydown",((e,t)=>{t.keystroke==wo.esc&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=this.editor,o=i.editing.view,n=o.document;let s=t.target;if(t.domEvent.detail>=3)return void(this._selectBlockContent(s)&&t.preventDefault());if(function(e){let t=e;for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(qk(t))return!1;t=t.parent}return!1}(s))return;if(!qk(s)&&(s=s.findAncestor(qk),!s))return;r.isAndroid&&t.preventDefault(),n.isFocused||o.focus();const a=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(e){const t=this.editor,i=t.model,o=t.editing.mapper,n=i.schema,r=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),s=function(e,t){for(const i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}(o.toModelElement(r),i.schema);return!!s&&(i.change((e=>{const t=n.isLimit(s)?null:function(e,t){const i=new Oa({startPosition:e});for(const{item:e}of i){if(t.isLimit(e)||!e.is("element"))return null;if(t.checkChild(e,"$text"))return e}return null}(e.createPositionAfter(s),n),i=e.createPositionAt(s,0),o=t?e.createPositionAt(t,0):e.createPositionAt(s,"end");e.setSelection(e.createRange(i,o))})),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,o=this.editor.model,n=o.schema,r=o.document.selection,s=r.getSelectedElement(),a=Ao(i,this.editor.locale.contentLanguageDirection),c="down"==a||"right"==a,l="up"==a||"down"==a;if(s&&n.isObject(s)){const i=c?r.getLastPosition():r.getFirstPosition(),s=n.getNearestSelectionRange(i,c?"forward":"backward");return void(s&&(o.change((e=>{e.setSelection(s)})),t.preventDefault(),e.stop()))}if(!r.isCollapsed&&!t.shiftKey){const i=r.getFirstPosition(),s=r.getLastPosition(),a=i.nodeAfter,l=s.nodeBefore;return void((a&&n.isObject(a)||l&&n.isObject(l))&&(o.change((e=>{e.setSelection(c?s:i)})),t.preventDefault(),e.stop()))}if(!r.isCollapsed)return;const d=this._getObjectElementNextToSelection(c);if(d&&n.isObject(d)){if(n.isInline(d)&&l)return;this._setSelectionOverElement(d),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t))return;if(!t.isCollapsed)return;const i=this._getObjectElementNextToSelection(e);return i?(this.editor.model.change((e=>{let o=t.anchor.parent;for(;o.isEmpty;){const t=o;o=t.parent,e.remove(t)}this._setSelectionOverElement(i)})),!0):void 0}_setSelectionOverElement(e){this.editor.model.change((t=>{t.setSelection(t.createRangeOn(e))}))}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,o=t.document.selection,n=t.createSelection(o);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(o))return null;const r=e?n.focus.nodeBefore:n.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass($k,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){const e=this.editor,t=this.editor.editing.view.document;for(const i of t.selection.getFirstRange().getItems())if(i.is("editableElement")){const t=e.editing.mapper.toModelElement(i);if(!t)continue;const o=e.model.createPositionAt(t,0),n=e.model.schema.getNearestSelectionRange(o,"forward");return e.model.change((e=>{e.setSelection(n)})),!0}return!1}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,o=(i.is("$text")?i.parent:i).findAncestor(qk);if(!o)return!1;const n=t.toModelElement(o);return!!n&&(e.model.change((e=>{e.setSelection(n,"on")})),!0)}}class ub extends Mn{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[tg]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",(t=>{(function(e){const t=e.getSelectedElement();return!(!t||!qk(t))})(e.editing.view.document.selection)&&t.stop()}),{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui,"update",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container"}){if(!i.length)return void b("widget-toolbar-no-items",{toolbarId:e});const r=this.editor,s=r.t,a=new Xu(r.locale);if(a.ariaLabel=t||s("Widget toolbar"),this._toolbarDefinitions.has(e))throw new k("widget-toolbar-duplicated",this,{toolbarId:e});const c={view:a,getRelatedElement:o,balloonClassName:n,itemsConfig:i,initialized:!1};r.ui.addToolbar(a,{isContextual:!0,beforeFocus:()=>{const e=o(r.editing.view.document.selection);e&&this._showToolbar(c,e)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const o of this._toolbarDefinitions.values()){const n=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&n)if(this.editor.ui.focusTracker.isFocused){const r=n.getAncestors().length;r>e&&(e=r,t=n,i=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?hb(this.editor,t):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:mb(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(()=>{for(const e of this._toolbarDefinitions.values())if(this._isToolbarVisible(e)){const t=e.getRelatedElement(this.editor.editing.view.document.selection);hb(this.editor,t)}})))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function hb(e,t){const i=e.plugins.get("ContextualBalloon"),o=mb(e,t);i.updatePosition(o)}function mb(e,t){const i=e.editing.view,o=Am.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast,o.viewportStickyNorth]}}j(),j();var gb=n(2060);yn()(gb.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),gb.A.locals;const pb=Qi("px");class fb extends An{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",(e=>!e))],style:{left:e.to("left",(e=>pb(e))),top:e.to("top",(e=>pb(e))),width:e.to("width",(e=>pb(e)))}}})}}class kb extends Mn{constructor(){super(...arguments),this.removeDropMarkerDelayed=Zo((()=>this.removeDropMarker()),40),this._updateDropMarkerThrottled=Nm((e=>this._updateDropMarker(e)),40),this._reconvertMarkerThrottled=Nm((()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")}),0),this._dropTargetLineView=new fb,this._domEmitter=new(Oi()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,o,n,r){this.removeDropMarkerDelayed.cancel();const s=bb(this.editor,e,t,i,o,n,r);if(s)return r&&r.containsRange(s)?this.removeDropMarker():void this._updateDropMarkerThrottled(s)}getFinalDropRange(e,t,i,o,n,r){const s=bb(this.editor,e,t,i,o,n,r);return this.removeDropMarker(),s}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,i=t.model.markers;t.model.change((t=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}_updateDropTargetLine(e){const i=this.editor.editing,o=e.start.nodeBefore,n=e.start.nodeAfter,r=e.start.parent,s=o?i.mapper.toViewElement(o):null,a=s?i.view.domConverter.mapViewToDom(s):null,c=n?i.mapper.toViewElement(n):null,l=c?i.view.domConverter.mapViewToDom(c):null,d=i.mapper.toViewElement(r);if(!d)return;const u=i.view.domConverter.mapViewToDom(d),h=this._getScrollableRect(d),{scrollX:m,scrollY:g}=t.window,p=a?new Ui(a):null,f=l?new Ui(l):null,k=new Ui(u).excludeScrollbarsAndBorders(),b=p?p.bottom:k.top,w=f?f.top:k.bottom,_=t.window.getComputedStyle(u),v=b<=w?(b+w)/2:w;if(h.topa.schema.checkChild(r,e)))){if(a.schema.checkChild(r,"$text"))return a.createRange(r);if(t)return _b(e,yb(e,t.parent),o,n)}}}else if(a.schema.isInline(l))return _b(e,l,o,n);if(a.schema.isBlock(l))return _b(e,l,o,n);if(a.schema.checkChild(l,"$block")){const t=Array.from(l.getChildren()).filter((t=>t.is("element")&&!wb(e,t)));let i=0,r=t.length;if(0==r)return a.createRange(a.createPositionAt(l,"end"));for(;i{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")})),r.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const i=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(i,"dragstart",((e,t)=>this._handleBlockDragStart(t))),this._domEmitter.listenTo(t.document,"dragover",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(t.document,"drop",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(t.document,"dragend",(()=>this._handleBlockDragEnd()),{useCapture:!0}),this.isEnabled&&i.setAttribute("draggable","true"),this.on("change:isEnabled",((e,t,o)=>{i.setAttribute("draggable",o?"true":"false")}))}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,i=t.document.selection,o=this.editor.editing.view,n=Array.from(i.getSelectedBlocks()),r=t.createRange(t.createPositionBefore(n[0]),t.createPositionAfter(n[n.length-1]));t.change((e=>e.setSelection(r))),this._isBlockDragging=!0,o.focus(),o.getObserver(Ck).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+("ltr"==this.editor.locale.contentLanguageDirection?100:-100),i=e.clientY,o=document.elementFromPoint(t,i),n=this.editor.editing.view;o&&o.closest(".ck-editor__editable")&&n.getObserver(Ck).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:o,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}var Ab=n(9262);yn()(Ab.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ab.A.locals;class Cb extends Mn{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=Zo((()=>this._clearDraggableAttributes()),40),this._blockMode=!1,this._domEmitter=new(Oi())}static get pluginName(){return"DragDrop"}static get requires(){return[Bk,db,kb,xb]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(Ck),t.addObserver(Td),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,i)=>{i||this._finalizeDragging(!1)})),r.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,i=e.model,o=e.editing.view,n=o.document,s=e.plugins.get(kb);this.listenTo(n,"dragstart",((e,t)=>{if(t.target&&t.target.is("editableElement"))return void t.preventDefault();if(this._prepareDraggedRange(t.target),!this._draggedRange)return void t.preventDefault();this._draggingUid=m(),t.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",t.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const o=i.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(t.dataTransfer,o,"dragstart");const{dataTransfer:n,domTarget:r,domEvent:s}=t,{clientX:a}=s;this._updatePreview({dataTransfer:n,domTarget:r,clientX:a}),t.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(n,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this._domEmitter.listenTo(t.document,"dragend",(()=>{this._blockMode=!1}),{useCapture:!0}),this.listenTo(n,"dragenter",(()=>{this.isEnabled&&o.focus()})),this.listenTo(n,"dragleave",(()=>{s.removeDropMarkerDelayed()})),this.listenTo(n,"dragging",((e,t)=>{if(!this.isEnabled)return void(t.dataTransfer.dropEffect="none");const{clientX:i,clientY:o}=t.domEvent;s.updateDropMarker(t.target,t.targetRanges,i,o,this._blockMode,this._draggedRange),this._draggedRange||(t.dataTransfer.dropEffect="copy"),r.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),e.stop()}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get(kb);this.listenTo(t,"clipboardInput",((t,o)=>{if("drop"!=o.method)return;const{clientX:n,clientY:r}=o.domEvent,s=i.getFinalDropRange(o.target,o.targetRanges,n,r,this._blockMode,this._draggedRange);return s?(this._draggedRange&&this._draggingUid!=o.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==Tb(o.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(s,!0)?(this._finalizeDragging(!1),void t.stop()):void(o.targetRanges=[e.editing.mapper.toViewRange(s)])):(this._finalizeDragging(!1),void t.stop())}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(Bk);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(i)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i="move"==Tb(t.dataTransfer),o=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(o&&i)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"mousedown",((o,n)=>{if(r.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let s=Eb(n.target);if(r.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const e=i.selection.getSelectedElement();e&&qk(e)||(s=i.selection.editableElement)}s&&(t.change((e=>{e.setAttribute("draggable","true",s)})),this._draggableElement=e.editing.mapper.toModelElement(s))})),this.listenTo(i,"mouseup",(()=>{r.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change((t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_finalizeDragging(e){const t=this.editor,i=t.model;t.plugins.get(kb).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change((e=>{const t=i.createSelection(this._draggedRange);i.deleteContent(t,{doNotAutoparagraph:!0});const o=t.getFirstPosition().parent;o.isEmpty&&!i.schema.checkChild(o,"$text")&&i.schema.checkChild(o,"paragraph")&&e.insertElement("paragraph",o,0)})),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,i=t.model,o=i.document.selection,n=e?Eb(e):null;if(n){const e=t.editing.mapper.toModelElement(n);return this._draggedRange=oc.fromRange(i.createRangeOn(e)),this._blockMode=i.schema.isBlock(e),void(t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop"))}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;const r=Array.from(o.getSelectedBlocks()),s=o.getFirstRange();if(0==r.length)return void(this._draggedRange=oc.fromRange(s));const a=Sb(i,r);if(r.length>1)this._draggedRange=oc.fromRange(a),this._blockMode=!0;else if(1==r.length){const e=s.start.isTouching(a.start)&&s.end.isTouching(a.end);this._draggedRange=oc.fromRange(e?a:s),this._blockMode=e}i.change((e=>e.setSelection(this._draggedRange.toRange())))}_updatePreview({dataTransfer:e,domTarget:i,clientX:o}){const n=this.editor.editing.view,s=n.document.selection.editableElement,a=n.domConverter.mapViewToDom(s),c=t.window.getComputedStyle(a);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=de(t.document,"div",{style:"position: fixed; left: -999999px;"}),t.document.body.appendChild(this._previewContainer));const l=new Ui(a);if(a.contains(i))return;const d=parseFloat(c.paddingLeft),u=de(t.document,"div");u.className="ck ck-content",u.style.width=c.width,u.style.paddingLeft=`${l.left-o+d}px`,r.isiOS&&(u.style.backgroundColor="white"),u.innerHTML=e.getData("text/html"),e.setDragImage(u,0,0),this._previewContainer.appendChild(u)}}function Tb(e){return r.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Eb(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(qk);if(qk(e))return e;const t=e.findAncestor((e=>qk(e)||e.is("editableElement")));return qk(t)?t:null}function Sb(e,t){const i=t[0],o=t[t.length-1],n=i.getCommonAncestor(o),r=e.createPositionBefore(i),s=e.createPositionAfter(o);if(n&&n.is("element")&&!e.schema.isLimit(n)){const t=e.createRangeOn(n),i=r.isTouching(t.start),o=s.isTouching(t.end);if(i&&o)return Sb(e,[n])}return e.createRange(r,s)}class Mb extends Mn{static get pluginName(){return"PastePlainText"}static get requires(){return[Bk]}init(){const e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=t.document.selection;let r=!1;i.addObserver(Ck),this.listenTo(o,"keydown",((e,t)=>{r=t.shiftKey})),e.plugins.get(Bk).on("contentInsertion",((e,i)=>{(r||function(e,t){if(e.childCount>1)return!1;const i=e.getChild(0);return!t.isObject(i)&&0==Array.from(i.getAttributeKeys()).length}(i.content,t.schema))&&t.change((e=>{const o=Array.from(n.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));n.isCollapsed||t.deleteContent(n,{doNotAutoparagraph:!0}),o.push(...n.getAttributes());const r=e.createRangeIn(i.content);for(const t of r.getItems())t.is("$textProxy")&&e.setAttributes(o,t)}))}))}}class Ib extends Mn{static get pluginName(){return"Clipboard"}static get requires(){return[Dk,Bk,Cb,Mb]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class Pb extends Pn{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!Vb(e.schema,i))do{if(i=i.parent,!i)return}while(!Vb(e.schema,i));e.change((e=>{e.setSelection(i,"in")}))}}function Vb(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const Nb=yo("Ctrl+A");class Lb extends Mn{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new Pb(e)),this.listenTo(i,"keydown",((t,i)=>{vo(i)===Nb&&(e.execute("selectAll"),i.preventDefault())})),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class Ob extends Mn{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(()=>{const e=this._createButton(gu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:selectAll",(()=>this._createButton($g)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("selectAll"),n=new e(t.locale),r=i.t;return n.set({label:r("Select all"),icon:'',keystroke:"Ctrl+A"}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),n}}class Rb extends Mn{static get requires(){return[Lb,Ob]}static get pluginName(){return"SelectAll"}}class Db extends Pn{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(e.data,"set",((e,t)=>{t[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const o=this.editor.model,n=o.document,r=[],s=e.map((e=>e.getTransformedByOperations(i))),a=s.flat();for(const e of s){const t=e.filter((e=>e.root!=n.graveyard)).filter((e=>!zb(e,a)));t.length&&(Bb(t),r.push(t[0]))}r.length&&o.change((e=>{e.setSelection(r,{backward:t})}))}_undo(e,t){const i=this.editor.model,o=i.document;this._createdBatches.add(t);const n=e.operations.slice().filter((e=>e.isDocumentOperation));n.reverse();for(const e of n){const n=e.baseVersion+1,r=Array.from(o.history.getOperations(n)),s=Ll([e.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let n of s){const r=n.affectedSelectable;r&&!i.canEditAt(r)&&(n=new Al(n.baseVersion)),t.addOperation(n),i.applyOperation(n),o.history.setOperationAsUndone(e,n)}}}}function Bb(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;tt!==e&&t.containsRange(e,!0)))}class jb extends Db{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,i=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,(()=>{this._undo(i.batch,o);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e)})),this.fire("revert",i.batch,o),this.refresh()}}class Fb extends Db{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)})),this.refresh()}}class Hb extends Mn{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const e=this.editor,t=e.t;this._undoCommand=new jb(e),this._redoCommand=new Fb(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const i=t[0];if(!i.isDocumentOperation)return;const o=i.batch,n=this._redoCommand.createdBatches.has(o),r=this._undoCommand.createdBatches.has(o);this._batchRegistry.has(o)||(this._batchRegistry.add(o),o.isUndoable&&(n?this._undoCommand.addBatch(o):r||(this._undoCommand.addBatch(o),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,i)=>{this._redoCommand.addBatch(i)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class Ub extends Mn{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,i=e.t,o="ltr"==t.uiLanguageDirection?eu.undo:eu.redo,n="ltr"==t.uiLanguageDirection?eu.redo:eu.undo;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",n)}_addButtonsToFactory(e,t,i,o){const n=this.editor;n.ui.componentFactory.add(e,(()=>{const n=this._createButton(gu,e,t,i,o);return n.set({tooltip:!0}),n})),n.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton($g,e,t,i,o)))}_createButton(e,t,i,o,n){const r=this.editor,s=r.locale,a=r.commands.get(t),c=new e(s);return c.set({label:i,icon:n,keystroke:o}),c.bind("isEnabled").to(a,"isEnabled"),this.listenTo(c,"execute",(()=>{r.execute(t),r.editing.view.focus()})),c}}class $b extends Mn{static get requires(){return[Hb,Ub]}static get pluginName(){return"Undo"}}class qb extends Mn{static get requires(){return[au,Ib,Zf,Rb,Qf,Lp,$b]}static get pluginName(){return"Essentials"}}class Wb extends Pn{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,o=e.value,n=e.batch,r=e=>{if(i.isCollapsed)o?e.setSelectionAttribute(this.attributeKey,o):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of n)o?e.setAttribute(this.attributeKey,o,t):e.removeAttribute(this.attributeKey,t)}};n?t.enqueueChange(n,(e=>{r(e)})):t.change((e=>{r(e)}))}}const Zb="fontSize",Gb="fontFamily",Kb="fontColor",Yb="fontBackgroundColor";function Qb(e,t){const i={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t)i.model.values.push(e.model),i.view[e.model]=e.view,e.upcastAlso&&(i.upcastAlso[e.model]=e.upcastAlso);return i}function Jb(e){return t=>t.getStyle(e).replace(/\s/g,"")}function Xb(e){return(t,{writer:i})=>i.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class ew extends Wb{constructor(e){super(e,Gb)}}function tw(e){return e.map(iw).filter((e=>void 0!==e))}function iw(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),i=t[0],o=t.map(ow).join(", ");return{title:i,model:o,view:{name:"span",styles:{"font-family":o},priority:7}}}(e):void 0}function ow(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class nw extends Mn{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e),e.config.define(Gb,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Gb}),e.model.schema.setAttributeProperties(Gb,{isFormatting:!0,copyOnEnter:!0});const t=tw(e.config.get("fontFamily.options")).filter((e=>e.model)),i=Qb(Gb,t);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(Gb,new ew(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:Gb,view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:Gb,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:Gb,value:e=>e.getAttribute("face")}})}}const rw='';class sw extends Mn{static get pluginName(){return"FontFamilyUI"}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),o=e.commands.get(Gb),n=t("Font Family"),r=function(e,t){const i=new Ho;for(const o of e){const e={type:"button",model:new Qm({commandName:Gb,commandParam:o.model,label:o.title,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(e=>e===o.model||!(!e||!o.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===o.model.toLowerCase())),o.view&&"string"!=typeof o.view&&o.view.styles&&e.model.set("labelStyle",`font-family: ${o.view.styles["font-family"]}`),i.add(e)}return i}(i,o);e.ui.componentFactory.add(Gb,(t=>{const i=hh(t);return ph(i,r,{role:"menu",ariaLabel:n}),i.buttonView.set({label:n,icon:rw,tooltip:!0}),i.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),i.bind("isEnabled").to(o),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${Gb}`,(t=>{const i=new Fg(t);i.buttonView.set({label:n,icon:rw}),i.bind("isEnabled").to(o);const s=new Hg(t);for(const o of r){const n=new xg(t,i),r=new $g(t);r.bind(...Object.keys(o.model)).to(o.model),r.bind("ariaChecked").to(r,"isOn"),r.delegate("execute").to(i),r.on("execute",(()=>{e.execute(o.model.commandName,{value:o.model.commandParam}),e.editing.view.focus()})),n.children.add(r),s.items.add(n)}return i.panelView.children.add(s),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t;return tw(e.config.get(Gb).options).map((e=>("Default"===e.title&&(e.title=t("Default")),e)))}}class aw extends Mn{static get requires(){return[nw,sw]}static get pluginName(){return"FontFamily"}}class cw extends Wb{constructor(e){super(e,Zb)}}function lw(e){return e.map((e=>function(e){if("number"==typeof e&&(e=String(e)),"object"==typeof e&&((t=e).title&&t.model&&t.view))return uw(e);var t;const i=function(e){return"string"==typeof e?dw[e]:dw[e.model]}(e);return i?uw(i):"default"===e?{model:void 0,title:"Default"}:function(e){let t;if("object"==typeof e){if(!e.model)throw new k("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e)?void 0:function(e){return"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`}),e.view={name:"span",styles:{"font-size":e.model}},uw(e)}(e)}(e))).filter((e=>void 0!==e))}const dw={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 uw(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}const hw=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class mw extends Mn{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e),e.config.define(Zb,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Zb}),e.model.schema.setAttributeProperties(Zb,{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),i=lw(this.editor.config.get("fontSize.options")).filter((e=>e.model)),o=Qb(Zb,i);t?(this._prepareAnyValueConverters(o),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(o),e.commands.add(Zb,new cw(e))}_prepareAnyValueConverters(e){const t=this.editor,i=e.model.values.filter((e=>{return!(t=String(e),Rd.test(t)||function(e){return Dd.test(e)}(String(e)));var t}));if(i.length)throw new k("font-size-invalid-use-of-named-presets",null,{presets:i});t.conversion.for("downcast").attributeToElement({model:Zb,view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").elementToAttribute({model:{key:Zb,value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:Zb,value:e=>{const t=e.getAttribute("size"),i="-"===t[0]||"+"===t[0];let o=parseInt(t,10);i&&(o=3+o);const n=hw.length-1,r=Math.min(Math.max(o,0),n);return hw[r]}}})}}var gw=n(9465);yn()(gw.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),gw.A.locals;const pw='';class fw extends Mn{static get pluginName(){return"FontSizeUI"}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),o=e.commands.get(Zb),n=t("Font Size"),r=function(e,t){const i=new Ho;for(const o of e){const e={type:"button",model:new Qm({commandName:Zb,commandParam:o.model,label:o.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};o.view&&"string"!=typeof o.view&&(o.view.styles&&e.model.set("labelStyle",`font-size:${o.view.styles["font-size"]}`),o.view.classes&&e.model.set("class",`${e.model.class} ${o.view.classes}`)),e.model.bind("isOn").to(t,"value",(e=>e===o.model)),i.add(e)}return i}(i,o);e.ui.componentFactory.add(Zb,(t=>{const i=hh(t);return ph(i,r,{role:"menu",ariaLabel:n}),i.buttonView.set({label:n,icon:pw,tooltip:!0}),i.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),i.bind("isEnabled").to(o),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${Zb}`,(t=>{const i=new Fg(t);i.buttonView.set({label:n,icon:pw}),i.bind("isEnabled").to(o);const s=new Hg(t);for(const o of r){const n=new xg(t,i),r=new $g(t);r.bind(...Object.keys(o.model)).to(o.model),r.bind("ariaChecked").to(r,"isOn"),r.delegate("execute").to(i),r.on("execute",(()=>{e.execute(o.model.commandName,{value:o.model.commandParam}),e.editing.view.focus()})),n.children.add(r),s.items.add(n)}return i.panelView.children.add(s),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t,i={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return lw(e.config.get(Zb).options).map((e=>{const t=i[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e}))}}class kw extends Mn{static get requires(){return[mw,fw]}static get pluginName(){return"FontSize"}normalizeSizeOptions(e){return lw(e)}}class bw extends Wb{constructor(e){super(e,Kb)}}class ww extends Mn{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(Kb,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:Kb,value:Jb("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:Kb,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:Kb,view:Xb("color")}),e.commands.add(Kb,new bw(e)),e.model.schema.extend("$text",{allowAttributes:Kb}),e.model.schema.setAttributeProperties(Kb,{isFormatting:!0,copyOnEnter:!0})}}class _w extends Mn{constructor(e,{commandName:t,componentName:i,icon:o,dropdownLabel:n}){super(e),this.commandName=t,this.componentName=i,this.icon=o,this.dropdownLabel=n,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,t=e.locale,i=t.t,o=e.commands.get(this.commandName),n=e.config.get(this.componentName),r=function(e,t){const i=e.t,o={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map((e=>{const t=o[e.label];return t&&t!=e.label&&(e.label=t),e}))}(t,function(e){return e.map(yu).filter((e=>!!e))}(n.colors)),s=n.documentColors,a=!1!==n.colorPicker;e.ui.componentFactory.add(this.componentName,(t=>{const c=hh(t);let l=!1;const d=function({dropdownView:e,colors:t,columns:i,removeButtonLabel:o,colorPickerLabel:n,documentColorsLabel:r,documentColorsCount:s,colorPickerViewConfig:a}){const c=e.locale,l=new nm(c,{colors:t,columns:i,removeButtonLabel:o,colorPickerLabel:n,documentColorsLabel:r,documentColorsCount:s,colorPickerViewConfig:a});return e.colorSelectorView=l,e.panelView.children.add(l),l}({dropdownView:c,colors:r.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==s?i("Document colors"):"",documentColorsCount:void 0===s?this.columns:s,colorPickerViewConfig:!!a&&(n.colorPicker||{})});return d.bind("selectedColor").to(o,"value"),c.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),c.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),c.bind("isEnabled").to(o),d.on("execute",((t,i)=>{c.isOpen&&e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),"colorPicker"!==i.source&&e.editing.view.focus(),"colorPickerSaveButton"===i.source&&(c.isOpen=!1)})),d.on("colorPicker:show",(()=>{this._undoStepBatch=e.model.createBatch()})),d.on("colorPicker:cancel",(()=>{this._undoStepBatch.operations.length&&(c.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()})),c.on("change:isOpen",((t,i,o)=>{l||(l=!0,c.colorSelectorView.appendUI()),o&&(0!==s&&d.updateDocumentColors(e.model,this.componentName),d.updateSelectedColors(),d.showColorGridsFragment())})),kh(c,(()=>c.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((e=>e.isOn)))),c})),e.ui.componentFactory.add(`menuBar:${this.componentName}`,(t=>{const n=new Fg(t);n.buttonView.set({label:this.dropdownLabel,icon:this.icon}),n.bind("isEnabled").to(o);let a=!1;const c=new nm(t,{colors:r.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==s?i("Document colors"):"",documentColorsCount:void 0===s?this.columns:s,colorPickerViewConfig:!1});return c.bind("selectedColor").to(o,"value"),c.delegate("execute").to(n),c.on("execute",((t,i)=>{e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),e.editing.view.focus()})),n.on("change:isOpen",((t,i,o)=>{a||(a=!0,c.appendUI()),o&&(0!==s&&c.updateDocumentColors(e.model,this.componentName),c.updateSelectedColors(),c.showColorGridsFragment())})),n.panelView.children.add(c),n}))}}class vw extends _w{constructor(e){const t=e.locale.t;super(e,{commandName:Kb,componentName:Kb,icon:'',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class yw extends Mn{static get requires(){return[ww,vw]}static get pluginName(){return"FontColor"}}class xw extends Wb{constructor(e){super(e,Yb)}}class Aw extends Mn{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(Yb,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(qd),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:Yb,value:Jb("background-color")}}),e.conversion.for("downcast").attributeToElement({model:Yb,view:Xb("background-color")}),e.commands.add(Yb,new xw(e)),e.model.schema.extend("$text",{allowAttributes:Yb}),e.model.schema.setAttributeProperties(Yb,{isFormatting:!0,copyOnEnter:!0})}}class Cw extends _w{constructor(e){const t=e.locale.t;super(e,{commandName:Yb,componentName:Yb,icon:'',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Tw extends Mn{static get requires(){return[Aw,Cw]}static get pluginName(){return"FontBackgroundColor"}}class Ew extends Pn{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=Uo(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Sw(t,e.schema)}execute(e={}){const t=this.editor.model,i=t.document,o=e.selection||i.selection;t.canEditAt(o)&&t.change((e=>{const i=o.getSelectedBlocks();for(const o of i)!o.is("element","paragraph")&&Sw(o,t.schema)&&e.rename(o,"paragraph")}))}}function Sw(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class Mw extends Pn{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,i=e.attributes;let o=e.position;t.canEditAt(o)&&t.change((e=>{if(o=this._findPositionToInsertParagraph(o,e),!o)return;const n=e.createElement("paragraph");i&&t.schema.setAllowedAttributes(n,i,e),t.insertContent(n,o),e.setSelection(n,"in")}))}_findPositionToInsertParagraph(e,t){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const o=i.schema.findAllowedParent(e,"paragraph");if(!o)return null;const n=e.parent,r=i.schema.checkChild(n,"$text");return n.isEmpty||r&&e.isAtEnd?i.createPositionAfter(n):!n.isEmpty&&r&&e.isAtStart?i.createPositionBefore(n):t.split(e,o).position}}class Iw extends Mn{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Ew(e)),e.commands.add("insertParagraph",new Mw(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Iw.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Iw.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);const Pw=Iw;class Vw extends Pn{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=Uo(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>Nw(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,i=t.document,o=e.value;t.change((e=>{const n=Array.from(i.selection.getSelectedBlocks()).filter((e=>Nw(e,o,t.schema)));for(const t of n)t.is("element",o)||e.rename(t,o)}))}}function Nw(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const Lw="paragraph";class Ow extends Mn{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Pw]}init(){const e=this.editor,t=e.config.get("heading.options"),i=[];for(const o of t)"paragraph"!==o.model&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),i.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Vw(e,i))}afterInit(){const e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,o)=>{const n=e.model.document.selection.getFirstPosition().parent;i.some((e=>n.is("element",e.model)))&&!n.is("element",Lw)&&0===n.childCount&&o.writer.rename(n,Lw)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:g.low+1})}}var Rw=n(6186);yn()(Rw.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Rw.A.locals;class Dw extends Mn{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,i=function(e){const t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map((e=>{const t=i[e.title];return t&&t!=e.title&&(e.title=t),e}))}(e),o=t("Choose heading"),n=t("Heading");e.ui.componentFactory.add("heading",(t=>{const r={},s=new Ho,a=e.commands.get("heading"),c=e.commands.get("paragraph"),l=[a];for(const e of i){const t={type:"button",model:new Qm({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(c,"value"),t.model.set("commandName","paragraph"),l.push(c)):(t.model.bind("isOn").to(a,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const d=hh(t);return ph(d,s,{ariaLabel:n,role:"menu"}),d.buttonView.set({ariaLabel:n,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:n}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some((e=>e)))),d.buttonView.bind("label").to(a,"value",c,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?o:r[i]?r[i]:o})),d.buttonView.bind("ariaLabel").to(a,"value",c,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?n:r[i]?`${r[i]}, ${n}`:n})),this.listenTo(d,"execute",(t=>{const{commandName:i,commandValue:o}=t.source;e.execute(i,o?{value:o}:void 0),e.editing.view.focus()})),d})),e.ui.componentFactory.add("menuBar:heading",(o=>{const n=new Fg(o),r=e.commands.get("heading"),s=e.commands.get("paragraph"),a=[r],c=new Hg(o);n.set({class:"ck-heading-dropdown"}),c.set({ariaLabel:t("Heading"),role:"menu"}),n.buttonView.set({label:t("Heading")}),n.panelView.children.add(c);for(const t of i){const i=new xg(o,n),l=new $g(o);i.children.add(l),c.items.add(i),l.set({label:t.title,role:"menuitemradio",class:t.class}),l.bind("ariaChecked").to(l,"isOn"),l.delegate("execute").to(n),l.on("execute",(()=>{const i="paragraph"===t.model?"paragraph":"heading";e.execute(i,{value:t.model}),e.editing.view.focus()})),"paragraph"===t.model?(l.bind("isOn").to(s,"value"),a.push(s)):l.bind("isOn").to(r,"value",(e=>e===t.model))}return n.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),n}))}}class Bw extends Mn{static get requires(){return[Ow,Dw]}static get pluginName(){return"Heading"}}new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class zw extends Pn{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=function(e,t,i){const o=function(e,t){const i=Qk(e,t).start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(e,i);return t.checkChild(o,"horizontalLine")}(i,t,e)}execute(){const e=this.editor.model;e.change((t=>{const i=t.createElement("horizontalLine");e.insertObject(i,null,null,{setSelection:"after"})}))}}var jw=n(1799);yn()(jw.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),jw.A.locals;class Fw extends Mn{static get pluginName(){return"HorizontalLineEditing"}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("horizontalLine",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToElement({model:"horizontalLine",view:(e,{writer:t})=>t.createEmptyElement("hr")}),o.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(e,{writer:t})=>{const o=i("Horizontal line"),n=t.createContainerElement("div",null,t.createEmptyElement("hr"));return t.addClass("ck-horizontal-line",n),t.setCustomProperty("hr",!0,n),function(e,t,i){return t.setCustomProperty("horizontalLine",!0,e),Wk(e,t,{label:i})}(n,t,o)}}),o.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),e.commands.add("horizontalLine",new zw(e))}}class Hw extends Mn{static get pluginName(){return"HorizontalLineUI"}init(){const e=this.editor;e.ui.componentFactory.add("horizontalLine",(()=>{const e=this._createButton(gu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:horizontalLine",(()=>this._createButton($g)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("horizontalLine"),n=new e(t.locale),r=i.t;return n.set({label:r("Horizontal line"),icon:eu.horizontalLine}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("horizontalLine"),t.editing.view.focus()})),n}}class Uw extends Mn{static get requires(){return[Fw,Hw,db]}static get pluginName(){return"HorizontalLine"}}class $w extends Pn{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection,o=qw(i);this.isEnabled=function(e,t,i){const o=function(e,t){const i=Qk(e,t).start.parent;return i.isEmpty&&!i.is("rootElement")?i.parent:i}(e,i);return t.checkChild(o,"rawHtml")}(i,t,e),this.value=o?o.getAttribute("value")||"":null}execute(e){const t=this.editor.model,i=t.document.selection;t.change((o=>{let n;null!==this.value?n=qw(i):(n=o.createElement("rawHtml"),t.insertObject(n,null,null,{setSelection:"on"})),o.setAttribute("value",e,n)}))}}function qw(e){const t=e.getSelectedElement();return t&&t.is("element","rawHtml")?t:null}var Ww=n(9856);yn()(Ww.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ww.A.locals;class Zw extends Mn{static get pluginName(){return"HtmlEmbedEditing"}constructor(e){super(e),this._widgetButtonViewReferences=new Set,e.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:e=>(b("html-embed-provide-sanitize-function"),{html:e,hasChanged:!1})})}init(){const e=this.editor;e.model.schema.register("rawHtml",{inheritAllFrom:"$blockObject",allowAttributes:["value"]}),e.commands.add("htmlEmbed",new $w(e)),this._setupConversion()}_setupConversion(){const e=this.editor,t=e.t,i=e.editing.view,o=this._widgetButtonViewReferences,n=e.config.get("htmlEmbed");function r({editor:e,domElement:i,state:n,props:r}){i.textContent="";const a=i.ownerDocument;let c;if(n.isEditable){const e={isDisabled:!1,placeholder:r.textareaPlaceholder};c=s({domDocument:a,state:n,props:e}),i.append(c)}else if(n.showPreviews){const o={sanitizeHtml:r.sanitizeHtml};i.append(function({editor:e,domDocument:i,state:o,props:n}){const r=n.sanitizeHtml(o.getRawHtmlValue()),s=de(i,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},o.getRawHtmlValue().length>0?t("No preview available"):t("Empty snippet content")),a=de(i,"div",{class:"raw-html-embed__preview-content",dir:e.locale.contentLanguageDirection}),c=i.createRange().createContextualFragment(r.html);a.appendChild(c);return de(i,"div",{class:"raw-html-embed__preview"},[s,a])}({domDocument:a,state:n,props:o,editor:e}))}else{const e={isDisabled:!0,placeholder:r.textareaPlaceholder};i.append(s({domDocument:a,state:n,props:e}))}const l={onEditClick:r.onEditClick,onSaveClick:()=>{r.onSaveClick(c.value)},onCancelClick:r.onCancelClick};i.prepend(function({editor:e,domDocument:t,state:i,props:n}){const r=de(t,"div",{class:"raw-html-embed__buttons-wrapper"});if(i.isEditable){const t=Gw(e,"save",n.onSaveClick),i=Gw(e,"cancel",n.onCancelClick);r.append(t.element,i.element),o.add(t).add(i)}else{const t=Gw(e,"edit",n.onEditClick);r.append(t.element),o.add(t)}return r}({editor:e,domDocument:a,state:n,props:l}))}function s({domDocument:e,state:t,props:i}){const o=de(e,"textarea",{placeholder:i.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return o.disabled=i.isDisabled,o.value=t.getRawHtmlValue(),o}this.editor.editing.view.on("render",(()=>{for(const e of o){if(e.element&&e.element.isConnected)return;e.destroy(),o.delete(e)}}),{priority:"lowest"}),e.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),e.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(e,{writer:t})=>t.createElement("rawHtml",{value:e.getCustomProperty("$rawContent")})}),e.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(e,{writer:t})=>t.createRawElement("div",{class:"raw-html-embed"},(function(t){t.innerHTML=e.getAttribute("value")||""}))}),e.conversion.for("editingDowncast").elementToStructure({model:{name:"rawHtml",attributes:["value"]},view:(o,{writer:s})=>{let a,c,l;const d=s.createRawElement("div",{class:"raw-html-embed__content-wrapper"},(function(t){a=t,r({editor:e,domElement:t,state:c,props:l}),a.addEventListener("mousedown",(()=>{if(c.isEditable){const t=e.model;t.document.selection.getSelectedElement()!==o&&t.change((e=>e.setSelection(o,"on")))}}),!0)})),u={makeEditable(){c=Object.assign({},c,{isEditable:!0}),r({domElement:a,editor:e,state:c,props:l}),i.change((e=>{e.setAttribute("data-cke-ignore-events","true",d)})),a.querySelector("textarea").focus()},save(t){t!==c.getRawHtmlValue()?(e.execute("htmlEmbed",t),e.editing.view.focus()):this.cancel()},cancel(){c=Object.assign({},c,{isEditable:!1}),r({domElement:a,editor:e,state:c,props:l}),e.editing.view.focus(),i.change((e=>{e.removeAttribute("data-cke-ignore-events",d)}))}};c={showPreviews:n.showPreviews,isEditable:!1,getRawHtmlValue:()=>o.getAttribute("value")||""},l={sanitizeHtml:n.sanitizeHtml,textareaPlaceholder:t("Paste raw HTML here..."),onEditClick(){u.makeEditable()},onSaveClick(e){u.save(e)},onCancelClick(){u.cancel()}};const h=s.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":t("HTML snippet"),dir:e.locale.uiLanguageDirection},d);return s.setCustomProperty("rawHtmlApi",u,h),s.setCustomProperty("rawHtml",!0,h),Wk(h,s,{label:t("HTML snippet"),hasSelectionHandle:!0})}})}}function Gw(e,t,i){const{t:o}=e.locale,n=new gu(e.locale),r=e.commands.get("htmlEmbed");return n.set({class:`raw-html-embed__${t}-button`,icon:eu.pencil,tooltip:!0,tooltipPosition:"rtl"===e.locale.uiLanguageDirection?"e":"w"}),n.render(),"edit"===t?(n.set({icon:eu.pencil,label:o("Edit source")}),n.bind("isEnabled").to(r)):"save"===t?(n.set({icon:eu.check,label:o("Save changes")}),n.bind("isEnabled").to(r)):n.set({icon:eu.cancel,label:o("Cancel")}),n.on("execute",i),n}class Kw extends Mn{static get pluginName(){return"HtmlEmbedUI"}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("htmlEmbed",(()=>{const e=this._createButton(gu);return e.set({tooltip:!0,label:t("Insert HTML")}),e})),e.ui.componentFactory.add("menuBar:htmlEmbed",(()=>{const e=this._createButton($g);return e.set({label:t("HTML snippet")}),e}))}_createButton(e){const t=this.editor,i=t.commands.get("htmlEmbed"),o=new e(t.locale);return o.set({icon:eu.html}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",(()=>{t.execute("htmlEmbed"),t.editing.view.focus(),t.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()})),o}}class Yw extends Mn{static get requires(){return[Zw,Kw,db]}static get pluginName(){return"HtmlEmbed"}}function Qw(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot("children")])}function Jw(e,t){const i=e.plugins.get("ImageUtils"),o=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>i.isInlineImageView(e)?o&&("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:n(e):null;function n(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function Xw(e,t){const i=Uo(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}function e_(e){return e&&e.endsWith("px")?parseInt(e):null}function t_(e){const t=e_(e.getStyle("width")),i=e_(e.getStyle("height"));return!(!t||!i)}const i_=/^(image|image-inline)$/;class o_ extends Mn{constructor(){super(...arguments),this._domEmitter=new(Oi())}static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,o={}){const n=this.editor,r=n.model,s=r.document.selection,a=n_(n,t||s,i);e={...Object.fromEntries(s.getAttributes()),...e};for(const t in e)r.schema.checkAttribute(a,t)||delete e[t];return r.change((i=>{const{setImageSizes:n=!0}=o,s=i.createElement(a,e);return r.insertObject(s,t,null,{setSelection:"on",findOptimalPosition:t||"imageInline"==a?void 0:"auto"}),s.parent?(n&&this.setImageNaturalSizeAttributes(s),s):null}))}setImageNaturalSizeAttributes(e){const i=e.getAttribute("src");i&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change((o=>{const n=new t.window.Image;this._domEmitter.listenTo(n,"load",(()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(o.batch,(t=>{t.setAttribute("width",n.naturalWidth,e),t.setAttribute("height",n.naturalHeight,e)})),this._domEmitter.stopListening(n,"load")})),n.src=i})))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:i_})}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){if("imageBlock"==n_(e,t,null)){const i=function(e,t){const i=Qk(e,t).start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every((e=>!e.is("element","imageBlock")))}(e)}toImageWidget(e,t,i){return t.setCustomProperty("image",!0,e),Wk(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&qk(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function n_(e,t,i){const o=e.model.schema,n=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===n?"imageInline":"auto"!==n?"imageBlock":t.is("selection")?Xw(o,t):o.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class r_ extends Pn{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),o=t.model,n=i.getClosestSelectedImageElement(o.document.selection);o.change((t=>{t.setAttribute("alt",e.newValue,n)}))}}class s_ extends Mn{static get requires(){return[o_]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new r_(this.editor))}}var a_=n(8429);yn()(a_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),a_.A.locals;var c_=n(871);yn()(c_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),c_.A.locals;class l_ extends An{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new $o,this.keystrokes=new qo,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),eu.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),eu.cancel,"ck-button-cancel","cancel"),this._focusables=new Jo,this._focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),En({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,i,o){const n=new gu(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createLabeledInputView(){const e=this.locale.t,t=new Lu(this.locale,wh);return t.label=e("Text alternative"),t}}function d_(e){const t=e.editing.view,i=Am.defaultPositions,o=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(o.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class u_ extends Mn{static get requires(){return[tg]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",(i=>{const o=e.commands.get("imageTextAlternative"),n=new gu(i);return n.set({label:t("Change image text alternative"),icon:eu.textAlternative,tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{this._showForm()})),n}))}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Tn(l_))(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),this.listenTo(e.ui,"update",(()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=d_(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),Cn({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:d_(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class h_ extends Mn{static get requires(){return[s_,u_]}static get pluginName(){return"ImageTextAlternative"}}function m_(e,t){const i=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,r=o.mapper.toViewElement(i.item),s=e.findViewImgElement(r);null===i.attributeNewValue?(n.removeAttribute("srcset",s),n.removeAttribute("sizes",s)):i.attributeNewValue&&(n.setAttribute("srcset",i.attributeNewValue,s),n.setAttribute("sizes","100vw",s))};return e=>{e.on(`attribute:srcset:${t}`,i)}}function g_(e,t,i){const o=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,r=o.mapper.toViewElement(i.item),s=e.findViewImgElement(r);n.setAttribute(i.attributeKey,i.attributeNewValue||"",s)};return e=>{e.on(`attribute:${i}:${t}`,o)}}class p_ extends Ds{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class f_ extends Pn{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&b("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&b("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Co(e.source),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const r=i.getSelectedElement();if("string"==typeof e&&(e={src:e}),t&&r&&o.isImage(r)){const t=this.editor.model.createPositionAfter(r);o.insertImage({...e,...n},t)}else o.insertImage({...e,...n})}))}}class k_ extends Pn{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change((o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),i.setImageNaturalSizeAttributes(t)}))}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class b_ extends Mn{static get requires(){return[o_]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(p_),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new f_(e),o=new k_(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",i)}}class w_ extends Mn{static get requires(){return[o_]}static get pluginName(){return"ImageSizeAttributes"}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils"),o="imageBlock"===e?"figure":"img";function n(t,o,n,r){t.on(`attribute:${o}:${e}`,((t,o,s)=>{if(!s.consumable.consume(o.item,t.name))return;const a=s.writer,c=s.mapper.toViewElement(o.item),l=i.findViewImgElement(c);if(null!==o.attributeNewValue?a.setAttribute(n,o.attributeNewValue,l):a.removeAttribute(n,l),o.item.hasAttribute("sources"))return;const d=o.item.hasAttribute("resizedWidth");if("imageInline"===e&&!d&&!r)return;const u=o.item.getAttribute("width"),h=o.item.getAttribute("height");u&&h&&a.setStyle("aspect-ratio",`${u}/${h}`,l)}))}t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:e=>t_(e)?e_(e.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:e=>t_(e)?e_(e.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add((e=>{n(e,"width","width",!0),n(e,"height","height",!0)})),t.conversion.for("dataDowncast").add((e=>{n(e,"width","width",!1),n(e,"height","height",!1)}))}}class __ extends Pn{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,i=this.editor.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection),r=Object.fromEntries(n.getAttributes());return r.src||r.uploadId?i.change((t=>{const{setImageSizes:s=!0}=e,a=Array.from(i.markers).filter((e=>e.getRange().containsItem(n))),c=o.insertImage(r,i.createSelection(n,"on"),this._modelElementName,{setImageSizes:s});if(!c)return null;const l=t.createRangeOn(c);for(const e of a){const i=e.getRange(),o="$graveyard"!=i.root.rootName?i.getJoined(l,!0):l;t.updateMarker(e,{range:o})}return{oldElement:n,newElement:c}})):null}}var v_=n(1091);yn()(v_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),v_.A.locals;class y_ extends Mn{static get requires(){return[o_]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add((e=>{e.on("attribute:placeholder",((e,t,o)=>{if(!o.consumable.test(t.item,e.name))return;if(!t.item.is("element","imageBlock")&&!t.item.is("element","imageInline"))return;o.consumable.consume(t.item,e.name);const n=o.writer,r=o.mapper.toViewElement(t.item),s=i.findViewImgElement(r);t.attributeNewValue?(n.addClass("image_placeholder",s),n.setStyle("background-image",`url(${t.attributeNewValue})`,s),n.setCustomProperty("editingPipeline:doNotReuseOnce",!0,s)):(n.removeClass("image_placeholder",s),n.removeStyle("background-image",s))}))}))}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,o=i.view,n=e.plugins.get("ImageUtils");o.addObserver(p_),this.listenTo(o.document,"imageLoaded",((e,r)=>{const s=o.domConverter.mapDomToView(r.target);if(!s)return;const a=n.getImageWidgetFromImageView(s);if(!a)return;const c=i.mapper.toModelElement(a);c&&c.hasAttribute("placeholder")&&t.enqueueChange({isUndoable:!1},(e=>{e.removeAttribute("placeholder",c)}))}))}}class x_ extends Mn{static get requires(){return[b_,w_,o_,y_,Bk]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new __(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>Qw(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>o.toImageWidget(Qw(i),i,t("image widget"))}),i.for("downcast").add(g_(o,"imageBlock","src")).add(g_(o,"imageBlock","alt")).add(m_(o,"imageBlock")),i.for("upcast").elementToElement({view:Jw(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)}).add(function(e){const t=(t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const n=e.findViewImgElement(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,classes:"image"});const r=Uo(o.convertItem(n,i.modelCursor).modelRange.getItems());r?(o.convertChildren(i.viewItem,r),o.updateConversionResult(r,i)):o.consumable.revert(i.viewItem,{name:!0,classes:"image"})};return e=>{e.on("element:figure",t)}}(o))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(o.isInlineImageView))return;a=r.targetRanges?e.editing.mapper.toModelRange(r.targetRanges[0]):t.document.selection.getFirstRange();const c=t.createSelection(a);if("imageBlock"===Xw(t.schema,c)){const e=new Ed(i.document),t=s.map((t=>e.createElement("figure",{class:"image"},t)));r.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(e)}))}))}}var A_=n(1545);yn()(A_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),A_.A.locals;class C_ extends An{constructor(e,t=[]){super(e),this.focusTracker=new $o,this.keystrokes=new qo,this._focusables=new Jo,this.children=this.createCollection(),this._focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const e of t)this.children.add(e),this._focusables.add(e),e instanceof vu&&this._focusables.addMany(e.children);if(this._focusables.length>1)for(const e of this._focusables)T_(e)&&(e.focusCycler.on("forwardCycle",(e=>{this._focusCycler.focusNext(),e.stop()})),e.focusCycler.on("backwardCycle",(e=>{this._focusCycler.focusPrevious(),e.stop()})));this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),En({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function T_(e){return"focusCycler"in e}class E_ extends Mn{static get pluginName(){return"ImageInsertUI"}static get requires(){return[o_]}constructor(e){super(e),this._integrations=new Map,e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",(()=>{this.isImageSelected=i.isImage(t.getSelectedElement())}));const o=e=>this._createToolbarComponent(e);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o)}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:o,requiresForm:n}){this._integrations.has(e)&&b("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,formViewCreator:o,requiresForm:!!n})}_createToolbarComponent(e){const t=this.editor,i=e.t,o=this._prepareIntegrations();if(!o.length)return null;let n;const r=o[0];if(1==o.length){if(!r.requiresForm)return r.buttonViewCreator(!0);n=r.buttonViewCreator(!0)}else{const t=r.buttonViewCreator(!1);n=new lh(e,t),n.tooltip=!0,n.bind("label").to(this,"isImageSelected",(e=>i(e?"Replace image":"Insert image")))}const s=this.dropdownView=hh(e,n),a=o.map((({observable:e})=>"function"==typeof e?e():e));return s.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),s.once("change:isOpen",(()=>{const e=o.map((({formViewCreator:e})=>e(1==o.length))),i=new C_(t.locale,e);s.panelView.children.add(i)})),s}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return b("image-insert-integrations-not-specified"),t;for(const i of e)this._integrations.has(i)?t.push(this._integrations.get(i)):["upload","assetManager","url"].includes(i)||b("image-insert-unknown-integration",{item:i});return t.length||b("image-insert-integrations-not-registered"),t}}var S_=n(8574);yn()(S_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),S_.A.locals;class M_ extends Mn{static get requires(){return[x_,db,h_,E_]}static get pluginName(){return"ImageBlock"}}class I_ extends Mn{static get requires(){return[b_,w_,o_,y_,Bk]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck(((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1})),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new __(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>o.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(g_(o,"imageInline","src")).add(g_(o,"imageInline","alt")).add(m_(o,"imageInline")),i.for("upcast").elementToElement({view:Jw(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(o.isBlockImageView))return;a=r.targetRanges?e.editing.mapper.toModelRange(r.targetRanges[0]):t.document.selection.getFirstRange();const c=t.createSelection(a);if("imageInline"===Xw(t.schema,c)){const e=new Ed(i.document),t=s.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,o.findViewImgElement(t)))),t.getChild(0)):t));r.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageInline")&&o.setImageNaturalSizeAttributes(e)}))}))}}class P_ extends Mn{static get requires(){return[I_,db,h_,E_]}static get pluginName(){return"ImageInline"}}class V_ extends Mn{static get requires(){return[M_,P_]}static get pluginName(){return"Image"}}class N_ extends Mn{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[o_]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class L_ extends Pn{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(x_))return this.isEnabled=!1,void(this.value=!1);const o=e.model.document.selection,n=o.getSelectedElement();if(!n){const e=t.getCaptionFromModelSelection(o);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=i.isImage(n),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(n):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change((e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)}))}_showImageCaption(e,t){const i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),n=this.editor.plugins.get("ImageUtils");let r=i.getSelectedElement();const s=o._getSavedCaption(r);n.isInlineImage(r)&&(this.editor.execute("imageTypeBlock"),r=i.getSelectedElement());const a=s||e.createElement("caption");e.append(a,r),t&&e.setSelection(a,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),n=t.plugins.get("ImageCaptionUtils");let r,s=i.getSelectedElement();s?r=n.getCaptionFromImageModelElement(s):(r=n.getCaptionFromModelSelection(i),s=r.parent),o._saveCaption(s,r),e.setSelection(s,"on"),e.remove(r)}}class O_ extends Mn{static get requires(){return[o_,N_]}static get pluginName(){return"ImageCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new L_(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),n=e.t;e.conversion.for("upcast").elementToElement({view:e=>o.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:o})=>{if(!i.isBlockImage(e.parent))return null;const r=o.createEditableElement("figcaption");o.setCustomProperty("imageCaption",!0,r),r.placeholder=n("Enter image caption"),jn({view:t,element:r,keepOnFocus:!0});const s=e.parent.getAttribute("alt");return Yk(r,o,{label:s?n("Caption for image: %0",[s]):n("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),n=e.commands.get("imageTypeBlock"),r=e=>{if(!e.return)return;const{oldElement:o,newElement:n}=e.return;if(!o)return;if(t.isBlockImage(o)){const e=i.getCaptionFromImageModelElement(o);if(e)return void this._saveCaption(n,e)}const r=this._getSavedCaption(o);r&&this._saveCaption(n,r)};o&&this.listenTo(o,"execute",r,{priority:"low"}),n&&this.listenTo(n,"execute",r,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?La.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const n=t.document.differ.getChanges();for(const t of n){if("alt"!==t.attributeKey)continue;const n=t.range.start.nodeAfter;if(i.isBlockImage(n)){const t=o.getCaptionFromImageModelElement(n);if(!t)return;e.editing.reconvertItem(t)}}}))}}class R_ extends Mn{static get requires(){return[N_]}static get pluginName(){return"ImageCaptionUI"}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",(n=>{const r=e.commands.get("toggleImageCaption"),s=new gu(n);return s.set({icon:eu.caption,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.bind("label").to(r,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(s,"execute",(()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const o=i.getCaptionFromModelSelection(e.model.document.selection);if(o){const i=e.editing.mapper.toViewElement(o);t.scrollToTheSelection(),t.change((e=>{e.addClass("image__caption_highlighted",i)}))}e.editing.view.focus()})),s}))}}var D_=n(3038);yn()(D_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),D_.A.locals;class B_ extends Mn{static get requires(){return[O_,R_]}static get pluginName(){return"ImageCaption"}}function z_(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function j_(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class F_ extends Mn{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,i=()=>{const e=this._createButton(ku);return e.set({label:t("Upload image from computer"),tooltip:!0}),e};if(e.ui.componentFactory.add("uploadImage",i),e.ui.componentFactory.add("imageUpload",i),e.ui.componentFactory.add("menuBar:uploadImage",(()=>{const e=this._createButton(qg);return e.label=t("Image from computer"),e})),e.plugins.has("ImageInsertUI")){const i=e.plugins.get("ImageInsertUI");i.registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>{const o=e.ui.componentFactory.create("uploadImage");return o.bind("label").to(i,"isImageSelected",(e=>t(e?"Replace image from computer":"Upload image from computer"))),o},formViewCreator:()=>{const o=e.ui.componentFactory.create("uploadImage");return o.withText=!0,o.bind("label").to(i,"isImageSelected",(e=>t(e?"Replace from computer":"Upload from computer"))),o.on("execute",(()=>{i.dropdownView.isOpen=!1})),o}})}}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("uploadImage"),n=t.config.get("image.upload.types"),r=z_(n),s=new e(t.locale),a=i.t;return s.set({acceptedType:n.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0,label:a("Upload image from computer"),icon:eu.imageUpload}),s.bind("isEnabled").to(o),s.on("done",((e,i)=>{const o=Array.from(i).filter((e=>r.test(e.type)));o.length&&(t.execute("uploadImage",{file:o}),t.editing.view.focus())})),s}}class H_ extends(j()){constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise(((i,o)=>{t.onload=()=>{const e=t.result;this._data=e,i(e)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)}))}abort(){this._reader.abort()}}class U_ extends Mn{constructor(){super(...arguments),this.loaders=new Ho,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[Xd]}init(){this.loaders.on("change",(()=>this._updatePendingAction())),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0))}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return b("filerepository-no-upload-adapter"),null;const t=new $_(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then((e=>{this._loadersMap.set(e,t)})).catch((()=>{})),t.on("change:uploaded",(()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e})),t.on("change:uploadTotal",(()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e})),t}destroyLoader(e){const t=e instanceof $_?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach(((e,i)=>{e===t&&this._loadersMap.delete(i)}))}_updatePendingAction(){const e=this.editor.plugins.get(Xd);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}}class $_ extends(j()){constructor(e,t){super(),this.id=m(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new H_,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0)),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then((e=>this._filePromiseWrapper?e:null)):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new k("filerepository-read-wrong-status",this);return this.status="reading",this.file.then((e=>this._reader.read(e))).then((e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e})).catch((e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e}))}upload(){if("idle"!=this.status)throw new k("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then((()=>this._adapter.upload())).then((e=>(this.uploadResponse=e,this.status="idle",e))).catch((e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e}))}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch((()=>{})),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise(((i,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then((e=>{t.isFulfilled=!0,i(e)})).catch((e=>{t.isFulfilled=!0,o(e)}))})),t}}var q_=n(7504);yn()(q_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),q_.A.locals;var W_=n(1230);yn()(W_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),W_.A.locals;var Z_=n(1160);yn()(Z_.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Z_.A.locals;class G_ extends Mn{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.uploadStatusChange=(e,t,i)=>{const o=this.editor,n=t.item,r=n.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const s=o.plugins.get("ImageUtils"),a=o.plugins.get(U_),c=r?t.attributeNewValue:null,l=this.placeholder,d=o.editing.mapper.toViewElement(n),u=i.writer;if("reading"==c)return K_(d,u),void Y_(s,l,d,u);if("uploading"==c){const e=a.loaders.get(r);return K_(d,u),void(e?(Q_(d,u),function(e,t,i,o){const n=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),n),i.on("change:uploadedPercent",((e,t,i)=>{o.change((e=>{e.setStyle("width",i+"%",n)}))}))}(d,u,e,o.editing.view),function(e,t,i,o){if(o.data){const n=e.findViewImgElement(t);i.setAttribute("src",o.data,n)}}(s,d,u,e)):Y_(s,l,d,u))}"complete"==c&&a.loaders.get(r)&&function(e,t,i){const o=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),o),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(o))))}),3e3)}(d,u,o.editing.view),function(e,t){X_(e,t,"progressBar")}(d,u),Q_(d,u),function(e,t){t.removeClass("ck-appear",e)}(d,u)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function K_(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Y_(e,t,i,o){i.hasClass("ck-image-upload-placeholder")||o.addClass("ck-image-upload-placeholder",i);const n=e.findViewImgElement(i);n.getAttribute("src")!==t&&o.setAttribute("src",t,n),J_(i,"placeholder")||o.insert(o.createPositionAfter(n),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(o))}function Q_(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),X_(e,t,"placeholder")}function J_(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function X_(e,t,i){const o=J_(e,i);o&&t.remove(t.createRangeOn(o))}class ev extends Pn{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=Co(e.file),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const r=i.getSelectedElement();if(t&&r&&o.isImage(r)){const t=this.editor.model.createPositionAfter(r);this._uploadImage(e,n,t)}else this._uploadImage(e,n)}))}_uploadImage(e,t,i){const o=this.editor,n=o.plugins.get(U_).createLoader(e),r=o.plugins.get("ImageUtils");n&&r.insertImage({...t,uploadId:n.id},i)}}class tv extends Mn{static get requires(){return[U_,Ym,Bk,o_]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,i=e.model.document,o=e.conversion,n=e.plugins.get(U_),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),a=z_(e.config.get("image.upload.types")),c=new ev(e);e.commands.add("uploadImage",c),e.commands.add("imageUpload",c),o.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(o=i.dataTransfer,Array.from(o.types).includes("text/html")&&""!==o.getData("text/html"))return;var o;const n=Array.from(i.dataTransfer.files).filter((e=>!!e&&a.test(e.type)));n.length&&(t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.execute("uploadImage",{file:n})})))})),this.listenTo(s,"inputTransformation",((i,o)=>{const s=Array.from(e.editing.view.createRangeIn(o.content)).map((e=>e.item)).filter((e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src")||!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!t.getAttribute("src").match(/^blob:/g))}(r,e)&&!e.getAttribute("uploadProcessed"))).map((e=>{return{promise:(i=e,new Promise(((e,o)=>{const n=i.getAttribute("src");fetch(n).then((e=>e.blob())).then((t=>{const i=j_(t,n),o=i.replace("image/",""),r=new File([t],`image.${o}`,{type:i});e(r)})).catch((i=>i&&"TypeError"===i.name?function(e){return function(e){return new Promise(((i,o)=>{const n=t.document.createElement("img");n.addEventListener("load",(()=>{const e=t.document.createElement("canvas");e.width=n.width,e.height=n.height,e.getContext("2d").drawImage(n,0,0),e.toBlob((e=>e?i(e):o()))})),n.addEventListener("error",(()=>o())),n.src=e}))}(e).then((t=>{const i=j_(t,e),o=i.replace("image/","");return new File([t],`image.${o}`,{type:i})}))}(n).then(e).catch(o):o(i)))}))),imageElement:e};var i}));if(!s.length)return;const a=new Ed(e.editing.view.document);for(const e of s){a.setAttribute("uploadProcessed",!0,e.imageElement);const t=n.createLoader(e.promise);t&&(a.setAttribute("src","",e.imageElement),a.setAttribute("uploadId",t.id,e.imageElement))}})),e.editing.view.document.on("dragover",((e,t)=>{t.preventDefault()})),i.on("change",(()=>{const t=i.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),o=new Set;for(const i of t)if("insert"==i.type&&"$text"!=i.name){const t=i.position.nodeAfter,r="$graveyard"==i.position.root.rootName;for(const i of iv(e,t)){const e=i.getAttribute("uploadId");if(!e)continue;const t=n.loaders.get(e);t&&(r?o.has(e)||t.abort():(o.add(e),this._uploadImageElements.set(e,i),"idle"==t.status&&this._readAndUpload(t)))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const o=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",o.default,t),this._parseAndSetSrcsetAttributeOnImage(o,t,e),r.setImageNaturalSizeAttributes(t)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,i=t.model,o=t.locale.t,n=t.plugins.get(U_),s=t.plugins.get(Ym),a=t.plugins.get("ImageUtils"),c=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{t.setAttribute("uploadStatus","reading",c.get(e.id))})),e.read().then((()=>{const n=e.upload(),s=c.get(e.id);if(r.isSafari){const e=t.editing.mapper.toViewElement(s),i=a.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const o=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=o}))}return t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image")),i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",s)})),n})).then((n=>{i.enqueueChange({isUndoable:!1},(i=>{const r=c.get(e.id);i.setAttribute("uploadStatus","complete",r),t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this.fire("uploadComplete",{data:n,imageElement:r})})),l()})).catch((n=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),"error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&s.showWarning(n,{title:o("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{t.remove(c.get(e.id))})),l()}));function l(){i.enqueueChange({isUndoable:!1},(t=>{const i=c.get(e.id);t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i),c.delete(e.id)})),n.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let o=0;const n=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return o=Math.max(o,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");if(""!=n){const e={srcset:n};t.hasAttribute("width")||t.hasAttribute("height")||(e.width=o),i.setAttributes(e,t)}}}function iv(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter((e=>i.isImage(e.item))).map((e=>e.item))}class ov extends Mn{static get pluginName(){return"ImageUpload"}static get requires(){return[tv,F_,G_]}}class nv extends An{constructor(e){super(e),this.set("imageURLInputValue",""),this.set("isImageSelected",!1),this.set("isEnabled",!0),this.focusTracker=new $o,this.keystrokes=new qo,this._focusables=new Jo,this.focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.urlInputView=this._createUrlInputView(),this.insertButtonView=this._createInsertButton(),this.cancelButtonView=this._createCancelButton(),this._focusables.addMany([this.urlInputView,this.insertButtonView,this.cancelButtonView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-image-insert-url"]},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]},children:[this.insertButtonView,this.cancelButtonView]}]})}render(){super.render();for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createUrlInputView(){const e=this.locale,t=e.t,i=new Lu(e,wh);return i.bind("label").to(this,"isImageSelected",(e=>t(e?"Update image URL":"Insert image via URL"))),i.bind("isEnabled").to(this),i.fieldView.placeholder="https://example.com/image.png",i.fieldView.bind("value").to(this,"imageURLInputValue",(e=>e||"")),i.fieldView.on("input",(()=>{this.imageURLInputValue=i.fieldView.element.value.trim()})),i}_createInsertButton(){const e=this.locale,t=e.t,i=new gu(e);return i.set({icon:eu.check,class:"ck-button-save",type:"submit",withText:!0}),i.bind("label").to(this,"isImageSelected",(e=>t(e?"Update":"Insert"))),i.bind("isEnabled").to(this,"imageURLInputValue",this,"isEnabled",((...e)=>e.every((e=>e)))),i.delegate("execute").to(this,"submit"),i}_createCancelButton(){const e=this.locale,t=e.t,i=new gu(e);return i.set({label:t("Cancel"),icon:eu.cancel,class:"ck-button-cancel",withText:!0}),i.bind("isEnabled").to(this),i.delegate("execute").to(this,"cancel"),i}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}}class rv extends Mn{static get pluginName(){return"ImageInsertViaUrlUI"}static get requires(){return[E_]}afterInit(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI"),this._imageInsertUI.registerIntegration({name:"url",observable:()=>this.editor.commands.get("insertImage"),requiresForm:!0,buttonViewCreator:e=>this._createInsertUrlButton(e),formViewCreator:e=>this._createInsertUrlView(e)})}_createInsertUrlView(e){const t=this.editor,i=t.locale,o=i.t,n=t.commands.get("replaceImageSource"),r=t.commands.get("insertImage"),s=new nv(i),a=e?null:new vu(i,[s]);return s.bind("isImageSelected").to(this._imageInsertUI),s.bind("isEnabled").toMany([r,n],"isEnabled",((...e)=>e.some((e=>e)))),s.imageURLInputValue=n.value||"",this._imageInsertUI.dropdownView.on("change:isOpen",(()=>{this._imageInsertUI.dropdownView.isOpen&&(s.imageURLInputValue=n.value||"",a&&(a.isCollapsed=!0))}),{priority:"low"}),s.on("submit",(()=>{n.isEnabled?t.execute("replaceImageSource",{source:s.imageURLInputValue}):t.execute("insertImage",{source:s.imageURLInputValue}),this._closePanel()})),s.on("cancel",(()=>this._closePanel())),a?(a.set({isCollapsed:!0}),a.bind("label").to(this._imageInsertUI,"isImageSelected",(e=>o(e?"Update image URL":"Insert image via URL"))),a):s}_createInsertUrlButton(e){const t=e?$u:gu,i=this.editor,o=new t(i.locale),n=i.locale.t;return o.set({icon:eu.imageUrl,tooltip:!0}),o.bind("label").to(this._imageInsertUI,"isImageSelected",(e=>n(e?"Update image URL":"Insert image via URL"))),o}_closePanel(){this.editor.editing.view.focus(),this._imageInsertUI.dropdownView.isOpen=!1}}class sv extends Mn{static get pluginName(){return"ImageInsertViaUrl"}static get requires(){return[rv,E_]}}class av extends Mn{static get pluginName(){return"ImageInsert"}static get requires(){return[ov,sv,E_]}}var cv=n(1173);yn()(cv.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),cv.A.locals;var lv=n(4214);yn()(lv.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),lv.A.locals;class dv extends Pn{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map((e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]})))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,o=t.plugins.get("ImageUtils");i.change((t=>{const n=e.value,{setImageSizes:r=!0}=e;let s=o.getClosestSelectedImageElement(i.document.selection);n&&this.shouldConvertImageType(n,s)&&(this.editor.execute(o.isBlockImage(s)?"imageTypeInline":"imageTypeBlock",{setImageSizes:r}),s=o.getClosestSelectedImageElement(i.document.selection)),!n||this._styles.get(n).isDefault?t.removeAttribute("imageStyle",s):t.setAttribute("imageStyle",n,s),r&&o.setImageNaturalSizeAttributes(s)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const{objectFullWidth:uv,objectInline:hv,objectLeft:mv,objectRight:gv,objectCenter:pv,objectBlockLeft:fv,objectBlockRight:kv}=eu,bv={get inline(){return{name:"inline",title:"In line",icon:hv,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:mv,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:fv,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:pv,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:gv,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:kv,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:pv,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:gv,modelElements:["imageBlock"],className:"image-style-side"}}},wv={full:uv,left:fv,right:kv,center:pv,inlineLeft:mv,inlineRight:gv,inline:hv},_v=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function vv(e){b("image-style-configuration-definition-invalid",e)}const yv={normalizeStyles:function(e){return(e.configuredStyles.options||[]).map((e=>{return"string"==typeof(t="string"==typeof(t=e)?bv[t]?{...bv[t]}:{name:t}:function(e,t){const i={...t};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);return i}(bv[t.name],t)).icon&&(t.icon=wv[t.icon]||t.icon),t;var t})).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:o,name:n}=e;if(!(o&&o.length&&n))return vv({style:e}),!1;{const n=[t?"imageBlock":null,i?"imageInline":null];if(!o.some((e=>n.includes(e))))return b("image-style-missing-dependency",{style:e,missingPlugins:o.map((e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(t,e)))},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[..._v]:[]},warnInvalidStyle:vv,DEFAULT_OPTIONS:bv,DEFAULT_ICONS:wv,DEFAULT_DROPDOWN_DEFINITIONS:_v};function xv(e,t){for(const i of t)if(i.name===e)return i}class Av extends Mn{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[o_]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=yv,i=this.editor,o=i.plugins.has("ImageBlockEditing"),n=i.plugins.has("ImageInlineEditing");i.config.define("image.styles",t(o,n)),this.normalizedStyles=e({configuredStyles:i.config.get("image.styles"),isBlockPluginLoaded:o,isInlinePluginLoaded:n}),this._setupConversion(o,n),this._setupPostFixer(),i.commands.add("imageStyle",new dv(i,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,o=i.model.schema,n=(r=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=xv(t.attributeNewValue,r),n=xv(t.attributeOldValue,r),s=i.mapper.toViewElement(t.item),a=i.writer;n&&a.removeClass(n.className,s),o&&a.addClass(o.className,s)});var r;const s=function(e){const t={imageInline:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageInline"))),imageBlock:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageBlock")))};return(e,i,o)=>{if(!i.modelRange)return;const n=i.viewItem,r=Uo(i.modelRange.getItems());if(r&&o.schema.checkAttribute(r,"imageStyle"))for(const e of t[r.name])o.consumable.consume(n,{classes:e.className})&&o.writer.setAttribute("imageStyle",e.name,r)}}(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",n),i.data.downcastDispatcher.on("attribute:imageStyle",n),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(o_),o=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let n=!1;for(const r of t.differ.getChanges())if("insert"==r.type||"attribute"==r.type&&"imageStyle"==r.attributeKey){let t="insert"==r.type?r.position.nodeAfter:r.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const s=t.getAttribute("imageStyle");if(!s)continue;const a=o.get(s);a&&a.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),n=!0)}return n}))}}var Cv=n(7879);yn()(Cv.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Cv.A.locals;class Tv extends Mn{static get requires(){return[Av]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],i=Ev(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of i)this._createButton(e);const o=Ev([...t.filter(N),...yv.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const e of o)this._createDropdown(e,i)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(o=>{let n;const{defaultItem:r,items:s,title:a}=e,c=s.filter((e=>t.find((({name:t})=>Sv(t)===e)))).map((e=>{const t=i.create(e);return e===r&&(n=t),t}));s.length!==c.length&&yv.warnInvalidStyle({dropdown:e});const l=hh(o,lh),d=l.buttonView,u=d.arrowView;return mh(l,c,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:Mv(a,n.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:a}),d.bind("icon").toMany(c,"isOn",((...e)=>{const t=e.findIndex(Po);return t<0?n.icon:c[t].icon})),d.bind("label").toMany(c,"isOn",((...e)=>{const t=e.findIndex(Po);return Mv(a,t<0?n.label:c[t].label)})),d.bind("isOn").toMany(c,"isOn",((...e)=>e.some(Po))),d.bind("class").toMany(c,"isOn",((...e)=>e.some(Po)?"ck-splitbutton_flatten":void 0)),d.on("execute",(()=>{c.some((({isOn:e})=>e))?l.isOpen=!l.isOpen:n.fire("execute")})),l.bind("isEnabled").toMany(c,"isEnabled",((...e)=>e.some(Po))),this.listenTo(l,"execute",(()=>{this.editor.editing.view.focus()})),l}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(Sv(t),(i=>{const o=this.editor.commands.get("imageStyle"),n=new gu(i);return n.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>e===t)),n.on("execute",this._executeCommand.bind(this,t)),n}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function Ev(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function Sv(e){return`imageStyle:${e}`}function Mv(e,t){return(e?e+": ":"")+t}class Iv extends Mn{static get requires(){return[Av,Tv]}static get pluginName(){return"ImageStyle"}}class Pv extends Mn{static get requires(){return[ub,o_]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(ub),o=e.plugins.get("ImageUtils");var n;i.register("image",{ariaLabel:t("Image toolbar"),items:(n=e.config.get("image.toolbar")||[],n.map((e=>N(e)?e.name:e))),getRelatedElement:e=>o.getClosestSelectedImageWidget(e)})}}class Vv extends Mn{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new Nn(e)),e.commands.add("outdent",new Nn(e))}}class Nv extends Mn{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,i=e.t,o="ltr"==t.uiLanguageDirection?eu.indent:eu.outdent,n="ltr"==t.uiLanguageDirection?eu.outdent:eu.indent;this._defineButton("indent",i("Increase indent"),o),this._defineButton("outdent",i("Decrease indent"),n)}_defineButton(e,t,i){const o=this.editor;o.ui.componentFactory.add(e,(()=>{const o=this._createButton(gu,e,t,i);return o.set({tooltip:!0}),o})),o.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton($g,e,t,i)))}_createButton(e,t,i,o){const n=this.editor,r=n.commands.get(t),s=new e(n.locale);return s.set({label:i,icon:o}),s.bind("isEnabled").to(r,"isEnabled"),this.listenTo(s,"execute",(()=>{n.execute(t),n.editing.view.focus()})),s}}class Lv extends Mn{static get pluginName(){return"Indent"}static get requires(){return[Vv,Nv]}}class Ov{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach((e=>this._definitions.add(e))):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",((e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!i.schema.isInline(t.item))return;const o=i.writer,n=o.document.selection;for(const e of this._definitions){const r=o.createAttributeElement("a",e.attributes,{priority:5});e.classes&&o.addClass(e.classes,r);for(const t in e.styles)o.setStyle(t,e.styles[t],r);o.setCustomProperty("link",!0,r),e.callback(t.attributeNewValue)?t.item.is("selection")?o.wrap(n.getFirstRange(),r):o.wrap(i.mapper.toViewRange(t.range),r):o.unwrap(i.mapper.toViewRange(t.range),r)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",((e,t,{writer:i,mapper:o})=>{const n=o.toViewElement(t.item),r=Array.from(n.getChildren()).find((e=>e.is("element","a")));for(const e of this._definitions){const o=Wo(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of o)"class"===e?i.addClass(t,r):i.setAttribute(e,t,r);e.classes&&i.addClass(e.classes,r);for(const t in e.styles)i.setStyle(t,e.styles[t],r)}else{for(const[e,t]of o)"class"===e?i.removeClass(t,r):i.removeAttribute(e,r);e.classes&&i.removeClass(e.classes,r);for(const t in e.styles)i.removeStyle(t,r)}}}))}}}var Rv=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const Dv=function(e){return Rv.test(e)};var Bv="\\ud800-\\udfff",zv="["+Bv+"]",jv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Fv="\\ud83c[\\udffb-\\udfff]",Hv="[^"+Bv+"]",Uv="(?:\\ud83c[\\udde6-\\uddff]){2}",$v="[\\ud800-\\udbff][\\udc00-\\udfff]",qv="(?:"+jv+"|"+Fv+")?",Wv="[\\ufe0e\\ufe0f]?",Zv=Wv+qv+"(?:\\u200d(?:"+[Hv,Uv,$v].join("|")+")"+Wv+qv+")*",Gv="(?:"+[Hv+jv+"?",jv,Uv,$v,zv].join("|")+")",Kv=RegExp(Fv+"(?="+Fv+")|"+Gv+Zv,"g");const Yv=function(e){return Dv(e)?function(e){return e.match(Kv)||[]}(e):function(e){return e.split("")}(e)},Qv=function(e){e=ur(e);var t,i,o,n,r=Dv(e)?Yv(e):void 0,s=r?r[0]:e.charAt(0),a=r?(t=r,i=1,n=t.length,o=void 0===o?n:o,!i&&o>=n?t:pr(t,i,o)).join(""):e.slice(1);return s.toUpperCase()+a},Jv=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Xv=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,ey=/^((\w+:(\/{2,})?)|(\W))/i,ty=["https?","ftps?","mailto"],iy="Ctrl+K";function oy(e,{writer:t}){const i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function ny(e,t=ty){const i=String(e),o=t.join("|");return function(e,t){return!!e.replace(Jv,"").match(t)}(i,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",o)}`,"i"))?i:"#"}function ry(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function sy(e,t){const i=(o=e,Xv.test(o)?"mailto:":t);var o;const n=!!i&&!ay(e);return e&&n?i+e:e}function ay(e){return ey.test(e)}function cy(e){window.open(e,"_blank","noopener")}class ly extends Pn{constructor(){super(...arguments),this.manualDecorators=new Ho,this.automaticDecorators=new Ov}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||Uo(t.getSelectedBlocks());ry(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const i=this.editor.model,o=i.document.selection,n=[],r=[];for(const e in t)t[e]?n.push(e):r.push(e);i.change((t=>{if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute("linkHref")){const a=dy(o);let c=Kp(s,"linkHref",o.getAttribute("linkHref"),i);o.getAttribute("linkHref")===a&&(c=this._updateLinkContent(i,t,c,e)),t.setAttribute("linkHref",e,c),n.forEach((e=>{t.setAttribute(e,!0,c)})),r.forEach((e=>{t.removeAttribute(e,c)})),t.setSelection(t.createPositionAfter(c.end.nodeBefore))}else if(""!==e){const r=Wo(o.getAttributes());r.set("linkHref",e),n.forEach((e=>{r.set(e,!0)}));const{end:a}=i.insertContent(t.createText(e,r),s);t.setSelection(a)}["linkHref",...n,...r].forEach((e=>{t.removeSelectionAttribute(e)}))}else{const s=i.schema.getValidRanges(o.getRanges(),"linkHref"),a=[];for(const e of o.getSelectedBlocks())i.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const c=a.slice();for(const e of s)this._isRangeToUpdate(e,a)&&c.push(e);for(const s of c){let a=s;if(1===c.length){const n=dy(o);o.getAttribute("linkHref")===n&&(a=this._updateLinkContent(i,t,s,e),t.setSelection(t.createSelection(a)))}t.setAttribute("linkHref",e,a),n.forEach((e=>{t.setAttribute(e,!0,a)})),r.forEach((e=>{t.removeAttribute(e,a)}))}}}))}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,o=i.getSelectedElement();return ry(o,t.schema)?o.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}_updateLinkContent(e,t,i,o){const n=t.createText(o,{linkHref:o});return e.insertContent(n,i)}}function dy(e){if(e.isCollapsed){const t=e.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(e.getFirstRange().getItems());if(t.length>1)return null;const i=t[0];return i.is("$text")||i.is("$textProxy")?i.data:null}}class uy extends Pn{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();ry(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,o=e.commands.get("link");t.change((e=>{const n=i.isCollapsed?[Kp(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of n)if(e.removeAttribute("linkHref",t),o)for(const i of o.manualDecorators)e.removeAttribute(i.id,t)}))}}class hy extends(j()){constructor({id:e,label:t,attributes:i,classes:o,styles:n,defaultValue:r}){super(),this.id=e,this.set("value",void 0),this.defaultValue=r,this.label=t,this.attributes=i,this.classes=o,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var my=n(7456);yn()(my.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),my.A.locals;const gy="automatic",py=/^(https?:)?\/\//;class fy extends Mn{static get pluginName(){return"LinkEditing"}static get requires(){return[Dp,Ap,Bk]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:oy}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,i)=>oy(ny(e,t),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new ly(e)),e.commands.add("unlink",new uy(e));const i=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>("label"in e&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[i,o]of Object.entries(e)){const e=Object.assign({},o,{id:`link${Qv(i)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter((e=>e.mode===gy))),this._enableManualDecorators(i.filter((e=>"manual"===e.mode))),e.plugins.get(Dp).registerAttribute("linkHref"),Qp(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:gy,callback:e=>!!e&&py.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(e),i.length&&t.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach((e=>{t.model.schema.extend("$text",{allowAttributes:e.id});const o=new hy(e);i.add(o),t.conversion.for("downcast").attributeToElement({model:o.id,view:(e,{writer:t,schema:i},{item:n})=>{if((n.is("selection")||i.isInline(n))&&e){const e=t.createAttributeElement("a",o.attributes,{priority:5});o.classes&&t.addClass(o.classes,e);for(const i in o.styles)t.setStyle(i,o.styles[i],e);return t.setCustomProperty("link",!0,e),e}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...o._createPattern()},model:{key:o.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",((e,t)=>{if(!(r.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let i=t.domTarget;if("a"!=i.tagName.toLowerCase()&&(i=i.closest("a")),!i)return;const o=i.getAttribute("href");o&&(e.stop(),t.preventDefault(),cy(o))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,i)=>{const o=e.commands.get("link").value;o&&i.keyCode===wo.enter&&i.altKey&&(t.stop(),cy(o))}))}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",((i,{attributeKeys:o})=>{o.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change((t=>{var i;!function(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}(t,(i=e.schema,i.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))))}))}))}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",((e,o)=>{t.change((e=>{const t=e.createRangeIn(o.content);for(const o of t.getItems())if(o.hasAttribute("linkHref")){const t=sy(o.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,o)}}))}))}}var ky=n(2350);yn()(ky.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ky.A.locals;class by extends An{constructor(e,t,i){super(e),this.focusTracker=new $o,this.keystrokes=new qo,this._focusables=new Jo;const o=e.t;this._validators=i,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(o("Save"),eu.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(o("Cancel"),eu.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const n=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&n.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:n,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((e,t)=>(e[t.name]=t.isOn,e)),{})}render(){super.render(),En({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createUrlInput(){const e=this.locale.t,t=new Lu(this.locale,wh);return t.label=e("Link URL"),t}_createButton(e,t,i,o){const n=new gu(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const o=new fu(this.locale);o.set({name:i.id,label:i.label,withText:!0}),o.bind("isOn").toMany([i,e],"value",((e,t)=>void 0===t&&void 0===e?!!i.defaultValue:!!e)),o.on("execute",(()=>{i.set("value",!o.isOn)})),t.add(o)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new An;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}}))),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}var wy=n(5659);yn()(wy.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wy.A.locals;class _y extends An{constructor(e,t={}){super(e),this.focusTracker=new $o,this.keystrokes=new qo,this._focusables=new Jo;const i=e.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(i("Unlink"),'',"unlink"),this.editButtonView=this._createButton(i("Edit link"),eu.pencil,"edit"),this.set("href",void 0),this._linkConfig=t,this._focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const o=new gu(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate("execute").to(this,i),o}_createPreviewButton(){const e=new gu(this.locale),t=this.bindTemplate,i=this.t;return e.set({withText:!0,tooltip:i("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",(e=>e&&ny(e,this._linkConfig.allowedProtocols))),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",(e=>e||i("This link has no URL"))),e.bind("isEnabled").to(this,"href",(e=>!!e)),e.template.tag="a",e.template.eventListeners={},e}}const vy="link-ui";class yy extends Mn{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[tg]}static get pluginName(){return"LinkUI"}init(){const e=this.editor,t=this.editor.t;e.editing.view.addObserver(Cd),this._balloon=e.plugins.get(tg),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:vy,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:vy,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:iy},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new _y(e.locale,e.config.get("link")),i=e.commands.get("link"),o=e.commands.get("unlink");return t.bind("href").to(i,"value"),t.editButtonView.bind("isEnabled").to(i),t.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(t,"edit",(()=>{this._addFormView()})),this.listenTo(t,"unlink",(()=>{e.execute("unlink"),this._hideUI()})),t.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),t.keystrokes.set(iy,((e,t)=>{this._addFormView(),t()})),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),i=e.config.get("link.defaultProtocol"),o=new(Tn(by))(e.locale,t,function(e){const t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[e=>{if(!i&&!e.url.length)return t("Link URL must not be empty.")}]}(e));return o.urlInputView.fieldView.bind("value").to(t,"value"),o.urlInputView.bind("isEnabled").to(t,"isEnabled"),o.saveButtonView.bind("isEnabled").to(t,"isEnabled"),this.listenTo(o,"submit",(()=>{if(o.isValid()){const{value:t}=o.urlInputView.fieldView.element,n=sy(t,i);e.execute("link",n,o.getDecoratorSwitchesState()),this._closeFormView()}})),this.listenTo(o.urlInputView,"change:errorText",(()=>{e.ui.update()})),this.listenTo(o,"cancel",(()=>{this._closeFormView()})),o.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),o}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link");e.ui.componentFactory.add("link",(()=>{const e=this._createButton(gu);return e.set({tooltip:!0,isToggleable:!0}),e.bind("isOn").to(t,"value",(e=>!!e)),e})),e.ui.componentFactory.add("menuBar:link",(()=>this._createButton($g)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("link"),n=new e(t.locale),r=i.t;return n.set({label:r("Link"),icon:'',keystroke:iy}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>this._showUI(!0))),n}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),e.keystrokes.set(iy,((t,i)=>{i(),e.commands.get("link").isEnabled&&this._showUI(!0)}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((e,t)=>{this._isUIVisible&&(this._hideUI(),t())})),Cn({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let i=this._getSelectedLinkElement(),o=r();const n=()=>{const e=this._getSelectedLinkElement(),t=r();i&&!e||!i&&t!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,o=t};function r(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,i=e.document;let o;if(t.markers.has(vy)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(vy)),i=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));o=e.domConverter.viewRangeToDom(i)}else o=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(i.selection.getFirstRange())};return{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&qk(i))return xy(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),o=xy(i.start),n=xy(i.end);return o&&o==n&&e.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(vy))t.updateMarker(vy,{range:i});else if(i.start.isAtEnd){const o=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(vy,{usingOperation:!1,affectsData:!1,range:t.createRange(o,i.end)})}else t.addMarker(vy,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(vy)&&e.change((e=>{e.removeMarker(vy)}))}}function xy(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))||null}const Ay=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Cy extends Mn{static get requires(){return[Np,fy]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?Kp(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const i=this.editor.model,o=i.document.selection,n=o.getFirstPosition(),r=o.getLastPosition();let s=t.getJoined(this._expandLinkRange(i,n)||t);s&&(s=s.getJoined(this._expandLinkRange(i,r)||t)),s&&(s.start.isBefore(n)||s.end.isAfter(r))&&e.setSelection(s)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,o=e.plugins.get("ClipboardPipeline"),n=e.commands.get("link");o.on("inputTransformation",((e,o)=>{if(!this.isEnabled||!n.isEnabled||i.isCollapsed||"paste"!==o.method)return;if(i.rangeCount>1)return;const r=i.getFirstRange(),s=o.dataTransfer.getData("text/plain");if(!s)return;const a=s.match(Ay);a&&a[2]===s&&(t.change((e=>{this._selectEntireLinks(e,r),n.execute(s)})),e.stop())}),{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new Rp(e.model,(e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=Ty(e.substr(0,e.length-1));return t?{url:t}:void 0}));t.on("matched:data",((t,i)=>{const{batch:o,range:n,url:r}=i;if(!o.isTyping)return;const s=n.end.getShiftedBy(-1),a=s.getShiftedBy(-r.length),c=e.model.createRange(a,s);this._applyAutoLink(r,c)})),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const i=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:o}=Op(e,t),n=Ty(i);if(n){const e=t.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,e)}}_applyAutoLink(e,t){const i=this.editor.model,o=sy(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&ay(o)&&!function(e){const t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(o,t)}_persistAutoLink(e,t){const i=this.editor.model,o=this.editor.plugins.get("Delete");i.enqueueChange((n=>{n.setAttribute("linkHref",e,t),i.enqueueChange((()=>{o.requestUndoOnBackspace()}))}))}}function Ty(e){const t=Ay.exec(e);return t?t[2]:null}class Ey extends Mn{static get requires(){return[fy,yy,Cy]}static get pluginName(){return"Link"}}var Sy=n(3669);yn()(Sy.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Sy.A.locals;class My{constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward="forward"==t.direction,this._includeSelf=!!t.includeSelf,this._sameAttributes=Co(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return Uo(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of Iy(this._getStartNode(),this._isForward?"forward":"backward")){const i=t.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some((e=>t.getAttribute(e)!==this._startElement.getAttribute(e))))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*Iy(e,t="forward"){const i="forward"==t,o=[];let n=null;for(;Ny(e);){let t=null;if(n){const i=e.getAttribute("listIndent"),r=n.getAttribute("listIndent");i>r?o[r]=n:ie.getAttribute("listItemId")!=t))}function qy(e){return Array.from(e).filter((e=>"$graveyard"!==e.root.rootName)).sort(((e,t)=>e.index-t.index))}function Wy(e){const t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function Zy(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function Gy(e,t,i){return Oy(t,{direction:"forward"}).pop().index>e.index?Fy(e,t,i):[]}class Ky extends Pn{constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=Yy(e.document.selection);e.change((e=>{const i=[];$y(t)&&!Dy(t[0])?("forward"==this._direction&&i.push(...Hy(t,e)),i.push(...jy(t[0],e))):"forward"==this._direction?i.push(...Hy(t,e,{expand:!0})):i.push(...function(e,t){const i=zy(e=Co(e)),o=new Set,n=Math.min(...i.map((e=>e.getAttribute("listIndent")))),r=new Map;for(const e of i)r.set(e,My.first(e,{lowerIndent:!0}));for(const e of i){if(o.has(e))continue;o.add(e);const i=e.getAttribute("listIndent")-1;if(i<0)Uy(e,t);else{if(e.getAttribute("listIndent")==n){const i=Gy(e,r.get(e),t);for(const e of i)o.add(e);if(i.length)continue}t.setAttribute("listIndent",i,e)}}return qy(o)}(t,e));for(const t of i){if(!t.hasAttribute("listType"))continue;const i=My.first(t,{sameIndent:!0});i&&e.setAttribute("listType",i.getAttribute("listType"),t)}this._fireAfterExecute(i)}))}_fireAfterExecute(e){this.fire("afterExecute",qy(new Set(e)))}_checkEnabled(){let e=Yy(this.editor.model.document.selection),t=e[0];if(!t)return!1;if("backward"==this._direction)return!0;if($y(e)&&!Dy(e[0]))return!0;e=zy(e),t=e[0];const i=My.first(t,{sameIndent:!0});return!!i&&i.getAttribute("listType")==t.getAttribute("listType")}}function Yy(e){const t=Array.from(e.getSelectedBlocks()),i=t.findIndex((e=>!Ny(e)));return-1!=i&&(t.length=i),t}class Qy extends Pn{constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.document,o=Wy(t),n=Array.from(i.selection.getSelectedBlocks()).filter((e=>t.schema.checkAttribute(e,"listType")||Zy(e,t.schema))),r=void 0!==e.forceValue?!e.forceValue:this.value;t.change((s=>{if(r){const e=n[n.length-1],t=Oy(e,{direction:"forward"}),i=[];t.length>1&&i.push(...jy(t[1],s)),i.push(...Uy(n,s)),i.push(...function(e,t){const i=[];let o=Number.POSITIVE_INFINITY;for(const{node:n}of Iy(e.nextSibling,"forward")){const e=n.getAttribute("listIndent");if(0==e)break;e{const{firstElement:r,lastElement:s}=this._getMergeSubjectElements(i,e),a=r.getAttribute("listIndent")||0,c=s.getAttribute("listIndent"),l=s.getAttribute("listItemId");if(a!=c){const e=(d=s,Array.from(new My(d,{direction:"forward",higherIndent:!0})));o.push(...Hy([s,...e],n,{indentBy:a-c,expand:a{const t=jy(this._getStartBlock(),e);this._fireAfterExecute(t)}))}_fireAfterExecute(e){this.fire("afterExecute",qy(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&Ny(t)&&!Dy(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?e:e.nextSibling}}class ex extends Mn{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(e){return function(e){e=Co(e);const t=new Set;for(const i of e)for(const e of Ry(i))t.add(e);return qy(t)}(e)}isFirstBlockOfListItem(e){return Dy(e)}isListItemBlock(e){return Ny(e)}expandListBlocksToCompleteItems(e,t={}){return zy(e,t)}isNumberedListType(e){return function(e){return"numbered"==e||"customNumbered"==e}(e)}}function tx(e){return e.is("element","ol")||e.is("element","ul")}function ix(e){return e.is("element","li")}function ox(e,t,i,o=sx(i,t)){return e.createAttributeElement(rx(i),null,{priority:2*t/100-100,id:o})}function nx(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function rx(e){return"numbered"==e||"customNumbered"==e?"ol":"ul"}function sx(e,t){return`list-${e}-${t}`}function ax(e,t){const i=e.nodeBefore;if(Ny(i)){let e=i;for(const{node:i}of Iy(e,"backward"))if(e=i,t.has(e))return;t.set(i,e)}else{const i=e.nodeAfter;Ny(i)&&t.set(i,i)}}function cx(){return(e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:!0}))return;const o=new Ed(t.viewItem.document);for(const e of Array.from(t.viewItem.getChildren()))ix(e)||tx(e)||o.remove(e)}}function lx(e,t,i,{dataPipeline:o}={}){const n=function(e){return(t,i)=>{const o=[];for(const i of e)t.hasAttribute(i)&&o.push(`attribute:${i}`);return!!o.every((e=>!1!==i.test(t,e)))&&(o.forEach((e=>i.consume(t,e))),!0)}}(e);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a,u=s.item;if(!e.includes(s.attributeKey))return;if(!n(u,d))return;const h=function(e,t,i){const o=i.createRangeOn(e);return t.toViewRange(o).getTrimmed().end.nodeBefore}(u,l,i);ux(h,c,l),function(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const o=i.parent;t.unwrap(t.createRangeOn(e),i),i=o}}(h,c);const m=function(e,t,i,o,{dataPipeline:n}){let r=o.createRangeOn(t);if(!Dy(e))return r;for(const s of i){if("itemMarker"!=s.scope)continue;const i=s.createElement(o,e,{dataPipeline:n});if(!i)continue;if(o.setCustomProperty("listItemMarker",!0,i),s.canInjectMarkerIntoElement&&s.canInjectMarkerIntoElement(e)?o.insert(o.createPositionAt(t,0),i):(o.insert(r.start,i),r=o.createRange(o.createPositionBefore(i),o.createPositionAfter(t))),!s.createWrapperElement||!s.canWrapElement)continue;const a=s.createWrapperElement(o,e,{dataPipeline:n});o.setCustomProperty("listItemWrapper",!0,a),s.canWrapElement(e)?r=o.wrap(r,a):(r=o.wrap(o.createRangeOn(i),a),r=o.createRange(r.start,o.createPositionAfter(t)))}return r}(u,h,t,c,{dataPipeline:o});!function(e,t,i,o){if(!e.hasAttribute("listIndent"))return;const n=e.getAttribute("listIndent");let r=e;for(let e=n;e>=0;e--){const n=nx(o,e,r.getAttribute("listItemId")),s=ox(o,e,r.getAttribute("listType"));for(const e of i)"list"!=e.scope&&"item"!=e.scope||!r.hasAttribute(e.attributeName)||e.setAttributeOnDowncast(o,r.getAttribute(e.attributeName),"list"==e.scope?s:n);if(t=o.wrap(t,n),t=o.wrap(t,s),0==e)break;if(r=My.first(r,{lowerIndent:!0}),!r)break}}(u,m,t,c)}}function dx(e,{dataPipeline:t}={}){return(i,{writer:o})=>{if(!hx(i,e))return null;if(!t)return o.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const n=o.createContainerElement("p");return o.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function ux(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);const o=[];n(t.createPositionBefore(e).getWalker({direction:"backward"})),n(t.createRangeIn(e).getWalker());for(const e of o)t.remove(e);function n(e){for(const{item:t}of e){if(t.is("element")&&i.toModelElement(t))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&o.push(t)}}}function hx(e,t,i=Ly(e)){if(!Ny(e))return!1;for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return i.length<2}var mx=n(7875);yn()(mx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mx.A.locals;var gx=n(532);yn()(gx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),gx.A.locals;const px=["listType","listIndent","listItemId"];class fx extends Mn{static get pluginName(){return"ListEditing"}static get requires(){return[Zf,Np,ex,Bk]}constructor(e){super(e),this._downcastStrategies=[],e.config.define("list.multiBlock",!0)}init(){const e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new k("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:px}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const e of px)t.schema.setAttributeProperties(e,{copyOnReplace:!0});e.commands.add("numberedList",new Qy(e,"numbered")),e.commands.add("bulletedList",new Qy(e,"bulleted")),e.commands.add("customNumberedList",new Qy(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new Qy(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new Ky(e,"forward")),e.commands.add("outdentList",new Ky(e,"backward")),e.commands.add("splitListItemBefore",new Xy(e,"before")),e.commands.add("splitListItemAfter",new Xy(e,"after")),i&&(e.commands.add("mergeListItemBackward",new Jy(e,"backward")),e.commands.add("mergeListItemForward",new Jy(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...px,...this._downcastStrategies.map((e=>e.attributeName))]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",((o,n)=>{const r=e.model.document.selection;Wy(e.model)||e.model.change((()=>{const s=r.getFirstPosition();if(r.isCollapsed&&"backward"==n.direction){if(!s.isAtStart)return;const i=s.parent;if(!Ny(i))return;if(My.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:kx(e.model,"backward")})}else By(i)||e.execute("splitListItemAfter"),e.execute("outdentList");n.preventDefault(),o.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:kx(e.model,"forward")}),n.preventDefault(),o.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,i=e.commands,o=i.get("enter");this.listenTo(e.editing.view.document,"enter",((i,o)=>{const n=t.document,r=n.selection.getFirstPosition().parent;if(n.selection.isCollapsed&&Ny(r)&&r.isEmpty&&!o.isSoft){const t=Dy(r),n=By(r);t&&n?(e.execute("outdentList"),o.preventDefault(),i.stop()):t&&!n?(e.execute("splitListItemAfter"),o.preventDefault(),i.stop()):n&&(e.execute("splitListItemBefore"),o.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(o,"afterExecute",(()=>{const t=i.get("splitListItemBefore");t.refresh(),t.isEnabled&&2===Ly(e.model.document.selection.getLastPosition().parent).length&&t.execute()}))}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",((t,i)=>{const o=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(o).isEnabled&&(e.execute(o),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,i=this.getListAttributeNames(),o=e.config.get("list.multiBlock"),n=o?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(e,{writer:t})=>t.createElement(n,{listType:""})}).elementToElement({view:"p",model:(e,{writer:t})=>e.parent&&e.parent.is("element","li")?t.createElement(n,{listType:""}):null,converterPriority:"high"}).add((e=>{e.on("element:li",((e,t,i)=>{const{writer:o,schema:n}=i;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter((e=>n.checkAttribute(e,"listItemId")));if(!r.length)return;const s=Vy.next(),a=function(e){let t=0,i=e.parent;for(;i;){if(ix(i))t++;else{const e=i.previousSibling;e&&ix(e)&&t++}i=i.parent}return t}(t.viewItem);let c=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const l=r[0].getAttribute("listType");l&&(c=l);const d={listItemId:s,listIndent:a,listType:c};for(const e of r)e.hasAttribute("listItemId")||o.setAttributes(d,e);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&i.keepEmptyElement(r[0])})),e.on("element:ul",cx(),{priority:"high"}),e.on("element:ol",cx(),{priority:"high"})})),o||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:n,view:dx(i),converterPriority:"high"}).add((e=>{var o;e.on("attribute",lx(i,this._downcastStrategies,t)),e.on("remove",(o=t.schema,(e,t,i)=>{const{writer:n,mapper:r}=i,s=e.name.split(":")[1];if(!o.checkAttribute(s,"listItemId"))return;const a=r.toViewPosition(t.position),c=t.position.getShiftedBy(t.length),l=r.toViewPosition(c,{isPhantom:!0}),d=n.createRange(a,l).getTrimmed().end.nodeBefore;d&&ux(d,n,r)}))})),e.conversion.for("dataDowncast").elementToElement({model:n,view:dx(i,{dataPipeline:!0}),converterPriority:"high"}).add((e=>{e.on("attribute",lx(i,this._downcastStrategies,t,{dataPipeline:!0}))}));const r=(s=this._downcastStrategies,a=e.editing.view,(e,t)=>{if(t.modelPosition.offset>0)return;const i=t.modelPosition.parent;if(!Ny(i))return;if(!s.some((e=>"itemMarker"==e.scope&&e.canInjectMarkerIntoElement&&e.canInjectMarkerIntoElement(i))))return;const o=t.mapper.toViewElement(i),n=a.createRangeIn(o),r=n.getWalker();let c=n.start;for(const{item:e}of r){if(e.is("element")&&t.mapper.toModelElement(e)||e.is("$textProxy"))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&(c=a.createPositionAfter(e),r.skip((({previousPosition:e})=>!e.isEqual(c))))}t.viewPosition=c});var s,a;e.editing.mapper.on("modelToViewPosition",r),e.data.mapper.on("modelToViewPosition",r),this.listenTo(t.document,"change:data",function(e,t,i,o){return()=>{const o=e.document.differ.getChanges(),s=[],a=new Map,c=new Set;for(const e of o)if("insert"==e.type&&"$text"!=e.name)ax(e.position,a),e.attributes.has("listItemId")?c.add(e.position.nodeAfter):ax(e.position.getShiftedBy(e.length),a);else if("remove"==e.type&&e.attributes.has("listItemId"))ax(e.position,a);else if("attribute"==e.type){const t=e.range.start.nodeAfter;i.includes(e.attributeKey)?(ax(e.range.start,a),null===e.attributeNewValue?(ax(e.range.start.getShiftedBy(1),a),r(t)&&s.push(t)):c.add(t)):Ny(t)&&r(t)&&s.push(t)}for(const e of a.values())s.push(...n(e,c));for(const e of new Set(s))t.reconvertItem(e)};function n(e,t){const o=[],n=new Set,a=[];for(const{node:c,previous:l}of Iy(e,"forward")){if(n.has(c))continue;const e=c.getAttribute("listIndent");l&&ei.includes(e))));const d=Oy(c,{direction:"forward"});for(const e of d)n.add(e),(r(e,d)||s(e,a,t))&&o.push(e)}return o}function r(e,n){const r=t.mapper.toViewElement(e);if(!r)return!1;if(o.fire("checkElement",{modelElement:e,viewElement:r}))return!0;if(!e.is("element","paragraph")&&!e.is("element","listItem"))return!1;const s=hx(e,i,n);return!(!s||!r.is("element","p"))||!(s||!r.is("element","span"))}function s(e,i,n){if(n.has(e))return!1;const r=t.mapper.toViewElement(e);let s=i.length-1;for(let e=r.parent;!e.is("editableElement");e=e.parent){const t=ix(e),n=tx(e);if(!n&&!t)continue;const r="checkAttributes:"+(t?"item":"list");if(o.fire(r,{viewElement:e,modelAttributes:i[s]}))break;if(n&&(s--,s<0))return!1}return!0}}(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((e,{viewElement:t,modelAttributes:i})=>{t.id!=i.listItemId&&(e.return=!0,e.stop())})),this.on("checkAttributes:list",((e,{viewElement:t,modelAttributes:i})=>{t.name==rx(i.listType)&&t.id==sx(i.listType,i.listIndent)||(e.return=!0,e.stop())}))}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer((i=>function(e,t,i,o){const n=e.document.differ.getChanges(),r=new Map,s=o.editor.config.get("list.multiBlock");let a=!1;for(const o of n){if("insert"==o.type&&"$text"!=o.name){const n=o.position.nodeAfter;if(!e.schema.checkAttribute(n,"listItemId"))for(const e of Array.from(n.getAttributeKeys()))i.includes(e)&&(t.removeAttribute(e,n),a=!0);ax(o.position,r),o.attributes.has("listItemId")||ax(o.position.getShiftedBy(o.length),r);for(const{item:t,previousPosition:i}of e.createRangeIn(n))Ny(t)&&ax(i,r)}else"remove"==o.type?ax(o.position,r):"attribute"==o.type&&i.includes(o.attributeKey)&&(ax(o.range.start,r),null===o.attributeNewValue&&ax(o.range.start.getShiftedBy(1),r));if(!s&&"attribute"==o.type&&px.includes(o.attributeKey)){const e=o.range.start.nodeAfter;null===o.attributeNewValue&&e&&e.is("element","listItem")?(t.rename(e,"paragraph"),a=!0):null===o.attributeOldValue&&e&&e.is("element")&&"listItem"!=e.name&&(t.rename(e,"listItem"),a=!0)}}const c=new Set;for(const e of r.values())a=o.fire("postFixer",{listNodes:new Py(e),listHead:e,writer:t,seenIds:c})||a;return a}(e,i,t,this))),this.on("postFixer",((e,{listNodes:t,writer:i})=>{e.return=function(e,t){let i=0,o=-1,n=null,r=!1;for(const{node:s}of e){const e=s.getAttribute("listIndent");if(e>i){let a;null===n?(n=e-i,a=i):(n>e&&(n=e),a=e-n),a>o+1&&(a=o+1),t.setAttribute("listIndent",a,s),r=!0,o=a}else n=null,i=e+1,o=e}return r}(t,i)||e.return}),{priority:"high"}),this.on("postFixer",((e,{listNodes:t,writer:i,seenIds:o})=>{e.return=function(e,t,i){const o=new Set;let n=!1;for(const{node:r}of e){if(o.has(r))continue;let e=r.getAttribute("listType"),s=r.getAttribute("listItemId");if(t.has(s)&&(s=Vy.next()),t.add(s),r.is("element","listItem"))r.getAttribute("listItemId")!=s&&(i.setAttribute("listItemId",s,r),n=!0);else for(const t of Oy(r,{direction:"forward"}))o.add(t),t.getAttribute("listType")!=e&&(s=Vy.next(),e=t.getAttribute("listType")),t.getAttribute("listItemId")!=s&&(i.setAttribute("listItemId",s,t),n=!0)}return n}(t,o,i)||e.return}),{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(e){return(t,[i,o])=>{const n=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!n.length)return;const r=(o?e.createSelection(o):e.document.selection).getFirstPosition();let s;if(Ny(r.parent))s=r.parent;else{if(!Ny(r.nodeBefore))return;s=r.nodeBefore}e.change((e=>{const t=s.getAttribute("listType"),i=s.getAttribute("listIndent"),o=n[0].getAttribute("listIndent")||0,r=Math.max(i-o,0);for(const i of n){const o=Ny(i);s.is("element","listItem")&&i.is("element","paragraph")&&e.rename(i,"listItem"),e.setAttributes({listIndent:(o?i.getAttribute("listIndent"):0)+r,listItemId:o?i.getAttribute("listItemId"):Vy.next(),listType:t},i)}}))}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",((t,i)=>{e.change((e=>{const t=Array.from(i.content.getChildren()),o=t[t.length-1];if(t.length>1&&o.is("element")&&o.isEmpty&&t.slice(0,-1).every(Ny)&&e.remove(o),"copy"==i.method||"cut"==i.method){const t=Array.from(i.content.getChildren());$y(t)&&Uy(t,e)}}))}))}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function kx(e,t){const i=e.document.selection;if(!i.isCollapsed)return!Wy(e);if("forward"===t)return!0;const o=i.getFirstPosition().parent,n=o.previousSibling;return!e.schema.isObject(n)&&(!!n.isEmpty||$y([o,n]))}function bx(e,t,i,o){e.ui.componentFactory.add(t,(()=>{const n=wx(gu,e,t,i,o);return n.set({tooltip:!0,isToggleable:!0}),n})),e.ui.componentFactory.add(`menuBar:${t}`,(()=>wx($g,e,t,i,o)))}function wx(e,t,i,o,n){const r=t.commands.get(i),s=new e(t.locale);return s.set({label:o,icon:n}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",(()=>{t.execute(i),t.editing.view.focus()})),s}class _x extends Mn{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||bx(this.editor,"numberedList",e("Numbered List"),eu.numberedList),this.editor.ui.componentFactory.has("bulletedList")||bx(this.editor,"bulletedList",e("Bulleted List"),eu.bulletedList)}}class vx extends Mn{static get requires(){return[fx,_x]}static get pluginName(){return"List"}}const yx={},xx={},Ax={},Cx=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:e,typeAttribute:t,listType:i}of Cx)yx[e]=i,xx[e]=t,t&&(Ax[t]=e);var Tx=n(1911);yn()(Tx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Tx.A.locals;var Ex=n(1330);yn()(Ex.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ex.A.locals,yo("Ctrl+Enter");var Sx=n(5484);function Mx(e,t){const i=(i,o,n)=>{if(!n.consumable.consume(o.item,i.name))return;const r=o.attributeNewValue,s=n.writer,a=n.mapper.toViewElement(o.item),c=[...a.getChildren()].find((e=>e.getCustomProperty("media-content")));s.remove(c);const l=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),l)};return e=>{e.on("attribute:url:media",i)}}function Ix(e,t,i,o){return e.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(e,i,o),e.createSlot()])}function Px(e){const t=e.getSelectedElement();return t&&t.is("element","media")?t:null}function Vx(e,t,i,o){e.change((n=>{const r=n.createElement("media",{url:t});e.insertObject(r,i,null,{setSelection:"on",findOptimalPosition:o?"auto":void 0})}))}yn()(Sx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Sx.A.locals,yo("Ctrl+Enter");class Nx extends Pn{refresh(){const e=this.editor.model,t=e.document.selection,i=Px(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=function(e){const t=e.getSelectedElement();return!!t&&"media"===t.name}(t)||function(e,t){let i=Qk(e,t).start.parent;return i.isEmpty&&!t.schema.isLimit(i)&&(i=i.parent),t.schema.checkChild(i,"media")}(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,o=Px(i);o?t.change((t=>{t.setAttribute("url",e,o)})):Vx(t,e,i,!0)}}class Lx{constructor(e,t){const i=t.providers,o=t.extraProviders||[],n=new Set(t.removeProviders),r=i.concat(o).filter((e=>{const t=e.name;return t?!n.has(t):(b("media-embed-no-provider-name",{provider:e}),!1)}));this.locale=e,this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new Ox(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,o=Co(t.url);for(const t of o){const o=this._getUrlMatches(e,t);if(o)return new Ox(this.locale,e,o,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let o=e.replace(/^https?:\/\//,"");return i=o.match(t),i||(o=o.replace(/^www\./,""),i=o.match(t),i||null)}}class Ox{constructor(e,t,i,o){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=o}getViewElement(e,t){const i={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const n=this._getPreviewHtml(t);o=e.createRawElement("div",i,((e,t)=>{t.setContentOf(e,n)}))}else this.url&&(i.url=this.url),o=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new uu,t=this._locale.t;return e.content='',e.viewBox="0 0 64 42",new Xo({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}var Rx=n(5767);yn()(Rx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Rx.A.locals;class Dx extends Mn{static get pluginName(){return"MediaEmbedEditing"}constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const t=e[1],i=e[2];return`
`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`
`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new Lx(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion,n=e.config.get("mediaEmbed.previewsInData"),r=e.config.get("mediaEmbed.elementName"),s=this.registry;e.commands.add("mediaEmbed",new Nx(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),o.for("dataDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const i=e.getAttribute("url");return Ix(t,s,i,{elementName:r,renderMediaPreview:!!i&&n})}}),o.for("dataDowncast").add(Mx(s,{elementName:r,renderMediaPreview:n})),o.for("editingDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const o=e.getAttribute("url");return function(e,t,i){return t.setCustomProperty("media",!0,e),Wk(e,t,{label:i})}(Ix(t,s,o,{elementName:r,renderForEditingView:!0}),t,i("media widget"))}}),o.for("editingDowncast").add(Mx(s,{elementName:r,renderForEditingView:!0})),o.for("upcast").elementToElement({view:e=>["oembed",r].includes(e.name)&&e.getAttribute("url")?{name:!0}:null,model:(e,{writer:t})=>{const i=e.getAttribute("url");return s.hasMedia(i)?t.createElement("media",{url:i}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(e,{writer:t})=>{const i=e.getAttribute("data-oembed-url");return s.hasMedia(i)?t.createElement("media",{url:i}):null}}).add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.consume(t.viewItem,{name:!0,classes:"media"}))return;const{modelRange:o,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=o,t.modelCursor=n,Uo(o.getItems())||i.consumable.revert(t.viewItem,{name:!0,classes:"media"})}))}))}}const Bx=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class zx extends Mn{static get requires(){return[Ib,Np,$b]}static get pluginName(){return"AutoMediaEmbed"}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,i=e.model.document,o=e.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",(()=>{const e=i.selection.getFirstRange(),t=Fl.fromPosition(e.start);t.stickiness="toPrevious";const o=Fl.fromPosition(e.end);o.stickiness="toNext",i.once("change:data",(()=>{this._embedMediaBetweenPositions(t,o),t.detach(),o.detach()}),{priority:"high"})})),e.commands.get("undo").on("execute",(()=>{this._timeoutId&&(t.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedMediaBetweenPositions(e,i){const o=this.editor,n=o.plugins.get(Dx).registry,r=new oc(e,i),s=r.getWalker({ignoreElementEnd:!0});let a="";for(const e of s)e.item.is("$textProxy")&&(a+=e.item.data);a=a.trim(),a.match(Bx)&&n.hasMedia(a)&&o.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Fl.fromPosition(e),this._timeoutId=t.window.setTimeout((()=>{o.model.change((e=>{this._timeoutId=null,e.remove(r),r.detach();let t=null;"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert),Vx(o.model,a,t,!1),this._positionToInsert.detach(),this._positionToInsert=null})),o.plugins.get(Np).requestUndoOnBackspace()}),100)):r.detach()}}var jx=n(6004);yn()(jx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),jx.A.locals;class Fx extends An{constructor(e,t){super(t);const i=t.t;this.focusTracker=new $o,this.keystrokes=new qo,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),eu.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),eu.cancel,"ck-button-cancel","cancel"),this._focusables=new Jo,this._focusCycler=new qu({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),En({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Lu(this.locale,wh),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.on("input",(()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()})),t}_createButton(e,t,i,o){const n=new gu(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}}class Hx extends Mn{static get requires(){return[Dx]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed");e.ui.componentFactory.add("mediaEmbed",(e=>{const i=hh(e);return this._setUpDropdown(i,t),i}))}_setUpDropdown(e,t){const i=this.editor,o=i.t,n=e.buttonView,r=i.plugins.get(Dx).registry;e.once("change:isOpen",(()=>{const o=new(Tn(Fx))(function(e,t){return[t=>{if(!t.url.length)return e("The URL must not be empty.")},i=>{if(!t.hasMedia(i.url))return e("This media URL is not supported.")}]}(i.t,r),i.locale);e.panelView.children.add(o),n.on("open",(()=>{o.disableCssTransitions(),o.url=t.value||"",o.urlInputView.fieldView.select(),o.enableCssTransitions()}),{priority:"low"}),e.on("submit",(()=>{o.isValid()&&(i.execute("mediaEmbed",o.url),i.editing.view.focus())})),e.on("change:isOpen",(()=>o.resetFormStatus())),e.on("cancel",(()=>{i.editing.view.focus()})),o.delegate("submit","cancel").to(e),o.urlInputView.fieldView.bind("value").to(t,"value"),o.urlInputView.on("change:errorText",(()=>{i.ui.update()})),o.urlInputView.bind("isEnabled").to(t,"isEnabled")})),e.bind("isEnabled").to(t),n.set({label:o("Insert media"),icon:'',tooltip:!0})}}var Ux=n(3155);yn()(Ux.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ux.A.locals;class $x extends Mn{static get requires(){return[Dx,Hx,zx,db]}static get pluginName(){return"MediaEmbed"}}class qx extends Pn{constructor(e){super(e),this.affectsData=!1,this.value=!1}execute(){const e="ck-show-blocks",t=this.editor.editing.view;t.change((i=>{for(const o of t.document.roots)o.hasClass(e)?(i.removeClass(e,o),this.value=!1):(i.addClass(e,o),this.value=!0)}))}}class Wx extends Mn{static get pluginName(){return"ShowBlocksEditing"}init(){const{editor:e}=this;e.commands.add("showBlocks",new qx(e))}}var Zx=n(4975);yn()(Zx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Zx.A.locals;class Gx extends Mn{static get pluginName(){return"ShowBlocksUI"}init(){const e=this.editor;e.ui.componentFactory.add("showBlocks",(()=>{const e=this._createButton(gu);return e.set({tooltip:!0,icon:''}),e})),e.ui.componentFactory.add("menuBar:showBlocks",(()=>this._createButton($g)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("showBlocks"),n=new e(i),r=i.t;return n.set({label:r("Show blocks")}),n.bind("isEnabled").to(o),n.bind("isOn").to(o,"value",o,"isEnabled",((e,t)=>e&&t)),this.listenTo(n,"execute",(()=>{t.execute("showBlocks"),t.editing.view.focus()})),n}}class Kx extends Mn{static get pluginName(){return"ShowBlocks"}static get requires(){return[Wx,Gx]}}function Yx(e,t,i=" "){return`${i.repeat(Math.max(0,t))}${e}`}var Qx=n(9227);yn()(Qx.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Qx.A.locals;const Jx="SourceEditingMode";class Xx extends Mn{static get pluginName(){return"SourceEditing"}static get requires(){return[Xd]}constructor(e){super(e),this.set("isSourceEditingMode",!1),this._elementReplacer=new W,this._replacedRoots=new Map,this._dataFromRoots=new Map,e.config.define("sourceEditing.allowCollaborationFeatures",!1)}init(){this._checkCompatibility();const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("sourceEditing",(()=>{const e=this._createButton(gu);return e.set({label:t("Source"),icon:'',tooltip:!0,class:"ck-source-editing-button"}),e})),e.ui.componentFactory.add("menuBar:sourceEditing",(()=>{const e=this._createButton($g);return e.set({label:t("Show source")}),e})),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",((e,t,i)=>{i?(this._hideVisibleDialog(),this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())})),this.on("change:isEnabled",((e,t,i)=>this._handleReadOnlyMode(!i))),this.listenTo(e,"change:isReadOnly",((e,t,i)=>this._handleReadOnlyMode(i)))),e.data.on("get",(()=>{this.isSourceEditingMode&&this.updateEditorData()}),{priority:"high"})}updateEditorData(){const e=this.editor,t={};for(const[e,i]of this._replacedRoots){const o=this._dataFromRoots.get(e),n=i.dataset.value;o!==n&&(t[e]=n,this._dataFromRoots.set(e,n))}Object.keys(t).length&&e.data.set(t,{batchType:{isUndoable:!0},suppressErrorInCollaboration:!0})}_checkCompatibility(){const e=this.editor,t=e.config.get("sourceEditing.allowCollaborationFeatures");if(!t&&e.plugins.has("RealTimeCollaborativeEditing"))throw new k("source-editing-incompatible-with-real-time-collaboration",null);!t&&["CommentsEditing","TrackChangesEditing","RevisionHistory"].some((t=>e.plugins.has(t)))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),e.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}_showSourceEditing(){const e=this.editor,t=e.editing.view,i=e.model;i.change((e=>{e.setSelection(null),e.removeSelectionAttribute(i.document.selection.getAttributeKeys())}));for(const[i,o]of t.domRoots){const n=eA(e.data.get({rootName:i})),r=de(o.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),s=de(o.ownerDocument,"div",{class:"ck-source-editing-area","data-value":n},[r]);r.value=n,r.setSelectionRange(0,0),r.addEventListener("input",(()=>{s.dataset.value=r.value,e.ui.update()})),t.change((e=>{const o=t.document.getRoot(i);e.addClass("ck-hidden",o)})),e.ui.setEditableElement("sourceEditing:"+i,r),this._replacedRoots.set(i,s),this._elementReplacer.replace(o,s),this._dataFromRoots.set(i,n)}this._focusSourceEditing()}_hideSourceEditing(){const e=this.editor.editing.view;this.updateEditorData(),e.change((t=>{for(const[i]of this._replacedRoots)t.removeClass("ck-hidden",e.document.getRoot(i))})),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),e.focus()}_focusSourceEditing(){const e=this.editor,[t]=this._replacedRoots.values(),i=t.querySelector("textarea");e.editing.view.document.isFocused=!1,i.focus()}_disableCommands(){const e=this.editor;for(const t of e.commands.commands())t.forceDisabled(Jx);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").forceDisabled(Jx)}_enableCommands(){const e=this.editor;for(const t of e.commands.commands())t.clearForceDisabled(Jx);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").clearForceDisabled(Jx)}_handleReadOnlyMode(e){if(this.isSourceEditingMode)for(const[,t]of this._replacedRoots)t.querySelector("textarea").readOnly=e}_isAllowedToHandleSourceEditingMode(){const e=this.editor.ui.view.editable;return e&&!e.hasExternalElement}_hideVisibleDialog(){if(this.editor.plugins.has("Dialog")){const e=this.editor.plugins.get("Dialog");e.isOpen&&e.hide()}}_createButton(e){const t=this.editor,i=new e(t.locale);return i.set({withText:!0}),i.bind("isOn").to(this,"isSourceEditingMode"),i.bind("isEnabled").to(this,"isEnabled",t,"isReadOnly",t.plugins.get(Xd),"hasAny",((e,t,i)=>!!e&&!t&&!i)),this.listenTo(i,"execute",(()=>{this.isSourceEditingMode=!this.isSourceEditingMode})),i}}function eA(e){return function(e){return e.startsWith("<")}(e)?function(e){const t=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],i=t.map((e=>e.name)).join("|"),o=e.replace(new RegExp(``,"g"),"\n$&\n").replace(/]*>/g,"$&\n").split("\n");let n=0,r=!1;return o.filter((e=>e.length)).map((e=>(r=function(e,t){return new RegExp("").test(e)?"first":new RegExp("").test(e)?"last":("first"===t||"middle"===t)&&"middle"}(e,r),function(e,t){return t.some((t=>!t.isVoid&&!!new RegExp(`<${t.name}( .*?)?>`).test(e)))}(e,t)?Yx(e,n++):function(e,t){return t.some((t=>new RegExp(``).test(e)))}(e,t)?Yx(e,--n):"middle"===r||"last"===r?e:Yx(e,n)))).join("\n")}(e):e}class tA extends cm{constructor(e,t){super(e);const i=e.t;this.set("class","ck-special-characters-navigation"),this.groupDropdownView=this._createGroupDropdown(t),this.groupDropdownView.panelPosition="rtl"===e.uiLanguageDirection?"se":"sw",this.label=i("Special characters"),this.children.add(this.groupDropdownView)}get currentGroupName(){return this.groupDropdownView.value}focus(){this.groupDropdownView.focus()}_createGroupDropdown(e){const t=this.locale,i=t.t,o=hh(t),n=this._getCharacterGroupListItemDefinitions(o,e),r=i("Character categories");return o.set("value",n.first.model.name),o.buttonView.bind("label").to(o,"value",(t=>e.get(t))),o.buttonView.set({isOn:!1,withText:!0,tooltip:r,class:["ck-dropdown__button_label-width_auto"],ariaLabel:r,ariaLabelledBy:void 0}),o.on("execute",(e=>{o.value=e.source.name})),o.delegate("execute").to(this),ph(o,n,{ariaLabel:r,role:"menu"}),o}_getCharacterGroupListItemDefinitions(e,t){const i=new Ho;for(const[o,n]of t){const t=new Qm({name:o,label:n,withText:!0,role:"menuitemradio"});t.bind("isOn").to(e,"value",(e=>e===t.name)),i.add({type:"button",model:t})}return i}}var iA=n(2221);yn()(iA.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),iA.A.locals;class oA extends An{constructor(e){super(e),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}}),this.focusTracker=new $o,this.keystrokes=new qo,Sn({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.tiles,numberOfColumns:()=>t.window.getComputedStyle(this.element.firstChild).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}createTile(e,t){const i=new gu(this.locale);return i.set({label:e,withText:!0,class:"ck-character-grid__tile"}),i.extendTemplate({attributes:{title:t},on:{mouseover:i.bindTemplate.to("mouseover"),focus:i.bindTemplate.to("focus")}}),i.on("mouseover",(()=>{this.fire("tileHover",{name:t,character:e})})),i.on("focus",(()=>{this.fire("tileFocus",{name:t,character:e})})),i.on("execute",(()=>{this.fire("execute",{name:t,character:e})})),i}render(){super.render();for(const e of this.tiles)this.focusTracker.add(e.element);this.tiles.on("change",((e,{added:t,removed:i})=>{if(t.length>0)for(const e of t)this.focusTracker.add(e.element);if(i.length>0)for(const e of i)this.focusTracker.remove(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}focus(){this.tiles.first.focus()}}var nA=n(3445);yn()(nA.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),nA.A.locals;class rA extends An{constructor(e){super(e);const t=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",sA),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:t.to("name",(e=>e||"​"))}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:t.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function sA(e){return null===e?"":"U+"+("0000"+e.codePointAt(0).toString(16)).slice(-4)}class aA extends An{constructor(e,t,i,o){super(e),this.navigationView=t,this.gridView=i,this.infoView=o,this.items=this.createCollection(),this.focusTracker=new $o,this.keystrokes=new qo,this._focusCycler=new qu({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",children:[this.navigationView,this.gridView,this.infoView],attributes:{tabindex:"-1"}}),this.items.add(this.navigationView.groupDropdownView.buttonView),this.items.add(this.gridView)}render(){super.render(),this.focusTracker.add(this.navigationView.groupDropdownView.buttonView.element),this.focusTracker.add(this.gridView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.navigationView.focus()}}var cA=n(7405);yn()(cA.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),cA.A.locals;const lA="All";class dA extends Mn{static get requires(){return[Lp]}static get pluginName(){return"SpecialCharacters"}constructor(e){super(e);const t=e.t;this._characters=new Map,this._groups=new Map,this._allSpecialCharactersGroupLabel=t("All")}init(){const e=this.editor,t=e.t,i=e.commands.get("insertText");e.ui.componentFactory.add("specialCharacters",(o=>{const n=hh(o);let r;return n.buttonView.set({label:t("Special characters"),icon:'',tooltip:!0}),n.bind("isEnabled").to(i),n.on("execute",((t,i)=>{e.execute("insertText",{text:i.character}),e.editing.view.focus()})),n.on("change:isOpen",(()=>{if(!r){r=this._createDropdownPanelContent(o,n);const e=new aA(o,r.navigationView,r.gridView,r.infoView);n.panelView.children.add(e)}r.infoView.set({character:null,name:null})})),n}))}addItems(e,t,i={label:e}){if(e===lA)throw new k("special-character-invalid-group-name",null);const o=this._getGroup(e,i.label);for(const e of t)o.items.add(e.title),this._characters.set(e.title,e.character)}getGroups(){const e=Array.from(this._groups.keys()),t=this.editor.config.get("specialCharacters.order")||[],i=t.find((t=>!e.includes(t)));if(i)throw new k("special-character-invalid-order-group-name",null,{invalidGroup:i});return new Set([...t,...e])}getCharactersForGroup(e){if(e===lA)return new Set(this._characters.keys());const t=this._groups.get(e);return t?t.items:void 0}getCharacter(e){return this._characters.get(e)}_getGroup(e,t){return this._groups.has(e)||this._groups.set(e,{items:new Set,label:t}),this._groups.get(e)}_updateGrid(e,t){t.tiles.clear();const i=this.getCharactersForGroup(e);for(const e of i){const i=this.getCharacter(e);t.tiles.add(t.createTile(i,e))}}_createDropdownPanelContent(e,t){const i=Array.from(this.getGroups()).map((e=>[e,this._groups.get(e).label])),o=new Map([[lA,this._allSpecialCharactersGroupLabel],...i]),n=new tA(e,o),r=new oA(e),s=new rA(e);return r.delegate("execute").to(t),r.on("tileHover",((e,t)=>{s.set(t)})),r.on("tileFocus",((e,t)=>{s.set(t)})),n.on("execute",(()=>{this._updateGrid(n.currentGroupName,r)})),this._updateGrid(n.currentGroupName,r),{navigationView:n,gridView:r,infoView:s}}}function uA(e,t,i,o,n=1){null!=t&&null!=n&&t>n?o.setAttribute(e,t,i):o.removeAttribute(e,i)}function hA(e,t,i={}){const o=e.createElement("tableCell",i);return e.insertElement("paragraph",o),e.insert(o,t),o}function mA(e,t){const i=t.parent.parent,o=parseInt(i.getAttribute("headingColumns")||"0"),{column:n}=e.getCellLocation(t);return!!o&&n{t.on(`element:${e}`,((e,t,{writer:i})=>{if(!t.modelRange)return;const o=t.modelRange.start.nodeAfter,n=i.createPositionAt(o,0);if(t.viewItem.isEmpty)return void i.insertElement("paragraph",n);const r=Array.from(o.getChildren());if(r.every((e=>e.is("element","$marker")))){const e=i.createElement("paragraph");i.insert(e,i.createPositionAt(o,0));for(const t of r)i.move(i.createRangeOn(t),i.createPositionAt(e,"end"))}}),{priority:"low"})}}function pA(e){let t=0,i=0;const o=Array.from(e.getChildren()).filter((e=>"th"===e.name||"td"===e.name));for(;i1||n>1)&&this._recordSpans(i,n,o),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new kA(this,e,t,i)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||i||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,i){const o={cell:e,row:this._row,column:this._column};for(let e=this._row;e0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}}class kA{constructor(e,t,i,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function bA(e,t){return(i,{writer:o})=>{const n=i.getAttribute("headingRows")||0,r=o.createContainerElement("table",null,[]),s=o.createContainerElement("figure",{class:"table"},r);n>0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("thead",null,o.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=n))));for(const{positionOffset:e,filter:i}of t.additionalSlots)o.insert(o.createPositionAt(r,e),o.createSlot(i));return o.insert(o.createPositionAt(r,"after"),o.createSlot((e=>!e.is("element","tableRow")&&!t.additionalSlots.some((({filter:t})=>t(e)))))),t.asWidget?function(e,t){return t.setCustomProperty("table",!0,e),Wk(e,t,{hasSelectionHandle:!0})}(s,o):s}}function wA(e={}){return(t,{writer:i})=>{const o=t.parent,n=o.parent,r=n.getChildIndex(o),s=new fA(n,{row:r}),a=n.getAttribute("headingRows")||0,c=n.getAttribute("headingColumns")||0;let l=null;for(const o of s)if(o.cell==t){const t=o.row{if(!t.parent.is("element","tableCell"))return null;if(!vA(t))return null;if(e.asWidget)return i.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function vA(e){return 1==e.parent.childCount&&!!e.getAttributeKeys().next().done}class yA extends Pn{refresh(){const e=this.editor.model,t=e.document.selection,i=e.schema;this.isEnabled=function(e,t){const i=e.getFirstPosition().parent,o=i===i.root?i:i.parent;return t.checkChild(o,"table")}(t,i)}execute(e={}){const t=this.editor,i=t.model,o=t.plugins.get("TableUtils"),n=t.config.get("table.defaultHeadings.rows"),r=t.config.get("table.defaultHeadings.columns");void 0===e.headingRows&&n&&(e.headingRows=n),void 0===e.headingColumns&&r&&(e.headingColumns=r),i.change((t=>{const n=o.createTable(t,e);i.insertObject(n,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(n.getNodeByPath([0,0,0]),0))}))}}class xA extends Pn{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="above"===this.order,n=i.getSelectionAffectedTableCells(t),r=i.getRowIndexes(n),s=o?r.first:r.last,a=n[0].findAncestor("table");i.insertRows(a,{at:o?s:s+1,copyStructureFromAbove:!o})}}class AA extends Pn{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="left"===this.order,n=i.getSelectionAffectedTableCells(t),r=i.getColumnIndexes(n),s=o?r.first:r.last,a=n[0].findAncestor("table");i.insertColumns(a,{columns:1,at:o?s:s+1})}}class CA extends Pn{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}function TA(e,t,i){const{startRow:o,startColumn:n,endRow:r,endColumn:s}=t,a=i.createElement("table"),c=r-o+1;for(let e=0;e0&&uA("headingRows",r-i,e,n,0);const s=parseInt(t.getAttribute("headingColumns")||"0");s>0&&uA("headingColumns",s-o,e,n,0)}(a,e,o,n,i),a}function EA(e,t,i=0){const o=[],n=new fA(e,{startRow:i,endRow:t-1});for(const e of n){const{row:i,cellHeight:n}=e;i1&&(a.rowspan=c);const l=parseInt(e.getAttribute("colspan")||"1");l>1&&(a.colspan=l);const d=r+s,u=[...new fA(n,{startRow:r,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:o,column:n,cell:r}=t;r===e&&void 0===h&&(h=n),void 0!==h&&h===n&&o===d&&(m=hA(i,t.getPositionBefore(),a))}return uA("rowspan",s,e,i),m}function MA(e,t){const i=[],o=new fA(e);for(const e of o){const{column:o,cellWidth:n}=e;o1&&(r.colspan=s);const a=parseInt(e.getAttribute("rowspan")||"1");a>1&&(r.rowspan=a);const c=hA(o,o.createPositionAfter(e),r);return uA("colspan",n,e,o),c}function PA(e,t,i,o,n,r){const s=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");i+s-1>n&&uA("colspan",n-i+1,e,r,1),t+a-1>o&&uA("rowspan",o-t+1,e,r,1)}function VA(e,t){const i=t.getColumns(e),o=new Array(i).fill(0);for(const{column:t}of new fA(e))o[t]++;const n=o.reduce(((e,t,i)=>t?e:[...e,i]),[]);if(n.length>0){const i=n[n.length-1];return t.removeColumns(e,{at:i}),!0}return!1}function NA(e,t){const i=[],o=t.getRows(e);for(let t=0;t0){const o=i[i.length-1];return t.removeRows(e,{at:o}),!0}return!1}function LA(e,t){VA(e,t)||NA(e,t)}function OA(e,t){const i=Array.from(new fA(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every((({cellHeight:e})=>1===e)))return t.lastRow;const o=i[0].cellHeight-1;return t.lastRow+o}function RA(e,t){const i=Array.from(new fA(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every((({cellWidth:e})=>1===e)))return t.lastColumn;const o=i[0].cellWidth-1;return t.lastColumn+o}class DA extends Pn{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,i=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,n=this.direction;e.change((e=>{const t="right"==n||"down"==n,r=t?i:o,s=t?o:i,a=s.parent;!function(e,t,i){BA(e)||(BA(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}(s,r,e);const c=this.isHorizontal?"colspan":"rowspan",l=parseInt(i.getAttribute(c)||"1"),d=parseInt(o.getAttribute(c)||"1");e.setAttribute(c,l+d,r),e.setSelection(e.createRangeIn(r));const u=this.editor.plugins.get("TableUtils");LA(a.findAncestor("table"),u)}))}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),i=t.getTableCellsContainingSelection(e.selection)[0];if(!i)return;const o=this.isHorizontal?function(e,t,i){const o=e.parent.parent,n="right"==t?e.nextSibling:e.previousSibling,r=(o.getAttribute("headingColumns")||0)>0;if(!n)return;const s="right"==t?e:n,a="right"==t?n:e,{column:c}=i.getCellLocation(s),{column:l}=i.getCellLocation(a),d=parseInt(s.getAttribute("colspan")||"1"),u=mA(i,s),h=mA(i,a);return r&&u!=h?void 0:c+d===l?n:void 0}(i,this.direction,t):function(e,t,i){const o=e.parent,n=o.parent,r=n.getChildIndex(o);if("down"==t&&r===i.getRows(n)-1||"up"==t&&0===r)return null;const s=parseInt(e.getAttribute("rowspan")||"1"),a=n.getAttribute("headingRows")||0;if(a&&("down"==t&&r+s===a||"up"==t&&r===a))return null;const c=parseInt(e.getAttribute("rowspan")||"1"),l="down"==t?r+c:r,d=[...new fA(n,{endRow:l})],u=d.find((t=>t.cell===e)).column,h=d.find((({row:e,cellHeight:i,column:o})=>o===u&&("down"==t?e===l:l===e+i)));return h&&h.cell?h.cell:null}(i,this.direction,t);if(!o)return;const n=this.isHorizontal?"rowspan":"colspan",r=parseInt(i.getAttribute(n)||"1");return parseInt(o.getAttribute(n)||"1")===r?o:void 0}}function BA(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class zA extends Pn{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getRows(o)-1,r=e.getRowIndexes(t),s=0===r.first&&r.last===n;this.isEnabled=!s}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0],r=n.findAncestor("table"),s=t.getCellLocation(n).column;e.change((e=>{const i=o.last-o.first+1;t.removeRows(r,{at:o.first,rows:i});const n=function(e,t,i,o){const n=e.getChild(Math.min(t,o-1));let r=n.getChild(0),s=0;for(const e of n.getChildren()){if(s>i)return r;r=e,s+=parseInt(e.getAttribute("colspan")||"1")}return r}(r,o.first,s,t.getRows(r));e.setSelection(e.createPositionAt(n,0))}))}}class jA extends Pn{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getColumns(o),{first:r,last:s}=e.getColumnIndexes(t);this.isEnabled=s-re.cell===t)).column,last:n.find((e=>e.cell===i)).column},s=function(e,t,i,o){return parseInt(i.getAttribute("colspan")||"1")>1?i:t.previousSibling||i.nextSibling?i.nextSibling||t.previousSibling:o.first?e.reverse().find((({column:e})=>ee>o.last)).cell}(n,t,i,r);this.editor.model.change((t=>{const i=r.last-r.first+1;e.removeColumns(o,{at:r.first,columns:i}),t.setSelection(t.createPositionAt(s,0))}))}}class FA extends Pn{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i.length>0;this.isEnabled=o,this.value=o&&i.every((e=>this._isInHeading(e,e.parent.parent)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:r,last:s}=t.getRowIndexes(o),a=this.value?r:s+1,c=n.getAttribute("headingRows")||0;i.change((e=>{if(a){const t=EA(n,a,a>c?c:0);for(const{cell:i}of t)SA(i,a,e)}uA("headingRows",a,n,e,0)}))}_isInHeading(e,t){const i=parseInt(t.getAttribute("headingRows")||"0");return!!i&&e.parent.index0;this.isEnabled=o,this.value=o&&i.every((e=>mA(t,e)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:r,last:s}=t.getColumnIndexes(o),a=this.value?r:s+1;i.change((e=>{if(a){const t=MA(n,a);for(const{cell:i,column:o}of t)IA(i,o,a,e)}uA("headingColumns",a,n,e,0)}))}}function UA(e){const t=function(e){if(e.is("element","tableColumnGroup"))return e;const t=e.getChildren();return Array.from(t).find((e=>e.is("element","tableColumnGroup")))}(e);return t?Array.from(t.getChildren()):[]}class $A extends Mn{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,i=t.parent,o=i.getChildIndex(t),n=new fA(i,{row:o});for(const{cell:t,row:i,column:o}of n)if(t===e)return{row:i,column:o}}createTable(e,t){const i=e.createElement("table"),o=t.rows||2,n=t.columns||2;return qA(e,i,0,o,n),t.headingRows&&uA("headingRows",Math.min(t.headingRows,o),i,e,0),t.headingColumns&&uA("headingColumns",Math.min(t.headingColumns,n),i,e,0),i}insertRows(e,t={}){const i=this.editor.model,o=t.at||0,n=t.rows||1,r=void 0!==t.copyStructureFromAbove,s=t.copyStructureFromAbove?o-1:o,a=this.getRows(e),c=this.getColumns(e);if(o>a)throw new k("tableutils-insertrows-insert-out-of-range",this,{options:t});i.change((t=>{const i=e.getAttribute("headingRows")||0;if(i>o&&uA("headingRows",i+n,e,t,0),!r&&(0===o||o===a))return void qA(t,e,o,n,c);const l=r?Math.max(o,s):o,d=new fA(e,{endRow:l}),u=new Array(c).fill(1);for(const{row:e,column:i,cellHeight:a,cellWidth:c,cell:l}of d){const d=e+a-1,h=e<=s&&s<=d;e0&&hA(t,n,o>1?{colspan:o}:void 0),e+=Math.abs(o)-1}}}))}insertColumns(e,t={}){const i=this.editor.model,o=t.at||0,n=t.columns||1;i.change((t=>{const i=e.getAttribute("headingColumns");on-1)throw new k("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});i.change((t=>{const i={first:r,last:s},{cellsToMove:o,cellsToTrim:n}=function(e,{first:t,last:i}){const o=new Map,n=[];for(const{row:r,column:s,cellHeight:a,cell:c}of new fA(e,{endRow:i})){const e=r+a-1;if(r>=t&&r<=i&&e>i){const e=a-(i-r+1);o.set(s,{cell:c,rowspan:e})}if(r=t){let o;o=e>=i?i-t+1:e-t+1,n.push({cell:c,rowspan:a-o})}}return{cellsToMove:o,cellsToTrim:n}}(e,i);o.size&&function(e,t,i,o){const n=[...new fA(e,{includeAllSlots:!0,row:t})],r=e.getChild(t);let s;for(const{column:e,cell:t,isAnchor:a}of n)if(i.has(e)){const{cell:t,rowspan:n}=i.get(e),a=s?o.createPositionAfter(s):o.createPositionAt(r,0);o.move(o.createRangeOn(t),a),uA("rowspan",n,t,o),s=t}else a&&(s=t)}(e,s+1,o,t);for(let i=s;i>=r;i--)t.remove(e.getChild(i));for(const{rowspan:e,cell:i}of n)uA("rowspan",e,i,t);!function(e,{first:t,last:i},o){const n=e.getAttribute("headingRows")||0;t{!function(e,t,i){const o=e.getAttribute("headingColumns")||0;if(o&&t.first=o;n--){for(const{cell:i,column:o,cellWidth:r}of[...new fA(e)])o<=n&&r>1&&o+r>n?uA("colspan",r-1,i,t):o===n&&t.remove(i);if(i[n]){const e=0===n?i[1]:i[n-1],o=parseFloat(i[n].getAttribute("columnWidth")),r=parseFloat(e.getAttribute("columnWidth"));t.remove(i[n]),t.setAttribute("columnWidth",o+r+"%",e)}}NA(e,this)||VA(e,this)}))}splitCellVertically(e,t=2){const i=this.editor.model,o=e.parent.parent,n=parseInt(e.getAttribute("rowspan")||"1"),r=parseInt(e.getAttribute("colspan")||"1");i.change((i=>{if(r>1){const{newCellsSpan:o,updatedSpan:s}=ZA(r,t);uA("colspan",s,e,i);const a={};o>1&&(a.colspan=o),n>1&&(a.rowspan=n),WA(r>t?t-1:r-1,i,i.createPositionAfter(e),a)}if(rt===e)),l=a.filter((({cell:t,cellWidth:i,column:o})=>t!==e&&o===c||oc));for(const{cell:e,cellWidth:t}of l)i.setAttribute("colspan",t+s,e);const d={};n>1&&(d.rowspan=n),WA(s,i,i.createPositionAfter(e),d);const u=o.getAttribute("headingColumns")||0;u>c&&uA("headingColumns",u+s,o,i)}}))}splitCellHorizontally(e,t=2){const i=this.editor.model,o=e.parent,n=o.parent,r=n.getChildIndex(o),s=parseInt(e.getAttribute("rowspan")||"1"),a=parseInt(e.getAttribute("colspan")||"1");i.change((i=>{if(s>1){const o=[...new fA(n,{startRow:r,endRow:r+s-1,includeAllSlots:!0})],{newCellsSpan:c,updatedSpan:l}=ZA(s,t);uA("rowspan",l,e,i);const{column:d}=o.find((({cell:t})=>t===e)),u={};c>1&&(u.rowspan=c),a>1&&(u.colspan=a);for(const e of o){const{column:t,row:o}=e;o>=r+l&&t===d&&(o+r+l)%c==0&&WA(1,i,e.getPositionBefore(),u)}}if(sr){const e=n+o;i.setAttribute("rowspan",e,t)}const l={};a>1&&(l.colspan=a),qA(i,n,r+1,o,1,l);const d=n.getAttribute("headingRows")||0;d>r&&uA("headingRows",d+o,n,i)}}))}getColumns(e){return[...e.getChild(0).getChildren()].filter((e=>e.is("element","tableCell"))).reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}getRows(e){return Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0)}createTableWalker(e,t={}){return new fA(e,t)}getSelectedTableCells(e){const t=[];for(const i of this.sortRanges(e.getRanges())){const e=i.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}getTableCellsContainingSelection(e){const t=[];for(const i of e.getRanges()){const e=i.start.findAncestor("tableCell");e&&t.push(e)}return t}getSelectionAffectedTableCells(e){const t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){const t=e.map((e=>e.parent.index));return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),i=[...new fA(t)].filter((t=>e.includes(t.cell))).map((e=>e.column));return this._getFirstLastIndexesObject(i)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,i=new Set;let o=0;for(const n of e){const{row:e,column:r}=this.getCellLocation(n),s=parseInt(n.getAttribute("rowspan"))||1,a=parseInt(n.getAttribute("colspan"))||1;t.add(e),i.add(r),s>1&&t.add(e+s-1),a>1&&i.add(r+a-1),o+=s*a}const n=function(e,t){const i=Array.from(e.values()),o=Array.from(t.values());return(Math.max(...i)-Math.min(...i)+1)*(Math.max(...o)-Math.min(...o)+1)}(t,i);return n==o}sortRanges(e){return Array.from(e).sort(GA)}_getFirstLastIndexesObject(e){const t=e.sort(((e,t)=>e-t));return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),i=this.getRowIndexes(e),o=parseInt(t.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(i,o))return!1;const n=this.getColumnIndexes(e),r=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(n,r)}_areIndexesInSameSection({first:e,last:t},i){return e{const o=t.getSelectedTableCells(e.document.selection),n=o.shift(),{mergeWidth:r,mergeHeight:s}=function(e,t,i){let o=0,n=0;for(const e of t){const{row:t,column:r}=i.getCellLocation(e);o=JA(e,r,o,"colspan"),n=JA(e,t,n,"rowspan")}const{row:r,column:s}=i.getCellLocation(e);return{mergeWidth:o-s,mergeHeight:n-r}}(n,o,t);uA("colspan",r,n,i),uA("rowspan",s,n,i);for(const e of o)YA(e,n,i);LA(n.findAncestor("table"),t),i.setSelection(n,"in")}))}}function YA(e,t,i){QA(e)||(QA(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function QA(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function JA(e,t,i,o){const n=parseInt(e.getAttribute(o)||"1");return Math.max(i,t+n)}class XA extends Pn{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0].findAncestor("table"),r=[];for(let t=o.first;t<=o.last;t++)for(const i of n.getChild(t).getChildren())r.push(e.createRangeOn(i));e.change((e=>{e.setSelection(r)}))}}class eC extends Pn{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i[0],n=i.pop(),r=o.findAncestor("table"),s=e.getCellLocation(o),a=e.getCellLocation(n),c=Math.min(s.column,a.column),l=Math.max(s.column,a.column),d=[];for(const e of new fA(r,{startColumn:c,endColumn:l}))d.push(t.createRangeOn(e.cell));t.change((e=>{e.setSelection(d)}))}}function tC(e,t){let i=!1;const o=function(e){const t=parseInt(e.getAttribute("headingRows")||"0"),i=Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),o=[];for(const{row:n,cell:r,cellHeight:s}of new fA(e)){if(s<2)continue;const e=ne){const t=e-n;o.push({cell:r,rowspan:t})}}return o}(e);if(o.length){i=!0;for(const e of o)uA("rowspan",e.rowspan,e.cell,t,1)}return i}function iC(e,t){let i=!1;const o=function(e){const t=new Array(e.childCount).fill(0);for(const{rowIndex:i}of new fA(e,{includeAllSlots:!0}))t[i]++;return t}(e),n=[];for(const[t,i]of o.entries())!i&&e.getChild(t).is("element","tableRow")&&n.push(t);if(n.length){i=!0;for(const i of n.reverse())t.remove(e.getChild(i)),o.splice(i,1)}const r=o.filter(((t,i)=>e.getChild(i).is("element","tableRow"))),s=r[0];if(!r.every((e=>e===s))){const o=r.reduce(((e,t)=>t>e?t:e),0);for(const[n,s]of r.entries()){const r=o-s;if(r){for(let i=0;ie.is("$text")));for(const e of i)t.wrap(t.createRangeOn(e),"paragraph");return!!i.length}function aC(e){return!!e.position.parent.is("element","tableCell")&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function cC(e,t){if(!e.is("element","paragraph"))return!1;const i=t.toViewElement(e);return!!i&&vA(e)!==i.is("element","span")}var lC=n(8864);yn()(lC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),lC.A.locals;class dC extends Mn{static get pluginName(){return"TableEditing"}static get requires(){return[$A]}constructor(e){super(e),this._additionalSlots=[]}init(){const e=this.editor,t=e.model,i=t.schema,o=e.conversion,n=e.plugins.get($A);i.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:!0,classes:"table"}))return;const o=function(e){for(const t of e.getChildren())if(t.is("element","table"))return t}(t.viewItem);if(!o||!i.consumable.test(o,{name:!0}))return;i.consumable.consume(t.viewItem,{name:!0,classes:"table"});const n=Uo(i.convertItem(o,t.modelCursor).modelRange.getItems());n?(i.convertChildren(t.viewItem,i.writer.createPositionAt(n,"end")),i.updateConversionResult(n,t)):i.consumable.revert(t.viewItem,{name:!0,classes:"table"})}))})),o.for("upcast").add((e=>{e.on("element:table",((e,t,i)=>{const o=t.viewItem;if(!i.consumable.test(o,{name:!0}))return;const{rows:n,headingRows:r,headingColumns:s}=function(e){let t,i=0;const o=[],n=[];let r;for(const s of Array.from(e.getChildren())){if("tbody"!==s.name&&"thead"!==s.name&&"tfoot"!==s.name)continue;"thead"!==s.name||r||(r=s);const e=Array.from(s.getChildren()).filter((e=>e.is("element","tr")));for(const a of e)if(r&&s===r||"tbody"===s.name&&Array.from(a.getChildren()).length&&Array.from(a.getChildren()).every((e=>e.is("element","th"))))i++,o.push(a);else{n.push(a);const e=pA(a);(!t||ei.convertItem(e,i.writer.createPositionAt(c,"end")))),i.convertChildren(o,i.writer.createPositionAt(c,"end")),c.isEmpty){const e=i.writer.createElement("tableRow");i.writer.insert(e,i.writer.createPositionAt(c,"end")),hA(i.writer,i.writer.createPositionAt(e,"end"))}i.updateConversionResult(c,t)}}))})),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:bA(n,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:bA(n,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add((e=>{e.on("element:tr",((e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()}),{priority:"high"})})),o.for("downcast").elementToElement({model:"tableRow",view:(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(gA("td")),o.for("upcast").add(gA("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:wA({asWidget:!0})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:wA()}),o.for("editingDowncast").elementToElement({model:"paragraph",view:_A({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:_A(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:uC("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:uC("rowspan")},view:"rowspan"}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new yA(e)),e.commands.add("insertTableRowAbove",new xA(e,{order:"above"})),e.commands.add("insertTableRowBelow",new xA(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new AA(e,{order:"left"})),e.commands.add("insertTableColumnRight",new AA(e,{order:"right"})),e.commands.add("removeTableRow",new zA(e)),e.commands.add("removeTableColumn",new jA(e)),e.commands.add("splitTableCellVertically",new CA(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new CA(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new KA(e)),e.commands.add("mergeTableCellRight",new DA(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new DA(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new DA(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new DA(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new HA(e)),e.commands.add("setTableRowHeader",new FA(e)),e.commands.add("selectTableRow",new XA(e)),e.commands.add("selectTableColumn",new eC(e)),function(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.differ.getChanges();let o=!1;const n=new Set;for(const t of i){let i=null;"insert"==t.type&&"table"==t.name&&(i=t.position.nodeAfter),"insert"!=t.type&&"remove"!=t.type||"tableRow"!=t.name&&"tableCell"!=t.name||(i=t.position.findAncestor("table")),oC(t)&&(i=t.range.start.findAncestor("table")),i&&!n.has(i)&&(o=tC(i,e)||o,o=iC(i,e)||o,n.add(i))}return o}(t,e)))}(t),function(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.differ.getChanges();let o=!1;for(const t of i)"insert"==t.type&&"table"==t.name&&(o=nC(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableRow"==t.name&&(o=rC(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableCell"==t.name&&(o=sC(t.position.nodeAfter,e)||o),"remove"!=t.type&&"insert"!=t.type||!aC(t)||(o=sC(t.position.parent,e)||o);return o}(t,e)))}(t),this.listenTo(t.document,"change:data",(()=>{!function(e,t){const i=e.document.differ;for(const e of i.getChanges()){let i,o=!1;if("attribute"==e.type){const t=e.range.start.nodeAfter;if(!t||!t.is("element","table"))continue;if("headingRows"!=e.attributeKey&&"headingColumns"!=e.attributeKey)continue;i=t,o="headingRows"==e.attributeKey}else"tableRow"!=e.name&&"tableCell"!=e.name||(i=e.position.findAncestor("table"),o="tableRow"==e.name);if(!i)continue;const n=i.getAttribute("headingRows")||0,r=i.getAttribute("headingColumns")||0,s=new fA(i);for(const e of s){const i=e.rowcC(e,t.mapper)));for(const e of i)t.reconvertItem(e)}}(t,e.editing)}))}registerAdditionalSlot(e){this._additionalSlots.push(e)}}function uC(e){return t=>{const i=parseInt(t.getAttribute(e));return Number.isNaN(i)||i<=0?null:i}}var hC=n(8603);yn()(hC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),hC.A.locals;class mC extends An{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new qo,this.focusTracker=new $o,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",((e,t)=>`${t} × ${e}`)),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to((e=>{e.preventDefault()})),click:t.to((()=>{this.fire("execute")}))}}),this.on("boxover",((e,t)=>{const{row:i,column:o}=t.target.dataset;this.items.get(10*(parseInt(i,10)-1)+(parseInt(o,10)-1)).focus()})),this.focusTracker.on("change:focusedElement",((e,t,i)=>{if(!i)return;const{row:o,column:n}=i.dataset;this.set({rows:parseInt(o),columns:parseInt(n)})})),this.on("change:columns",(()=>this._highlightGridBoxes())),this.on("change:rows",(()=>this._highlightGridBoxes()))}render(){super.render(),Sn({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map(((i,o)=>{const n=Math.floor(o/10){const o=e.commands.get("insertTable"),n=hh(i);let r;return n.bind("isEnabled").to(o),n.buttonView.set({icon:eu.table,label:t("Insert table"),tooltip:!0}),n.on("change:isOpen",(()=>{r||(r=new mC(i),n.panelView.children.add(r),r.delegate("execute").to(n),n.on("execute",(()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()})))})),n})),e.ui.componentFactory.add("menuBar:insertTable",(i=>{const o=e.commands.get("insertTable"),n=new Fg(i),r=new mC(i);return r.delegate("execute").to(n),n.on("change:isOpen",((e,t,i)=>{i||r.reset()})),r.on("execute",(()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()})),n.buttonView.set({label:t("Table"),icon:eu.table}),n.panelView.children.add(r),n.bind("isEnabled").to(o),n})),e.ui.componentFactory.add("tableColumn",(e=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'',o,e)})),e.ui.componentFactory.add("tableRow",(e=>{const i=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'',i,e)})),e.ui.componentFactory.add("mergeTableCells",(e=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'',o,e)}))}_prepareDropdown(e,t,i,o){const n=this.editor,r=hh(o),s=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(r,"execute",(e=>{n.execute(e.source.commandName),e.source instanceof fu||n.editing.view.focus()})),r}_prepareMergeSplitButtonDropdown(e,t,i,o){const n=this.editor,r=hh(o,lh),s="mergeTableCells",a=n.commands.get(s),c=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),r.bind("isEnabled").toMany([a,...c],"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(r.buttonView,"execute",(()=>{n.execute(s),n.editing.view.focus()})),this.listenTo(r,"execute",(e=>{n.execute(e.source.commandName),n.editing.view.focus()})),r}_fillDropdownWithListOptions(e,t){const i=this.editor,o=[],n=new Ho;for(const e of t)pC(e,i,o,n);return ph(e,n),o}}function pC(e,t,i,o){if("button"===e.type||"switchbutton"===e.type){const o=e.model=new Qm(e.model),{commandName:n,bindIsOn:r}=e.model,s=t.commands.get(n);i.push(s),o.set({commandName:n}),o.bind("isEnabled").to(s),r&&o.bind("isOn").to(s,"value"),o.set({withText:!0})}o.add(e)}var fC=n(2850);yn()(fC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),fC.A.locals;class kC extends Mn{static get pluginName(){return"TableSelection"}static get requires(){return[$A,$A]}init(){const e=this.editor,t=e.model,i=e.editing.view;this.listenTo(t,"deleteContent",((e,t)=>this._handleDeleteContent(e,t)),{priority:"high"}),this.listenTo(i.document,"insertText",((e,t)=>this._handleInsertTextEvent(e,t)),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get($A),t=this.editor.model.document.selection,i=e.getSelectedTableCells(t);return 0==i.length?null:i}getSelectionAsFragment(){const e=this.editor.plugins.get($A),t=this.getSelectedTableCells();return t?this.editor.model.change((i=>{const o=i.createDocumentFragment(),{first:n,last:r}=e.getColumnIndexes(t),{first:s,last:a}=e.getRowIndexes(t),c=t[0].findAncestor("table");let l=a,d=r;if(e.isSelectionRectangular(t)){const e={firstColumn:n,lastColumn:r,firstRow:s,lastRow:a};l=OA(c,e),d=RA(c,e)}const u=TA(c,{startRow:s,startColumn:n,endRow:l,endColumn:d},i);return i.insert(u,o,0),o})):null}setCellSelection(e,t){const i=this._getCellsToSelect(e,t);this.editor.model.change((e=>{e.setSelection(i.cells.map((t=>e.createRangeOn(t))),{backward:i.backward})}))}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=Uo(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add((e=>e.on("selection",((e,i,o)=>{const n=o.writer;!function(e){for(const i of t)e.removeClass("ck-editor__editable_selected",i);t.clear()}(n);const r=this.getSelectedTableCells();if(!r)return;for(const e of r){const i=o.mapper.toViewElement(e);n.addClass("ck-editor__editable_selected",i),t.add(i)}const s=o.mapper.toViewElement(r[r.length-1]);n.setSelection(s,0)}),{priority:"lowest"})))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",(()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change((i=>{const o=i.createPositionAt(t[0],0),n=e.model.schema.getNearestSelectionRange(o);i.setSelection(n)}))}}))}_handleDeleteContent(e,t){const i=this.editor.plugins.get($A),o=t[0],n=t[1],r=this.editor.model,s=!n||"backward"==n.direction,a=i.getSelectedTableCells(o);a.length&&(e.stop(),r.change((e=>{const t=a[s?a.length-1:0];r.change((e=>{for(const t of a)r.deleteContent(e.createSelection(t,"in"))}));const i=r.schema.getNearestSelectionRange(e.createPositionAt(t,0));o.is("documentSelection")?e.setSelection(i):o.setTo(i)})))}_handleInsertTextEvent(e,t){const i=this.editor,o=this.getSelectedTableCells();if(!o)return;const n=i.editing.view,r=i.editing.mapper,s=o.map((e=>n.createRangeOn(r.toViewElement(e))));t.selection=n.createSelection(s)}_getCellsToSelect(e,t){const i=this.editor.plugins.get("TableUtils"),o=i.getCellLocation(e),n=i.getCellLocation(t),r=Math.min(o.row,n.row),s=Math.max(o.row,n.row),a=Math.min(o.column,n.column),c=Math.max(o.column,n.column),l=new Array(s-r+1).fill(null).map((()=>[])),d={startRow:r,endRow:s,startColumn:a,endColumn:c};for(const{row:t,cell:i}of new fA(e.findAncestor("table"),d))l[t-r].push(i);const u=n.rowe.reverse())),{cells:l.flat(),backward:u||h}}}class bC extends Mn{static get pluginName(){return"TableClipboard"}static get requires(){return[Dk,Bk,kC,$A]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",((e,t)=>this._onCopyCut(e,t))),this.listenTo(t,"cut",((e,t)=>this._onCopyCut(e,t))),this.listenTo(e.model,"insertContent",((e,[t,i])=>this._onInsertContent(e,t,i)),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const i=this.editor.editing.view,o=this.editor.plugins.get(kC),n=this.editor.plugins.get(Dk);o.getSelectedTableCells()&&("cut"!=e.name||this.editor.model.canEditAt(this.editor.model.document.selection))&&(t.preventDefault(),e.stop(),this.editor.model.enqueueChange({isUndoable:"cut"===e.name},(()=>{const r=n._copySelectedFragmentWithMarkers(e.name,this.editor.model.document.selection,(()=>o.getSelectionAsFragment()));i.document.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:this.editor.data.toView(r),method:e.name})})))}_onInsertContent(e,t,i){if(i&&!i.is("documentSelection"))return;const o=this.editor.model,n=this.editor.plugins.get($A),r=this.editor.plugins.get(Dk),s=this.getTableIfOnlyTableInContent(t,o);if(!s)return;const a=n.getSelectionAffectedTableCells(o.document.selection);a.length?(e.stop(),t.is("documentFragment")?r._pasteMarkersIntoTransformedElement(t.markers,(e=>this._replaceSelectedCells(s,a,e))):this.editor.model.change((e=>{this._replaceSelectedCells(s,a,e)}))):LA(s,n)}_replaceSelectedCells(e,t,i){const o=this.editor.plugins.get($A),n={width:o.getColumns(e),height:o.getRows(e)},r=function(e,t,i,o){const n=e[0].findAncestor("table"),r=o.getColumnIndexes(e),s=o.getRowIndexes(e),a={firstColumn:r.first,lastColumn:r.last,firstRow:s.first,lastRow:s.last},c=1===e.length;return c&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,function(e,t,i,o){const n=o.getColumns(e),r=o.getRows(e);i>n&&o.insertColumns(e,{at:n,columns:i-n}),t>r&&o.insertRows(e,{at:r,rows:t-r})}(n,a.lastRow+1,a.lastColumn+1,o)),c||!o.isSelectionRectangular(e)?function(e,t,i){const{firstRow:o,lastRow:n,firstColumn:r,lastColumn:s}=t,a={first:o,last:n},c={first:r,last:s};_C(e,r,a,i),_C(e,s+1,a,i),wC(e,o,c,i),wC(e,n+1,c,i,o)}(n,a,i):(a.lastRow=OA(n,a),a.lastColumn=RA(n,a)),a}(t,n,i,o),s=r.lastRow-r.firstRow+1,a=r.lastColumn-r.firstColumn+1;e=TA(e,{startRow:0,startColumn:0,endRow:Math.min(s,n.height)-1,endColumn:Math.min(a,n.width)-1},i);const c=t[0].findAncestor("table"),l=this._replaceSelectedCellsWithPasted(e,n,c,r,i);if(this.editor.plugins.get("TableSelection").isEnabled){const e=o.sortRanges(l.map((e=>i.createRangeOn(e))));i.setSelection(e)}else i.setSelection(l[0],0);return c}_replaceSelectedCellsWithPasted(e,t,i,o,n){const{width:r,height:s}=t,a=function(e,t,i){const o=new Array(i).fill(null).map((()=>new Array(t).fill(null)));for(const{column:t,row:i,cell:n}of new fA(e))o[i][t]=n;return o}(e,r,s),c=[...new fA(i,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],l=[];let d;for(const e of c){const{row:t,column:i}=e;i===o.firstColumn&&(d=e.getPositionBefore());const c=t-o.firstRow,u=i-o.firstColumn,h=a[c%s][u%r],m=h?n.cloneElement(h):null,g=this._replaceTableSlotCell(e,m,d,n);g&&(PA(g,t,i,o.lastRow,o.lastColumn,n),l.push(g),d=n.createPositionAfter(g))}const u=parseInt(i.getAttribute("headingRows")||"0"),h=parseInt(i.getAttribute("headingColumns")||"0"),m=o.firstRowvC(e,t,i))).map((({cell:e})=>SA(e,t,o)))}function _C(e,t,i,o){if(!(t<1))return MA(e,t).filter((({row:e,cellHeight:t})=>vC(e,t,i))).map((({cell:e,column:i})=>IA(e,i,t,o)))}function vC(e,t,i){const o=e+t-1,{first:n,last:r}=i;return e>=n&&e<=r||e=n}class yC extends Mn{static get pluginName(){return"TableKeyboard"}static get requires(){return[kC,$A]}init(){const e=this.editor,t=e.editing.view.document,i=e.t;this.listenTo(t,"arrowKey",((...e)=>this._onArrowKey(...e)),{context:"table"}),this.listenTo(t,"tab",((...e)=>this._handleTabOnSelectedTable(...e)),{context:"figure"}),this.listenTo(t,"tab",((...e)=>this._handleTab(...e)),{context:["th","td"]}),e.accessibility.addKeystrokeInfoGroup({id:"table",label:i("Keystrokes that can be used in a table cell"),keystrokes:[{label:i("Move the selection to the next cell"),keystroke:"Tab"},{label:i("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:i("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:i("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(e,t){const i=this.editor,o=i.model.document.selection.getSelectedElement();o&&o.is("element","table")&&(t.preventDefault(),t.stopPropagation(),e.stop(),i.model.change((e=>{e.setSelection(e.createRangeIn(o.getChild(0).getChild(0)))})))}_handleTab(e,t){const i=this.editor,o=this.editor.plugins.get($A),n=this.editor.plugins.get("TableSelection"),r=i.model.document.selection,s=!t.shiftKey;let a=o.getTableCellsContainingSelection(r)[0];if(a||(a=n.getFocusCell()),!a)return;t.preventDefault(),t.stopPropagation(),e.stop();const c=a.parent,l=c.parent,d=l.getChildIndex(c),u=c.getChildIndex(a),h=0===u;if(!s&&h&&0===d)return void i.model.change((e=>{e.setSelection(e.createRangeOn(l))}));const m=u===c.childCount-1,g=d===o.getRows(l)-1;if(s&&g&&m&&(i.execute("insertTableRowBelow"),d===o.getRows(l)-1))return void i.model.change((e=>{e.setSelection(e.createRangeOn(l))}));let p;if(s&&m){const e=l.getChild(d+1);p=e.getChild(0)}else if(!s&&h){const e=l.getChild(d-1);p=e.getChild(e.childCount-1)}else p=c.getChild(u+(s?1:-1));i.model.change((e=>{e.setSelection(e.createRangeIn(p))}))}_onArrowKey(e,t){const i=this.editor,o=Ao(t.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(o,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const i=this.editor.plugins.get($A),o=this.editor.plugins.get("TableSelection"),n=this.editor.model,r=n.document.selection,s=["right","down"].includes(e),a=i.getSelectedTableCells(r);if(a.length){let i;return i=t?o.getFocusCell():s?a[a.length-1]:a[0],this._navigateFromCellInDirection(i,e,t),!0}const c=r.focus.findAncestor("tableCell");if(!c)return!1;if(!r.isCollapsed)if(t){if(r.isBackward==s&&!r.containsEntireContent(c))return!1}else{const e=r.getSelectedElement();if(!e||!n.schema.isObject(e))return!1}return!!this._isSelectionAtCellEdge(r,c,s)&&(this._navigateFromCellInDirection(c,e,t),!0)}_isSelectionAtCellEdge(e,t,i){const o=this.editor.model,n=this.editor.model.schema,r=i?e.getLastPosition():e.getFirstPosition();if(!n.getLimitElement(r).is("element","tableCell"))return o.createPositionAt(t,i?"end":0).isTouching(r);const s=o.createSelection(r);return o.modifySelection(s,{direction:i?"forward":"backward"}),r.isEqual(s.focus)}_navigateFromCellInDirection(e,t,i=!1){const o=this.editor.model,n=e.findAncestor("table"),r=[...new fA(n,{includeAllSlots:!0})],{row:s,column:a}=r[r.length-1],c=r.find((({cell:t})=>t==e));let{row:l,column:d}=c;switch(t){case"left":d--;break;case"up":l--;break;case"right":d+=c.cellWidth;break;case"down":l+=c.cellHeight}if(l<0||l>s||d<0&&l<=0||d>a&&l>=s)return void o.change((e=>{e.setSelection(e.createRangeOn(n))}));d<0?(d=i?0:a,l--):d>a&&(d=i?a:0,l++);const u=r.find((e=>e.row==l&&e.column==d)).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(i&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=o.createPositionAt(u,h?0:"end");o.change((t=>{t.setSelection(e)}))}}}class xC extends js{constructor(){super(...arguments),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class AC extends Mn{static get pluginName(){return"TableMouse"}static get requires(){return[kC,$A]}init(){this.editor.editing.view.addObserver(xC),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get($A);let i=!1;const o=e.plugins.get(kC);this.listenTo(e.editing.view.document,"mousedown",((n,r)=>{const s=e.model.document.selection;if(!this.isEnabled||!o.isEnabled)return;if(!r.domEvent.shiftKey)return;const a=o.getAnchorCell()||t.getTableCellsContainingSelection(s)[0];if(!a)return;const c=this._getModelTableCellFromDomEvent(r);c&&CC(a,c)&&(i=!0,o.setCellSelection(a,c),r.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{i=!1})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{i&&e.stop()}),{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,i,o=!1,n=!1;const r=e.plugins.get(kC);this.listenTo(e.editing.view.document,"mousedown",((e,i)=>{this.isEnabled&&r.isEnabled&&(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(i)))})),this.listenTo(e.editing.view.document,"mousemove",((e,s)=>{if(!s.domEvent.buttons)return;if(!t)return;const a=this._getModelTableCellFromDomEvent(s);a&&CC(t,a)&&(i=a,o||i==t||(o=!0)),o&&(n=!0,r.setCellSelection(t,i),s.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{o=!1,n=!1,t=null,i=null})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{n&&e.stop()}),{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,i=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function CC(e,t){return e.parent.parent==t.parent.parent}var TC=n(9969);yn()(TC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),TC.A.locals;class EC extends Mn{static get requires(){return[dC,gC,kC,AC,yC,bC,db]}static get pluginName(){return"Table"}}function SC(e){const t=e.getSelectedElement();return t&&IC(t)?t:null}function MC(e){const t=e.getFirstPosition();if(!t)return null;let i=t.parent;for(;i;){if(i.is("element")&&IC(i))return i;i=i.parent}return null}function IC(e){return!!e.getCustomProperty("table")&&qk(e)}class PC extends Mn{static get requires(){return[ub]}static get pluginName(){return"TableToolbar"}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(ub),o=e.config.get("table.contentToolbar"),n=e.config.get("table.tableToolbar");o&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:MC}),n&&i.register("table",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:SC})}}var VC=n(4307);yn()(VC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),VC.A.locals;var NC=n(6016);yn()(NC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),NC.A.locals;var LC=n(1806);yn()(LC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),LC.A.locals;var OC=n(5704);yn()(OC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),OC.A.locals;var RC=n(6701);yn()(RC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),RC.A.locals;const DC=Am.defaultPositions;DC.northArrowSouth,DC.northArrowSouthWest,DC.northArrowSouthEast,DC.southArrowNorth,DC.southArrowNorthWest,DC.southArrowNorthEast,DC.viewportStickyNorth;var BC=n(4001);yn()(BC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),BC.A.locals;var zC=n(7406);yn()(zC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),zC.A.locals;var jC=n(4204);yn()(jC.A,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),jC.A.locals;class FC extends cp{static builtinPlugins=[wp,tf,rk,df,Ak,qb,aw,kw,yw,Tw,Bw,Uw,Yw,V_,B_,Iv,Pv,av,Lv,vf,Ey,vx,$x,Pw,Kx,Xx,dA,SpecialCharactersArrows,SpecialCharactersCurrency,SpecialCharactersLatin,SpecialCharactersMathematical,SpecialCharactersText,SpecialCharactersEssential,EC,PC,Zp,Ff,Tf,ff,Pf,Rf];static defaultConfig={toolbar:{items:["undo","redo","showBlocks","sourceEditing","|","fontFamily","fontSize","fontColor","fontBackgroundColor","bold","italic","underline","strikethrough","subscript","superscript","code","-","bulletedList","numberedList","outdent","indent","alignment","|","heading","link","blockQuote","insertTable","specialCharacters","|","codeBlock","mediaEmbed","insertImage","htmlEmbed"],shouldNotGroupWhenFull:!0},language:"en",image:{toolbar:["imageTextAlternative","toggleImageCaption","imageStyle:inline","imageStyle:block","imageStyle:side"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]}}}window.ClassicEditor=FC})()})();