PageSourceSearch

https://www.petrosoftdesign.com/o/frontend-editor-ckeditor-web/__l…/@ckeditor$ckeditor5-ui$dist$index.js.js

js petrosoftdesign.com collected 2026-10-05 01:12:00 UTC 208,523 bytes, 12 lines download raw bytes

1var Xs=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var $o=Object.getOwnPropertyNames;var jo=Object.prototype.hasOwnProperty;var Uo=(s,e)=>{for(var t in e)Xs(s,t,{get:e[t],enumerable:!0})},Ks=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $o(e))!jo.call(s,o)&&o!==t&&Xs(s,o,{get:()=>e[o],enumerable:!(i=zo(e,o))||i.enumerable});return s},M=(s,e,t)=>(Ks(s,e,"default"),t&&Ks(t,e,"default"));var qs={};Uo(qs,{AccessibilityHelp:()=>fs,AccessibilityHelpContentView:()=>it,AriaLiveAnnouncer:()=>et,AriaLiveAnnouncerPoliteness:()=>ds,AriaLiveAnnouncerRegionView:()=>st,AriaLiveAnnouncerView:()=>tt,AutocompleteView:()=>As,Badge:()=>pe,BalloonPanelView:()=>T,BalloonToolbar:()=>Fs,BlockButtonView:()=>$t,BlockToolbar:()=>Ds,BodyCollection:()=>ht,BoxedEditorUIView:()=>Ts,ButtonLabelView:()=>de,ButtonLabelWithHighlightView:()=>Ms,ButtonView:()=>g,CollapsibleView:()=>gs,ColorGridView:()=>ge,ColorGridsFragmentView:()=>At,ColorPickerFragmentView:()=>Mt,ColorPickerInputRowView:()=>Pt,ColorPickerView:()=>Ot,ColorSelectorView:()=>ks,ColorTileView:()=>be,ComponentFactory:()=>Lt,ContextualBalloon:()=>Ee,CssTransitionDisablerMixin:()=>Vr,DefaultMenuBarItems:()=>So,Dialog:()=>at,DialogActionsView:()=>rt,DialogContentView:()=>nt,DialogView:()=>lt,DialogViewPosition:()=>x,DocumentColorCollection:()=>Bt,DraggableViewMixin:()=>xo,DropdownButtonView:()=>wt,DropdownMenuButtonView:()=>_t,DropdownMenuListItemButtonView:()=>ye,DropdownMenuListItemView:()=>Te,DropdownMenuListView:()=>xe,DropdownMenuNestedMenuPanelView:()=>kt,DropdownMenuNestedMenuView:()=>ve,DropdownMenuPanelPositioningFunctions:()=>Po,DropdownMenuRootListView:()=>yt,DropdownPanelView:()=>bt,DropdownView:()=>gt,EditableUIView:()=>Nt,EditorUI:()=>xs,EditorUIView:()=>Dt,EvaluationBadge:()=>Ft,FileDialogButtonView:()=>ms,FileDialogListItemButtonView:()=>dt,FileDialogViewMixin:()=>Hs,FocusCycler:()=>E,FormHeaderView:()=>ot,FormRowView:()=>Vs,HighlightedTextView:()=>Oe,IconView:()=>C,IframeView:()=>Cs,InlineEditableUIView:()=>vs,InputBase:()=>_e,InputNumberView:()=>pt,InputTextView:()=>ft,InputView:()=>ke,ItemsView:()=>vt,LabelView:()=>N,LabelWithHighlightView:()=>Ls,LabeledFieldView:()=>we,LabeledInputView:()=>Es,ListItemButtonView:()=>O,ListItemGroupView:()=>H,ListItemView:()=>v,ListSeparatorView:()=>ee,ListView:()=>G,MenuBarMenuButtonView:()=>jt,MenuBarMenuListItemButtonView:()=>fe,MenuBarMenuListItemFileDialogButtonView:()=>qt,MenuBarMenuListItemView:()=>Ce,MenuBarMenuListView:()=>Ie,MenuBarMenuPanelView:()=>Ut,MenuBarMenuView:()=>Z,MenuBarView:()=>Ns,NESTED_TOOLBAR_ICONS:()=>Tt,Notification:()=>Os,PoweredBy:()=>ut,SearchInfoView:()=>Ht,SearchResultsView:()=>Gt,SearchTextView:()=>zt,SliderView:()=>It,SpinnerView:()=>Ss,SplitButtonView:()=>Et,StickyPanelView:()=>Bs,SwitchButtonView:()=>me,Template:()=>k,TextareaView:()=>mt,ToolbarLineBreakView:()=>xt,ToolbarSeparatorView:()=>Ve,ToolbarView:()=>te,TooltipManager:()=>St,UIModel:()=>Is,View:()=>f,ViewCollection:()=>V,ViewModel:()=>Is,_CheckIconHolderView:()=>ct,_CollapsibleView:()=>gs,_ContextualBalloonRotatorView:()=>Wt,_DropdownMenuBehaviors:()=>W,_DropdownRootMenuBehaviors:()=>ws,_MenuBarBehaviors:()=>R,_MenuBarMenuBehaviors:()=>A,_MenuBarMenuViewPanelPositioningFunctions:()=>Lo,_SearchInfoView:()=>Ht,_SearchTextQueryView:()=>Rt,_TemplateBinding:()=>D,_TemplateIfBinding:()=>ue,_TemplateToBinding:()=>Ze,_convertColor:()=>Gs,_convertColorToHex:()=>Eo,_preventUiViewDefault:()=>Bo,_processMenuBarConfig:()=>Do,_registerCustomElement:()=>Oo,_tryNormalizeHexColor:()=>Us,addKeyboardHandlingForGrid:()=>To,addListToDropdown:()=>Hr,addMenuToDropdown:()=>Rr,addToolbarToDropdown:()=>zs,clickOutsideHandler:()=>Kt,createDropdown:()=>Yt,createLabeledDropdown:()=>Zr,createLabeledInputNumber:()=>Yr,createLabeledInputText:()=>js,createLabeledTextarea:()=>Qr,filterGroupAndItemNames:()=>cn,focusChildOnDropdownOpen:()=>$s,getLocalizedColorOptions:()=>Sr,isFocusable:()=>se,isViewWithFocusCycler:()=>vo,normalizeColorOptions:()=>Fr,normalizeMenuBarConfig:()=>Fo,normalizeSingleColorDefinition:()=>Co,normalizeToolbarConfig:()=>Xt,submitHandler:()=>Cr});var c={};M(c,mn);import*as mn from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";function Ys(s){return Number.isSafeInteger(s)&&s>=0}function Qs(s){return s!=null&&typeof s!="function"&&Ys(s.length)}function z(s){return s!==null&&(typeof s=="object"||typeof s=="function")}function Zs(s){return s==null||typeof s!="object"&&typeof s!="function"}function Js(s,e){return s===e||Number.isNaN(s)&&Number.isNaN(e)}function ei(s){return Object.getOwnPropertySymbols(s).filter(e=>Object.prototype.propertyIsEnumerable.call(s,e))}
1function ti(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}var si="[object RegExp]",Be="[object String]",Ae="[object Number]",Me="[object Boolean]",Le="[object Arguments]",ii="[object Symbol]",oi="[object Date]",ri="[object Map]",ni="[object Set]",li="[object Array]";var ai="[object ArrayBuffer]",ci="[object Object]";var hi="[object DataView]",ui="[object Uint8Array]",di="[object Uint8ClampedArray]",fi="[object Uint16Array]",pi="[object Uint32Array]";var mi="[object Int8Array]",bi="[object Int16Array]",gi="[object Int32Array]";var wi="[object Float32Array]",_i="[object Float64Array]";function Se(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function ki(s,e){return $(s,void 0,s,new Map,e)}function $(s,e,t,i=new Map,o=void 0){let r=o?.(s,e,t,i);if(r!=null)return r;if(Zs(s))return s;if(i.has(s))return i.get(s);if(Array.isArray(s)){let n=new Array(s.length);i.set(s,n);for(let l=0;l<s.length;l++)n[l]=$(s[l],l,t,i,o);return Object.hasOwn(s,"index")&&(n.index=s.index),Object.hasOwn(s,"input")&&(n.input=s.input),n}if(s instanceof Date)return new Date(s.getTime());if(s instanceof RegExp){let n=new RegExp(s.source,s.flags);return n.lastIndex=s.lastIndex,n}if(s instanceof Map){let n=new Map;i.set(s,n);for(let[l,a]of s)n.set(l,$(a,l,t,i,o));return n}if(s instanceof Set){let n=new Set;i.set(s,n);for(let l of s)n.add($(l,void 0,t,i,o));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(s))return s.subarray();if(Se(s)){let n=new(Object.getPrototypeOf(s)).constructor(s.length);i.set(s,n);for(let l=0;l<s.length;l++)n[l]=$(s[l],l,t,i,o);return n}if(s instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&s instanceof SharedArrayBuffer)return s.slice(0);if(s instanceof DataView){let n=new DataView(s.buffer.slice(0),s.byteOffset,s.byteLength);return i.set(s,n),L(n,s,t,i,o),n}if(typeof File<"u"&&s instanceof File){let n=new File([s],s.name,{type:s.type});return i.set(s,n),L(n,s,t,i,o),n}if(s instanceof Blob){let n=new Blob([s],{type:s.type});return i.set(s,n),L(n,s,t,i,o),n}if(s instanceof Error){let n=new s.constructor;return i.set(s,n),n.message=s.message,n.name=s.name,n.stack=s.stack,n.cause=s.cause,L(n,s,t,i,o),n}if(typeof s=="object"&&qo(s)){let n=Object.create(Object.getPrototypeOf(s));return i.set(s,n),L(n,s,t,i,o),n}return s}function L(s,e,t=s,i,o){let r=[...Object.keys(e),...ei(e)];for(let n=0;n<r.length;n++){let l=r[n],a=Object.getOwnPropertyDescriptor(s,l);(a==null||a.writable)&&(s[l]=$(e[l],l,t,i,o))}}function qo(s){switch(ti(s)){case Le:case li:case ai:case hi:case Me:case oi:case wi:case _i:case mi:case bi:case gi:case ri:case Ae:case ci:case si:case ni:case Be:case ii:case ui:case di:case fi:case pi:return!0;default:return!1}}function oe(s,e){return ki(s,(t,i,o,r)=>{let n=e?.(t,i,o,r);if(n!=null)return n;if(typeof s=="object")switch(Object.prototype.toString.call(s)){case Ae:case Be:case Me:{let l=new s.constructor(s?.valueOf());return L(l,s),l}case Le:{let l={};return L(l,s),l.length=s.length,l[Symbol.iterator]=s[Symbol.iterator],l}default:return}})}function re(s){return oe(s)}function yi(s){return typeof s=="object"&&s!==null}function xi(s){return typeof s=="symbol"||s instanceof Symbol}function Ti(s){return xi(s)?NaN:Number(s)}function vi(s){return s?(s=Ti(s),s===1/0||s===-1/0?(s<0?-1:1)*Number.MAX_VALUE:s===s?s:0):s===0?s:0}function Vi(s){let e=vi(s),t=e%1;return t?e-t:e}function Ci(s,e,{signal:t,edges:i}={}){let o,r=null,n=i!=null&&i.includes("leading"),l=i==null||i.includes("trailing"),a=()=>{r!==null&&(s.apply(o,r),o=void 0,r=null)},h=()=>{l&&a(),_()},u=null,p=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,h()},e)},b=()=>{u!==null&&(clearTimeout(u),u=null)},_=()=>{b(),o=void 0,r=null},Qt=()=>{b(),a()},Pe=function(...Ho){if(t?.aborted)return;o=this,r=Ho;let Go=u==null;p(),n&&Go&&a()};return Pe.schedule=p,Pe.cancel=_,Pe.flush=Qt,t?.addEventListener("abort",_,{once:!0}),Pe}function S(s,e=0,t={}){typeof t!="object"&&(t={});let{leading:i=!1,trailing:o=!0,maxWait:r}=t,n=Array(2);i&&(n[0]="leading"),o&&(n[1]="trailing");let l,a=null,h=Ci(function(...b){l=s.apply(this,b),a=null},e,{edges:n}),u=function(...b){return r!=null&&(a===null&&(a=Date.now()),Date.now()-a>=r)?(l=s.apply(this,b),a=Date.now(),h.cancel(),h.schedule(),l):(h.apply(this,b),l)},p=()=>(h.flush(),l);return u.cancel=h.cancel,u.flush=p,u}function Zt(s,e=0,t={}){typeof t!="object"&&(t={});let{leading:i=!0,trailing:o=!0}=t;return S(s,e,{leading:i,trailing:o,maxWait:e})}function ne(s){if(s==null)return"";if(typeof s=="string")return s;if(Array.isArray(s))return s.map(ne).join(",");let e=String(s);return e==="0"&&Object.is(Number(s),-0)?"-0":e}function Ei(s){return typeof Buffer<"u"&&Buffer.isBuffer(s)}function Oi(s){let e=s?.constructor,t=typeof e=="function"?e.prototype:Object.prototype;return s===t}function Ii(s){return Se(s)}function Pi(s,e){if(s=Vi(s),s<1||!Number.isSafeInteger(s))return[];let t=new Array(s);for(let i=0;i<s;i++)t[i]=typeof e=="function"?e(i):i;return t}function Bi(s){if(s==null)return[];switch(typeof s){case"object":case"function":return Qs(s)?Xo(s):Oi(s)?Ko(s):Fe(s);default:return Fe(Object(s))}}function Fe(s){let e=[];for(let t in s)e.push(t);return e}function Ko(s){return Fe(s).filter(t=>t!=="constructor")}function Xo(s){let e=Pi(s.length,i=>`${i}`),t=new Set(e);return Ei(s)&&(t.add("offset"),t.add("parent")),Ii(s)&&(t.add("buffer"),t.add("byteLength"),t.add("byteOffset")),[...e,...Fe(s).filter(i=>!t.has(i))]}function De(s,...e){for(let t=0;t<e.length;t++)Yo(s,e[t]);return s}function Yo(s,e){let t=Bi(e);for(let i=0;i<t.length;i++){let o=t[i];(!(o in s)||!Js(s[o],e[o]))&&(s[o]=e[o])}}function Ai(s){if(typeof s!="object"||s==null)return!1;if(Object.getPrototypeOf(s)===null)return!0;
1if(Object.prototype.toString.call(s)!=="[object Object]"){let t=s[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(s,Symbol.toStringTag)?.writable?!1:s.toString()===`[object ${t}]`}let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function le(s){return yi(s)&&s.nodeType===1&&!Ai(s)}var Qo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Mi(s){return s.replace(/[&<>"']/g,e=>Qo[e])}function Ne(s){return Mi(ne(s))}function Li(s){return s.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function Jt(s){return Li(ne(s))}var y={};M(y,Ll);import*as Ll from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";var m={};M(m,Sl);import*as Sl from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-icons$dist$index.js.js";var I={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]};var es=Zo,Si={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Zo(s){var e,t=[],i=1,o;
1if(typeof s=="number")return{space:"rgb",values:[s>>>16,(s&65280)>>>8,s&255],alpha:1};if(typeof s=="number")return{space:"rgb",values:[s>>>16,(s&65280)>>>8,s&255],alpha:1};if(s=String(s).toLowerCase(),I[s])t=I[s].slice(),o="rgb";else if(s==="transparent")i=0,o="rgb",t=[0,0,0];else if(s[0]==="#"){var r=s.slice(1),n=r.length,l=n<=4;i=1,l?(t=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],n===4&&(i=parseInt(r[3]+r[3],16)/255)):(t=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],n===8&&(i=parseInt(r[6]+r[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(s)){var a=e[1];o=a.replace(/a$/,"");var h=o==="cmyk"?4:o==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=t.shift()),t=t.map(function(u,p){if(u[u.length-1]==="%")return u=parseFloat(u)/100,p===3?u:o==="rgb"?u*255:o[0]==="h"||o[0]==="l"&&!p?u*100:o==="lab"?u*125:o==="lch"?p<2?u*150:u*360:o[0]==="o"&&!p?u:o==="oklab"?u*.4:o==="oklch"?p<2?u*.4:u*360:u;if(o[p]==="h"||p===2&&o[o.length-1]==="h"){if(Si[u]!==void 0)return Si[u];if(u.endsWith("deg"))return parseFloat(u);if(u.endsWith("turn"))return parseFloat(u)*360;if(u.endsWith("grad"))return parseFloat(u)*360/400;if(u.endsWith("rad"))return parseFloat(u)*180/Math.PI}return u==="none"?0:parseFloat(u)}),i=t.length>h?t.pop():1}else/[0-9](?:\s|\/|,)/.test(s)&&(t=s.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),o=s.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:o,values:t,alpha:i}}var Fi={};for(let s of Object.keys(I))Fi[I[s]]=s;var d={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"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},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"]}},B=d,P=(6/29)**3;function j(s){let e=s>.0031308?1.055*s**.4166666666666667-.055:s*12.92;return Math.min(Math.max(0,e),1)}function U(s){return s>.04045?((s+.055)/1.055)**2.4:s/12.92}for(let s of Object.keys(d)){if(!("channels"in d[s]))throw new Error("missing channels property: "+s);if(!("labels"in d[s]))throw new Error("missing channel labels property: "+s);if(d[s].labels.length!==d[s].channels)throw new Error("channel and label counts mismatch: "+s);let{channels:e,labels:t}=d[s];delete d[s].channels,delete d[s].labels,Object.defineProperty(d[s],"channels",{value:e}),Object.defineProperty(d[s],"labels",{value:t})}d.rgb.hsl=function(s){let e=s[0]/255,t=s[1]/255,i=s[2]/255,o=Math.min(e,t,i),r=Math.max(e,t,i),n=r-o,l,a;switch(r){case o:{l=0;break}case e:{l=(t-i)/n;break}case t:{l=2+(i-e)/n;break}case i:{l=4+(e-t)/n;break}}l=Math.min(l*60,360),l<0&&(l+=360);let h=(o+r)/2;return r===o?a=0:h<=.5?a=n/(r+o):a=n/(2-r-o),[l,a*100,h*100]};d.rgb.hsv=function(s){let e,t,i,o,r,n=s[0]/255,l=s[1]/255,a=s[2]/255,h=Math.max(n,l,a),u=h-Math.min(n,l,a),p=function(b){return(h-b)/6/u+1/2};if(u===0)o=0,r=0;else{switch(r=u/h,e=p(n),t=p(l),i=p(a),h){case n:{o=i-t;break}case l:{o=1/3+e-i;break}case a:{o=2/3+t-e;break}}o<0?o+=1:o>1&&(o-=1)}return[o*360,r*100,h*100]};d.rgb.hwb=function(s){let e=s[0],t=s[1],i=s[2],o=d.rgb.hsl(s)[0],r=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[o,r*100,i*100]};d.rgb.oklab=function(s){let e=U(s[0]/255),t=U(s[1]/255),i=U(s[2]/255),o=Math.cbrt(.4122214708*e+.5363325363*t+.0514459929*i),r=Math.cbrt(.2119034982*e+.6806995451*t+.1073969566*i),n=Math.cbrt(.0883024619*e+.2817188376*t+.6299787005*i),l=.2104542553*o+.793617785*r-.0040720468*n,a=1.9779984951*o-2.428592205*r+.4505937099*n,h=.0259040371*o+.7827717662*r-.808675766*n;return[l*100,a*100,h*100]};d.rgb.cmyk=function(s){let e=s[0]/255,t=s[1]/255,i=s[2]/255,o=Math.min(1-e,1-t,1-i),r=(1-e-o)/(1-o)||0,n=(1-t-o)/(1-o)||0,l=(1-i-o)/(1-o)||0;return[r*100,n*100,l*100,o*100]};function Jo(s,e){return(s[0]-e[0])**2+(s[1]-e[1])**2+(s[2]-e[2])**2}d.rgb.keyword=function(s){let e=Fi[s];if(e)return e;let t=Number.POSITIVE_INFINITY,i;for(let o of Object.keys(I)){let r=I[o],n=Jo(s,r);n<t&&(t=n,i=o)}return i};
vendor: 4,623 bytes, line 1
1d.keyword.rgb=function(s){return I[s]};d.rgb.xyz=function(s){let e=U(s[0]/255),t=U(s[1]/255),i=U(s[2]/255),o=e*.4124564+t*.3575761+i*.1804375,r=e*.2126729+t*.7151522+i*.072175,n=e*.0193339+t*.119192+i*.9503041;return[o*100,r*100,n*100]};d.rgb.lab=function(s){let e=d.rgb.xyz(s),t=e[0],i=e[1],o=e[2];t/=95.047,i/=100,o/=108.883,t=t>P?t**(1/3):7.787*t+16/116,i=i>P?i**(1/3):7.787*i+16/116,o=o>P?o**(1/3):7.787*o+16/116;let r=116*i-16,n=500*(t-i),l=200*(i-o);return[r,n,l]};d.hsl.rgb=function(s){let e=s[0]/360,t=s[1]/100,i=s[2]/100,o,r;if(t===0)return r=i*255,[r,r,r];let n=i<.5?i*(1+t):i+t-i*t,l=2*i-n,a=[0,0,0];for(let h=0;h<3;h++)o=e+1/3*-(h-1),o<0&&o++,o>1&&o--,6*o<1?r=l+(n-l)*6*o:2*o<1?r=n:3*o<2?r=l+(n-l)*(2/3-o)*6:r=l,a[h]=r*255;return a};d.hsl.hsv=function(s){let e=s[0],t=s[1]/100,i=s[2]/100,o=t,r=Math.max(i,.01);i*=2,t*=i<=1?i:2-i,o*=r<=1?r:2-r;let n=(i+t)/2,l=i===0?2*o/(r+o):2*t/(i+t);return[e,l*100,n*100]};d.hsv.rgb=function(s){let e=s[0]/60,t=s[1]/100,i=s[2]/100,o=Math.floor(e)%6,r=e-Math.floor(e),n=255*i*(1-t),l=255*i*(1-t*r),a=255*i*(1-t*(1-r));switch(i*=255,o){case 0:return[i,a,n];case 1:return[l,i,n];case 2:return[n,i,a];case 3:return[n,l,i];case 4:return[a,n,i];case 5:return[i,n,l]}};d.hsv.hsl=function(s){let e=s[0],t=s[1]/100,i=s[2]/100,o=Math.max(i,.01),r,n;n=(2-t)*i;let l=(2-t)*o;return r=t*o,r/=l<=1?l:2-l,r=r||0,n/=2,[e,r*100,n*100]};d.hwb.rgb=function(s){let e=s[0]/360,t=s[1]/100,i=s[2]/100,o=t+i,r;o>1&&(t/=o,i/=o);let n=Math.floor(6*e),l=1-i;r=6*e-n,n&1&&(r=1-r);let a=t+r*(l-t),h,u,p;switch(n){default:case 6:case 0:{h=l,u=a,p=t;break}case 1:{h=a,u=l,p=t;break}case 2:{h=t,u=l,p=a;break}case 3:{h=t,u=a,p=l;break}case 4:{h=a,u=t,p=l;break}case 5:{h=l,u=t,p=a;break}}return[h*255,u*255,p*255]};d.cmyk.rgb=function(s){let e=s[0]/100,t=s[1]/100,i=s[2]/100,o=s[3]/100,r=1-Math.min(1,e*(1-o)+o),n=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,i*(1-o)+o);return[r*255,n*255,l*255]};d.xyz.rgb=function(s){let e=s[0]/100,t=s[1]/100,i=s[2]/100,o,r,n;return o=e*3.2404542+t*-1.5371385+i*-.4985314,r=e*-.969266+t*1.8760108+i*.041556,n=e*.0556434+t*-.2040259+i*1.0572252,o=j(o),r=j(r),n=j(n),[o*255,r*255,n*255]};d.xyz.lab=function(s){let e=s[0],t=s[1],i=s[2];e/=95.047,t/=100,i/=108.883,e=e>P?e**(1/3):7.787*e+16/116,t=t>P?t**(1/3):7.787*t+16/116,i=i>P?i**(1/3):7.787*i+16/116;let o=116*t-16,r=500*(e-t),n=200*(t-i);return[o,r,n]};d.xyz.oklab=function(s){let e=s[0]/100,t=s[1]/100,i=s[2]/100,o=Math.cbrt(.8189330101*e+.3618667424*t-.1288597137*i),r=Math.cbrt(.0329845436*e+.9293118715*t+.0361456387*i),n=Math.cbrt(.0482003018*e+.2643662691*t+.633851707*i),l=.2104542553*o+.793617785*r-.0040720468*n,a=1.9779984951*o-2.428592205*r+.4505937099*n,h=.0259040371*o+.7827717662*r-.808675766*n;return[l*100,a*100,h*100]};d.oklab.oklch=function(s){return d.lab.lch(s)};d.oklab.xyz=function(s){let e=s[0]/100,t=s[1]/100,i=s[2]/100,o=(.999999998*e+.396337792*t+.215803758*i)**3,r=(1.000000008*e-.105561342*t-.063854175*i)**3,n=(1.000000055*e-.089484182*t-1.291485538*i)**3,l=1.227013851*o-.55779998*r+.281256149*n,a=-.040580178*o+1.11225687*r-.071676679*n,h=-.076381285*o-.421481978*r+1.58616322*n;return[l*100,a*100,h*100]};d.oklab.rgb=function(s){let e=s[0]/100,t=s[1]/100,i=s[2]/100,o=(e+.3963377774*t+.2158037573*i)**3,r=(e-.1055613458*t-.0638541728*i)**3,n=(e-.0894841775*t-1.291485548*i)**3,l=j(4.0767416621*o-3.3077115913*r+.2309699292*n),a=j(-1.2684380046*o+2.6097574011*r-.3413193965*n),h=j(-.0041960863*o-.7034186147*r+1.707614701*n);return[l*255,a*255,h*255]};d.oklch.oklab=function(s){return d.lch.lab(s)};d.lab.xyz=function(s){let e=s[0],t=s[1],i=s[2],o,r,n;r=(e+16)/116,o=t/500+r,n=r-i/200;let l=r**3,a=o**3,h=n**3;return r=l>P?l:(r-16/116)/7.787,o=a>P?a:(o-16/116)/7.787,n=h>P?h:(n-16/116)/7.787,o*=95.047,r*=100,n*=108.883,[o,r,n]};d.lab.lch=function(s){let e=s[0],t=s[1],i=s[2],o;o=Math.atan2(i,t)*360/2/Math.PI,o<0&&(o+=360);let n=Math.sqrt(t*t+i*i);return[e,n,o]};d.lch.lab=function(s){let e=s[0],t=s[1],o=s[2]/360*2*Math.PI,r=t*Math.cos(o),n=t*Math.sin(o);return[e,r,n]};d.rgb.ansi16=function(s,e=null){let[t,i,o]=s,r=e===null?d.rgb.hsv(s)[2]:e;if(r=Math.round(r/50),r===0)return 30;let n=30+(Math.round(o/255)<<2|Math.round(i/255)<<1|Math.round(t/255));return r===2&&(n+=60),n};d.hsv.ansi16=function(s){return d.rgb.ansi16(d.hsv.rgb(s),s[2])};d.rgb.ansi256=function(s){let e=s[0],t=s[1],i=s[2];return e>>4===t>>4&&t>>4===i>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5)};d.ansi16.rgb=function(s){s=s[0];let e=s%10;if(e===0||e===7)return s>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(Math.trunc(s>50)+1)*.5,i=(e&1)*t*255,o=(e>>
11&1)*t*255,r=(e>>2&1)*t*255;return[i,o,r]};d.ansi256.rgb=function(s){if(s=s[0],s>=232){let r=(s-232)*10+8;return[r,r,r]}s-=16;let e,t=Math.floor(s/36)/5*255,i=Math.floor((e=s%36)/6)/5*255,o=e%6/5*255;return[t,i,o]};d.rgb.hex=function(s){let t=(((Math.round(s[0])&255)<<16)+((Math.round(s[1])&255)<<8)+(Math.round(s[2])&255)).toString(16).toUpperCase();return"000000".slice(t.length)+t};d.hex.rgb=function(s){let e=s.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=[...t].map(l=>l+l).join(""));let i=Number.parseInt(t,16),o=i>>16&255,r=i>>8&255,n=i&255;return[o,r,n]};d.rgb.hcg=function(s){let e=s[0]/255,t=s[1]/255,i=s[2]/255,o=Math.max(Math.max(e,t),i),r=Math.min(Math.min(e,t),i),n=o-r,l,a=n<1?r/(1-n):0;return n<=0?l=0:o===e?l=(t-i)/n%6:o===t?l=2+(i-e)/n:l=4+(e-t)/n,l/=6,l%=1,[l*360,n*100,a*100]};d.hsl.hcg=function(s){let e=s[1]/100,t=s[2]/100,i=t<.5?2*e*t:2*e*(1-t),o=0;return i<1&&(o=(t-.5*i)/(1-i)),[s[0],i*100,o*100]};d.hsv.hcg=function(s){let e=s[1]/100,t=s[2]/100,i=e*t,o=0;return i<1&&(o=(t-i)/(1-i)),[s[0],i*100,o*100]};d.hcg.rgb=function(s){let e=s[0]/360,t=s[1]/100,i=s[2]/100;if(t===0)return[i*255,i*255,i*255];let o=[0,0,0],r=e%1*6,n=r%1,l=1-n,a=0;switch(Math.floor(r)){case 0:{o[0]=1,o[1]=n,o[2]=0;break}case 1:{o[0]=l,o[1]=1,o[2]=0;break}case 2:{o[0]=0,o[1]=1,o[2]=n;break}case 3:{o[0]=0,o[1]=l,o[2]=1;break}case 4:{o[0]=n,o[1]=0,o[2]=1;break}default:o[0]=1,o[1]=0,o[2]=l}return a=(1-t)*i,[(t*o[0]+a)*255,(t*o[1]+a)*255,(t*o[2]+a)*255]};d.hcg.hsv=function(s){let e=s[1]/100,t=s[2]/100,i=e+t*(1-e),o=0;return i>0&&(o=e/i),[s[0],o*100,i*100]};d.hcg.hsl=function(s){let e=s[1]/100,i=s[2]/100*(1-e)+.5*e,o=0;return i>0&&i<.5?o=e/(2*i):i>=.5&&i<1&&(o=e/(2*(1-i))),[s[0],o*100,i*100]};d.hcg.hwb=function(s){let e=s[1]/100,t=s[2]/100,i=e+t*(1-e);return[s[0],(i-e)*100,(1-i)*100]};d.hwb.hcg=function(s){let e=s[1]/100,i=1-s[2]/100,o=i-e,r=0;return o<1&&(r=(i-o)/(1-o)),[s[0],o*100,r*100]};d.apple.rgb=function(s){return[s[0]/65535*255,s[1]/65535*255,s[2]/65535*255]};d.rgb.apple=function(s){return[s[0]/255*65535,s[1]/255*65535,s[2]/255*65535]};d.gray.rgb=function(s){return[s[0]/100*255,s[0]/100*255,s[0]/100*255]};d.gray.hsl=function(s){return[0,0,s[0]]};d.gray.hsv=d.gray.hsl;d.gray.hwb=function(s){return[0,100,s[0]]};d.gray.cmyk=function(s){return[0,0,0,s[0]]};d.gray.lab=function(s){return[s[0],0,0]};d.gray.hex=function(s){let e=Math.round(s[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(i.length)+i};d.rgb.gray=function(s){return[(s[0]+s[1]+s[2])/3/255*100]};function er(){let s={},e=Object.keys(B);for(let{length:t}=e,i=0;i<t;i++)s[e[i]]={distance:-1,parent:null};return s}function tr(s){let e=er(),t=[s];for(e[s].distance=0;t.length>0;){let i=t.pop(),o=Object.keys(B[i]);for(let{length:r}=o,n=0;n<r;n++){let l=o[n],a=e[l];a.distance===-1&&(a.distance=e[i].distance+1,a.parent=i,t.unshift(l))}}return e}function sr(s,e){return function(t){return e(s(t))}}function ir(s,e){let t=[e[s].parent,s],i=B[e[s].parent][s],o=e[s].parent;for(;e[o].parent;)t.unshift(e[o].parent),i=sr(B[e[o].parent][o],i),o=e[o].parent;return i.conversion=t,i}function or(s){let e=tr(s),t={},i=Object.keys(e);for(let{length:o}=i,r=0;r<o;r++){let n=i[r];e[n].parent!==null&&(t[n]=ir(n,e))}return t}var Di=or;var q={},rr=Object.keys(B);function nr(s){let e=function(...t){let i=t[0];return i==null?i:(i.length>1&&(t=i),s(t))};return"conversion"in s&&(e.conversion=s.conversion),e}function lr(s){let e=function(...t){let i=t[0];if(i==null)return i;i.length>1&&(t=i);let o=s(t);if(typeof o=="object")for(let{length:r}=o,n=0;n<r;n++)o[n]=Math.round(o[n]);return o};return"conversion"in s&&(e.conversion=s.conversion),e}for(let s of rr){q[s]={},Object.defineProperty(q[s],"channels",{value:B[s].channels}),Object.defineProperty(q[s],"labels",{value:B[s].labels});let e=Di(s),t=Object.keys(e);for(let i of t){let o=e[i];q[s][i]=lr(o),q[s][i].raw=nr(o)}}var ts=q;var F=(s,e=0,t=1)=>s>t?t:s<e?e:s,w=(s,e=0,t=Math.pow(10,e))=>Math.round(t*s)/t;var Kl={grad:360/400,turn:360,rad:360/(Math.PI*2)},Ni=s=>ur(Re(s)),Re=s=>(s[0]==="#"&&(s=s.substring(1)),s.length<6?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?w(parseInt(s[3]+s[3],16)/255,2):1}:{r:parseInt(s.substring(0,2),16),g:parseInt(s.substring(2,4),16),b:parseInt(s.substring(4,6),16),a:s.length===8?w(parseInt(s.substring(6,8),16)/255,2):1});var Wi=s=>hr(cr(s)),ar=({h:s,s:e,v:t,a:i})=>{let o=(200-e)*t/100;return{h:w(s),s:w(o>0&&o<200?e*t/100/(o<=100?o:200-o)*100:0),l:w(o/2),a:w(i,2)}};var ae=s=>{let{h:e,s:t,l:i}=ar(s);return`hsl(${e}, ${t}%, ${i}%)`};var cr=({h:s,s:e,v:t,a:i})=>{s=s/360*6,e=e/100,t=t/100;let o=Math.floor(s),r=t*(1-e),n=t*(1-(s-o)*e),l=t*(1-(1-s+o)*e),a=o%6;return{r:w([t,n,r,r,l,t][a]*255),g:w([l,t,t,n,r,r][a]*255),b:w([r,r,l,t,t,n][a]*255),a:w(i,2)}};var We=s=>{let e=s.toString(16);return e.length<2?"0"+e:e},hr=({r:s,g:e,b:t,a:i})=>{let o=i<1?We(w(i*255)):"";return"#"+We(s)+We(e)+We(t)+o}
1,ur=({r:s,g:e,b:t,a:i})=>{let o=Math.max(s,e,t),r=o-Math.min(s,e,t),n=r?o===s?(e-t)/r:o===e?2+(t-s)/r:4+(s-e)/r:0;return{h:w(60*(n<0?n+6:n)),s:w(o?r/o*100:0),v:w(o/255*100),a:i}};var ss=(s,e)=>{if(s===e)return!0;for(let t in s)if(s[t]!==e[t])return!1;return!0};var Ri=(s,e)=>s.toLowerCase()===e.toLowerCase()?!0:ss(Re(s),Re(e));var Hi={},He=s=>{let e=Hi[s];return e||(e=document.createElement("template"),e.innerHTML=s,Hi[s]=e),e},ce=(s,e,t)=>{s.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))};var K=!1,is=s=>"touches"in s,dr=s=>K&&!is(s)?!1:(K||(K=is(s)),!0),Gi=(s,e)=>{let t=is(e)?e.touches[0]:e,i=s.el.getBoundingClientRect();ce(s.el,"move",s.getMove({x:F((t.pageX-(i.left+window.pageXOffset))/i.width),y:F((t.pageY-(i.top+window.pageYOffset))/i.height)}))},fr=(s,e)=>{let t=e.keyCode;t>40||s.xy&&t<37||t<33||(e.preventDefault(),ce(s.el,"move",s.getMove({x:t===39?.01:t===37?-.01:t===34?.05:t===33?-.05:t===35?1:t===36?-1:0,y:t===40?.01:t===38?-.01:0},!0)))},X=class{constructor(e,t,i,o){let r=He(`<div role="slider" tabindex="0" part="${t}" ${i}><div part="${t}-pointer"></div></div>`);e.appendChild(r.content.cloneNode(!0));let n=e.querySelector(`[part=${t}]`);n.addEventListener("mousedown",this),n.addEventListener("touchstart",this),n.addEventListener("keydown",this),this.el=n,this.xy=o,this.nodes=[n.firstChild,n]}set dragging(e){let t=e?document.addEventListener:document.removeEventListener;t(K?"touchmove":"mousemove",this),t(K?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!dr(e)||!K&&e.button!=0)return;this.el.focus(),Gi(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),Gi(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":fr(this,e);break}}style(e){e.forEach((t,i)=>{for(let o in t)this.nodes[i].style.setProperty(o,t[o])})}};var Ge=class extends X{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:ae({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${w(e)}`)}getMove(e,t){return{h:t?F(this.h+e.x*360,0,360):360*e.x}}};var ze=class extends X{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:ae(e)},{"background-color":ae({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${w(e.s)}%, Brightness ${w(e.v)}%`)}getMove(e,t){return{s:t?F(this.hsva.s+e.x*100,0,100):e.x*100,v:t?F(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var zi=':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)}';var $i="[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}";var ji="[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}";var $e=Symbol("same"),os=Symbol("color"),Ui=Symbol("hsva"),rs=Symbol("update"),qi=Symbol("parts"),Ki=Symbol("css"),Xi=Symbol("sliders"),je=class extends HTMLElement{static get observedAttributes(){return["color"]}get[Ki](){return[zi,$i,ji]}get[Xi](){return[ze,Ge]}get color(){return this[os]}set color(e){if(!this[$e](e)){let t=this.colorModel.toHsva(e);this[rs](t),this[os]=e}}constructor(){super();let e=He(`<style>${this[Ki].join("")}</style>`),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[qi]=this[Xi].map(i=>new i(t))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,i){let o=this.colorModel.fromAttr(i);this[$e](o)||(this.color=o)}handleEvent(e){let t=this[Ui],i={...t,...e.detail};this[rs](i);let o;!ss(i,t)&&!this[$e](o=this.colorModel.fromHsva(i))&&(this[os]=o,ce(this,"color-changed",{value:o}))}[$e](e){return this.color&&this.colorModel.equal(e,this.color)}
1[rs](e){this[Ui]=e,this[qi].forEach(t=>t.update(e))}};var pr={defaultColor:"#000",toHsva:Ni,fromHsva:({h:s,s:e,v:t})=>Wi({h:s,s:e,v:t,a:1}),equal:Ri,fromAttr:s=>s},Ue=class extends je{get colorModel(){return pr}};var Y={};M(Y,Va);import*as Va from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";var V=class extends c.Collection{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,i,o)=>{this._renderViewIntoCollectionParent(i,o)}),this.on("remove",(t,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(let t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!mr(e))throw new c.CKEditorError("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(let i of this)for(let o of e)i.delegate(o).to(t);this.on("add",(i,o)=>{for(let r of e)o.delegate(r).to(t)}),this.on("remove",(i,o)=>{for(let r of e)o.stopDelegating(r,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)}};function mr(s){return s.every(e=>typeof e=="string")}var br="http://www.w3.org/1999/xhtml",k=class extends(0,c.EmitterMixin)(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Qi(Yi(e))),this._isRendered=!1,this._revertData=null}render(){let e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=eo(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new c.CKEditorError("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(let i of t.children)Je(i)?yield i:Ws(i)&&(yield*e(i))}yield*e(this)}static bind(e,t){return{to(i,o){return new Ze({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o})},if(i,o,r){return new ue({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:r})}}}static extend(e,t){if(e._isRendered)throw new c.CKEditorError("template-extend-render",[this,e]);yo(e,Qi(Yi(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new c.CKEditorError("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||br,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(""),Ye(this.text)?this._bindToObservable({schema:this.text,updater:wr(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;let t=e.node,i=e.revertData;for(let o in this.attributes){let r=t.getAttribute(o),n=this.attributes[o];i&&(i.attributes[o]=r);let l=Ji(n)?n[0].ns:null;if(Ye(n)){let a=Ji(n)?n[0].value:n;i&&to(o)&&a.unshift(r),this._bindToObservable({schema:a,updater:_r(t,o,l),data:e})}else if(o=="style"&&typeof n[0]!="string")this._renderStyleAttribute(n[0],e);else{i&&r&&to(o)&&n.unshift(r);let a=n.map(h=>h&&(h.value||h)).reduce((h,u)=>h.concat(u),[]).reduce(ko,"");J(a)||t.setAttributeNS(l,o,a)}}}_renderStyleAttribute(e,t){let i=t.node;for(let o in e){let r=e[o];Ye(r)?this._bindToObservable({schema:[r],updater:kr(i,o),data:t}):i.style[o]=r}}_renderElementChildren(e){let t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying,r=0;for(let n of this.children)if(Rs(n)){if(!o){n.setParent(t);for(let l of n)i.appendChild(l.element)}}else if(Je(n))o||(n.isRendered||n.render(),i.appendChild(n.element));else if((0,c.isNode)(n))i.appendChild(n);else if(o){let l=e.revertData,a=eo();l.children.push(a),n._renderNode({intoFragment:!1,node:i.childNodes[r++],isApplying:!0,revertData:a})}else i.appendChild(n.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(let t in this.eventListeners){let i=this.eventListeners[t].map(o=>{let[r,n]=t.split("@");return o.activateDomEventListener(r,n,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){let o=i.revertData;wo(e,t,i);let r=e.filter(n=>!J(n)).filter(n=>n.observable).map(n=>n.activateAttributeListener(e,t,i));o&&o.bindings.push(r)}_revertTemplateFromNode(e,t){for(let o of t.bindings)for(let r of o)r();if(t.text){e.textContent=t.text;return}let i=e;for(let o in t.attributes){let r=t.attributes[o];r===null?i.removeAttribute(o):i.setAttribute(o,r)}for(let o=0;o<t.children.length;++o)this._revertTemplateFromNode(i.childNodes[o],t.children[o])}},D=class{attribute;observable;emitter;callback;constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){let t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){let o=()=>wo(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}},Ze=class extends D{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){let o=(r,n)=>{(!t||n.target.matches(t))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}},ue=class extends D{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){let t=super.getValue(e);return J(t)?!1:this.valueIfTrue||!0}};function Ye(s){return s?(s.value&&(s=s.value),Array.isArray(s)?s.some(Ye):s instanceof D):!1}function gr(s,e){return s.map(t=>t instanceof D?t.getValue(e):t)}function wo(s,e,{node:t}){let i=gr(s,t),o;s.length==1&&s[0]instanceof ue?o=i[0]:o=i.reduce(ko,""),J(o)?e.remove():e.set(o)}function wr(s){return{set(e){s.textContent=e},remove(){s.textContent=""}}}
1function _r(s,e,t){return{set(i){s.setAttributeNS(t,e,i)},remove(){s.removeAttributeNS(t,e)}}}function kr(s,e){return{set(t){s.style[e]=t},remove(){s.style[e]=null}}}function Yi(s){return oe(s,t=>{if(t&&(t instanceof D||Ws(t)||Je(t)||Rs(t)))return t})}function Qi(s){if(typeof s=="string"?s=Tr(s):s.text&&vr(s),s.on&&(s.eventListeners=xr(s.on),delete s.on),!s.text){s.attributes&&yr(s.attributes);let e=[];if(s.children)if(Rs(s.children))e.push(s.children);else for(let t of s.children)Ws(t)||Je(t)||(0,c.isNode)(t)?e.push(t):e.push(new k(t));s.children=e}return s}function yr(s){for(let e in s)s[e].value&&(s[e].value=(0,c.toArray)(s[e].value)),_o(s,e)}function xr(s){for(let e in s)_o(s,e);return s}function Tr(s){return{text:[s]}}function vr(s){s.text=(0,c.toArray)(s.text)}function _o(s,e){s[e]=(0,c.toArray)(s[e])}function ko(s,e){return J(e)?s:J(s)?e:`${s} ${e}`}function Zi(s,e){for(let t in e)s[t]?s[t].push(...e[t]):s[t]=e[t]}function yo(s,e){if(e.attributes&&(s.attributes||(s.attributes={}),Zi(s.attributes,e.attributes)),e.eventListeners&&(s.eventListeners||(s.eventListeners={}),Zi(s.eventListeners,e.eventListeners)),e.text&&s.text.push(...e.text),e.children&&e.children.length){if(s.children.length!=e.children.length)throw new c.CKEditorError("ui-template-extend-children-mismatch",s);let t=0;for(let i of e.children)yo(s.children[t++],i)}}function J(s){return!s&&s!==0}function Je(s){return s instanceof f}function Ws(s){return s instanceof k}function Rs(s){return s instanceof V}function Ji(s){return z(s[0])&&s[0].ns}function eo(){return{children:[],bindings:[],attributes:{}}}function to(s){return s=="class"||s=="style"}var f=class extends(0,c.DomEmitterMixin)((0,c.ObservableMixin)()){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new c.Collection,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=k.bind(this,this)}createCollection(e){let t=new V(e);return this._viewCollections.add(t),t}registerChild(e){(0,c.isIterable)(e)||(e=[e]);for(let t of e)this._unboundChildren.add(t)}deregisterChild(e){(0,c.isIterable)(e)||(e=[e]);for(let t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new k(e)}extendTemplate(e){k.extend(this.template,e)}render(){if(this.isRendered)throw new c.CKEditorError("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)}},ds={POLITE:"polite",ASSERTIVE:"assertive"},et=class{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(let t of Object.values(ds))this.announce("",t)})}announce(e,t=ds.POLITE){let i=this.editor;if(!i.ui.view)return;this.view||(this.view=new tt(i.locale),i.ui.view.body.add(this.view));let{politeness:o,isUnsafeHTML:r}=typeof t=="string"?{politeness:t}:t,n=this.view.regionViews.find(l=>l.politeness===o);n||(n=new st(i,o),this.view.regionViews.add(n)),n.announce({announcement:e,isUnsafeHTML:r})}},tt=class extends f{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}},st=class extends f{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{this._pruneAnnouncementsInterval!==null&&(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;let i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}};function Kt({emitter:s,activator:e,callback:t,contextElements:i,listenerOptions:o}){s.listenTo(document,"mousedown",(r,n)=>{if(!e())return;let l=typeof n.composedPath=="function"?n.composedPath():[],a=typeof i=="function"?i():i;for(let h of a)if(h.contains(n.target)||l.includes(h))return;t()},o)}function Vr(s){class e extends s{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...i){super(...i),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return e}function xo(s){class e extends s{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...i){super(...i),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(c.global.document,"mouseup",this._onDragEndBound),this.listenTo(c.global.document,"touchend",this._onDragEndBound),this.listenTo(c.global.document,"mousemove",this._onDragBound),this.listenTo(c.global.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(c.global.document,"mouseup",this._onDragEndBound),this.stopListening(c.global.document,"touchend",this._onDragEndBound),this.stopListening(c.global.document,"mousemove",this._onDragBound),this.stopListening(c.global.document,"touchmove",this._onDragBound)}_onDragStart(i,o){if(!this._isHandleElementPressed(o))return;this._attachDragListeners();let r=0,n=0;o instanceof MouseEvent?(r=o.clientX,n=o.clientY):(r=o.touches[0].clientX,n=o.touches[0].clientY),this._lastDraggingCoordinates={x:r,y:n},this.isDragging=!0}_onDrag(i,o){if(!this.isDragging){this._detachDragListeners();return}let r=0,n=0;o instanceof MouseEvent?(r=o.clientX,n=o.clientY):(r=o.touches[0].clientX,n=o.touches[0].clientY),o.preventDefault(),this.fire("drag",{deltaX:Math.round(r-this._lastDraggingCoordinates.x),deltaY:Math.round(n-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:r,y:n}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(i){return this.dragHandleElement?this.dragHandleElement===i.target||i.target instanceof HTMLElement&&this.dragHandleElement.contains(i.target):!1}}return e}function Cr({view:s}){s.listenTo(s.element,"submit",(e,t)=>{t.preventDefault(),s.fire("submit")},{useCapture:!0})}function To({keystrokeHandler:s,focusTracker:e,gridItems:t,numberOfColumns:i,uiLanguageDirection:o}){let r=typeof i=="number"?()=>i:i;s.set("arrowright",n((h,u)=>o==="rtl"?a(h,u.length):l(h,u.length))),s.set("arrowleft",n((h,u)=>o==="rtl"?l(h,u.length):a(h,u.length))),s.set("arrowup",n((h,u)=>{let p=h-r();return p<0&&(p=h+r()*Math.floor(u.length/r()),p>
1u.length-1&&(p-=r())),p})),s.set("arrowdown",n((h,u)=>{let p=h+r();return p>u.length-1&&(p=h%r()),p}));function n(h){return u=>{let p=t.find(Qt=>Qt.element===e.focusedElement),b=t.getIndex(p),_=h(b,t);t.get(_).focus(),u.stopPropagation(),u.preventDefault()}}function l(h,u){return h===u-1?0:h+1}function a(h,u){return h===0?u-1:h-1}}var N=class extends f{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${(0,c.uid)()}`;let t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}},it=class extends f{constructor(e,t){super(e);let i=e.t,o=new N;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:[(0,c.createElement)(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(t=>{let i=[(0,c.createElement)(document,"h3",{},t.label),...Array.from(t.groups.values()).map(o=>this._createGroup(o)).flat()];return t.description&&i.splice(1,0,(0,c.createElement)(document,"p",{},t.description)),(0,c.createElement)(document,"section",{},i)})}_createGroup(e){let t=e.keystrokes.sort((o,r)=>o.label.localeCompare(r.label)).map(o=>this._createGroupRow(o)).flat(),i=[(0,c.createElement)(document,"dl",{},t)];return e.label&&i.unshift((0,c.createElement)(document,"h4",{},e.label)),i}_createGroupRow(e){let t=this.locale.t,i=(0,c.createElement)(document,"dt"),o=(0,c.createElement)(document,"dd"),r=Or(e.keystroke),n=[];for(let l of r)n.push(l.map(Er).join(""));return i.innerHTML=e.label,o.innerHTML=n.join(", ")+(e.mayRequireFn&&c.env.isMac?` ${t("(may require <kbd>Fn</kbd>)")}`:""),[i,o]}};function Er(s){return(0,c.getEnvKeystrokeText)(s).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}function Or(s){return typeof s=="string"?[[s]]:typeof s[0]=="string"?[s]:s}var C=class s extends f{static 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"];constructor(){super();let 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",t=>!t),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}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){let t=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!t)throw new c.CKEditorError("ui-iconview-invalid-svg",this);let i=t.getAttribute("viewBox");i&&(this.viewBox=i);for(let{name:o,value:r}of Array.from(t.attributes))s.presentationalAttributeNames.includes(o)&&this.element.setAttribute(o,r);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e
1=>{e.style.fill=this.fillColor})}},de=class extends f{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});let 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")}]})}},g=class extends f{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new de){super(e);let i=this.bindTemplate,o=(0,c.uid)();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),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 C,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));let r={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",n=>!n),i.if("isVisible","ck-hidden",n=>!n),i.to("isOn",n=>n?"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",n=>n||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,n=>!n),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(n=>{this.isEnabled?this.fire("execute"):n.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(n,l,a)=>!l||so(a)?!1:String(!!n)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(n,l,a)=>!l||!so(a)?!1:String(!!n)),c.env.isSafari&&(this._focusDelayed||(this._focusDelayed=(0,c.delay)(()=>this.focus(),0)),r.on.mousedown=i.to(()=>{this._focusDelayed()}),r.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(r)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(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(){let e=new f;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>(0,c.getEnvKeystrokeText)(t))}]}),e}_getTooltipString(e,t,i){return e?typeof e=="string"?e:(i&&(i=(0,c.getEnvKeystrokeText)(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}};function so(s){switch(s){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}var ot=class extends f{children;iconView;constructor(e,t={}){super(e);let 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 C,this.iconView.content=t.icon,this.children.add(this.iconView));let o=new f(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}},E=class extends(0,c.EmitterMixin)(){focusables;focusTracker;keystrokeHandler;actions;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(let t in e.actions){let i=e.actions[t];typeof i=="string"&&(i=[i]);for(let o of i)e.keystrokeHandler.set(o,(r,n)=>{this[t](),n()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(ns)||null}get last(){return this.focusables.filter(ns).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,i)=>{let 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(){let e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){let e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){let t=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",i=>{let o=t();this.focusNext(),o!==t()&&i.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",i=>{let o=t();this.focusPrevious(),o!==t()&&i.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}
1_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){let t=this.focusables.length;if(!t)return null;let i=this.current;if(i===null)return this[e===1?"first":"last"];let o=this.focusables.get(i),r=(i+t+e)%t;do{let n=this.focusables.get(r);if(ns(n)){o=n;break}r=(r+t+e)%t}while(r!==i);return o}};function ns(s){return se(s)&&(0,c.isVisible)(s.element)}function se(s){return"focus"in s&&typeof s.focus=="function"}function vo(s){return se(s)&&"focusCycler"in s&&s.focusCycler instanceof E}var rt=class extends f{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new c.KeystrokeHandler,this._focusTracker=new c.FocusTracker,this._focusables=new V,this.focusCycler=new E({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(let t of e){let i=new g(this.locale),o;i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i);for(o in t)o!="onExecute"&&o!="onCreate"&&i.set(o,t[o]);this.children.add(i)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}},nt=class extends f{children;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)}},x={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},io=(0,c.toUnit)("px"),lt=class s extends xo(f){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e);let r=this.bindTemplate,n=e.t;this.set("className",""),this.set("ariaLabel",n("Editor dialog")),this.set("isModal",!1),this.set("position",x.SCREEN_CENTER),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 c.KeystrokeHandler,this.focusTracker=new c.FocusTracker,this._focusables=new V,this._focusCycler=new E({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:o}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",r.if("isModal","ck-dialog-overlay__transparent",l=>!l),r.if("_isVisible","ck-hidden",l=>!l)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",r.if("isModal","ck-dialog_modal"),r.to("className")],role:"dialog","aria-label":r.to("ariaLabel"),style:{top:r.to("_top",l=>io(l)),left:r.to("_left",l=>io(l)),visibility:r.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())}),this.on("drag",(e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)}),this.listenTo(c.global.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(c.global.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.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:r}){t&&(this.headerView=new ot(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 f&&(o=[o]),this.contentView=new nt(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),r&&(this.actionsView=new rt(this.locale),this.actionsView.setButtons(r),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}
1moveTo(e,t){let i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){if(!this.element||!this.element.parentNode)return;let e=this._getViewportRect(),t=this.position,i;this._getCurrentDomRoot()?i=this._getVisibleDomRootRect(e):t=x.SCREEN_CENTER;let o=s.defaultOffset,r=this._getDialogRect();switch(t){case x.EDITOR_TOP_SIDE:{if(i){let n=this.locale.contentLanguageDirection==="ltr"?i.right-r.width-o:i.left+o;this.moveTo(n,i.top+o)}else this._moveOffScreen();break}case x.EDITOR_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-r.width/2),Math.round(i.top+i.height/2-r.height/2)):this._moveOffScreen();break}case x.SCREEN_CENTER:{this.moveTo(Math.round((e.width-r.width)/2),Math.round((e.height-r.height)/2));break}case x.EDITOR_TOP_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-r.width/2),i.top+o):this._moveOffScreen();break}case x.EDITOR_BOTTOM_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-r.width/2),i.bottom-r.height-o):this._moveOffScreen();break}case x.EDITOR_ABOVE_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-r.width/2),i.top-r.height-o):this._moveOffScreen();break}case x.EDITOR_BELOW_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-r.width/2),i.bottom+o):this._moveOffScreen();break}}}_getVisibleDomRootRect(e){let t=new c.Rect(this._getCurrentDomRoot()).getVisible();if(t){if(t=e.getIntersection(t),!t)return null}else return null;return t}_getDialogRect(){return new c.Rect(this.element.firstElementChild)}_getViewportRect(){let e=new c.Rect(c.global.window);if(this.isModal)return e;let t={top:0,bottom:0,left:0,right:0,...this._getViewportOffset()};return e.top+=t.top,e.height-=t.top,e.bottom-=t.bottom,e.height-=t.bottom,e.left+=t.left,e.right-=t.right,e.width-=t.left+t.right,e}_updateFocusCyclableItems(){let e=[];
1if(this.contentView)for(let t of this.contentView.children)se(t)&&e.push(t);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element),vo(t)&&this._focusCycler.chain(t.focusCycler)})}_createCloseButton(){let e=new g(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:m.IconCancel}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}},at=class s extends y.Plugin{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);let t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),s._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,t)=>{this._show(t)}),this.on("show",(e,t)=>{t.onShow&&t.onShow(this)},{priority:"low"}),this.on("hide",()=>{s._visibleDialogPlugin&&s._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){let 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(){let e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;let t=e.document.differ.getChangedRoots();for(let i of t)i.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:r,actionButtons:n,className:l,isModal:a,position:h,onHide:u,keystrokeHandlerOptions:p}){let b=this.editor;this.view=new lt(b.locale,{getCurrentDomRoot:()=>b.editing.view.getDomRoot(b.model.document.selection.anchor.root.rootName),getViewportOffset:()=>b.ui.viewportOffset,keystrokeHandlerOptions:p});let _=this.view;_.on("close",()=>{this.hide()}),b.ui.view.body.add(_),b.keystrokes.listenTo(_.element),h||(h=a?x.SCREEN_CENTER:x.EDITOR_CENTER),a&&this._lockBodyScroll(),_.set({position:h,_isVisible:!0,className:l,isModal:a}),_.setupParts({icon:t,title:i,hasCloseButton:o,content:r,actionButtons:n}),this.id=e,u&&(this._onHide=u),this.isOpen=!0,s._visibleDialogPlugin=this}hide(){s._visibleDialogPlugin&&s._visibleDialogPlugin.fire(`hide:${s._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;let e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),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,s._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}},O=class extends g{_checkIconHolderView=new ct;constructor(e,t=new de){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});let i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(o,r)=>o||r)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{let{children:o,_checkIconHolderView:r}=this;i?o.add(r,0):o.remove(r)})}},ct=class extends f{children;_checkIconView=this._createCheckIconView();constructor(){super();let e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",t=>t?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{let{children:o,_checkIconView:r}=this;i&&!o.has(r)?o.add(r):!i&&o.has(r)&&o.remove(r)})}_createCheckIconView(){let e=new C;return e.content=m.IconCheck,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}},fe=class extends O{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}},fs=class extends y.Plugin{contentView=null;static get requires(){return[at]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{let i=this._createButton(g);return i.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),i}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{let i=this._createButton(fe);return i.label=t("Accessibility"),i}),e.keystrokes.set("Alt+0",(i,o)=>{this._toggleDialog(),o()}),this._setupRootLabels()}_createButton(e){let t=this.editor,i=t.plugins.get("Dialog"),o=t.locale,r=new e(o);return r.set({keystroke:"Alt+0",icon:m.IconAccessibility,isToggleable:!0}),r.on("execute",()=>this._toggleDialog()),r.bind("isOn").to(i,"id",n=>n==="accessibilityHelp"),r}_setupRootLabels(){let e=this.editor,t=e.editing.view,i=e.t;e.ui.on("ready",()=>{t.change(r=>{for(let n of t.document.roots)o(r,n)}),e.on("addRoot",(r,n)=>{let l=e.editing.view.document.getRoot(n.rootName);t.change(a=>o(a,l))},{priority:"low"})});function o(r,n){let a=[n.getAttribute("aria-label"),i("Press %0 for help.",[(0,c.getEnvKeystrokeText)("Alt+0")])].filter(h=>h).join(". ");r.setAttribute("aria-label",a,n)}}_toggleDialog(){let e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new it(e.locale,e.accessibility.keystrokeInfos)),t.id==="accessibilityHelp"?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:m.IconAccessibility,hasCloseButton:!0,content:this.contentView})}},ht=class s extends V{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new k({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),(!s._bodyWrapper||!s._bodyWrapper.isConnected)&&(s._bodyWrapper=(0,c.createElement)(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(s._bodyWrapper)),s._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),s._bodyWrapper&&!s._bodyWrapper.childElementCount&&(s._bodyWrapper.remove(),delete s._bodyWrapper)}},oo=(0,c.toUnit)("px"),Ir={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}
1},T=class s extends f{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);let 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._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",i=>`ck-balloon-panel_${i}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",oo),left:t.to("left",oo)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){let t=Qe(e.target);if(t&&!(0,c.isVisible)(t))return!1;this.show();let i=s.defaultPositions,o=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:c.global.document.body,fitInViewport:!0},e),r=s._getOptimalPosition(o)||Ir,n=parseInt(r.left),l=parseInt(r.top),a=r.name,h=r.config||{},{withArrow:u=!0}=h;return this.top=l,this.left=n,this.position=a,this.withArrow=u,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},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){if(!this.attachTo(e))return!1;let t=Qe(e.target),i=e.limiter?Qe(e.limiter):c.global.document.body;if(this.listenTo(c.global.document,"scroll",(o,r)=>{let n=r.target,l=t&&n.contains(t),a=i&&n.contains(i);(l||a||!t||!i)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(c.global.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(t&&(0,c.isText)(t)&&(t=t.parentElement),t)){let o=()=>{(0,c.isVisible)(t)||this.unpin()};this._resizeObserver=new c.ResizeObserver(t,o)}return!0}_stopPinning(){this.stopListening(c.global.document,"scroll"),this.stopListening(c.global.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){let{sideOffset:t=s.arrowSideOffset,heightOffset:i=s.arrowHeightOffset,stickyVerticalOffset:o=s.stickyVerticalOffset,config:r}=e;return{northWestArrowSouthWest:(a,h)=>({top:n(a,h),left:a.left-t,name:"arrow_sw",...r&&{config:r}}),northWestArrowSouthMiddleWest:(a,h)=>({top:n(a,h),left:a.left-h.width*.25-t,name:"arrow_smw",...r&&{config:r}}),northWestArrowSouth:(a,h)=>({top:n(a,h),left:a.left-h.width/2,name:"arrow_s",...r&&{config:r}}),northWestArrowSouthMiddleEast:(a,h)=>({top:n(a,h),left:a.left-h.width*.75+t,name:"arrow_sme",...r&&{config:r}}),northWestArrowSouthEast:(a,h)=>({top:n(a,h),left:a.left-h.width+t,name:"arrow_se",...r&&{config:r}}),northArrowSouthWest:(a,h)=>({top:n(a,h),left:a.left+a.width/2-t,name:"arrow_sw",...r&&{config:r}}),northArrowSouthMiddleWest:(a,h)=>({top:n(a,h),left:a.left+a.width/2-h.width*.25-t,name:"arrow_smw",...r&&{config:r}}),northArrowSouth:(a,h)=>({top:n(a,h),left:a.left+a.width/2-h.width/2,name:"arrow_s",...r&&{config:r}}),northArrowSouthMiddleEast:(a,h)=>({top:n(a,h),left:a.left+a.width/2-h.width*.75+t,name:"arrow_sme",...r&&{config:r}}),northArrowSouthEast:(a,h)=>({top:n(a,h),left:a.left+a.width/2-h.width+t,name:"arrow_se",...r&&{config:r}}),northEastArrowSouthWest:(a,h)=>({top:n(a,h),left:a.right-t,name:"arrow_sw",...r&&{config:r}}),northEastArrowSouthMiddleWest:(a,h)=>({top:n(a,h),left:a.right-h.width*.25-t,name:"arrow_smw",...r&&{config:r}}),northEastArrowSouth:(a,h)=>({top:n(a,h),left:a.right-h.width/2,name:"arrow_s",...r&&{config:r}}),northEastArrowSouthMiddleEast:(a,h)=>({top:n(a,h),left:a.right-h.width*.75+t,name:"arrow_sme",...r&&{config:r}}),northEastArrowSouthEast:(a,h)=>({top:n(a,h),left:a.right-h.width+t,name:"arrow_se",...r&&{config:r}}),southWestArrowNorthWest:a=>
1({top:l(a),left:a.left-t,name:"arrow_nw",...r&&{config:r}}),southWestArrowNorthMiddleWest:(a,h)=>({top:l(a),left:a.left-h.width*.25-t,name:"arrow_nmw",...r&&{config:r}}),southWestArrowNorth:(a,h)=>({top:l(a),left:a.left-h.width/2,name:"arrow_n",...r&&{config:r}}),southWestArrowNorthMiddleEast:(a,h)=>({top:l(a),left:a.left-h.width*.75+t,name:"arrow_nme",...r&&{config:r}}),southWestArrowNorthEast:(a,h)=>({top:l(a),left:a.left-h.width+t,name:"arrow_ne",...r&&{config:r}}),southArrowNorthWest:a=>({top:l(a),left:a.left+a.width/2-t,name:"arrow_nw",...r&&{config:r}}),southArrowNorthMiddleWest:(a,h)=>({top:l(a),left:a.left+a.width/2-h.width*.25-t,name:"arrow_nmw",...r&&{config:r}}),southArrowNorth:(a,h)=>({top:l(a),left:a.left+a.width/2-h.width/2,name:"arrow_n",...r&&{config:r}}),southArrowNorthMiddleEast:(a,h)=>({top:l(a),left:a.left+a.width/2-h.width*.75+t,name:"arrow_nme",...r&&{config:r}}),southArrowNorthEast:(a,h)=>({top:l(a),left:a.left+a.width/2-h.width+t,name:"arrow_ne",...r&&{config:r}}),southEastArrowNorthWest:a=>({top:l(a),left:a.right-t,name:"arrow_nw",...r&&{config:r}}),southEastArrowNorthMiddleWest:(a,h)=>({top:l(a),left:a.right-h.width*.25-t,name:"arrow_nmw",...r&&{config:r}}),southEastArrowNorth:(a,h)=>({top:l(a),left:a.right-h.width/2,name:"arrow_n",...r&&{config:r}}),southEastArrowNorthMiddleEast:(a,h)=>({top:l(a),left:a.right-h.width*.75+t,name:"arrow_nme",...r&&{config:r}}),southEastArrowNorthEast:(a,h)=>({top:l(a),left:a.right-h.width+t,name:"arrow_ne",...r&&{config:r}}),westArrowEast:(a,h)=>({top:a.top+a.height/2-h.height/2,left:a.left-h.width-i,name:"arrow_e",...r&&{config:r}}),eastArrowWest:(a,h)=>({top:a.top+a.height/2-h.height/2,left:a.right+i,name:"arrow_w",...r&&{config:r}}),viewportStickyNorth:(a,h,u)=>{let p=new c.Rect(c.global.document.body).getIntersection(u.getVisible());if(!p)return null;let b=p.getVisible();return!a.getIntersection(b)||!(b.top-a.top-o<h.height&&b.bottom-a.bottom<h.height)?null:{top:b.top+o,left:a.left+a.width/2-h.width/2,name:"arrowless",config:{withArrow:!1,...r}}}};function n(a,h){return a.top-h.height-i}function l(a){return a.bottom+i}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=c.getOptimalPosition;static defaultPositions=s.generatePositions()};function Qe(s){return le(s)?s:(0,c.isRange)(s)?s.commonAncestorContainer:typeof s=="function"?Qe(s()):null}var Pr=50,Br=350,pe=class extends(0,c.DomEmitterMixin)(){editor;_balloonView=null;_showBalloonThrottled=Zt(()=>this._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){let e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){let e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(t,i,o)=>{this._updateLastFocusedEditableElement(),o?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,i,o)=>{this._updateLastFocusedEditableElement(),o&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){let e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){let e=this.editor,t=new T,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;let e=this._getNormalizedConfig(),t=e.side==="right"?Ar(this._lastFocusedEditableElement,e):Mr(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){let e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}let o=Array.from(e.ui.getEditableElementsNames()).map(r=>e.ui.getEditableElement(r));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}};function Ar(s,e){return Vo(s,e,(t,i)=>t.left+t.width-i.width-e.horizontalOffset)}function Mr(s,e){return Vo(s,e,t=>t.left+e.horizontalOffset)}function Vo(s,e,t){return(i,o)=>{let r=new c.Rect(s);if(r.width<Br||r.height<Pr)return null;let n;e.position==="inside"?n=r.bottom-o.height:n=r.bottom-o.height/2,n-=e.verticalOffset;let l=t(r,o),h=i.clone().moveTo(l,n).getIntersection(o.clone().moveTo(l,n)).getVisible();return!h||h.getArea()<o.getArea()?null:{top:n,left:l,name:`position_${e.position}-side_${e.side}`,config:{withArrow:!1}
1}}}var Lr="Powered by",ut=class extends pe{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){let e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;let i=e.config.get("licenseKey");if(i=="GPL")return!0;let o=(0,c.parseBase64EncodedObject)(i.split(".")[1]);return o?!o.whiteLabel:!0}_createBadgeContent(){return new ps(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=i==="inside"?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:t.label===void 0?Lr:t.label,verticalOffset:t.verticalOffset!==void 0?t.verticalOffset:o,horizontalOffset:t.horizontalOffset!==void 0?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}},ps=class extends f{constructor(e,t){super(e);let i=new C,o=this.bindTemplate;i.set({content:m.IconProjectLogo,isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?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(r=>r.preventDefault())}}]})}},me=class extends g{toggleSwitchView;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(){let e=new f;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}},ms=class extends Hs(g){},dt=class extends Hs(O){};function Hs(s){class e extends s{_fileInputView;constructor(...i){super(...i),this._fileInputView=new bs(this.locale),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)}}return e}var bs=class extends f{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);let 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?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}},gs=class extends f{buttonView;children;constructor(e,t){super(e);let 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(){let e=new g(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:m.IconDropdownArrow}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",i=>!i),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}};function Sr(s,e){let t=s.t,i={Black:t("Black"),"Dim grey":t("Dim grey"),Grey:t("Grey"),"Light grey":t("Light grey"),White:t("White"),Red:t("Red"),Orange:t("Orange"),Yellow:t("Yellow"),"Light green":t("Light green"),Green:t("Green"),Aquamarine:t("Aquamarine"),Turquoise:t("Turquoise"),"Light blue":t("Light blue"),Blue:t("Blue"),Purple:t("Purple")};return e.map(o=>{let r=i[o.label];return r&&r!=o.label&&(o.label=r),o}
1)}function Fr(s){return s.map(Co).filter(e=>!!e)}function Co(s){return typeof s=="string"?{model:s,label:s,hasBorder:!1,view:{name:"span",styles:{color:s}}}:{model:s.color,label:s.label||s.color,hasBorder:s.hasBorder===void 0?!1:s.hasBorder,view:{name:"span",styles:{color:`${s.color}`}}}}var be=class extends g{constructor(e){super(e);let t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=m.IconColorTileCheck,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",i=>c.env.isMediaForcedColors?null:i)},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%)"}},ge=class extends f{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);let i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||5;let o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new c.FocusTracker,this.keystrokes=new c.KeystrokeHandler,this.items.on("add",(r,n)=>{n.isOn=n.color===this.selectedColor}),i.forEach(r=>{let n=new be;n.set({color:r.color,label:r.label,tooltip:!0,hasBorder:r.options.hasBorder}),n.on("execute",()=>{this.fire("execute",{value:r.color,hasBorder:r.options.hasBorder,label:r.label})}),this.items.add(n)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(r,n,l)=>{for(let a of this.items)a.isOn=a.color===l})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(let 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),To({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}};function Gs(s,e){if(!s)return"";let t=Io(s);if(!t)return"";if(t.space===e)return s;if(!Nr(t))return"";let o=ts[t.space][e];if(!o)return"";let r=o(t.space==="hex"?t.hexValue:t.values);return Dr(r,e)}function Eo(s){if(!s)return"";let e=Io(s);return e?e.space==="hex"?e.hexValue:Gs(s,"hex"):"#000"}function Oo(s,e){customElements.get(s)===void 0&&customElements.define(s,e)}function Dr(s,e){switch(e){case"hex":return`#${s}`;case"rgb":return`rgb(${s[0]}, ${s[1]}, ${s[2]})`;case"hsl":return`hsl(${s[0]}, ${s[1]}%, ${s[2]}%)`;case"hwb":return`hwb(${s[0]}, ${s[1]}, ${s[2]})`;case"lab":return`lab(${s[0]}% ${s[1]} ${s[2]})`;case"lch":return`lch(${s[0]}% ${s[1]} ${s[2]})`;default:return""}}function Io(s){if(s.startsWith("#")){let t=es(s);return{space:"hex",values:t.values,hexValue:s,alpha:t.alpha}}let e=es(s);return e.space?e:null}function Nr(s){return Object.keys(ts).includes(s.space)}var we=class extends f{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);let i=`ck-labeled-field-view-${(0,c.uid)()}`,o=`ck-labeled-field-view-status-${(0,c.uid)()}`;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",(n,l)=>n||l);let r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",n=>!n),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){let t=new N(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){let t=new f(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",o=>!o)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}},_e=class extends f{focusTracker;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 c.FocusTracker,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);let t=this.bindTemplate;
1this.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((...i)=>{this.fire("input",...i),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=Wr(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}};function Wr(s){return!s.value}var ke=class extends _e{constructor(e){super(e),this.set("inputMode","text");let t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}},ft=class extends ke{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}},pt=class extends ke{constructor(e,{min:t,max:i,step:o}={}){super(e);let r=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:r.to("min"),max:r.to("max"),step:r.to("step")}})}},mt=class extends _e{_resizeObserver;_isUpdateAutoGrowHeightPending=!1;constructor(e){super(e);let t=(0,c.toUnit)("px");this.set("minRows",2),this.set("maxRows",5),this.set("_height",null),this.set("resize","none"),this._resizeObserver=null,this.on("change:minRows",this._validateMinMaxRows.bind(this)),this.on("change:maxRows",this._validateMinMaxRows.bind(this));let i=this.bindTemplate;this.template.tag="textarea",this.extendTemplate({attributes:{class:["ck-textarea"],style:{height:i.to("_height",o=>o?t(o):null),resize:i.to("resize")},rows:i.to("minRows")}})}render(){super.render();let e=!1;this.on("input",()=>{this._updateAutoGrowHeight(!0),this.fire("update")}),this.on("change:value",()=>{c.global.window.requestAnimationFrame(()=>{if(!(0,c.isVisible)(this.element)){this._isUpdateAutoGrowHeightPending=!0;return}this._updateAutoGrowHeight(),this.fire("update")})}),this._resizeObserver=new c.ResizeObserver(this.element,t=>{let i=!!t.contentRect.width&&!!t.contentRect.height;!e&&i&&this._isUpdateAutoGrowHeightPending&&c.global.window.requestAnimationFrame(()=>{this._updateAutoGrowHeight(),this.fire("update")}),e=i})}destroy(){this._resizeObserver&&this._resizeObserver.destroy()}reset(){super.reset(),this._updateAutoGrowHeight(),this.fire("update")}_updateAutoGrowHeight(e){let t=this.element;if(!t.offsetParent){this._isUpdateAutoGrowHeightPending=!0;return}this._isUpdateAutoGrowHeightPending=!1;let i=ro(t,"1"),o=ro(t,t.value),r=i.ownerDocument.defaultView.getComputedStyle(i),n=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),l=(0,c.getBorderWidths)(i),a=parseFloat(r.lineHeight),h=l.top+l.bottom,u=new c.Rect(i).height,p=Math.round((o.scrollHeight-n)/a),b=this.maxRows*a+n+h,_=p===1?u:this.minRows*a+n+h;this._height=Math.min(Math.max(Math.max(p,this.minRows)*a+n+h,_),b),e&&(t.scrollTop=t.scrollHeight),i.remove(),o.remove()}_validateMinMaxRows(){if(this.minRows>this.maxRows)throw new c.CKEditorError("ui-textarea-view-min-rows-greater-than-max-rows",{textareaView:this,minRows:this.minRows,maxRows:this.maxRows})}};function ro(s,e){let t=s.cloneNode();return t.style.position="absolute",t.style.top="-99999px",t.style.left="-99999px",t.style.height="auto",t.style.overflow="hidden",t.style.width=s.ownerDocument.defaultView.getComputedStyle(s).width,t.tabIndex=-1,t.rows=1,t.value=e,s.parentNode.insertBefore(t,s),t}var bt=class extends f{children;constructor(e){super(e);let 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",i=>`ck-dropdown__panel_${i}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(){if(this.children.length){let e=this.children.first;typeof e.focus=="function"?e.focus():(0,c.logWarning)("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){let e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}},gt=class s extends f{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);let 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 c.KeystrokeHandler,this.focusTracker=new c.FocusTracker,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",r=>!r)],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",(t,i,o)=>
1{if(o)if(this.panelPosition==="auto"){let r=s._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=r?r.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);let e=(t,i)=>{this.isOpen&&(this.isOpen=!1,i())};this.keystrokes.set("arrowdown",(t,i)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,i())}),this.keystrokes.set("arrowright",(t,i)=>{this.isOpen&&i()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){let{south:e,north:t,southEast:i,southWest:o,northEast:r,northWest:n,southMiddleEast:l,southMiddleWest:a,northMiddleEast:h,northMiddleWest:u}=s.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[i,o,l,a,e,r,n,h,u,t]:[o,i,a,l,e,n,r,u,h,t]}get _defaultPanelPositionName(){return this.locale.uiLanguageDirection==="rtl"?"sw":"se"}static 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-(t.width-e.width)*3/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-(t.width-e.width)*3/4,name:"nmw"})};static _getOptimalPosition=c.getOptimalPosition},wt=class extends g{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",t=>String(t))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new C;return e.content=m.IconDropdownArrow,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}},ye=class extends g{id;constructor(e,t,i){super(e),this.id=t,this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem",label:i}),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__item__button"]}})}},_t=class extends O{arrowView;constructor(e){super(e);let t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",i=>String(i)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new C;return e.content=m.IconDropdownArrow,e.extendTemplate({attributes:{class:"ck-dropdown-menu-list__nested-menu__button__arrow"}}),e}},v=class extends f{children;constructor(e){super(e);let 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",i=>!i)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}},ee=class extends f{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}},H=class extends f{labelView;items;children;constructor(e,t=new N){super(e);let i=this.bindTemplate,o=new G(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",r=>!r)]},children:this.children})}focus(){if(this.items){let e=this.items.find(t=>!(t instanceof ee));e&&e.focus()}}},G=class extends f{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);let t=this.bindTemplate;this.focusables=new V,this.items=this.createCollection(),this.focusTracker=new c.FocusTracker,this.keystrokes=new c.KeystrokeHandler,this._focusCycler=new E({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(let e of this.items)e instanceof H?this._registerFocusableItemsGroup(e):e instanceof v&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(let i of t.removed)i instanceof H?this._deregisterFocusableItemsGroup(i):i instanceof v&&this._deregisterFocusableListItem(i);for(let i of Array.from(t.added).reverse())i instanceof H?this._registerFocusableItemsGroup(i,t.index):this._registerFocusableListItem(i,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(let o of i.removed)this._deregisterFocusableListItem(o);for(let o of Array.from(i.added).reverse())this._registerFocusableListItem(o,this.items.getIndex(e)+i.index)}}
1_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((o,r)=>{let n=typeof t<"u"?t+r:void 0;this._registerFocusableListItem(o,n)});let i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(let t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}},xe=class extends G{constructor(e){super(e);let t=this.bindTemplate;this.role="menu",this.set("isVisible",!0),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list",t.if("isVisible","ck-hidden",i=>!i)]}})}};var qe=5,Po={eastSouth:s=>({top:s.top,left:s.right-qe,name:"es"}),eastNorth:(s,e)=>({top:s.top-e.height+s.height,left:s.right-qe,name:"en"}),westSouth:(s,e)=>({top:s.top,left:s.left-e.width+qe,name:"ws"}),westNorth:(s,e)=>({top:s.top-e.height+s.height,left:s.left-e.width+qe,name:"wn"})},Te=class extends v{childView;constructor(e,t,i){super(e);let o=this.bindTemplate;this.childView=i,this.children.add(i),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__item"]},on:{mouseenter:o.to("mouseenter")}}),t&&(this.delegate("mouseenter").to(t),i instanceof ye&&i.delegate("execute").to(t))}},ws={toggleMenusAndFocusItemsOnHover(s){s.on("menu:mouseenter",e=>{let[t]=e.path;e.source.focus();for(let i of s.menus){let o=t instanceof Te&&t.childView===i;i.isOpen=(e.path.includes(i)||o)&&i.isEnabled}})},closeMenuWhenAnotherOnTheSameLevelOpens(s){s.on("menu:change:isOpen",(e,t,i)=>{if(!i)return;let o=e.source;for(let r of s.menus)o.parentMenuView===r.parentMenuView&&o!==r&&(r.isOpen=!1)})}},W={openOnArrowRightKey(s){let e=s.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";s.keystrokes.set(e,(t,i)=>{s.focusTracker.focusedElement!==s.buttonView.element||!s.isEnabled||(s.isOpen||(s.isOpen=!0),s.panelView.focus(),i())})},openOnButtonClick(s){s.buttonView.on("execute",()=>{s.isEnabled&&(s.isOpen=!0)})},openAndFocusOnEnterKeyPress(s){s.keystrokes.set("enter",(e,t)=>{s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen=!0,s.panelView.focus(),t())})},closeOnArrowLeftKey(s){let e=s.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";s.keystrokes.set(e,(t,i)=>{s.isOpen&&(s.focus(),s.isOpen=!1,i())})},closeOnEscKey(s){s.keystrokes.set("esc",(e,t)=>{s.isOpen&&(s.focus(),s.isOpen=!1,t())})},closeOnParentClose(s,e){e.on("change:isOpen",(t,i,o)=>{!o&&t.source===e&&(s.isOpen=!1)})}},kt=class extends T{constructor(e){super(e);let t=this.bindTemplate;this.set({isVisible:!1,position:"se",class:null,top:0,left:0}),this.extendTemplate({tag:"div",attributes:{class:["ck-reset","ck-dropdown-menu__nested-menu__panel"],tabindex:"-1"},on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){let{content:t}=this;t.length&&(e===1?t.first.focus():t.last.focus())}},ve=class s extends f{static DELEGATED_EVENTS=["mouseenter","execute","change:isOpen"];id;buttonView;panelView;listView;focusTracker;keystrokes;_bodyCollection;constructor(e,t,i,o,r){super(e),this._bodyCollection=t,this.id=i,this.set({isOpen:!1,isEnabled:!0,panelPosition:"w",class:void 0,parentMenuView:null}),this.keystrokes=new c.KeystrokeHandler,this.focusTracker=new c.FocusTracker,this.buttonView=new _t(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.buttonView.label=o,this.panelView=new kt(e),this.panelView.isVisible=!0,this.listView=new xe(e),this.listView.bind("ariaLabel").to(this.buttonView,"label"),this.panelView.content.add(this.listView);let n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown-menu-list__nested-menu",n.to("class"),n.if("isEnabled","ck-disabled",l=>!l)],role:"presentation"},children:[this.buttonView]}),this.parentMenuView=r,this.parentMenuView&&this._handleParentMenuView(),this._attachBehaviors()}get _panelPositions(){let{westSouth:e,eastSouth:t,westNorth:i,eastNorth:o}=Po;return this.locale.uiLanguageDirection==="ltr"?[t,o,e,i]:[e,i,t,o]}render(){super.render(),this.panelView.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.focusTracker.add(this.listView),this.keystrokes.listenTo(this.element),this._mountPanelOnOpen()}destroy(){this._removePanelFromBody(),this.panelView.destroy(),super.destroy()}focus(){this.buttonView.focus()}_handleParentMenuView(){this.delegate(...s.DELEGATED_EVENTS).to(this.parentMenuView),W.closeOnParentClose(this,this.parentMenuView)}_attachBehaviors(){W.openOnButtonClick(this),W.openAndFocusOnEnterKeyPress(this),W.openOnArrowRightKey(this),W.closeOnEscKey(this),W.closeOnArrowLeftKey(this)}_mountPanelOnOpen(){let{panelView:e}=this;this.on("change:isOpen",(t,i,o)=>
1{if(t.source===this){if(!o&&this._bodyCollection.has(e)){this._removePanelFromBody();return}o&&!this._bodyCollection.has(e)&&this._addPanelToBody()}})}_removePanelFromBody(){let{panelView:e,keystrokes:t}=this;this._bodyCollection.has(e)&&(this._bodyCollection.remove(e),t.stopListening(e.element))}_addPanelToBody(){let{panelView:e,buttonView:t,keystrokes:i}=this;this._bodyCollection.has(e)||(this._bodyCollection.add(e),i.listenTo(e.element),e.pin({positions:this._panelPositions,limiter:c.global.document.body,element:e.element,target:t.element,fitInViewport:!0}))}},yt=class extends xe{_definition;_cachedMenus=[];_cachedButtons=[];_bodyCollection;constructor(e,t,i){super(e),this._bodyCollection=t,this._definition=i,this.set("menuPanelClass",void 0)}get menus(){return Array.from(this._cachedMenus.values())}get buttons(){return Array.from(this._cachedButtons.values())}render(){this._createStructure(this._definition,null),super.render(),ws.toggleMenusAndFocusItemsOnHover(this),ws.closeMenuWhenAnotherOnTheSameLevelOpens(this)}closeMenus(){this.menus.forEach(e=>{e.isOpen=!1})}_createStructure(e,t){let i=[];for(let r of e){let n;"menu"in r?(n=new ve(this.locale,this._bodyCollection,r.id,r.menu,t),n.panelView.bind("class").to(this,"menuPanelClass"),t||n.delegate(...ve.DELEGATED_EVENTS).to(this,a=>`menu:${a}`),this._cachedMenus.push(n),this._createStructure(r.children,n)):(n=new ye(this.locale,r.id,r.label),t||n.delegate("execute").to(this,"menu:execute"),this._cachedButtons.push(n));let l=new Te(this.locale,t,n);t||l.delegate("mouseenter").to(this,"menu:mouseenter"),i.push(l)}(t?t.listView:this).items.addMany(i)}},Ve=class extends f{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}},xt=class extends f{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}};function Bo(s){return s.bindTemplate.to(e=>{e.target===s.element&&e.preventDefault()})}function Xt(s){if(Array.isArray(s))return{items:s,removeItems:[]};let e={items:[],removeItems:[]};return s?{...e,...s}:e}var Tt={alignLeft:m.IconAlignLeft,bold:m.IconBold,importExport:m.IconImportExport,paragraph:m.IconParagraph,plus:m.IconPlus,text:m.IconText,threeVerticalDots:m.IconThreeVerticalDots,pilcrow:m.IconPilcrow,dragIndicator:m.IconDragIndicator},te=class extends f{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);let i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new c.FocusTracker,this.keystrokes=new c.KeystrokeHandler,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new vt(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();let r=e.uiLanguageDirection==="rtl";this._focusCycler=new E({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});let n=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&n.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:n,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:Bo(this)}}),this._behavior=this.options.shouldGroupWhenFull?new Ct(this):new Vt(this)}render(){super.render(),this.focusTracker.add(this.element);for(let e of this.items)this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),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))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new Ct(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new Vt(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){let o=Xt(e),r=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,r).map(l=>z(l)?this._createNestedToolbarDropdown(l,t,r):l==="|"?new Ve:l==="-"?new xt:t.create(l)).filter(l=>!!l)}_cleanItemsConfiguration(e,t,i){let o=e.filter((r,n,l)=>r==="|"?!0:i.indexOf(r)!==-1?!1:r==="-"?this.options.shouldGroupWhenFull?((0,c.logWarning)("toolbarview-line-break-ignored-when-grouping-items",l),!1):!0:!z(r)&&!t.has(r)?((0,c.logWarning)("toolbarview-item-unavailable",{item:r}),!1):!0);return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){let t=n=>n!=="-"&&n!=="|",i=e.length,o=e.findIndex(t);if(o===-1)return[];let r=i-e.slice().reverse().findIndex(t);return e.slice(o,r).filter((n,l,a)=>t(n)?!0:!(l>0&&a[l-1]===n))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:r,items:n,tooltip:l=!0,withText:a=!1}=e;if(n=this._cleanItemsConfiguration(n,t,i),!n.length)return null;let h=this.locale,u=Yt(h);return o||(0,c.logWarning)("toolbarview-nested-toolbar-dropdown-missing-label",e),u.class="ck-toolbar__nested-toolbar-dropdown",u.buttonView.set({label:o,tooltip:l,withText:!!a}),r!==!1?u.buttonView.icon=Tt[r]||r||m.IconThreeVerticalDots:u.buttonView.withText=!0,zs(u,()=>u.toolbarView._buildItemsFromConfig(n,t,i)),u}},vt=class extends f{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}},Vt=class{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(t=>t),e.focusables.bindTo(e.items).using(t=>se(t)?t:null)}render(){}destroy(){}},Ct=class{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(t,i)=>{let o=i.index,r=Array.from(i.added);for(let n of i.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(n):this.ungroupedItems.remove(n);for(let n=o;n<o+r.length;n++){let l=r[n-o];n>this.ungroupedItems.length?this.groupedItems.add(l,n-this.ungroupedItems.length):this.ungroupedItems.add(l,n)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){let e=this.view;if(e.items.length){for(let t=0;t<e.items.length;t++){let i=[...e.items][t];this.ungroupedItems.add(i,t)}this._updateGrouping()}}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!(0,c.isVisible)(this.viewElement)){this.shouldUpdateGroupingOnNextResize=!0;return}let e=this.groupedItems.length,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;let e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new c.Rect(e.lastChild),o=new c.Rect(e);
1if(!this.cachedPadding){let r=c.global.window.getComputedStyle(e),n=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[n])}return t==="ltr"?i.right>o.right-this.cachedPadding:i.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new c.ResizeObserver(this.viewElement,t=>{(!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 Ve),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(){let e=this.viewLocale,t=e.t,i=Yt(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",zs(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:m.IconThreeVerticalDots}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{se(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}},Et=class extends f{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);let 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 c.KeystrokeHandler,this.focusTracker=new c.FocusTracker,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",o=>!o),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){let t=e||new g;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(){let e=new g,t=e.bindTemplate;return e.icon=m.IconDropdownArrow,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}};function Yt(s,e=wt){let t=typeof e=="function"?new e(s):e,i=new bt(s),o=new gt(s,t,i);return t.bind("isEnabled").to(o),t instanceof Et?t.arrowView.bind("isOn").to(o,"isOpen"):t.bind("isOn").to(o,"isOpen"),Gr(o),o}function Rr(s,e,t,i={}){s.menuView=new yt(s.locale,e,t),s.focusTracker.add(s.menuView),s.isOpen?no(s,i):s.once("change:isOpen",()=>{no(s,i)},{priority:"highest"})}function no(s,e){let t=s.menuView,i=s.locale.t;t.delegate("menu:execute").to(s,"execute"),t.listenTo(s,"change:isOpen",(o,r,n)=>{n||t.closeMenus()},{priority:"low"}),s.panelView.children.add(t);for(let o of t.menus)s.focusTracker.add(o);t.ariaLabel=e.ariaLabel||i("Dropdown menu")}function zs(s,e,t={}){s.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),s.isOpen?lo(s,e,t):s.once("change:isOpen",()=>lo(s,e,t),{priority:"highest"}),t.enableActiveItemFocusOnDropdownOpen&&$s(s,()=>s.toolbarView.items.find(i=>i.isOn))}function lo(s,e,t){let i=s.locale,o=i.t,r=s.toolbarView=new te(i),n=typeof e=="function"?e():e;r.ariaLabel=t.ariaLabel||o("Dropdown toolbar"),t.maxWidth&&(r.maxWidth=t.maxWidth),t.class&&(r.class=t.class),t.isCompact&&(r.isCompact=t.isCompact),t.isVertical&&(r.isVertical=!0),n instanceof V?r.items.bindTo(n).using(l=>l):r.items.addMany(n),s.panelView.children.add(r),s.focusTracker.add(r),r.items.delegate("execute").to(s)}function Hr(s,e,t={}){s.isOpen?ao(s,e,t):s.once("change:isOpen",()=>ao(s,e,t),{priority:"highest"}),$s(s,()=>s.listView.items.find(i=>i instanceof v?i.children.first.isOn:!1))}function ao(s,e,t){let i=s.locale,o=s.listView=new G(i),r=typeof e=="function"?e():e;o.ariaLabel=t.ariaLabel,o.role=t.role,Mo(s,o.items,r,i),s.panelView.children.add(o),o.items.delegate("execute").to(s)}function $s(s,e){s.on("change:isOpen",()=>{if(!s.isOpen)return;let t=e();t&&(typeof t.focus=="function"?t.focus():(0,c.logWarning)("ui-dropdown-focus-child-on-open-child-missing-focus",{view:t}))},{priority:c.priorities.low-10})}function Gr(s){zr(s),$r(s),jr(s),Ur(s),qr(s),Kr(s)}function zr(s){Kt({emitter:s,activator:()=>s.isRendered&&s.isOpen,callback:()=>{s.isOpen=!1},contextElements:()=>[s.element,...Ao(s.focusTracker).filter(e=>!s.element.contains(e))]})}function Ao(s){return[...s.elements,...s.externalViews.flatMap(e=>Ao(e.focusTracker))]}function $r(s){s.on("execute",e=>{e.source instanceof me||(s.isOpen=!1)})}function jr(s){s.focusTracker.on("change:isFocused",(e,t,i)=>{i||!s.isOpen||(s.isOpen=!1)})}function Ur(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isOpen&&(s.panelView.focus(),t())}),s.keystrokes.set("arrowup",(e,t)=>{s.isOpen&&(s.panelView.focusLast(),t())})}function qr(s){s.on("change:isOpen",(e,t,i)=>{if(i)return;s.focusTracker.elements.some(r=>r.contains(c.global.document.activeElement))&&s.buttonView.focus()})}function Kr(s){s.on("change:isOpen",(e,t,i)=>{i&&s.panelView.focus()},{priority:"low"})}function Mo(s,e,t,i){Xr(e),e.bindTo(t).using(o=>{if(o.type==="separator")return new ee(i);if(o.type==="group"){let r=new H(i);return r.set({label:o.label}),Mo(s,r.items,o.items,i),r.items.delegate("execute").to(s),r}else if(o.type==="button"||o.type==="switchbutton"){let r=o.model.role==="menuitemcheckbox"||o.model.role==="menuitemradio",n=new v(i),l;return o.type==="button"?(l=new O(i),l.set({isToggleable:r})):l=new me(i),l.bind(...Object.keys(o.model)).to(o.model),l.delegate("execute").to(n),n.children.add(l),n}return null})}function Xr(s){let e=0,t=r=>!(r instanceof v)||!(r.children.first instanceof O)?null:r.children.first,
1i=r=>{let n=t(r);return!n||!n.isToggleable?null:n},o=r=>{for(let n of s){let l=t(n);l&&(l.hasCheckSpace=r)}};s.on("change",(r,n)=>{let l=e>0;for(let h of n.removed)i(h)&&e--;for(let h of n.added){let u=t(h);u&&(u.isToggleable&&e++,u.hasCheckSpace=e>0)}let a=e>0;l!==a&&o(a)})}var js=(s,e,t)=>{let i=new ft(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},Yr=(s,e,t)=>{let i=new pt(s.locale);return i.set({id:e,ariaDescribedById:t,inputMode:"numeric"}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},Qr=(s,e,t)=>{let i=new mt(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},Zr=(s,e,t)=>{let i=Yt(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isEnabled").to(s),i},Jr=150,Ot=class extends f{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();let 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=S(o=>{this.set("color",o),this.fire("colorSelected",{color:this.color})},Jr,{leading:!0}),this.on("set:color",(o,r,n)=>{o.return=Gs(n,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=ls(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),ls(this.color)!=ls(this._hexColor)&&(this.color=this._hexColor)})}render(){if(super.render(),Oo("hex-color-picker",Ue),this.picker=c.global.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);let 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=>{let t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){!this._config.hideInput&&(c.env.isGecko||c.env.isiOS||c.env.isSafari||c.env.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){let i=[...this.picker.shadowRoot.children].filter(o=>o.getAttribute("role")==="slider").map(o=>new It(o));this.slidersView=this.createCollection(),i.forEach(o=>{this.slidersView.add(o)})}_createInputRow(){let e=this._createColorInput();return new Pt(this.locale,e)}_createColorInput(){let e=new we(this.locale,js),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",i=>e.isFocused?e.fieldView.value:i.startsWith("#")?i.substring(1):i),e.fieldView.on("input",()=>{let i=e.fieldView.element.value;if(i){let o=Us(i);o&&this._debounceColorPickerEvent(o)}}),e}isValid(){let{t:e}=this.locale;return this._config.hideInput?!0:(this.resetValidationStatus(),this.hexInputRow.getParsedColor()?!0:(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}};function ls(s){let e=Eo(s);return e||(e="#000"),e.length===4&&(e="#"+[e[1],e[1],e[2],e[2],e[3],e[3]].join("")),e.toLowerCase()}var It=class extends f{constructor(e){super(),this.element=e}focus(){this.element.focus()}},_s=class extends f{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}},Pt=class extends f{children;
1inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new _s,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return Us(this.inputView.fieldView.element.value)}};function Us(s){if(!s)return null;let e=s.trim().replace(/^#/,"");return![3,4,6,8].includes(e.length)||!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(e)?null:`#${e}`}var Bt=class extends(0,c.ObservableMixin)(c.Collection){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){return this.find(i=>i.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}},At=class extends f{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,focusTracker:a,focusables:h}){super(e);let u=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new Bt,this.documentColorsCount=n,this._focusables=h,this._removeButtonLabel=o,this._colorPickerLabel=l,this._documentColorsLabel=r,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",u.if("isVisible","ck-hidden",p=>!p)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){let i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(let r of i.getRoots()){let n=e.createRangeIn(r);for(let l of n.getItems())if(l.is("$textProxy")&&l.hasAttribute(t)&&(this._addColorToDocumentColors(l.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){let 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){let e=k.bind(this.documentColors,this.documentColors),t=new f(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),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 g,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:m.IconColorPalette,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){let e=new g;return e.set({withText:!0,icon:m.IconEraser,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){let e=new ge(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(t,i)=>{this.fire("execute",{value:i.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){let e=k.bind(this.documentColors,this.documentColors),t=new ge(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(i=>{let o=new be;return o.set({color:i.color,hasBorder:i.options?.hasBorder}),i.label&&o.set({label:i.label,tooltip:!0}),o.on("execute",()=>{this.fire("execute",{value:i.color,source:"documentColorsGrid"})}),o}),this.documentColors.on("change:isEmpty",(i,o,r)=>{r&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){let t=this.colorDefinitions.find(i=>i.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}},Mt=class extends f{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:r}){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=r;let n=this.bindTemplate,{saveButtonView:l,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=l,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:l,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",n.if("isVisible","ck-hidden",h=>!h)]},children:this.items})}render(){super.render();let e=new Ot(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(){let e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(let t of this.colorPickerView.slidersView)this.focusTracker.add(t.element),this._focusables.add(t);let 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}){let i=new f,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(){let e=this.locale,t=e.t,i=new g(e),o=new g(e);return i.set({icon:m.IconCheck,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:m.IconCancel,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)})}},ks=class extends f{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new c.FocusTracker,this.keystrokes=new c.KeystrokeHandler,this._focusables=new V,this._colorPickerViewConfig=a,this._focusCycler=new E({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new At(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new Mt(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",(h,u,p)=>{this.colorGridsFragmentView.set("selectedColor",p),this.colorPickerFragmentView.set("selectedColor",p)}),this.colorGridsFragmentView.on("change:selectedColor",(h,u,p)=>{this.set("selectedColor",p)}),this.colorPickerFragmentView.on("change:selectedColor",(h,u,p)=>{this.set("selectedColor",p)}),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(){this.items.length!==2&&(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))}},Lt=class{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(let e of this._components.values())yield e.originalName}add(e,t){this._components.set(as(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new c.CKEditorError("componentfactory-item-missing",this,{name:e});return this._components.get(as(e)).callback(this.editor.locale)}has(e){return this._components.has(as(e))}};function as(s){return String(s).toLowerCase()}var co="ck-tooltip",St=class s extends(0,c.DomEmitterMixin)(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=T.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),s._editors.add(e),s._instance)return s._instance;s._instance=this,this.tooltipTextView=new f(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 T(e.locale),this.balloonPanelView.class=co,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=en(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=S(this._pinTooltip,600),this._unpinTooltipDebounced=S(this._unpinTooltip,400),this.listenTo(c.global.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(c.global.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(c.global.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(c.global.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(c.global.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(c.global.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){let t=e.ui.view&&e.ui.view.body;s._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),s._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),s._instance=null)}static getPositioningFunctions(e){let t=s.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]}
1_onKeyDown(e,t){t.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){let i=cs(t);if(!i){e.name==="focus"&&this._unpinTooltip();return}if(i===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),e.name==="focus"&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,hs(i)):this._pinTooltipDebounced(i,hs(i))}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if(e.name==="mouseleave"){if(!le(t))return;let o=this.balloonPanelView.element,r=o&&(o===i||o.contains(i)),n=!r&&t===o;if(r){this._unpinTooltipDebounced.cancel();return}if(!n&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;let l=cs(t),a=cs(i);(n||l&&l!==a)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||l&&l.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),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();let r=(0,c.first)(s._editors.values()).ui.view.body;r.has(this.balloonPanelView)||r.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[co,o].filter(n=>n).join(" "),this.balloonPanelView.pin({target:e,positions:s.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(let n of s._editors)this.listenTo(n.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(let e of s._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;let e=hs(this._currentElementWithTooltip);if(!(0,c.isVisible)(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:s.getPositioningFunctions(e.position)})}};function cs(s){return le(s)?s.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function hs(s){return{text:s.dataset.ckeTooltipText,position:s.dataset.ckeTooltipPosition||"s",cssClass:s.dataset.ckeTooltipClass||""}}function en(s){let e=new MutationObserver(()=>{s()});return{attach(t){e.observe(t,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}var Ft=class extends pe{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){let t=this.editor.config.get("licenseKey"),i=ho(t);return!!(i&&this.licenseTypeMessage[i])}_createBadgeContent(){let e=this.editor.config.get("licenseKey"),t=ho(e);return new ys(this.editor.locale,this.licenseTypeMessage[t])}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=t.side||e.side;return{position:i,side:o==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}},ys=class extends f{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}};function ho(s){if(s=="GPL")return"GPL";let e=(0,c.parseBase64EncodedObject)(s.split(".")[1]);return e?e.licenseType||"production":null}var Ce=class extends v{constructor(e,t){super(e);let i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}},Ke=5,R={toggleMenusAndFocusItemsOnHover(s){s.on("menu:mouseenter",e=>{if(!(!s.isFocusBorderEnabled&&!s.isOpen)){if(s.isOpen)for(let t of s.menus){let i=e.path[0],o=i instanceof Ce&&i.children.first===t;t.isOpen=(e.path.includes(t)||o)&&t.isEnabled}
1e.source.focus()}})},focusCycleMenusOnArrows(s){let e=s.locale.uiLanguageDirection==="rtl";s.on("menu:arrowright",i=>{t(i.source,e?-1:1)}),s.on("menu:arrowleft",i=>{t(i.source,e?1:-1)});function t(i,o){let r=s.children.getIndex(i),n=i.isOpen,l=s.children.length,a=s.children.get((r+l+o)%l);i.isOpen=!1,n&&(a.isOpen=!0),a.buttonView.focus()}},closeMenusWhenTheBarCloses(s){s.on("change:isOpen",()=>{s.isOpen||s.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(s){s.on("menu:change:isOpen",(e,t,i)=>{i&&s.menus.filter(o=>e.source.parentMenuView===o.parentMenuView&&e.source!==o&&o.isOpen).forEach(o=>{o.isOpen=!1})})},closeOnClickOutside(s){Kt({emitter:s,activator:()=>s.isOpen,callback:()=>s.close(),contextElements:()=>s.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(s){let e=!1;s.on("change:isOpen",(t,i,o)=>{o||(e||(s.isFocusBorderEnabled=!1),e=!1)}),s.listenTo(s.element,"keydown",()=>{e=!0},{useCapture:!0}),s.listenTo(s.element,"keyup",()=>{e=!1},{useCapture:!0}),s.listenTo(s.element,"focus",()=>{e&&(s.isFocusBorderEnabled=!0)},{useCapture:!0})}},A={openAndFocusPanelOnArrowDownKey(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isEnabled&&s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen||(s.isOpen=!0),s.panelView.focus(),t())})},openOnArrowRightKey(s){let e=s.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";s.keystrokes.set(e,(t,i)=>{s.focusTracker.focusedElement!==s.buttonView.element||!s.isEnabled||(s.isOpen||(s.isOpen=!0),s.panelView.focus(),i())})},openOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!0})},toggleOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!s.isOpen})},openAndFocusOnEnterKeyPress(s){s.keystrokes.set("enter",(e,t)=>{s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen=!0,s.panelView.focus(),t())})},closeOnArrowLeftKey(s){let e=s.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";s.keystrokes.set(e,(t,i)=>{s.isOpen&&(s.isOpen=!1,s.focus(),i())})},closeOnEscKey(s){s.keystrokes.set("esc",(e,t)=>{s.isOpen&&(s.isOpen=!1,s.focus(),t())})},closeOnParentClose(s){s.parentMenuView.on("change:isOpen",(e,t,i)=>{!i&&e.source===s.parentMenuView&&(s.isOpen=!1)})}},Lo={southEast:s=>({top:s.bottom,left:s.left,name:"se"}),southWest:(s,e)=>({top:s.bottom,left:s.left-e.width+s.width,name:"sw"}),northEast:(s,e)=>({top:s.top-e.height,left:s.left,name:"ne"}),northWest:(s,e)=>({top:s.top-e.height,left:s.left-e.width+s.width,name:"nw"}),eastSouth:s=>({top:s.top,left:s.right-Ke,name:"es"}),eastNorth:(s,e)=>({top:s.top-e.height,left:s.right-Ke,name:"en"}),westSouth:(s,e)=>({top:s.top,left:s.left-e.width+Ke,name:"ws"}),westNorth:(s,e)=>({top:s.top-e.height,left:s.left-e.width+Ke,name:"wn"})},So=[{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:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]}
1,{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException"]}]},{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:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","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 Fo(s){let e;return!("items"in s)||!s.items?e={items:re(So),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...s}:e={items:s.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...s},e}function Do({normalizedConfig:s,locale:e,componentFactory:t,extraItems:i}){let o=re(s);return uo(s,o,i),tn(s,o),uo(s,o,o.addItems),sn(s,o,t),No(s,o),on(o,e),o}function tn(s,e){let t=e.removeItems,i=[];e.items=e.items.filter(({menuId:o})=>t.includes(o)?(i.push(o),!1):!0),ie(e.items,o=>{o.groups=o.groups.filter(({groupId:r})=>t.includes(r)?(i.push(r),!1):!0);for(let r of o.groups)r.items=r.items.filter(n=>{let l=Wo(n);return t.includes(l)?(i.push(l),!1):!0})});for(let o of t)i.includes(o)||(0,c.logWarning)("menu-bar-item-could-not-be-removed",{menuBarConfig:s,itemName:o})}function uo(s,e,t){let i=[];if(t.length!=0){for(let o of t){let r=ln(o.position),n=an(o.position);if(rn(o))if(!n)r==="start"?(e.items.unshift(o.menu),i.push(o)):r==="end"&&(e.items.push(o.menu),i.push(o));else{let l=e.items.findIndex(a=>a.menuId===n);l!=-1?r==="before"?(e.items.splice(l,0,o.menu),i.push(o)):r==="after"&&(e.items.splice(l+1,0,o.menu),i.push(o)):fo(e,o.menu,n,r)&&i.push(o)}else nn(o)?ie(e.items,l=>{if(l.menuId===n)r==="start"?(l.groups.unshift(o.group),i.push(o)):r==="end"&&(l.groups.push(o.group),i.push(o));else{let a=l.groups.findIndex(h=>h.groupId===n);a!==-1&&(r==="before"?(l.groups.splice(a,0,o.group),i.push(o)):r==="after"&&(l.groups.splice(a+1,0,o.group),i.push(o)))}}):fo(e,o.item,n,r)&&i.push(o)}for(let o of t)i.includes(o)||(0,c.logWarning)("menu-bar-item-could-not-be-added",{menuBarConfig:s,addedItemConfig:o})}}function fo(s,e,t,i){let o=!1;return ie(s.items,r=>{for(let{groupId:n,items:l}of r.groups){if(o)return;if(n===t)i==="start"?(l.unshift(e),o=!0):i==="end"&&(l.push(e),o=!0);else{let a=l.findIndex(h=>Wo(h)===t);a!==-1&&(i==="before"?(l.splice(a,0,e),o=!0):i==="after"&&(l.splice(a+1,0,e),o=!0))}}}),o}function sn(s,e,t){ie(e.items,i=>{for(let o of i.groups)o.items=o.items.filter(r=>{let n=typeof r=="string"&&!t.has(r);return n&&!e.isUsingDefaultConfig&&(0,c.logWarning)("menu-bar-item-unavailable",{menuBarConfig:s,parentMenuConfig:re(i),componentName:r}),!n})})}function No(s,e){let t=e.isUsingDefaultConfig,i=!1;if(e.items=e.items.filter(o=>o.groups.length?!0:(us(s,o,t),!1)),!e.items.length){us(s,s,t);return}ie(e.items,o=>{o.groups=o.groups.filter(r=>r.items.length?!0:(i=!0,!1));for(let r of o.groups)r.items=r.items.filter(n=>Ro(n)&&!n.groups.length?(us(s,n,t),i=!0,!1):!0)}),i&&No(s,e)}function us(s,e,t){t||(0,c.logWarning)("menu-bar-menu-empty",{menuBarConfig:s,emptyMenuConfig:e})}function on(s,e){let t=e.t,i={File:t({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:t({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:t({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:t({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:t({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:t({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:t({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:t({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:t({string:"Font",id:"MENU_BAR_MENU_FONT"})};ie(s.items,o=>{o.label in i&&(o.label=i[o.label])})}function ie(s,e){if(Array.isArray(s))for(let i of s)t(i);function t(i){e(i);for(let o of i.groups)for(let r of o.items)Ro(r)&&t(r)}}function rn(s){return typeof s=="object"&&"menu"in s}function nn(s){return typeof s=="object"&&"group"in s}function ln(s){return s.startsWith("start")?"start":s.startsWith("end")?"end":s.startsWith("after")?"after":"before"}function an(s){let e=s.match(/^[^:]+:(.+)/);return e?e[1]:null}function Wo(s){return typeof s=="string"?s:s.menuId}function Ro(s){return typeof s=="object"&&"menuId"in s}var xs=class extends(0,c.ObservableMixin)(){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();let t=e.editing.view;this.editor=e,this.componentFactory=new Lt(e),this.focusTracker=new c.FocusTracker,this.tooltipManager=new St(e),this.poweredBy=new ut(e),this.evaluationBadge=new Ft(e),this.ariaLiveAnnouncer=new et(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}
1get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(let e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);let i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){let 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),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){let t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);let i=Fo(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(o,r)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),r())}),this.editor.keystrokes.set("Alt+F9",(o,r)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),r())})}_readViewportOffsetFromConfig(){let e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;let 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(){let e=this.editor,t;e.keystrokes.set("Alt+F10",(i,o)=>{this._saveLastFocusedForeignElement();let r=this._getCurrentFocusedToolbarDefinition();(!r||!t)&&(t=this._getFocusableCandidateToolbarDefinitions());for(let n=0;n<t.length;n++){let l=t.shift();if(t.push(l),l!==r&&this._focusFocusableCandidateToolbar(l)){r&&r.options.afterBlur&&r.options.afterBlur();break}}o()}),e.keystrokes.set("Esc",(i,o)=>{let r=this._getCurrentFocusedToolbarDefinition();r&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),r.options.afterBlur&&r.options.afterBlur(),o())})}_saveLastFocusedForeignElement(){let e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){let e=[];for(let t of this._focusableToolbarDefinitions){let{toolbarView:i,options:o}=t;((0,c.isVisible)(i.element)||o.beforeFocus)&&e.push(t)}return e.sort((t,i)=>po(t)-po(i)),e}_getCurrentFocusedToolbarDefinition(){for(let e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){let{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),(0,c.isVisible)(t.element)?(t.focus(),!0):!1}_handleScrollToTheSelection(e,t){let 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}_bindBodyCollectionWithFocusTracker(){let e=this.view.body;for(let t of e)this.focusTracker.add(t.element);e.on("add",(t,i)=>{this.focusTracker.add(i.element)}),e.on("remove",(t,i)=>{this.focusTracker.remove(i.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(t,i,o)=>{let r=this._getVisualViewportTopOffset(o);o.visualTop!==r&&(t.return={...o,visualTop:r})}),this.set("viewportOffset",e)}
1_initVisualViewportSupport(){if(!c.global.window.visualViewport)return;let e=()=>{let t=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==t&&(this.viewportOffset={...this.viewportOffset,visualTop:t})};this._domEmitter=new((0,c.DomEmitterMixin)()),this._domEmitter.listenTo(c.global.window.visualViewport,"scroll",e),this._domEmitter.listenTo(c.global.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){let t=(0,c.getVisualViewportOffset)().top,i=e.top||0;return t>i?0:i-t}};function po(s){let{toolbarView:e,options:t}=s,i=10;return(0,c.isVisible)(e.element)&&i--,t.isContextual&&(i-=2),i}var Dt=class extends f{body;menuBarView;toolbar;constructor(e){super(e),this.body=new ht(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}},Ts=class extends Dt{top;main;_voiceLabelView;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(){let e=this.t,t=new N;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}},Nt=class extends f{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),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(){let e=this._editingView;e.isRenderingInProgress?i(this):t(this);function t(o){e.change(r=>{let n=e.document.getRoot(o.name);r.addClass(o.isFocused?"ck-focused":"ck-blurred",n),r.removeClass(o.isFocused?"ck-blurred":"ck-focused",n)})}function i(o){e.once("change:isRenderingInProgress",(r,n,l)=>{l?i(o):t(o)})}}},vs=class extends Nt{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();let e=this._editingView;e.change(t=>{let i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){let e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if(typeof t=="string")return t;if(typeof t=="object")return t[o];if(typeof t=="function")return t(this);if(i){let r=i.getAttribute("aria-label");if(r)return r}return e("Rich Text Editor. Editing area: %0",o)}},Vs=class extends f{children;constructor(e,t={}){super(e);let i=this.bindTemplate;this.set("class",["ck","ck-form__row",...(0,c.toArray)(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach(o=>this.children.add(o)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",o=>o.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}},Cs=class extends f{constructor(e){super(e);let t=this.bindTemplate;this.setTemplate({tag:"iframe",attributes:{class:["ck","ck-reset_all"],sandbox:"allow-same-origin allow-scripts"},on:{load:t.to("loaded")}})}render(){return new Promise(e=>(this.on("loaded",e),super.render()))}},Es=class extends f{labelView;
1inputView;statusView;constructor(e,t){super(e);let i=`ck-input-${(0,c.uid)()}`,o=`ck-status-${(0,c.uid)()}`;this.set("label",void 0),this.set("value",void 0),this.set("isReadOnly",!1),this.set("errorText",null),this.set("infoText",null),this.labelView=this._createLabelView(i),this.inputView=this._createInputView(t,i,o),this.statusView=this._createStatusView(o),this.bind("_statusText").to(this,"errorText",this,"infoText",(n,l)=>n||l);let r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",r.if("isReadOnly","ck-disabled")]},children:[this.labelView,this.inputView,this.statusView]})}_createLabelView(e){let t=new N(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createInputView(e,t,i){let o=new e(this.locale,i);return o.id=t,o.ariaDescribedById=i,o.bind("value").to(this),o.bind("isReadOnly").to(this),o.bind("hasError").to(this,"errorText",r=>!!r),o.on("input",()=>{this.errorText=null}),o}_createStatusView(e){let t=new f(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__status",i.if("errorText","ck-labeled-input__status_error"),i.if("_statusText","ck-hidden",o=>!o)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}select(){this.inputView.select()}focus(){this.inputView.focus()}};function cn(s,e){let t=0,i=0;for(let o of e){let r=o,n=r.items,l=s&&!!r.label.match(s);r.labelView.highlightText(l?s:null);for(let h of n){let u=h.children.first,p=u.labelView;if(!s)h.isVisible=!0,p.highlightText(null);else{let b=!!u.label.match(s);p.highlightText(b?s:null),h.isVisible=l||b}}let a=n.filter(h=>h.isVisible).length;t+=r.items.length,i+=l?r.items.length:a,r.isVisible=l||!!a}return{resultsCount:i,totalItemsCount:t}}var Os=class extends y.ContextPlugin{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}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){let t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}},Is=class extends(0,c.ObservableMixin)(){constructor(e,t){super(),t&&De(this,t),e&&this.set(e)}},Xe=(0,c.toUnit)("px"),Ee=class extends y.Plugin{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{let t=this.editor.editing.view,o=t.document.selection.editableElement;return o?t.domConverter.mapViewToDom(o.root):null},this.decorate("getPositionOptions"),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 c.CKEditorError("contextualballoon-add-view-exist",[this,e]);let t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(t);return}let 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 c.CKEditorError("contextualballoon-remove-view-not-exist",[this,e]);let t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(t.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),t.size===1?(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.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){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,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;let t=this._idToStack.get(e);if(!t)throw new c.CKEditorError("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new T(this.editor.locale),this.editor.ui.view.body.add(this._view),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(i=>i[1]===e)[0]}_showNextStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){let e=new Wt(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(i,o)=>!o&&i>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(i,o)=>
1{if(o<2)return"";let r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[r,o])}),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(){let e=new Ps(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,i)=>!i&&t>=2?Math.min(t-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.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}},Wt=class extends f{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new c.FocusTracker,this.buttonPrevView=this._createButtonView(t("Previous"),m.IconPreviousArrow),this.buttonNextView=this._createButtonView(t("Next"),m.IconNextArrow),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",o=>o?"":"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){let i=new g(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}},Ps=class extends f{content;_balloonPanelView;constructor(e,t){super(e);let 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",o=>o?"":"ck-hidden")],style:{top:i.to("top",Xe),left:i.to("left",Xe),width:i.to("width",Xe),height:i.to("height",Xe)}},children:this.content}),this.on("change:numberOfPanels",(o,r,n,l)=>{n>l?this._addPanels(n-l):this._removePanels(l-n),this.updatePosition()})}_addPanels(e){for(;e--;){let t=new f;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){let t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){let{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new c.Rect(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}},Q=(0,c.toUnit)("px"),Bs=class extends f{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);let 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 k({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",i=>i?"block":"none"),height:t.to("isSticky",i=>i?Q(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new k({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",i=>i?Q(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",i=>i&&Q(i)),bottom:t.to("_stickyBottomOffset",i=>i&&Q(i)),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]}
1)}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(c.global.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),c.global.window.visualViewport&&(this.listenTo(c.global.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(c.global.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}let e=new c.Rect(this.limiterElement),t=e.getVisible();if(t){let r=new c.Rect(c.global.window);r.top+=this.viewportTopOffset,r.height-=this.viewportTopOffset,t=t.getIntersection(r)}let{left:i,top:o}=(0,c.getVisualViewportOffset)();if(e.moveBy(i,o),t&&t.moveBy(i,o),t&&e.top<t.top)if(this._contentPanelRect.height+this.limiterBottomOffset>t.height){let r=Math.max(e.bottom-t.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+r+1<e.height?this._stickToBottomOfLimiter(r):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<e.height?this._stickToTopOfAncestors(t.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=e,this._stickyBottomOffset=null,this._marginLeft=Q(-c.global.window.scrollX+(0,c.getVisualViewportOffset)().left)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=Q(-c.global.window.scrollX+(0,c.getVisualViewportOffset)().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new c.Rect(this.contentPanelElement)}},Rt=class extends we{iconView;resetButtonView;_viewConfig;constructor(e,t){let i=e.t,o=Object.assign({},{showResetButton:!0,showIcon:!0,creator:js},t);super(e,o.creator),this.label=t.label,this._viewConfig=o,this._viewConfig.showIcon&&(this.iconView=new C,this.iconView.content=m.IconLoupe,this.fieldWrapperChildren.add(this.iconView,0),this.extendTemplate({attributes:{class:"ck-search__query_with-icon"}})),this._viewConfig.showResetButton&&(this.resetButtonView=new g(e),this.resetButtonView.set({label:i("Clear"),icon:m.IconCancel,class:"ck-search__reset",isVisible:!1,tooltip:!0}),this.resetButtonView.on("execute",()=>{this.reset(),this.focus(),this.fire("reset")}),this.resetButtonView.bind("isVisible").to(this.fieldView,"isEmpty",r=>!r),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)}},Ht=class extends f{constructor(){super();let e=this.bindTemplate;this.set({isVisible:!1,primaryText:"",secondaryText:""}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__info",e.if("isVisible","ck-hidden",t=>!t)],tabindex:-1},children:[{tag:"span",children:[{text:[e.to("primaryText")]}]},{tag:"span",children:[{text:[e.to("secondaryText")]}]}]})}focus(){this.element.focus()}},Gt=class extends f{focusTracker;children;_focusCycler;constructor(e){super(e),this.children=this.createCollection(),this.focusTracker=new c.FocusTracker,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new E({focusables:this.children,focusTracker:this.focusTracker})}render(){super.render();for(let e of this.children)this.focusTracker.add(e.element)}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}},zt=class extends f{focusTracker;keystrokes;resultsView;filteredView;infoView;queryView;focusCycler;_config;constructor(e,t){super(e),this._config=t,this.filteredView=t.filteredView,this.queryView=this._createSearchTextQueryView(),this.focusTracker=new c.FocusTracker,this.keystrokes=new c.KeystrokeHandler,this.resultsView=new Gt(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 Ht,this._enableDefaultInfoViewBehavior(),this.on("render",()=>{this.search("")})),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new E({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",(i,{resultsCount:o,totalItemsCount:r})=>{this.resultsCount=o,this.totalItemsCount=r}),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]);let e=t=>t.stopPropagation();for(let t of this.focusableChildren)this.focusTracker.add(t.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(""),this.filteredView.element.scrollTo(0,0)}search(e){let t=e?new RegExp(Jt(e),"ig"):null,i=this.filteredView.filter(t);this.fire("search",{query:e,...i})}_createSearchTextQueryView(){let e=new Rt(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(){let e=this.locale.t,t=this.infoView;this.on("search",(o,r)=>{if(r.resultsCount)t.set({isVisible:!1});else{let n=this._config.infoView&&this._config.infoView.text,l,a;r.totalItemsCount?n?.notFound?(l=n.notFound.primary,a=n.notFound.secondary):(l=e("No results found"),a=""):n?.noSearchableItems?(l=n.noSearchableItems.primary,a=n.noSearchableItems.secondary):(l=e("No searchable items"),a=""),t.set({primaryText:i(l,r),secondaryText:i(a,r),isVisible:!0})}});function i(o,{query:r,resultsCount:n,totalItemsCount:l}){return typeof o=="function"?o(r,n,l):o}}},As=class s extends zt{_config;constructor(e,t){super(e,t),this._config=t;let i=(0,c.toUnit)("px");this.extendTemplate({attributes:{class:["ck-autocomplete"]}});let o=this.resultsView.bindTemplate;this.resultsView.set("isVisible",!1),this.resultsView.set("_position","s"),this.resultsView.set("_width",0),this.resultsView.extendTemplate({attributes:{class:[o.if("isVisible","ck-hidden",r=>!r),o.to("_position",r=>`ck-search__results_${r}`)],style:{width:o.to("_width",i)}}}),this.focusTracker.on("change:isFocused",(r,n,l)=>{this._updateResultsVisibility(),l?this.resultsView.element.scrollTop=0:t.resetOnBlur&&this.queryView.reset()}),this.on("search",()=>{this._updateResultsVisibility(),this._updateResultsViewWidthAndPosition()}),this.keystrokes.set("esc",(r,n)=>{this.resultsView.isVisible&&(this.queryView.focus(),this.resultsView.isVisible=!1,n())}),this.listenTo(c.global.document,"scroll",()=>{this._updateResultsViewWidthAndPosition()}),this.on("change:isEnabled",()=>{this._updateResultsVisibility()}),this.filteredView.on("execute",(r,{value:n})=>{this.focus(),this.reset(),this.queryView.fieldView.value=this.queryView.fieldView.element.value=n,this.resultsView.isVisible=!1}),this.resultsView.on("change:isVisible",()=>{this._updateResultsViewWidthAndPosition()})}_updateResultsViewWidthAndPosition(){if(!this.resultsView.isVisible)return;this.resultsView._width=new c.Rect(this.queryView.fieldView.element).width;let e=s._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:s.defaultResultsPositions});this.resultsView._position=e?e.name:"s"}_updateResultsVisibility(){let e=typeof this._config.queryMinChars>"u"?0:this._config.queryMinChars,t=this.queryView.fieldView.element.value.length;this.resultsView.isVisible=this.focusTracker.isFocused&&this.isEnabled&&t>=e}static defaultResultsPositions=[e=>({top:e.bottom,left:e.left,name:"s"}),(e,t)=>({top:e.top-t.height,left:e.left,name:"n"})];static _getOptimalPosition=c.getOptimalPosition},Oe=class extends f{constructor(){super(),this.set("text",void 0),this.setTemplate({tag:"span",attributes:{class:["ck","ck-highlighted-text"]}}),this.on("render",()=>{this.on("change:text",()=>{this._updateInnerHTML(this.text)}),this._updateInnerHTML(this.text)})}highlightText(e){this._updateInnerHTML(hn(this.text||"",e))}_updateInnerHTML(e){this.element.innerHTML=e||""}};function hn(s,e){if(!e)return Ne(s);let t=[],i=0,o=e.exec(s);for(;o!==null;){let n=o.index;
1n!==i&&t.push({text:s.substring(i,n),isMatch:!1}),t.push({text:o[0],isMatch:!0}),i=e.lastIndex,o=e.exec(s)}return i!==s.length&&t.push({text:s.substring(i),isMatch:!1}),t.map(n=>(n.text=Ne(n.text),n)).map(n=>n.isMatch?`<mark>${n.text}</mark>`:n.text).join("")}var Ms=class extends Oe{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});let e=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-button__label"],style:e.to("style"),id:e.to("id")}})}},Ls=class extends Oe{id;constructor(){super(),this.set("for",void 0);let e=this.bindTemplate;this.id=`ck-editor__label_${(0,c.uid)()}`,this.extendTemplate({attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")}})}},Ss=class extends f{constructor(){super(),this.set("isVisible",!1);let e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-spinner-container",e.if("isVisible","ck-hidden",t=>!t)]},children:[{tag:"span",attributes:{class:["ck","ck-spinner"]}}]})}},un=(0,c.toUnit)("px"),Fs=class extends y.Plugin{toolbarView;focusTracker;_balloonConfig;_resizeObserver=null;_balloon;_fireSelectionChangeDebounced;static get pluginName(){return"BalloonToolbar"}static get isOfficialPlugin(){return!0}static get requires(){return[Ee]}constructor(e){super(e),this._balloonConfig=Xt(e.config.get("balloonToolbar")),this.toolbarView=this._createToolbarView(),this.focusTracker=new c.FocusTracker,this._trackFocusableEditableElements(),this.focusTracker.add(this.toolbarView),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this.show(!0),afterBlur:()=>this.hide(),isContextual:!0}),this._balloon=e.plugins.get(Ee),this._fireSelectionChangeDebounced=S(()=>this.fire("_selectionChangeDebounced"),200),this.decorate("show")}init(){let e=this.editor,t=e.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",(i,o,r)=>{let n=this._balloon.visibleView===this.toolbarView;!r&&n?this.hide():r&&this.show()}),this.listenTo(t,"change:range",(i,o)=>{(o.directChange||t.isCollapsed)&&this.hide(),this._fireSelectionChangeDebounced()}),this.listenTo(this,"_selectionChangeDebounced",()=>{this.editor.editing.view.document.isFocused&&this.show()}),this._balloonConfig.shouldNotGroupWhenFull||this.listenTo(e,"ready",()=>{let i=e.ui.view.editable.element;this._resizeObserver=new c.ResizeObserver(i,o=>{this.toolbarView.maxWidth=un(o.contentRect.width*.9)})}),this.listenTo(this.toolbarView,"groupedItemsUpdate",()=>{this._updatePosition()}),e.ui.once("ready",()=>{this.toolbarView.fillFromConfig(this._balloonConfig,this.editor.ui.componentFactory)})}_createToolbarView(){let e=this.editor.locale.t,t=!this._balloonConfig.shouldNotGroupWhenFull,i=new te(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return i.ariaLabel=e("Editor contextual toolbar"),i.render(),i}show(e=!1){let t=this.editor,i=t.model.document.selection,o=t.model.schema;this._balloon.hasView(this.toolbarView)||i.isCollapsed&&!e||dn(i,o)||Array.from(this.toolbarView.items).every(r=>r.isEnabled!==void 0&&!r.isEnabled)||(this.listenTo(this.editor.ui,"update",()=>{this._updatePosition()}),this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"}))}hide(){this._balloon.hasView(this.toolbarView)&&(this.stopListening(this.editor.ui,"update"),this._balloon.remove(this.toolbarView))}_trackFocusableEditableElements(){let{editor:e,focusTracker:t}=this,{editing:i}=e;i.view.addObserver(class extends Y.Observer{observe(r){t.add(r)}stopObserving(r){t.remove(r)}})}_getBalloonPositionData(){let t=this.editor.editing.view,i=t.document,o=i.selection,r=i.selection.isBackward;return{target:()=>{let n=r?o.getFirstRange():o.getLastRange(),l=c.Rect.getDomRangeRects(t.domConverter.viewRangeToDom(n));return r?l[0]:(l.length>1&&l[l.length-1].width===0&&l.pop(),l[l.length-1])},positions:this._getBalloonPositions(r)}}_updatePosition(){this._balloon.updatePosition(this._getBalloonPositionData())}destroy(){super.destroy(),this.stopListening(),this._fireSelectionChangeDebounced.cancel(),this.toolbarView.destroy(),this.focusTracker.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getBalloonPositions(e){let i=c.env.isSafari&&c.env.isiOS?T.generatePositions({heightOffset:Math.max(T.arrowHeightOffset,Math.round(20/c.global.window.visualVie
1wport.scale))}):T.defaultPositions;return e?[i.northWestArrowSouth,i.northWestArrowSouthWest,i.northWestArrowSouthEast,i.northWestArrowSouthMiddleEast,i.northWestArrowSouthMiddleWest,i.southWestArrowNorth,i.southWestArrowNorthWest,i.southWestArrowNorthEast,i.southWestArrowNorthMiddleWest,i.southWestArrowNorthMiddleEast]:[i.southEastArrowNorth,i.southEastArrowNorthEast,i.southEastArrowNorthWest,i.southEastArrowNorthMiddleEast,i.southEastArrowNorthMiddleWest,i.northEastArrowSouth,i.northEastArrowSouthEast,i.northEastArrowSouthWest,i.northEastArrowSouthMiddleEast,i.northEastArrowSouthMiddleWest]}};function dn(s,e){return s.rangeCount===1?!1:[...s.getRanges()].every(t=>{let i=t.getContainedElement();return i&&e.isSelectable(i)})}var mo=(0,c.toUnit)("px"),$t=class extends g{constructor(e){super(e);let t=this.bindTemplate;this.isVisible=!1,this.isToggleable=!0,this.set("top",0),this.set("left",0),this.extendTemplate({attributes:{class:"ck-block-toolbar-button",style:{top:t.to("top",i=>mo(i)),left:t.to("left",i=>mo(i))}}})}},he=(0,c.toUnit)("px"),Ds=class extends y.Plugin{toolbarView;panelView;buttonView;_resizeObserver=null;_blockToolbarConfig;static get pluginName(){return"BlockToolbar"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this._blockToolbarConfig=Xt(this.editor.config.get("blockToolbar")),this.toolbarView=this._createToolbarView(),this.panelView=this._createPanelView(),this.buttonView=this._createButtonView(),Kt({emitter:this.panelView,contextElements:[this.panelView.element,this.buttonView.element],activator:()=>this.panelView.isVisible,callback:()=>this._hidePanel()})}init(){let e=this.editor,t=e.t,i=t("Click to edit block"),o=t("Drag to move"),r=t("Edit block"),n=e.plugins.has("DragDropBlockToolbar"),l=n?`${i}
2${o}`:r;this.buttonView.label=l,n&&(this.buttonView.element.dataset.ckeTooltipClass="ck-tooltip_multi-line"),this.listenTo(e.model.document.selection,"change:range",(a,h)=>{h.directChange&&this._hidePanel()}),this.listenTo(e.ui,"update",()=>this._updateButton()),this.listenTo(e,"change:isReadOnly",()=>this._updateButton(),{priority:"low"}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>this._updateButton()),this.listenTo(this.buttonView,"change:isVisible",(a,h,u)=>{u?this.buttonView.listenTo(window,"resize",()=>this._updateButton()):(this.buttonView.stopListening(window,"resize"),this._hidePanel())}),this._repositionButtonOnScroll(),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this._showPanel(),afterBlur:()=>this._hidePanel()}),e.ui.once("ready",()=>{this.toolbarView.fillFromConfig(this._blockToolbarConfig,this.editor.ui.componentFactory);for(let a of this.toolbarView.items)a.on("execute",()=>this._hidePanel(!0),{priority:"high"})})}destroy(){super.destroy(),this.panelView.destroy(),this.buttonView.destroy(),this.toolbarView.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_createToolbarView(){let e=this.editor.locale.t,t=!this._blockToolbarConfig.shouldNotGroupWhenFull,i=new te(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return i.ariaLabel=e("Editor block content toolbar"),i}_createPanelView(){let e=this.editor,t=new T(e.locale);return t.content.add(this.toolbarView),t.class="ck-toolbar-container",e.ui.view.body.add(t),this.toolbarView.keystrokes.set("Esc",(i,o)=>{this._hidePanel(!0),o()}),t}_createButtonView(){let e=this.editor,t=e.t,i=new $t(e.locale),o=this._blockToolbarConfig.icon,r=Tt[o]||o||Tt.dragIndicator;return i.set({label:t("Edit block"),icon:r,withText:!1}),i.bind("isOn").to(this.panelView,"isVisible"),i.bind("tooltip").to(this.panelView,"isVisible",n=>!n),this.listenTo(i,"execute",()=>{this.panelView.isVisible?this._hidePanel(!0):this._showPanel()}),this.listenTo(i,"change:isEnabled",(n,l,a)=>{!a&&this.panelView.isVisible&&this._hidePanel(!1)}),e.ui.view.body.add(i),i}_updateButton(){let e=this.editor,t=e.model,i=e.editing.view;if(!e.ui.focusTracker.isFocused){this._hideButton();return}if(!e.model.canEditAt(e.model.document.selection)){this._hideButton();return}let o=Array.from(t.document.selection.getSelectedBlocks())[0];if(!o||Array.from(this.toolbarView.items).every(n=>!n.isEnabled)){this._hideButton();return}let r=i.domConverter.mapViewToDom(e.editing.mapper.toViewElement(o));this.buttonView.isVisible=!0,this._setupToolbarResize(),this._attachButtonToElement(r),this.panelView.isVisible&&this._showPanel()}_hideButton(){this.buttonView.isVisible=!1}_showPanel(){if(!this.buttonView.isVisible)return;let e=this.panelView.isVisible;this.panelView.show();let t=this._getSelectedEditableElement();this.toolbarView.maxWidth=this._getToolbarMaxWidth(t),this.panelView.pin({target:this.buttonView.element,limiter:t}),e||this.toolbarView.items.get(0).focus()}_getSelectedEditableElement(){let e=this.editor.model.document.selection.getFirstRange().root.rootName;return this.editor.ui.getEditableElement(e)}_hidePanel(e){this.panelView.isVisible=!1,e&&this.editor.editing.view.focus()}_repositionButtonOnScroll(){let{buttonView:e}=this,t=!1,i=(o,r)=>{if(t)return;let n=this._getSelectedEditableElement();r.target!==c.global.document&&!(0,c.getAncestors)(n).includes(r.target)||(t=!0,c.global.window.requestAnimationFrame(()=>{this._updateButton(),t=!1}))};e.on("change:isVisible",(o,r,n)=>{n?e.listenTo(c.global.document,"scroll",i,{useCapture:!0,usePassive:!0}):e.stopListening(c.global.document,"scroll",i)})}_attachButtonToElement(e){let t=this.buttonView.element,i=this._getSelectedEditableElement(),o=window.getComputedStyle(e),r=new c.Rect(i),n=parseInt(o.paddingTop,10),l=parseInt(o.lineHeight,10)||parseInt(o.fontSize,10)*1.2,a=new c.Rect(t),h=new c.Rect(e),u;this.editor.locale.uiLanguageDirection==="ltr"?u=r.left-a.width:u=r.right;let p=h.top+n+(l-a.height)/2;a.moveTo(u,p);let b=a.toAbsoluteRect();this.buttonView.top=b.top,this.buttonView.left=b.left,this._clipButtonToViewport(this.buttonView,i)}_clipButtonToViewport(e,t){let i=new c.Rect(e.element),o=new c.Rect(t).getVisible(),r=(...l)=>{e.element.style.clipPath=l.length?`polygon(${l.join(",")})`:""},n=l=>{e.isEnabled=!l,e.element.style.pointerEvents=l?"none":""};if(o&&o.bottom<i.bottom){let l=Math.min(i.height,i.bottom-o.bottom);n(l>=i.height),r("0 0","100% 0",`100% calc(100% - ${he(l)})`,`0 calc(100% - ${he(l)}`)}else if(o&&o.top>i.top){let l=Math.min(i.height,o.top-i.top);n(l>=i.height),r(`0 ${he(l)}`,`100% ${he(l)}`,"100% 100%","0 100%")}else n(!1),r()}_setupToolbarResize(){let e=this._getSelectedEditableElement();this._blockToolbarConfig.shouldNotGroupWhenFull||(this._resizeObserver&&this._resizeObserver.element!==e&&(this._resizeObserver.destroy(),this._resizeObserver=null),this._resizeObserver||(this._resizeObserver=new c.ResizeObserver(e,()=>{this.toolbarView.maxWidth=this._getToolbarMaxWidth(e)})))}_getToolbarMaxWidth(e){let t=new c.Rect(e),i=new c.Rect(this.buttonView.element),r=this.editor.locale.uiLanguageDirection==="rtl"?i.left-t.right+i.width:t.left-i.left;return he(t.width+r)}},jt=class extends O{arrowView;constructor(e){super(e);let 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",i=>String(i)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new C;return e.content=m.IconDropdownArrow,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}},Ut=class extends f{children;constructor(e){super(e);let 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",i=>`ck-menu-bar__menu__panel_position_${i}`),t.if("isVisible","ck-hidden",i=>!i)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}},Z=class s extends f{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);let t=this.bindTemplate;this.buttonView=new jt(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Ut(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new c.KeystrokeHandler,this.focusTracker=new c.FocusTracker,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",i=>!i),t.if("parentMenuView","ck-menu-bar__menu_top-level",i=>!i)]},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),A.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(A.openOnButtonClick(this),A.openOnArrowRightKey(this),A.closeOnArrowLeftKey(this),A.openAndFocusOnEnterKeyPress(this),A.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),A.openAndFocusPanelOnArrowDownKey(this),A.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;let o=s._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){let{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:r,eastSouth:n,westNorth:l,eastNorth:a}=Lo;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[n,a,r,l]:[e,t,i,o]:this.parentMenuView?[r,l,n,a]:[t,e,o,i]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=c.getOptimalPosition},Ie=class extends G{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){let e=Array.from(this.items).some(t=>{let i=bo(t);return i&&i.isToggleable});
2this.items.forEach(t=>{let i=bo(t);i&&(i.hasCheckSpace=e)})}};function bo(s){return s instanceof v?s.children.map(e=>fn(e)?e.buttonView:e).find(e=>e instanceof O):null}function fn(s){return typeof s=="object"&&"buttonView"in s&&s.buttonView instanceof g}var qt=class extends dt{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}},go=["mouseenter","arrowleft","arrowright","change:isOpen"],Ns=class extends f{children;menus=[];constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){let o=this.locale,n=Do({normalizedConfig:e,locale:o,componentFactory:t,extraItems:i}).items.map(l=>this._createMenu({componentFactory:t,menuDefinition:l}));this.children.addMany(n)}render(){super.render(),R.toggleMenusAndFocusItemsOnHover(this),R.closeMenusWhenTheBarCloses(this),R.closeMenuWhenAnotherOnTheSameLevelOpens(this),R.focusCycleMenusOnArrows(this),R.closeOnClickOutside(this),R.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(let e of this.children)e.isOpen=!1}disable(){for(let e of this.children)e.isEnabled=!1}enable(){for(let e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...go).to(t),e.parentMenuView=t):e.delegate(...go).to(this,i=>"menu:"+i),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){let o=this.locale,r=new Z(o);return this.registerMenu(r,i),r.buttonView.set({label:t.label}),r.once("change:isOpen",()=>{let n=new Ie(o);n.ariaLabel=t.label,r.panelView.children.add(n),n.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:r,componentFactory:e}))}),r}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){let o=this.locale,r=[];for(let n of e.groups){for(let l of n.items){let a=new Ce(o,t);if(z(l))a.children.add(this._createMenu({componentFactory:i,menuDefinition:l,parentMenuView:t}));else{let h=this._createMenuItemContentFromFactory({componentName:l,componentFactory:i,parentMenuView:t});if(!h)continue;a.children.add(h)}r.push(a)}n!==e.groups[e.groups.length-1]&&r.push(new ee(o))}return r}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){let o=i.create(e);return o instanceof Z||o instanceof fe||o instanceof qt?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):((0,c.logWarning)("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof Z)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);let i=e.panelView.children.filter(r=>r instanceof Ie)[0];if(!i){e.delegate("mouseenter").to(t);return}let o=i.items.filter(r=>r instanceof v);for(let r of o)this._registerMenuTree(r.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(r=>r.isOpen)},0)})}};var{AccessibilityHelp:Sa,AccessibilityHelpContentView:Fa,AriaLiveAnnouncer:Da,AriaLiveAnnouncerPoliteness:Na,AriaLiveAnnouncerRegionView:Wa,AriaLiveAnnouncerView:Ra,AutocompleteView:Ha,Badge:Ga,BalloonPanelView:za,BalloonToolbar:$a,BlockButtonView:ja,BlockToolbar:Ua,BodyCollection:qa,BoxedEditorUIView:Ka,ButtonLabelView:Xa,ButtonLabelWithHighlightView:Ya,ButtonView:Qa,CollapsibleView:Za,ColorGridView:Ja,ColorGridsFragmentView:ec,ColorPickerFragmentView:tc,ColorPickerInputRowView:sc,ColorPickerView:ic,ColorSelectorView:oc,ColorTileView:rc,ComponentFactory:nc,ContextualBalloon:lc,CssTransitionDisablerMixin:ac,DefaultMenuBarItems:cc,Dialog:hc,DialogActionsView:uc,DialogContentView:dc,DialogView:fc,DialogViewPosition:pc,DocumentColorCollection:mc,DraggableViewMixin:bc,DropdownButtonView:gc,DropdownMenuButtonView:wc,DropdownMenuListItemButtonView:_c,DropdownMenuListItemView:kc,DropdownMenuListView:yc,DropdownMenuNestedMenuPanelView:xc,DropdownMenuNestedMenuView:Tc,DropdownMenuPanelPositioningFunctions:vc,DropdownMenuRootListView:Vc,DropdownPanelView:Cc,DropdownView:Ec,EditableUIView:Oc,EditorUI:Ic,EditorUIView:Pc,EvaluationBadge:Bc,FileDialogButtonView:Ac,FileDialogListItemButtonView:Mc,FileDialogViewMixin:Lc,FocusCycler:Sc,FormHeaderView:Fc,FormRowView:Dc,HighlightedTextView:Nc,IconView:Wc,IframeView:Rc,InlineEditableUIView:Hc,InputBase:Gc,InputNumberView:zc,InputTextView:$c,InputView:jc,ItemsView:Uc,LabelView:qc,LabelWithHighlightView:Kc,LabeledFieldView:Xc,LabeledInputVie
2w:Yc,ListItemButtonView:Qc,ListItemGroupView:Zc,ListItemView:Jc,ListSeparatorView:eh,ListView:th,MenuBarMenuButtonView:sh,MenuBarMenuListItemButtonView:ih,MenuBarMenuListItemFileDialogButtonView:oh,MenuBarMenuListItemView:rh,MenuBarMenuListView:nh,MenuBarMenuPanelView:lh,MenuBarMenuView:ah,MenuBarView:ch,NESTED_TOOLBAR_ICONS:hh,Notification:uh,PoweredBy:dh,SearchInfoView:fh,SearchResultsView:ph,SearchTextView:mh,SliderView:bh,SpinnerView:gh,SplitButtonView:wh,StickyPanelView:_h,SwitchButtonView:kh,Template:yh,TextareaView:xh,ToolbarLineBreakView:Th,ToolbarSeparatorView:vh,ToolbarView:Vh,TooltipManager:Ch,UIModel:Eh,View:Oh,ViewCollection:Ih,ViewModel:Ph,_CheckIconHolderView:Bh,_CollapsibleView:Ah,_ContextualBalloonRotatorView:Mh,_DropdownMenuBehaviors:Lh,_DropdownRootMenuBehaviors:Sh,_MenuBarBehaviors:Fh,_MenuBarMenuBehaviors:Dh,_MenuBarMenuViewPanelPositioningFunctions:Nh,_SearchInfoView:Wh,_SearchTextQueryView:Rh,_TemplateBinding:Hh,_TemplateIfBinding:Gh,_TemplateToBinding:zh,_convertColor:$h,_convertColorToHex:jh,_preventUiViewDefault:Uh,_processMenuBarConfig:qh,_registerCustomElement:Kh,_tryNormalizeHexColor:Xh,addKeyboardHandlingForGrid:Yh,addListToDropdown:Qh,addMenuToDropdown:Zh,addToolbarToDropdown:Jh,clickOutsideHandler:eu,createDropdown:tu,createLabeledDropdown:su,createLabeledInputNumber:iu,createLabeledInputText:ou,createLabeledTextarea:ru,filterGroupAndItemNames:nu,focusChildOnDropdownOpen:lu,getLocalizedColorOptions:au,isFocusable:cu,isViewWithFocusCycler:hu,normalizeColorOptions:uu,normalizeMenuBarConfig:du,normalizeSingleColorDefinition:fu,normalizeToolbarConfig:pu,submitHandler:mu,__esModule:bu}=qs;export{Sa as AccessibilityHelp,Fa as AccessibilityHelpContentView,Da as AriaLiveAnnouncer,Na as AriaLiveAnnouncerPoliteness,Wa as AriaLiveAnnouncerRegionView,Ra as AriaLiveAnnouncerView,Ha as AutocompleteView,Ga as Badge,za as BalloonPanelView,$a as BalloonToolbar,ja as BlockButtonView,Ua as BlockToolbar,qa as BodyCollection,Ka as BoxedEditorUIView,Xa as ButtonLabelView,Ya as ButtonLabelWithHighlightView,Qa as ButtonView,Za as CollapsibleView,Ja as ColorGridView,ec as ColorGridsFragmentView,tc as ColorPickerFragmentView,sc as ColorPickerInputRowView,ic as ColorPickerView,oc as ColorSelectorView,rc as ColorTileView,nc as ComponentFactory,lc as ContextualBalloon,ac as CssTransitionDisablerMixin,cc as DefaultMenuBarItems,hc as Dialog,uc as DialogActionsView,dc as DialogContentView,fc as DialogView,pc as DialogViewPosition,mc as DocumentColorCollection,bc as DraggableViewMixin,gc as DropdownButtonView,wc as DropdownMenuButtonView,_c as DropdownMenuListItemButtonView,kc as DropdownMenuListItemView,yc as DropdownMenuListView,xc as DropdownMenuNestedMenuPanelView,Tc as DropdownMenuNestedMenuView,vc as DropdownMenuPanelPositioningFunctions,Vc as DropdownMenuRootListView,Cc as DropdownPanelView,Ec as DropdownView,Oc as EditableUIView,Ic as EditorUI,Pc as EditorUIView,Bc as EvaluationBadge,Ac as FileDialogButtonView,Mc as FileDialogListItemButtonView,Lc as FileDialogViewMixin,Sc as FocusCycler,Fc as FormHeaderView,Dc as FormRowView,Nc as HighlightedTextView,Wc as IconView,Rc as IframeView,Hc as InlineEditableUIView,Gc as InputBase,zc as InputNumberView,$c as InputTextView,jc as InputView,Uc as ItemsView,qc as LabelView,Kc as LabelWithHighlightView,Xc as LabeledFieldView,Yc as LabeledInputView,Qc as ListItemButtonView,Zc as ListItemGroupView,Jc as ListItemView,eh as ListSeparatorView,th as ListView,sh as MenuBarMenuButtonView,ih as MenuBarMenuListItemButtonView,oh as MenuBarMenuListItemFileDialogButtonView,rh as MenuBarMenuListItemView,nh as MenuBarMenuListView,lh as MenuBarMenuPanelView,ah as MenuBarMenuView,ch as MenuBarView,hh as NESTED_TOOLBAR_ICONS,uh as Notification,dh as PoweredBy,fh as SearchInfoView,ph as SearchResultsView,mh as SearchTextView,bh as SliderView,gh as SpinnerView,wh as SplitButtonView,_h as StickyPanelView,kh as SwitchButtonView,yh as Template,xh as TextareaView,Th as ToolbarLineBreakView,vh as ToolbarSeparatorView,Vh as ToolbarView,Ch as TooltipManager,Eh as UIModel,Oh as View,Ih as ViewCollection,Ph as ViewModel,Bh as _CheckIconHolderView,Ah as _CollapsibleView,Mh as _ContextualBalloonRotatorView,Lh as _DropdownMenuBehaviors,Sh as _DropdownRootMenuBehaviors,Fh as _MenuBarBehaviors,Dh as _MenuBarMenuBehaviors,Nh as _MenuBarMenuViewPanelPositioningFunctions,Wh as _SearchInfoView,Rh as _SearchTextQueryView,Hh as _TemplateBinding,Gh as _TemplateIfBinding,zh as _TemplateToBinding,bu as __esMo
2dule,$h as _convertColor,jh as _convertColorToHex,Uh as _preventUiViewDefault,qh as _processMenuBarConfig,Kh as _registerCustomElement,Xh as _tryNormalizeHexColor,Yh as addKeyboardHandlingForGrid,Qh as addListToDropdown,Zh as addMenuToDropdown,Jh as addToolbarToDropdown,eu as clickOutsideHandler,tu as createDropdown,su as createLabeledDropdown,iu as createLabeledInputNumber,ou as createLabeledInputText,ru as createLabeledTextarea,nu as filterGroupAndItemNames,lu as focusChildOnDropdownOpen,au as getLocalizedColorOptions,cu as isFocusable,hu as isViewWithFocusCycler,uu as normalizeColorOptions,du as normalizeMenuBarConfig,fu as normalizeSingleColorDefinition,pu as normalizeToolbarConfig,mu as submitHandler};
3/*! Bundled license information:
4
5@ckeditor/ckeditor5-ui/dist/index.js:
6  (**
7   * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
8   * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
9   *)
10  (* istanbul ignore next -- @preserve *)
11*/
12//# sourceMappingURL=@ckeditor$ckeditor5-ui$dist$index.js.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.