PageSourceSearch

https://www.cccb.org/o/frontend-editor-ckeditor-web/__liferay__/ex…/@ckeditor$ckeditor5-ui$dist$index.js.js

js cccb.org collected 2026-09-24 07:58:25 UTC 208,816 bytes, 12 lines download raw bytes

1import{CKEditorError as y,Collection as Ke,Config as sl,DOCUMENTATION_URL as ol,DomEmitterMixin as fe,ElementReplacer as rl,EmitterMixin as wi,EventInfo as nl,FocusTracker as _,KeystrokeHandler as T,Locale as ll,ObservableMixin as pe,Rect as g,ResizeObserver as Y,_clearTranslations as al,_getEmitterId as cl,_getEmitterListenedTo as hl,_getUserAgent as ul,_isAndroid as dl,_isBlink as fl,_isGecko as pl,_isMac as ml,_isMediaForcedColors as bl,_isMotionReduced as gl,_isRegExpUnicodePropertySupported as wl,_isSafari as _l,_isWindows as kl,_isiOS as yl,_setEmitterId as xl,_translate as Tl,_unifyTranslations as vl,abortableDebounce as Vl,add as Cl,areConnectedThroughProperties as Il,collectStylesheets as El,compareArrays as Ol,count as Pl,crc32 as Bl,createElement as B,delay as gs,diff as Sl,diffToChanges as Ml,env as S,exponentialDelay as Ll,fastDiff as Al,findClosestScrollableAncestor as Dl,first as ws,formatHtml as Fl,getAncestors as _s,getBorderWidths as ks,getCode as Nl,getCommonAncestor as Rl,getDataFromElement as Wl,getEnvKeystrokeText as me,getLanguageDirection as Hl,getLocalizedArrowKeyCodeDirection as zl,getOptimalPosition as be,getPositionedAncestor as Gl,getRangeFromMouseEvent as $l,getVisualViewportOffset as ge,global as p,indexOf as jl,insertAt as Ul,insertToPriorityArray as Kl,isArrowKeyCode as ql,isCombiningMark as Xl,isComment as Yl,isForwardArrowKeyCode as Ql,isHighSurrogateHalf as Zl,isInsideCombinedSymbol as Jl,isInsideEmojiSequence as ea,isInsideSurrogatePair as ta,isIterable as _i,isLowSurrogateHalf as ia,isNode as ki,isRange as ys,isText as xs,isValidAttributeName as sa,isViewWithFocusTracker as oa,isVisible as M,isWindow as ra,keyCodes as na,logError as la,logWarning as I,mapsEqual as aa,nth as ca,objectToMap as ha,parseBase64EncodedObject as yi,parseKeystroke as ua,priorities as Ts,releaseDate as da,remove as fa,retry as pa,scrollAncestorsToShowTarget as ma,scrollViewportToShowTarget as ba,setDataInElement as ga,spliceArray as wa,spy as _a,toArray as we,toMap as ka,toUnit as L,uid as W,version as ya,wait as xa}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";function vs(i){return Number.isSafeInteger(i)&&i>=0}function Vs(i){return i!=null&&typeof i!="function"&&vs(i.length)}function Q(i){return i!==null&&(typeof i=="object"||typeof i=="function")}function Cs(i){return i==null||typeof i!="object"&&typeof i!="function"}function Is(i,e){return i===e||Number.isNaN(i)&&Number.isNaN(e)}function Es(i){return Object.getOwnPropertySymbols(i).filter(e=>Object.prototype.propertyIsEnumerable.call(i,e))}function Os(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(i)}var Ps="[object RegExp]",qe="[object String]",Xe="[object Number]",Ye="[object Boolean]",Qe="[object Arguments]",Bs="[object Symbol]",Ss="[object Date]",Ms="[object Map]",Ls="[object Set]",As="[object Array]";var Ds="[object ArrayBuffer]",Fs="[object Object]";var Ns="[object DataView]",Rs="[object Uint8Array]",Ws="[object Uint8ClampedArray]",Hs="[object Uint16Array]",zs="[object Uint32Array]";var Gs="[object Int8Array]",$s="[object Int16Array]",js="[object Int32Array]";var Us="[object Float32Array]",Ks="[object Float64Array]";function Ze(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function qs(i,e){return Z(i,void 0,i,new Map,e)}function Z(i,e,t,s=new Map,o=void 0){let r=o?.(i,e,t,s);if(r!=null)return r;if(Cs(i))return i;if(s.has(i))return s.get(i);if(Array.isArray(i)){let n=new Array(i.length);s.set(i,n);for(let l=0;l<i.length;l++)n[l]=Z(i[l],l,t,s,o);return Object.hasOwn(i,"index")&&(n.index=i.index),Object.hasOwn(i,"input")&&(n.input=i.input),n}if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp){let n=new RegExp(i.source,i.flags);return n.lastIndex=i.lastIndex,n}if(i instanceof Map){let n=new Map;s.set(i,n);for(let[l,a]of i)n.set(l,Z(a,l,t,s,o));return n}if(i instanceof Set){let n=new Set;s.set(i,n);for(let l of i)n.add(Z(l,void 0,t,s,o));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(i))return i.subarray();if(Ze(i)){let n=new(Object.getPrototypeOf(i)).constructor(i.length);s.set(i,n);for(let l=0;l<i.length;l++)n[l]=Z(i[l],l,t,s,o);return n}if(i instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&i instanceof SharedArrayBuffer)return i.slice(0);if(i instanceof DataView){let n=new DataView(i.buffer.slice(0),i.byteOffset,i.byteLength);return s.set(i,n),H(n,i,t,s,o),n}if(typeof File<"u"&&i instanceof File){let n=new File([i],i.name,{type:i.type});return s.set(i,n),H(n,i,t,s,o),n}if(i instanceof Blob){let n=new Blob([i],{type:i.type});return s.set(i,n),H(n,i,t,s,o),n}if(i instanceof Error){let n=new i.constructor;return s.set(i,n),n.message=i.message,n.name=i.name,n.stack=i.stack,n.cause=i.cause,H(n,i,t,s,o),n}if(typeof i=="object"&&Lr(i)){let n=Object.create(Object.getPrototypeOf(i));return s.set(i,n),H(n,i,t,s,o),n}return i}function H(i,e,t=i,s,o){let r=[...Object.keys(e),...Es(e)];for(let n=0;n<r.length;n++){let l=r[n],a=Object.getOwnPropertyDescriptor(i,l);(a==null||a.writable)&&(i[l]=Z(e[l],l,t,s,o))}}function Lr(i){switch(Os(i)){case Qe:case As:case Ds:case Ns:case Ye:case Ss:case Us:case Ks:case Gs:case $s:case js:case Ms:case Xe:case Fs:case Ps:case Ls:case qe:case Bs:case Rs:case Ws:case Hs:case zs:return!0;default:return!1}}function _e(i,e){return qs(i,(t,s,o,r)=>{let n=e?.(t,s,o,r);if(n!=null)return n;if(typeof i=="object")switch(Object.prototype.toString.call(i)){case Xe:case qe:case Ye:{let l=new i.constructor(i?.valueOf());return H(l,i),l}case Qe:{let l={};return H(l,i),l.length=i.length,l[Symbol.iterator]=i[Symbol.iterator],l}default:return}})}function ke(i){return _e(i)}function Xs(i){return typeof i=="object"&&i!==null}function Ys(i){return typeof i=="symbol"||i instanceof Symbol}function Qs(i){return Ys(i)?NaN:Number(i)}function Zs(i){return i?(i=Qs(i),i===1/0||i===-1/0?(i<0?-1:1)*Number.MAX_VALUE:i===i?i:0):i===0?i:0}function Js(i){let e=Zs(i),t=e%1;return t?e-t:e}function eo(i,e,{signal:t,edges:s}={}){let o,r=null,n=s!=null&&s.includes("leading"),l=s==null||s.includes("trailing"),a=()=>{r!==null&&(i.apply(o,r),o=void 0,r=null)},c=()=>{l&&a(),k()},h=null,f=()=>{h!=null&&clearTimeout(h),h=setTimeout(()=>{h=null,c()},e)},m=()=>{h!==null&&(clearTimeout(h),h=null)},k=()=>{m(),o=void 0,r=null},gi=()=>{m(),a()},Ue=function(...Sr){if(t?.aborted)return;o=this,r=Sr;let Mr=h==null;f(),n&&Mr&&a()};return Ue.schedule=f,Ue.cancel=k,Ue.flush=gi,t?.addEventListener("abort",k,{once:!0}),Ue}function z(i,e=0,t={}){typeof t!="object"&&(t={});let{leading:s=!1,trailing:o=!0,maxWait:r}=t,n=Array(2);s&&(n[0]="leading"),o&&(n[1]="trailing");let l,a=null,c=eo(function(...m){l=i.apply(this,m),a=null},e,{edges:n}),h=function(...m){return r!=null&&(a===null&&(a=Date.now()),Date.now()-a>=r)?(l=i.apply(this,m),a=Date.now(),c.cancel(),c.schedule(),l):(c.apply(this,m),l)},f=()=>(c.flush(),l);return h.cancel=c.cancel,h.flush=f,h}function xi(i,e=0,t={}){typeof t!="object"&&(t={});let{leading:s=!0,trailing:o=!0}=t;return z(i,e,{leading:s,trailing:o,maxWait:e})}function ye(i){if(i==null)return"";if(typeof i=="string")return i;if(Array.isArray(i))return i.map(ye).join(",");let e=String(i);return e==="0"&&Object.is(Number(i),-0)?"-0":e}function to(i){return typeof Buffer<"u"&&Buffer.isBuffer(i)}function io(i){let e=i?.constructor,t=typeof e=="function"?e.prototype:Object.prototype;return i===t}function so(i){return Ze(i)}function oo(i,e){if(i=Js(i),i<1||!Number.isSafeInteger(i))return[];let t=new Array(i);for(let s=0;s<i;s++)t[s]=typeof e=="function"?e(s):s;return t}function ro(i){if(i==null)return[];switch(typeof i){case"object":case"function":return Vs(i)?Dr(i):io(i)?Ar(i):Je(i);default:return Je(Object(i))}}function Je(i){let e=[];for(let t in i)e.push(t);return e}function Ar(i){return Je(i).filter(t=>t!=="constructor")}function Dr(i){let e=oo(i.length,s=>`${s}`),t=new Set(e);return to(i)&&(t.add("offset"),t.add("parent")),so(i)&&(t.add("buffer"),t.add("byteLength"),t.add("byteOffset")),[...e,...Je(i).filter(s=>!t.has(s))]}function et(i,...e){for(let t=0;t<e.length;t++)Fr(i,e[t]);return i}function Fr(i,e){let t=ro(e);for(let s=0;s<t.length;s++){let o=t[s];(!(o in i)||!Is(i[o],e[o]))&&(i[o]=e[o])}}function no(i){if(typeof i!="object"||i==null)return!1;if(Object.getPrototypeOf(i)===null)return!0;
1if(Object.prototype.toString.call(i)!=="[object Object]"){let t=i[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(i,Symbol.toStringTag)?.writable?!1:i.toString()===`[object ${t}]`}let e=i;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function xe(i){return Xs(i)&&i.nodeType===1&&!no(i)}var Nr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function lo(i){return i.replace(/[&<>"']/g,e=>Nr[e])}function tt(i){return lo(ye(i))}function ao(i){return i.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function Ti(i){return ao(ye(i))}import{Accessibility as Gc,Command as $c,CommandCollection as jc,Context as Uc,ContextPlugin as co,EditingKeystrokeHandler as Kc,Editor as qc,ElementApiMixin as Xc,MultiCommand as Yc,PendingActions as Qc,Plugin as J,_DEFAULT_ACCESSIBILITY_GROUP_ID as Zc,_getEditorUsageData as Jc,attachToForm as eh,secureSourceElement as th}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{IconAccessibility as vi,IconAddComment as oh,IconAlignBottom as rh,IconAlignCenter as nh,IconAlignJustify as lh,IconAlignLeft as ho,IconAlignMiddle as ah,IconAlignRight as ch,IconAlignTop as hh,IconArrowDown as uh,IconArrowUp as dh,IconBold as uo,IconBookmark as fh,IconBookmarkInline as ph,IconBookmarkMedium as mh,IconBookmarkSmall as bh,IconBrowseFiles as gh,IconBulletedList as wh,IconCancel as it,IconCaption as _h,IconCaseChange as kh,IconCheck as Vi,IconChevronDown as yh,IconChevronUp as xh,IconCkboxImageEdit as Th,IconCode as vh,IconCodeBlock as Vh,IconCog as Ch,IconColorPalette as fo,IconColorTileCheck as po,IconCommentsArchive as Ih,IconContentLock as Eh,IconContentUnlock as Oh,IconCopy as Ph,IconDragHandle as Bh,IconDragIndicator as mo,IconDropbox as Sh,IconDropdownArrow as ee,IconEditComment as Mh,IconEmoji as Lh,IconEraser as bo,IconError as Ah,IconExportPdf as Dh,IconExportWord as Fh,IconFacebook as Nh,IconFindReplace as Rh,IconFontBackground as Wh,IconFontColor as Hh,IconFontFamily as zh,IconFontSize as Gh,IconFullscreenEnter as $h,IconFullscreenLeave as jh,IconGoogleDrive as Uh,IconGooglePhotos as Kh,IconHeading1 as qh,IconHeading2 as Xh,IconHeading3 as Yh,IconHeading4 as Qh,IconHeading5 as Zh,IconHeading6 as Jh,IconHistory as eu,IconHorizontalLine as tu,IconHtml as iu,IconImage as su,IconImageAssetManager as ou,IconImageUpload as ru,IconImageUrl as nu,IconImportExport as go,IconImportWord as lu,IconIndent as au,IconInsertMergeField as cu,IconItalic as hu,IconLegalStyleList as uu,IconLineHeight as du,IconLink as fu,IconListStyleCircle as pu,IconListStyleDecimal as mu,IconListStyleDecimalLeadingZero as bu,IconListStyleDisc as gu,IconListStyleLowerLatin as wu,IconListStyleLowerRoman as _u,IconListStyleSquare as ku,IconListStyleUpperLatin as yu,IconListStyleUpperRoman as xu,IconLocal as Tu,IconLoupe as wo,IconLowVision as vu,IconMagicWand as Vu,IconMarker as Cu,IconMedia as Iu,IconMediaPlaceholder as Eu,IconMultiLevelList as Ou,IconNextArrow as _o,IconNotification as Pu,IconNumberedList as Bu,IconObjectCenter as Su,IconObjectFullWidth as Mu,IconObjectInline as Lu,IconObjectInlineLeft as Au,IconObjectInlineRight as Du,IconObjectLeft as Fu,IconObjectRight as Nu,IconObjectSizeCustom as Ru,IconObjectSizeFull as Wu,IconObjectSizeLarge as Hu,IconObjectSizeMedium as zu,IconObjectSizeSmall as Gu,IconOneDrive as $u,IconOutdent as ju,IconPageBreak as Uu,IconPaginationExample as Ku,IconPaintRoller as qu,IconPaintRollerCursorDefault as Xu,IconPaintRollerCursorText as Yu,IconParagraph as ko,IconPen as Qu,IconPencil as Zu,IconPilcrow as yo,IconPlay as Ju,IconPlus as xo,IconPreviewMergeFields as ed,IconPreviousArrow as To,IconPrint as td,IconProjectLogo as vo,IconQuote as id,IconRedo as sd,IconRemove as od,IconRemoveComment as rd,IconRemoveFormat as nd,IconReturnArrow as ld,IconRevisionHistory as ad,IconRobotPencil as cd,IconSelectAll as hd,IconSettings as ud,IconShowBlocks as dd,IconSource as fd,IconSpecialCharacters as pd,IconStrikethrough as md,IconSubmit as bd,IconSubscript as gd,IconSuperscript as wd,IconTable as _d,IconTableCellProperties as kd,IconTableColumn as yd,IconTableLayout as xd,IconTableMergeCell as Td,IconTableOfContents as vd,IconTableProperties as Vd,IconTableRow as Cd,IconTemplate as Id,IconTemplateGeneric as Ed,IconText as Vo,IconTextAlternative as Od,IconThreeVerticalDots as st,IconTodoList as Pd,IconTrackChanges as Bd,IconTrackChangesAccept as Sd,IconTrackChangesDiscard as Md,IconUnderline as Ld,IconUndo as Ad,IconUnlink as Dd,IconUploadcareImageEdit as Fd,IconUploadcareImageUpload as Nd,IconUploadcareLink as Rd,IconUser as Wd,IconWarning as Hd}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-icons$dist$index.js.js";var D={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],ol
1ive:[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 Ci=Rr,Co={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Rr(i){var e,t=[],s=1,o;if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(i=String(i).toLowerCase(),D[i])t=D[i].slice(),o="rgb";else if(i==="transparent")s=0,o="rgb",t=[0,0,0];else if(i[0]==="#"){var r=i.slice(1),n=r.length,l=n<=4;s=1,l?(t=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],n===4&&(s=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&&(s=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(i)){var a=e[1];o=a.replace(/a$/,"");var c=o==="cmyk"?4:o==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=t.shift()),t=t.map(function(h,f){if(h[h.length-1]==="%")return h=parseFloat(h)/100,f===3?h:o==="rgb"?h*255:o[0]==="h"||o[0]==="l"&&!f?h*100:o==="lab"?h*125:o==="lch"?f<2?h*150:h*360:o[0]==="o"&&!f?h:o==="oklab"?h*.4:o==="oklch"?f<2?h*.4:h*360:h;if(o[f]==="h"||f===2&&o[o.length-1]==="h"){if(Co[h]!==void 0)return Co[h];if(h.endsWith("deg"))return parseFloat(h);if(h.endsWith("turn"))return parseFloat(h)*360;if(h.endsWith("grad"))return parseFloat(h)*360/400;if(h.endsWith("rad"))return parseFloat(h)*180/Math.PI}return h==="none"?0:parseFloat(h)}),s=t.length>c?t.pop():1}else/[0-9](?:\s|\/|,)/.test(i)&&(t=i.match(/([0-9]+)/g).map(function(h){return parseFloat(h)}),o=i.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:o,values:t,alpha:s}}var Io={};for(let i of Object.keys(D))Io[D[i]]=i;var u={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"]}},N=u,F=(6/29)**3;function te(i){let e=i>.0031308?1.055*i**.4166666666666667-.055:i*12.92;return Math.min(Math.max(0,e),1)}function ie(i){return i>.04045?((i+.055)/1.055)**2.4:i/12.92}for(let i of Object.keys(u)){if(!("channels"in u[i]))throw new Error("missing channels property: "+i);if(!("labels"in u[i]))throw new Error("missing channel labels property: "+i);if(u[i].labels.length!==u[i].channels)throw new Error("channel and label counts mismatch: "+i);let{channels:e,labels:t}=u[i];delete u[i].channels,delete u[i].labels,Object.defineProperty(u[i],"channels",{value:e}),Object.defineProperty(u[i],"labels",{value:t})}u.rgb.hsl=function(i){let e=i[0]/255,t=i[1]/255,s=i[2]/255,o=Math.min(e,t,s),r=Math.max(e,t,s),n=r-o,l,a;switch(r){case o:{l=0;break}case e:{l=(t-s)/n;break}case t:{l=2+(s-e)/n;break}case s:{l=4+(e-t)/n;break}}l=Math.min(l*60,360),l<0&&(l+=360);let c=(o+r)/2;return r===o?a=0:c<=.5?a=n/(r+o):a=n/(2-r-o),[l,a*100,c*100]};u.rgb.hsv=function(i){let e,t,s,o,r,n=i[0]/255,l=i[1]/255,a=i[2]/255,c=Math.max(n,l,a),h=c-Math.min(n,l,a),f=function(m){return(c-m)/6/h+1/2};if(h===0)o=0,r=0;else{switch(r=h/c,e=f(n),t=f(l),s=f(a),c){case n:{o=s-t;break}case l:{o=1/3+e-s;break}case a:{o=2/3+t-e;break}}o<0?o+=1:o>1&&(o-=1)}return[o*360,r*100,c*100]};u.rgb.hwb=function(i){let e=i[0],t=i[1],s=i[2],o=u.rgb.hsl(i)[0],r=1/255*Math.min(e,Math.min(t,s));return s=1-1/255*Math.max(e,Math.max(t,s)),[o,r*100,s*100]};u.rgb.oklab=function(i){let e=ie(i[0]/255),t=ie(i[1]/255),s=ie(i[2]/255),o=Math.cbrt(.4122214708*e+.5363325363*t+.0514459929*s),r=Math.cbrt(.2119034982*e+.6806995451*t+.1073969566*s),n=Math.cbrt(.0883024619*e+.2817188376*t+.6299787005*s),l=.2104542553*o+.793617785*r-.0040720468*n,a=1.9779984951*o-2.428592205*r+.4505937099*n,c=.0259040371*o+.7827717662*r-.808675766*n;return[l*100,a*100,c*100]};u.rgb.cmyk=function(i){let e=i[0]/255,t=i[1]/255,s=i[2]/255,o=Math.min(1-e,1-t,1-s),r=(1-e-o)/(1-o)||0,n=(1-t-o)/(1-o)||0,l=(1-s-o)/(1-o)||0;return[r*100,n*100,l*100,o*100]};function Wr(i,e){return(i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]-e[2])**2}u.rgb.keyword=function(i){let e=Io[i];if(e)return e;let t=Number.POSITIVE_INFINITY,s;for(let o of Object.keys(D)){let r=D[o],n=Wr(i,r);n<t&&(t=n,s=o)}return s};
vendor: 4,632 bytes, line 1
1u.keyword.rgb=function(i){return D[i]};u.rgb.xyz=function(i){let e=ie(i[0]/255),t=ie(i[1]/255),s=ie(i[2]/255),o=e*.4124564+t*.3575761+s*.1804375,r=e*.2126729+t*.7151522+s*.072175,n=e*.0193339+t*.119192+s*.9503041;return[o*100,r*100,n*100]};u.rgb.lab=function(i){let e=u.rgb.xyz(i),t=e[0],s=e[1],o=e[2];t/=95.047,s/=100,o/=108.883,t=t>F?t**(1/3):7.787*t+16/116,s=s>F?s**(1/3):7.787*s+16/116,o=o>F?o**(1/3):7.787*o+16/116;let r=116*s-16,n=500*(t-s),l=200*(s-o);return[r,n,l]};u.hsl.rgb=function(i){let e=i[0]/360,t=i[1]/100,s=i[2]/100,o,r;if(t===0)return r=s*255,[r,r,r];let n=s<.5?s*(1+t):s+t-s*t,l=2*s-n,a=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-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[c]=r*255;return a};u.hsl.hsv=function(i){let e=i[0],t=i[1]/100,s=i[2]/100,o=t,r=Math.max(s,.01);s*=2,t*=s<=1?s:2-s,o*=r<=1?r:2-r;let n=(s+t)/2,l=s===0?2*o/(r+o):2*t/(s+t);return[e,l*100,n*100]};u.hsv.rgb=function(i){let e=i[0]/60,t=i[1]/100,s=i[2]/100,o=Math.floor(e)%6,r=e-Math.floor(e),n=255*s*(1-t),l=255*s*(1-t*r),a=255*s*(1-t*(1-r));switch(s*=255,o){case 0:return[s,a,n];case 1:return[l,s,n];case 2:return[n,s,a];case 3:return[n,l,s];case 4:return[a,n,s];case 5:return[s,n,l]}};u.hsv.hsl=function(i){let e=i[0],t=i[1]/100,s=i[2]/100,o=Math.max(s,.01),r,n;n=(2-t)*s;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]};u.hwb.rgb=function(i){let e=i[0]/360,t=i[1]/100,s=i[2]/100,o=t+s,r;o>1&&(t/=o,s/=o);let n=Math.floor(6*e),l=1-s;r=6*e-n,n&1&&(r=1-r);let a=t+r*(l-t),c,h,f;switch(n){default:case 6:case 0:{c=l,h=a,f=t;break}case 1:{c=a,h=l,f=t;break}case 2:{c=t,h=l,f=a;break}case 3:{c=t,h=a,f=l;break}case 4:{c=a,h=t,f=l;break}case 5:{c=l,h=t,f=a;break}}return[c*255,h*255,f*255]};u.cmyk.rgb=function(i){let e=i[0]/100,t=i[1]/100,s=i[2]/100,o=i[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,s*(1-o)+o);return[r*255,n*255,l*255]};u.xyz.rgb=function(i){let e=i[0]/100,t=i[1]/100,s=i[2]/100,o,r,n;return o=e*3.2404542+t*-1.5371385+s*-.4985314,r=e*-.969266+t*1.8760108+s*.041556,n=e*.0556434+t*-.2040259+s*1.0572252,o=te(o),r=te(r),n=te(n),[o*255,r*255,n*255]};u.xyz.lab=function(i){let e=i[0],t=i[1],s=i[2];e/=95.047,t/=100,s/=108.883,e=e>F?e**(1/3):7.787*e+16/116,t=t>F?t**(1/3):7.787*t+16/116,s=s>F?s**(1/3):7.787*s+16/116;let o=116*t-16,r=500*(e-t),n=200*(t-s);return[o,r,n]};u.xyz.oklab=function(i){let e=i[0]/100,t=i[1]/100,s=i[2]/100,o=Math.cbrt(.8189330101*e+.3618667424*t-.1288597137*s),r=Math.cbrt(.0329845436*e+.9293118715*t+.0361456387*s),n=Math.cbrt(.0482003018*e+.2643662691*t+.633851707*s),l=.2104542553*o+.793617785*r-.0040720468*n,a=1.9779984951*o-2.428592205*r+.4505937099*n,c=.0259040371*o+.7827717662*r-.808675766*n;return[l*100,a*100,c*100]};u.oklab.oklch=function(i){return u.lab.lch(i)};u.oklab.xyz=function(i){let e=i[0]/100,t=i[1]/100,s=i[2]/100,o=(.999999998*e+.396337792*t+.215803758*s)**3,r=(1.000000008*e-.105561342*t-.063854175*s)**3,n=(1.000000055*e-.089484182*t-1.291485538*s)**3,l=1.227013851*o-.55779998*r+.281256149*n,a=-.040580178*o+1.11225687*r-.071676679*n,c=-.076381285*o-.421481978*r+1.58616322*n;return[l*100,a*100,c*100]};u.oklab.rgb=function(i){let e=i[0]/100,t=i[1]/100,s=i[2]/100,o=(e+.3963377774*t+.2158037573*s)**3,r=(e-.1055613458*t-.0638541728*s)**3,n=(e-.0894841775*t-1.291485548*s)**3,l=te(4.0767416621*o-3.3077115913*r+.2309699292*n),a=te(-1.2684380046*o+2.6097574011*r-.3413193965*n),c=te(-.0041960863*o-.7034186147*r+1.707614701*n);return[l*255,a*255,c*255]};u.oklch.oklab=function(i){return u.lch.lab(i)};u.lab.xyz=function(i){let e=i[0],t=i[1],s=i[2],o,r,n;r=(e+16)/116,o=t/500+r,n=r-s/200;let l=r**3,a=o**3,c=n**3;return r=l>F?l:(r-16/116)/7.787,o=a>F?a:(o-16/116)/7.787,n=c>F?c:(n-16/116)/7.787,o*=95.047,r*=100,n*=108.883,[o,r,n]};u.lab.lch=function(i){let e=i[0],t=i[1],s=i[2],o;o=Math.atan2(s,t)*360/2/Math.PI,o<0&&(o+=360);let n=Math.sqrt(t*t+s*s);return[e,n,o]};u.lch.lab=function(i){let e=i[0],t=i[1],o=i[2]/360*2*Math.PI,r=t*Math.cos(o),n=t*Math.sin(o);return[e,r,n]};u.rgb.ansi16=function(i,e=null){let[t,s,o]=i,r=e===null?u.rgb.hsv(i)[2]:e;if(r=Math.round(r/50),r===0)return 30;let n=30+(Math.round(o/255)<<2|Math.round(s/255)<<1|Math.round(t/255));return r===2&&(n+=60),n};u.hsv.ansi16=function(i){return u.rgb.ansi16(u.hsv.rgb(i),i[2])};u.rgb.ansi256=function(i){let e=i[0],t=i[1],s=i[2];return e>>4===t>>4&&t>>4===s>>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(s/255*5)};u.ansi16.rgb=function(i){i=i[0];let e=i%10;if(e===0||e===7)return i>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(Math.trunc(i>50)+1)*.5,s=(e&1)*t*255,o=(e>>
11&1)*t*255,r=(e>>2&1)*t*255;return[s,o,r]};u.ansi256.rgb=function(i){if(i=i[0],i>=232){let r=(i-232)*10+8;return[r,r,r]}i-=16;let e,t=Math.floor(i/36)/5*255,s=Math.floor((e=i%36)/6)/5*255,o=e%6/5*255;return[t,s,o]};u.rgb.hex=function(i){let t=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".slice(t.length)+t};u.hex.rgb=function(i){let e=i.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 s=Number.parseInt(t,16),o=s>>16&255,r=s>>8&255,n=s&255;return[o,r,n]};u.rgb.hcg=function(i){let e=i[0]/255,t=i[1]/255,s=i[2]/255,o=Math.max(Math.max(e,t),s),r=Math.min(Math.min(e,t),s),n=o-r,l,a=n<1?r/(1-n):0;return n<=0?l=0:o===e?l=(t-s)/n%6:o===t?l=2+(s-e)/n:l=4+(e-t)/n,l/=6,l%=1,[l*360,n*100,a*100]};u.hsl.hcg=function(i){let e=i[1]/100,t=i[2]/100,s=t<.5?2*e*t:2*e*(1-t),o=0;return s<1&&(o=(t-.5*s)/(1-s)),[i[0],s*100,o*100]};u.hsv.hcg=function(i){let e=i[1]/100,t=i[2]/100,s=e*t,o=0;return s<1&&(o=(t-s)/(1-s)),[i[0],s*100,o*100]};u.hcg.rgb=function(i){let e=i[0]/360,t=i[1]/100,s=i[2]/100;if(t===0)return[s*255,s*255,s*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)*s,[(t*o[0]+a)*255,(t*o[1]+a)*255,(t*o[2]+a)*255]};u.hcg.hsv=function(i){let e=i[1]/100,t=i[2]/100,s=e+t*(1-e),o=0;return s>0&&(o=e/s),[i[0],o*100,s*100]};u.hcg.hsl=function(i){let e=i[1]/100,s=i[2]/100*(1-e)+.5*e,o=0;return s>0&&s<.5?o=e/(2*s):s>=.5&&s<1&&(o=e/(2*(1-s))),[i[0],o*100,s*100]};u.hcg.hwb=function(i){let e=i[1]/100,t=i[2]/100,s=e+t*(1-e);return[i[0],(s-e)*100,(1-s)*100]};u.hwb.hcg=function(i){let e=i[1]/100,s=1-i[2]/100,o=s-e,r=0;return o<1&&(r=(s-o)/(1-o)),[i[0],o*100,r*100]};u.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};u.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};u.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};u.gray.hsl=function(i){return[0,0,i[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(i){return[0,100,i[0]]};u.gray.cmyk=function(i){return[0,0,0,i[0]]};u.gray.lab=function(i){return[i[0],0,0]};u.gray.hex=function(i){let e=Math.round(i[0]/100*255)&255,s=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(s.length)+s};u.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]};function Hr(){let i={},e=Object.keys(N);for(let{length:t}=e,s=0;s<t;s++)i[e[s]]={distance:-1,parent:null};return i}function zr(i){let e=Hr(),t=[i];for(e[i].distance=0;t.length>0;){let s=t.pop(),o=Object.keys(N[s]);for(let{length:r}=o,n=0;n<r;n++){let l=o[n],a=e[l];a.distance===-1&&(a.distance=e[s].distance+1,a.parent=s,t.unshift(l))}}return e}function Gr(i,e){return function(t){return e(i(t))}}function $r(i,e){let t=[e[i].parent,i],s=N[e[i].parent][i],o=e[i].parent;for(;e[o].parent;)t.unshift(e[o].parent),s=Gr(N[e[o].parent][o],s),o=e[o].parent;return s.conversion=t,s}function jr(i){let e=zr(i),t={},s=Object.keys(e);for(let{length:o}=s,r=0;r<o;r++){let n=s[r];e[n].parent!==null&&(t[n]=$r(n,e))}return t}var Eo=jr;var se={},Ur=Object.keys(N);function Kr(i){let e=function(...t){let s=t[0];return s==null?s:(s.length>1&&(t=s),i(t))};return"conversion"in i&&(e.conversion=i.conversion),e}function qr(i){let e=function(...t){let s=t[0];if(s==null)return s;s.length>1&&(t=s);let o=i(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 i&&(e.conversion=i.conversion),e}for(let i of Ur){se[i]={},Object.defineProperty(se[i],"channels",{value:N[i].channels}),Object.defineProperty(se[i],"labels",{value:N[i].labels});let e=Eo(i),t=Object.keys(e);for(let s of t){let o=e[s];se[i][s]=qr(o),se[i][s].raw=Kr(o)}}var Ii=se;var G=(i,e=0,t=1)=>i>t?t:i<e?e:i,w=(i,e=0,t=Math.pow(10,e))=>Math.round(t*i)/t;var ef={grad:360/400,turn:360,rad:360/(Math.PI*2)},Oo=i=>Zr(rt(i)),rt=i=>(i[0]==="#"&&(i=i.substring(1)),i.length<6?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?w(parseInt(i[3]+i[3],16)/255,2):1}:{r:parseInt(i.substring(0,2),16),g:parseInt(i.substring(2,4),16),b:parseInt(i.substring(4,6),16),a:i.length===8?w(parseInt(i.substring(6,8),16)/255,2):1});var Po=i=>Qr(Yr(i)),Xr=({h:i,s:e,v:t,a:s})=>{let o=(200-e)*t/100;return{h:w(i),s:w(o>0&&o<200?e*t/100/(o<=100?o:200-o)*100:0),l:w(o/2),a:w(s,2)}};var Te=i=>{let{h:e,s:t,l:s}=Xr(i);return`hsl(${e}, ${t}%, ${s}%)`};var Yr=({h:i,s:e,v:t,a:s})=>{i=i/360*6,e=e/100,t=t/100;let o=Math.floor(i),r=t*(1-e),n=t*(1-(i-o)*e),l=t*(1-(1-i+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(s,2)}};var ot=i=>{let e=i.toString(16);return e.length<2?"0"+e:e},Qr=({r:i,g:e,b:t,a:s})=>{let o=s<1?ot(w(s*255)):"";return"#"+ot(i)+ot(e)+ot(t)+o},Zr=({r:i,g:e,b:t,a:s})=>{let o=Math.max(i,e,t),r=o-Math.min(i,e,t),n=r?o===i?(e-t)/r:o===e?2+(t-i)/r:4+(i-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:s}};var Ei=(i,e)=>{if(i===e)return!0;for(let t in i)if(i[t]!==e[t])return!1;return!0};var Bo=(i,e)=>i.toLowerCase()===e.toLowerCase()?!0:Ei(rt(i),rt(e));var So={},nt=i=>{let e=So[i];return e||(e=document.createElement("template"),e.innerHTML=i,So[i]=e),e},ve=(i,e,t)=>{i.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))};var oe=!1,Oi=i=>"touches"in i,Jr=i=>oe&&!Oi(i)?!1:(oe||(oe=Oi(i)),!0),Mo=(i,e)=>{let t=Oi(e)?e.touches[0]:e,s=i.el.getBoundingClientRect();ve(i.el,"move",i.getMove({x:G((t.pageX-(s.left+window.pageXOffset))/s.width),y:G((t.pageY-(s.top+window.pageYOffset))/s.height)}))},en=(i,e)=>{let t=e.keyCode;t>40||i.xy&&t<37||t<33||(e.preventDefault(),ve(i.el,"move",i.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)))},re=class{constructor(e,t,s,o){let r=nt(`<div role="slider" tabindex="0" part="${t}" ${s}><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;
1t(oe?"touchmove":"mousemove",this),t(oe?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!Jr(e)||!oe&&e.button!=0)return;this.el.focus(),Mo(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),Mo(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":en(this,e);break}}style(e){e.forEach((t,s)=>{for(let o in t)this.nodes[s].style.setProperty(o,t[o])})}};var lt=class extends re{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:Te({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${w(e)}`)}getMove(e,t){return{h:t?G(this.h+e.x*360,0,360):360*e.x}}};var at=class extends re{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Te(e)},{"background-color":Te({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?G(this.hsva.s+e.x*100,0,100):e.x*100,v:t?G(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var Lo=':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 Ao="[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 Do="[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 ct=Symbol("same"),Pi=Symbol("color"),Fo=Symbol("hsva"),Bi=Symbol("update"),No=Symbol("parts"),Ro=Symbol("css"),Wo=Symbol("sliders"),ht=class extends HTMLElement{static get observedAttributes(){return["color"]}get[Ro](){return[Lo,Ao,Do]}get[Wo](){return[at,lt]}get color(){return this[Pi]}set color(e){if(!this[ct](e)){let t=this.colorModel.toHsva(e);this[Bi](t),this[Pi]=e}}constructor(){super();let e=nt(`<style>${this[Ro].join("")}</style>`),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[No]=this[Wo].map(s=>new s(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,s){let o=this.colorModel.fromAttr(s);this[ct](o)||(this.color=o)}handleEvent(e){let t=this[Fo],s={...t,...e.detail};this[Bi](s);let o;!Ei(s,t)&&!this[ct](o=this.colorModel.fromHsva(s))&&(this[Pi]=o,ve(this,"color-changed",{value:o}))}[ct](e){return this.color&&this.colorModel.equal(e,this.color)}[Bi](e){this[Fo]=e,this[No].forEach(t=>t.update(e))}};var tn={defaultColor:"#000",toHsva:Oo,fromHsva:({h:i,s:e,v:t})=>Po({h:i,s:e,v:t,a:1}),equal:Bo,fromAttr:i=>i},ut=class extends ht{get colorModel(){return tn}};import{AttributeOperation as Lf,Batch as Af,BubblingEmitterMixin as Df,BubblingEventInfo as Ff,ClickObserver as Nf,CompositionObserver as Rf,Conversion as Wf,ConversionHelpers as Hf,DataController as zf,Differ as Gf,DomEventObserver as $f,DowncastHelpers as jf,EditingController as Uf,EditingView as Kf,FakeSelectionObserver as qf,FocusObserver as Xf,History as Yf,HtmlDataProcessor as Qf,InputObserver as Zf,InsertOperation as Jf,KeyObserver as ep,MarkerCollection as tp,MarkerOperation as ip,Matcher as sp,MergeOperation as op,Model as rp,ModelDocument as np,ModelDocumentFragment as lp,ModelDocumentSelection as ap,ModelElement as cp,ModelLivePosition as hp,ModelLiveRange as up,ModelNode as dp,ModelNodeList as fp,ModelPosition as pp,ModelRange as mp,ModelRootElement as bp,ModelSchemaContext as gp,ModelSelection as wp,ModelText as _p,ModelTextProxy as kp,ModelTreeWalker as yp,ModelTypeCheckable as xp,ModelWriter as Tp,MouseObserver as vp,MoveOperation as Vp,MutationObserver as Cp,NoOperation as Ip,Ob
1server as Ho,OperationFactory as Ep,RenameOperation as Op,RootAttributeOperation as Pp,RootOperation as Bp,SelectionObserver as Sp,SplitOperation as Mp,StylesMap as Lp,StylesProcessor as Ap,TabObserver as Dp,TouchObserver as Fp,UpcastHelpers as Np,UpcastWriter as Rp,ViewAttributeElement as Wp,ViewContainerElement as Hp,ViewDataTransfer as zp,ViewDocument as Gp,ViewDocumentDomEventData as $p,ViewDocumentFragment as jp,ViewDocumentSelection as Up,ViewDomConverter as Kp,ViewDowncastWriter as qp,ViewEditableElement as Xp,ViewElement as Yp,ViewEmptyElement as Qp,ViewNode as Zp,ViewPosition as Jp,ViewRange as em,ViewRawElement as tm,ViewRenderer as im,ViewRootEditableElement as sm,ViewSelection as om,ViewText as rm,ViewTextProxy as nm,ViewTokenList as lm,ViewTreeWalker as am,ViewTypeCheckable as cm,ViewUIElement as hm,ViewUpcastWriter as um,XmlDataProcessor as dm,_DataProcessorBasicHtmlWriter as fm,_DetachOperation as pm,_MapperCache as mm,_OperationReplayer as bm,_VIEW_BR_FILLER as gm,_VIEW_INLINE_FILLER as wm,_VIEW_INLINE_FILLER_LENGTH as _m,_VIEW_MARKED_NBSP_FILLER as km,_VIEW_NBSP_FILLER as ym,_ViewElementConversionConsumables as xm,_autoParagraphEmptyModelRoots as Tm,_convertMapToStringifiedObject as vm,_convertMapToTags as Vm,_deleteModelContent as Cm,_downcastCleanSelection as Im,_downcastConvertCollapsedSelection as Em,_downcastConvertRangeSelection as Om,_downcastCreateViewElementFromDowncastHighlightDescriptor as Pm,_downcastInsertAttributesAndChildren as Bm,_downcastInsertElement as Sm,_downcastInsertStructure as Mm,_downcastInsertText as Lm,_downcastInsertUIElement as Am,_downcastRemove as Dm,_downcastWrap as Fm,_dumpTrees as Nm,_getDataWithoutViewFiller as Rm,_getModelData as Wm,_getModelNodeAfterPosition as Hm,_getModelNodeBeforePosition as zm,_getModelTextNodeAtPosition as Gm,_getSelectedModelContent as $m,_getViewData as jm,_initDocumentDumping as Um,_injectModelSelectionPostFixer as Km,_injectViewQuirksHandling as qm,_injectViewUIElementHandling as Xm,_insertIntoModelNodeList as Ym,_insertModelContent as Qm,_insertModelObject as Zm,_isInlineViewFiller as Jm,_isParagraphableModelNode as eb,_isViewPatternMatched as tb,_logDocument as ib,_mergeIntersectingModelRanges as sb,_modifyModelSelection as ob,_moveInModelNodeList as rb,_normalizeConversionConsumables as nb,_normalizeInModelNodeList as lb,_operationTransform as ab,_parseModel as cb,_parseView as hb,_removeFromModelNodeList as ub,_setAttributeInModelNodeList as db,_setModelData as fb,_setViewData as pb,_startsWithViewFiller as mb,_stringifyModel as bb,_stringifyView as gb,_tryFixingModelRange as wb,_upcastConvertSelectionChange as _b,_upcastConvertText as kb,_upcastConvertToModelFragment as yb,_wrapInModelParagraph as xb,addBackgroundStylesRules as Tb,addBorderStylesRules as vb,addMarginStylesRules as Vb,addPaddingStylesRules as Cb,autoParagraphEmptyRoots as Ib,disableViewPlaceholder as Eb,enableViewPlaceholder as Ob,getBoxSidesStyleShorthandValue as Pb,getBoxSidesStyleValueReducer as Bb,getBoxSidesStyleValues as Sb,getPositionStyleShorthandNormalizer as Mb,getShorthandStylesValues as Lb,getViewFillerOffset as Ab,hideViewPlaceholder as Db,isAttachmentStyleValue as Fb,isColorStyleValue as Nb,isLengthStyleValue as Rb,isLineStyleValue as Wb,isParagraphable as Hb,isPercentageStyleValue as zb,isPositionStyleValue as Gb,isRepeatStyleValue as $b,isURLStyleValue as jb,needsViewPlaceholder as Ub,showViewPlaceholder as Kb,transformOperationSets as qb,wrapInParagraph as Xb}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";var E=class extends Ke{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,s,o)=>{this._renderViewIntoCollectionParent(s,o)}),this.on("remove",(t,s)=>{s.element&&this._parentElement&&s.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||!sn(e))throw new y("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(let s of this)for(let o of e)s.delegate(o).to(t);this.on("add",(s,o)=>{for(let r of e)o.delegate(r).to(t)}),this.on("remove",(s,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 sn(i){return i.every(e=>typeof e=="string")}var on="http://www.w3.org/1999/xhtml",x=class extends wi(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Go(zo(e))),this._isRendered=!1,this._revertData=null}render(){let e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Uo(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new y("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(let s of t.children)wt(s)?yield s:cs(s)&&(yield*e(s))}yield*e(this)}static bind(e,t){return{to(s,o){return new gt({eventNameOrFunction:s,attribute:s,observable:e,emitter:t,callback:o})},if(s,o,r){return new Ce({observable:e,emitter:t,attribute:s,valueIfTrue:o,callback:r})}}}static extend(e,t){if(e._isRendered)throw new y("template-extend-render",[this,e]);dr(e,Go(zo(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new y("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||on,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(""),mt(this.text)?this._bindToObservable({schema:this.text,updater:nn(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;let t=e.node,s=e.revertData;for(let o in this.attributes){let r=t.getAttribute(o),n=this.attributes[o];s&&(s.attributes[o]=r);let l=jo(n)?n[0].ns:null;if(mt(n)){let a=jo(n)?n[0].value:n;s&&Ko(o)&&a.unshift(r),this._bindToObservable({schema:a,updater:ln(t,o,l),data:e})}
1else if(o=="style"&&typeof n[0]!="string")this._renderStyleAttribute(n[0],e);else{s&&r&&Ko(o)&&n.unshift(r);let a=n.map(c=>c&&(c.value||c)).reduce((c,h)=>c.concat(h),[]).reduce(ur,"");ae(a)||t.setAttributeNS(l,o,a)}}}_renderStyleAttribute(e,t){let s=t.node;for(let o in e){let r=e[o];mt(r)?this._bindToObservable({schema:[r],updater:an(s,o),data:t}):s.style[o]=r}}_renderElementChildren(e){let t=e.node,s=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying,r=0;for(let n of this.children)if(hs(n)){if(!o){n.setParent(t);for(let l of n)s.appendChild(l.element)}}else if(wt(n))o||(n.isRendered||n.render(),s.appendChild(n.element));else if(ki(n))s.appendChild(n);else if(o){let l=e.revertData,a=Uo();l.children.push(a),n._renderNode({intoFragment:!1,node:s.childNodes[r++],isApplying:!0,revertData:a})}else s.appendChild(n.render());e.intoFragment&&t.appendChild(s)}_setUpListeners(e){if(this.eventListeners)for(let t in this.eventListeners){let s=this.eventListeners[t].map(o=>{let[r,n]=t.split("@");return o.activateDomEventListener(r,n,e)});e.revertData&&e.revertData.bindings.push(s)}}_bindToObservable({schema:e,updater:t,data:s}){let o=s.revertData;cr(e,t,s);let r=e.filter(n=>!ae(n)).filter(n=>n.observable).map(n=>n.activateAttributeListener(e,t,s));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 s=e;for(let o in t.attributes){let r=t.attributes[o];r===null?s.removeAttribute(o):s.setAttribute(o,r)}for(let o=0;o<t.children.length;++o)this._revertTemplateFromNode(s.childNodes[o],t.children[o])}},$=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,s){let o=()=>cr(e,t,s);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}},gt=class extends ${eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,s){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(s.node,e,o),()=>{this.emitter.stopListening(s.node,e,o)}}},Ce=class extends ${valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){let t=super.getValue(e);return ae(t)?!1:this.valueIfTrue||!0}};function mt(i){return i?(i.value&&(i=i.value),Array.isArray(i)?i.some(mt):i instanceof $):!1}function rn(i,e){return i.map(t=>t instanceof $?t.getValue(e):t)}function cr(i,e,{node:t}){let s=rn(i,t),o;i.length==1&&i[0]instanceof Ce?o=s[0]:o=s.reduce(ur,""),ae(o)?e.remove():e.set(o)}function nn(i){return{set(e){i.textContent=e},remove(){i.textContent=""}}}function ln(i,e,t){return{set(s){i.setAttributeNS(t,e,s)},remove(){i.removeAttributeNS(t,e)}}}function an(i,e){return{set(t){i.style[e]=t},remove(){i.style[e]=null}}}function zo(i){return _e(i,t=>{if(t&&(t instanceof $||cs(t)||wt(t)||hs(t)))return t})}function Go(i){if(typeof i=="string"?i=un(i):i.text&&dn(i),i.on&&(i.eventListeners=hn(i.on),delete i.on),!i.text){i.attributes&&cn(i.attributes);let e=[];
1if(i.children)if(hs(i.children))e.push(i.children);else for(let t of i.children)cs(t)||wt(t)||ki(t)?e.push(t):e.push(new x(t));i.children=e}return i}function cn(i){for(let e in i)i[e].value&&(i[e].value=we(i[e].value)),hr(i,e)}function hn(i){for(let e in i)hr(i,e);return i}function un(i){return{text:[i]}}function dn(i){i.text=we(i.text)}function hr(i,e){i[e]=we(i[e])}function ur(i,e){return ae(e)?i:ae(i)?e:`${i} ${e}`}function $o(i,e){for(let t in e)i[t]?i[t].push(...e[t]):i[t]=e[t]}function dr(i,e){if(e.attributes&&(i.attributes||(i.attributes={}),$o(i.attributes,e.attributes)),e.eventListeners&&(i.eventListeners||(i.eventListeners={}),$o(i.eventListeners,e.eventListeners)),e.text&&i.text.push(...e.text),e.children&&e.children.length){if(i.children.length!=e.children.length)throw new y("ui-template-extend-children-mismatch",i);let t=0;for(let s of e.children)dr(i.children[t++],s)}}function ae(i){return!i&&i!==0}function wt(i){return i instanceof d}function cs(i){return i instanceof x}function hs(i){return i instanceof E}function jo(i){return Q(i[0])&&i[0].ns}function Uo(){return{children:[],bindings:[],attributes:{}}}function Ko(i){return i=="class"||i=="style"}var d=class extends fe(pe()){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 Ke,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,s)=>{s.locale=e,s.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=x.bind(this,this)}createCollection(e){let t=new E(e);return this._viewCollections.add(t),t}registerChild(e){_i(e)||(e=[e]);for(let t of e)this._unboundChildren.add(t)}deregisterChild(e){_i(e)||(e=[e]);for(let t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new x(e)}extendTemplate(e){x.extend(this.template,e)}render(){if(this.isRendered)throw new y("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)}},Ni={POLITE:"polite",ASSERTIVE:"assertive"},_t=class{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(let t of Object.values(Ni))this.announce("",t)})}announce(e,t=Ni.POLITE){let s=this.editor;if(!s.ui.view)return;this.view||(this.view=new kt(s.locale),s.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 yt(s,o),this.view.regionViews.add(n)),n.announce({announcement:e,isUnsafeHTML:r})}},kt=class extends d{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}},yt=class extends d{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 s=document.createElement("li");t?this._domConverter.setContentOf(s,e):s.innerText=e,this._listElement.appendChild(s)}get _listElement(){return this.element.querySelector("ul")}};function pi({emitter:i,activator:e,callback:t,contextElements:s,listenerOptions:o}){i.listenTo(document,"mousedown",(r,n)=>{if(!e())return;let l=typeof n.composedPath=="function"?n.composedPath():[],a=typeof s=="function"?s():s;for(let c of a)if(c.contains(n.target)||l.includes(c))return;t()},o)}function fn(i){class e extends i{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...s){super(...s),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return e}function fr(i){class e extends i{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...s){super(...s),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(p.document,"mouseup",this._onDragEndBound),this.listenTo(p.document,"touchend",this._onDragEndBound),this.listenTo(p.document,"mousemove",this._onDragBound),this.listenTo(p.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(p.document,"mouseup",this._onDragEndBound),this.stopListening(p.document,"touchend",this._onDragEndBound),this.stopListening(p.document,"mousemove",this._onDragBound),this.stopListening(p.document,"touchmove",this._onDragBound)}_onDragStart(s,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(s,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(s){return this.dragHandleElement?this.dragHandleElement===s.target||s.target instanceof HTMLElement&&this.dragHandleElement.contains(s.target):!1}}return e}function pn({view:i}){i.listenTo(i.element,"submit",(e,t)=>{t.preventDefault(),i.fire("submit")},{useCapture:!0})}function pr({keystrokeHandler:i,focusTracker:e,gridItems:t,numberOfColumns:s,uiLanguageDirection:o}){let r=typeof s=="number"?()=>s:s;i.set("arrowright",n((c,h)=>o==="rtl"?a(c,h.length):l(c,h.length))),i.set("arrowleft",n((c,h)=>o==="rtl"?l(c,h.length):a(c,h.length))),i.set("arrowup",n((c,h)=>{let f=c-r();return f<0&&(f=c+r()*Math.floor(h.length/r()),f>h.length-1&&(f-=r())),f})),i.set("arrowdown",n((c,h)=>{let f=c+r();return f>h.length-1&&(f=c%r()),f}));function n(c){return h=>{let f=t.find(gi=>gi.element===e.focusedElement),m=t.getIndex(f),k=c(m,t);t.get(k).focus(),h.stopPropagation(),h.preventDefault()}}function l(c,h){return c===h-1?0:c+1}function a(c,h){return c===0?h-1:c-1}}var j=class extends d{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${W()}`;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")}]})}},xt=class extends d{constructor(e,t){super(e);let s=e.t,o=new j;o.text=s("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:[B(document,"p",{},s("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())
1),o]})}focus(){this.element.focus()}_createCategories(e){return e.map(t=>{let s=[B(document,"h3",{},t.label),...Array.from(t.groups.values()).map(o=>this._createGroup(o)).flat()];return t.description&&s.splice(1,0,B(document,"p",{},t.description)),B(document,"section",{},s)})}_createGroup(e){let t=e.keystrokes.sort((o,r)=>o.label.localeCompare(r.label)).map(o=>this._createGroupRow(o)).flat(),s=[B(document,"dl",{},t)];return e.label&&s.unshift(B(document,"h4",{},e.label)),s}_createGroupRow(e){let t=this.locale.t,s=B(document,"dt"),o=B(document,"dd"),r=bn(e.keystroke),n=[];for(let l of r)n.push(l.map(mn).join(""));return s.innerHTML=e.label,o.innerHTML=n.join(", ")+(e.mayRequireFn&&S.isMac?` ${t("(may require <kbd>Fn</kbd>)")}`:""),[s,o]}};function mn(i){return me(i).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}function bn(i){return typeof i=="string"?[[i]]:typeof i[0]=="string"?[i]:i}var O=class i extends d{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 y("ui-iconview-invalid-svg",this);let s=t.getAttribute("viewBox");s&&(this.viewBox=s);for(let{name:o,value:r}of Array.from(t.attributes))i.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=>{e.style.fill=this.fillColor})}},Ie=class extends d{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")}]})}},b=class extends d{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new Ie){super(e);let s=this.bindTemplate,o=W();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 O,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",s.to("class"),s.if("isEnabled","ck-disabled",n=>!n),s.if("isVisible","ck-hidden",n=>!n),s.to("isOn",n=>n?"ck-on":"ck-off"),s.if("withText","ck-button_with-text"),s.if("withKeystroke","ck-button_with-keystroke")],role:s.to("role"),type:s.to("type",n=>n||"button"),tabindex:s.to("tabindex"),"aria-checked":s.to("_ariaChecked"),"aria-pressed":s.to("_ariaPressed"),"aria-label":s.to("ariaLabel"),"aria-labelledby":s.to("ariaLabelledBy"),"aria-disabled":s.if("isEnabled",!0,n=>!n),"data-cke-tooltip-text":s.to("_tooltipString"),"data-cke-tooltip-position":s.to("tooltipPosition")},children:this.children,on:{click:s.to(n=>{this.isEnabled?this.fire("execute"):n.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(n,l,a)=>!l||qo(a)?!1:String(!!n)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(n,l,a)=>!l||!qo(a)?!1:String(!!n)),S.isSafari&&(this._focusDelayed||(this._focusDelayed=gs(()=>
1this.focus(),0)),r.on.mousedown=s.to(()=>{this._focusDelayed()}),r.on.mouseup=s.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(r)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,s,o)=>{s&&!o?this.children.add(this.iconView,0):!s&&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 d;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>me(t))}]}),e}_getTooltipString(e,t,s){return e?typeof e=="string"?e:(s&&(s=me(s)),e instanceof Function?e(t,s):`${t}${s?` (${s})`:""}`):""}};function qo(i){switch(i){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}var Tt=class extends d{children;iconView;constructor(e,t={}){super(e);let s=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",s.to("class")]},children:this.children}),t.icon&&(this.iconView=new O,this.iconView.content=t.icon,this.children.add(this.iconView));let o=new d(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:s.to("label")}]}),this.children.add(o)}},P=class extends wi(){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 s=e.actions[t];typeof s=="string"&&(s=[s]);for(let o of s)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(Si)||null}get last(){return this.focusables.filter(Si).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,s)=>{let o=t.element===this.focusTracker.focusedElement;return o&&(e=s),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",s=>{let o=t();this.focusNext(),o!==t()&&s.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",s=>{let o=t();this.focusPrevious(),o!==t()&&s.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){let t=this.focusables.length;if(!t)return null;let s=this.current;if(s===null)return this[e===1?"first":"last"];let o=this.focusables.get(s),r=(s+t+e)%t;do{let n=this.focusables.get(r);if(Si(n)){o=n;break}r=(r+t+e)%t}while(r!==s);return o}};function Si(i){return ue(i)&&M(i.element)}function ue(i){return"focus"in i&&typeof i.focus=="function"}function mr(i){return ue(i)&&"focusCycler"in i&&i.focusCycler instanceof P}var vt=class extends d{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new T,this._focusTracker=new _,this._focusables=new E,this.focusCycler=new P({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 s=new b(this.locale),o;s.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(s);for(o in t)o!="onExecute"&&o!="onCreate"&&s.set(o,t[o]);this.children.add(s)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}
1_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}},Vt=class extends d{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)}},v={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"},Xo=L("px"),Ct=class i extends fr(d){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:s,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",v.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=s,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new T,this.focusTracker=new _,this._focusables=new E,this._focusCycler=new P({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=>Xo(l)),left:r.to("_left",l=>Xo(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:s})=>{this.wasMoved=!0,this.moveBy(t,s)}),this.listenTo(p.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(p.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,t,s)=>{s&&(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:s=!0,content:o,actionButtons:r}){t&&(this.headerView=new Tt(this.locale,{icon:e}),s&&(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 d&&(o=[o]),this.contentView=new Vt(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),r&&(this.actionsView=new vt(this.locale),this.actionsView.setButtons(r),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){let s=this._getViewportRect(),o=this._getDialogRect();e+o.width>s.right&&(e=s.right-o.width),e<s.left&&(e=s.left),t<s.top&&(t=s.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,s;this._getCurrentDomRoot()?s=this._getVisibleDomRootRect(e):t=v.SCREEN_CENTER;let o=i.defaultOffset,r=this._getDialogRect();switch(t){case v.EDITOR_TOP_SIDE:{if(s){let n=this.locale.contentLanguageDirection==="ltr"?s.right-r.width-o:s.left+o;this.moveTo(n,s.top+o)}else this._moveOffScreen();break}case v.EDITOR_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-r.width/2),Math.round(s.top+s.height/2-r.height/2)):this._moveOffScreen();break}case v.SCREEN_CENTER:{this.moveTo(Math.round((e.width-r.width)/2),Math.round((e.height-r.height)/2));break}case v.EDITOR_TOP_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-r.width/2),s.top+o):this._moveOffScreen();break}case v.EDITOR_BOTTOM_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-r.width/2),s.bottom-r.height-o):this._moveOffScreen();break}case v.EDITOR_ABOVE_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-r.width/2),s.top-r.height-o):this._moveOffScreen();break}case v.EDITOR_BELOW_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-r.width/2),s.bottom+o):this._moveOffScreen();break}}}_getVisibleDomRootRect(e){let t=new g(this._getCurrentDomRoot()).getVisible();if(t){if(t=e.getIntersection(t),!t)return null}else return null;return t}
1_getDialogRect(){return new g(this.element.firstElementChild)}_getViewportRect(){let e=new g(p.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=[];if(this.contentView)for(let t of this.contentView.children)ue(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),mr(t)&&this._focusCycler.chain(t.focusCycler)})}_createCloseButton(){let e=new b(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:it}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}},It=class i extends J{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(),i._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",()=>{i._visibleDialogPlugin&&i._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,s)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),s())})}_initMultiRootIntegration(){let e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;let t=e.document.differ.getChangedRoots();for(let s of t)s.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:s,hasCloseButton:o=!0,content:r,actionButtons:n,className:l,isModal:a,position:c,onHide:h,keystrokeHandlerOptions:f}){let m=this.editor;this.view=new Ct(m.locale,{getCurrentDomRoot:()=>m.editing.view.getDomRoot(m.model.document.selection.anchor.root.rootName),getViewportOffset:()=>m.ui.viewportOffset,keystrokeHandlerOptions:f});let k=this.view;k.on("close",()=>{this.hide()}),m.ui.view.body.add(k),m.keystrokes.listenTo(k.element),c||(c=a?v.SCREEN_CENTER:v.EDITOR_CENTER),a&&this._lockBodyScroll(),k.set({position:c,_isVisible:!0,className:l,isModal:a}),k.setupParts({icon:t,title:s,hasCloseButton:o,content:r,actionButtons:n}),this.id=e,h&&(this._onHide=h),this.isOpen=!0,i._visibleDialogPlugin=this}hide(){i._visibleDialogPlugin&&i._visibleDialogPlugin.fire(`hide:${i._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,i._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}},A=class extends b{_checkIconHolderView=new Et;constructor(e,t=new Ie){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});let s=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",s.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,s)=>{let{children:o,_checkIconHolderView:r}=this;s?o.add(r,0):o.remove(r)})}},Et=class extends d{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,s)=>{let{children:o,_checkIconView:r}=this;s&&!o.has(r)?o.add(r):!s&&o.has(r)&&o.remove(r)})}_createCheckIconView(){let e=new O;return e.content=Vi,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}},Ee=class extends A{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}},Ri=class extends J{contentView=null;static get requires(){return[It]}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 s=this._createButton(b);return s.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),s}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{let s=this._createButton(Ee);return s.label=t("Accessibility"),s}),e.keystrokes.set("Alt+0",(s,o)=>{this._toggleDialog(),o()}),this._setupRootLabels()}_createButton(e){let t=this.editor,s=t.plugins.get("Dialog"),o=t.locale,r=new e(o);return r.set({keystroke:"Alt+0",icon:vi,isToggleable:!0}),r.on("execute",()=>this._toggleDialog()),r.bind("isOn").to(s,"id",n=>n==="accessibilityHelp"),r}_setupRootLabels(){let e=this.editor,t=e.editing.view,s=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"),s("Press %0 for help.",[me("Alt+0")])].filter(c=>c).join(". ");r.setAttribute("aria-label",a,n)}}_toggleDialog(){let e=this.editor,t=e.plugins.get("Dialog"),s=e.locale.t;this.contentView||(this.contentView=new xt(e.locale,e.accessibility.keystrokeInfos)),t.id==="accessibilityHelp"?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:s("Accessibility help"),icon:vi,hasCloseButton:!0,content:this.contentView})}}
1,Ot=class i extends E{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new x({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),(!i._bodyWrapper||!i._bodyWrapper.isConnected)&&(i._bodyWrapper=B(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(i._bodyWrapper)),i._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),i._bodyWrapper&&!i._bodyWrapper.childElementCount&&(i._bodyWrapper.remove(),delete i._bodyWrapper)}},Yo=L("px"),gn={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}},V=class i extends d{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",s=>`ck-balloon-panel_${s}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",Yo),left:t.to("left",Yo)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){let t=bt(e.target);if(t&&!M(t))return!1;this.show();let s=i.defaultPositions,o=Object.assign({},{element:this.element,positions:[s.southArrowNorth,s.southArrowNorthMiddleWest,s.southArrowNorthMiddleEast,s.southArrowNorthWest,s.southArrowNorthEast,s.northArrowSouth,s.northArrowSouthMiddleWest,s.northArrowSouthMiddleEast,s.northArrowSouthWest,s.northArrowSouthEast,s.viewportStickyNorth],limiter:p.document.body,fitInViewport:!0},e),r=i._getOptimalPosition(o)||gn,n=parseInt(r.left),l=parseInt(r.top),a=r.name,c=r.config||{},{withArrow:h=!0}=c;return this.top=l,this.left=n,this.position=a,this.withArrow=h,!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=bt(e.target),s=e.limiter?bt(e.limiter):p.document.body;if(this.listenTo(p.document,"scroll",(o,r)=>{let n=r.target,l=t&&n.contains(t),a=s&&n.contains(s);(l||a||!t||!s)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(p.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(t&&xs(t)&&(t=t.parentElement),t)){let o=()=>{M(t)||this.unpin()};this._resizeObserver=new Y(t,o)}return!0}_stopPinning(){this.stopListening(p.document,"scroll"),this.stopListening(p.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){let{sideOffset:t=i.arrowSideOffset,heightOffset:s=i.arrowHeightOffset,stickyVerticalOffset:o=i.stickyVerticalOffset,config:r}=e;return{northWestArrowSouthWest:(a,c)=>({top:n(a,c),left:a.left-t,name:"arrow_sw",...r&&{config:r}}),northWestArrowSouthMiddleWest:(a,c)=>({top:n(a,c),left:a.left-c.width*.25-t,name:"arrow_smw",...r&&{config:r}}),northWestArrowSouth:(a,c)=>({top:n(a,c),left:a.left-c.width/2,name:"arrow_s",...r&&{config:r}}),northWestArrowSouthMiddleEast:(a,c)=>({top:n(a,c),left:a.left-c.width*.75+t,name:"arrow_sme",...r&&{config:r}}),northWestArrowSouthEast:(a,c)=>({top:n(a,c),left:a.left-c.width+t,name:"arrow_se",...r&&{config:r}}),northArrowSouthWest:(a,c)=>({top:n(a,c),left:a.left+a.width/2-t,name:"arrow_sw",...r&&{config:r}}),northArrowSouthMiddleWest:(a,c)=>({top:n(a,c),left:a.left+a.width/2-c.width*.25-t,name:"arrow_smw",...r&&{config:r}}),northArrowSouth:(a,c)=>
1({top:n(a,c),left:a.left+a.width/2-c.width/2,name:"arrow_s",...r&&{config:r}}),northArrowSouthMiddleEast:(a,c)=>({top:n(a,c),left:a.left+a.width/2-c.width*.75+t,name:"arrow_sme",...r&&{config:r}}),northArrowSouthEast:(a,c)=>({top:n(a,c),left:a.left+a.width/2-c.width+t,name:"arrow_se",...r&&{config:r}}),northEastArrowSouthWest:(a,c)=>({top:n(a,c),left:a.right-t,name:"arrow_sw",...r&&{config:r}}),northEastArrowSouthMiddleWest:(a,c)=>({top:n(a,c),left:a.right-c.width*.25-t,name:"arrow_smw",...r&&{config:r}}),northEastArrowSouth:(a,c)=>({top:n(a,c),left:a.right-c.width/2,name:"arrow_s",...r&&{config:r}}),northEastArrowSouthMiddleEast:(a,c)=>({top:n(a,c),left:a.right-c.width*.75+t,name:"arrow_sme",...r&&{config:r}}),northEastArrowSouthEast:(a,c)=>({top:n(a,c),left:a.right-c.width+t,name:"arrow_se",...r&&{config:r}}),southWestArrowNorthWest:a=>({top:l(a),left:a.left-t,name:"arrow_nw",...r&&{config:r}}),southWestArrowNorthMiddleWest:(a,c)=>({top:l(a),left:a.left-c.width*.25-t,name:"arrow_nmw",...r&&{config:r}}),southWestArrowNorth:(a,c)=>({top:l(a),left:a.left-c.width/2,name:"arrow_n",...r&&{config:r}}),southWestArrowNorthMiddleEast:(a,c)=>({top:l(a),left:a.left-c.width*.75+t,name:"arrow_nme",...r&&{config:r}}),southWestArrowNorthEast:(a,c)=>({top:l(a),left:a.left-c.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,c)=>({top:l(a),left:a.left+a.width/2-c.width*.25-t,name:"arrow_nmw",...r&&{config:r}}),southArrowNorth:(a,c)=>({top:l(a),left:a.left+a.width/2-c.width/2,name:"arrow_n",...r&&{config:r}}),southArrowNorthMiddleEast:(a,c)=>({top:l(a),left:a.left+a.width/2-c.width*.75+t,name:"arrow_nme",...r&&{config:r}}),southArrowNorthEast:(a,c)=>({top:l(a),left:a.left+a.width/2-c.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,c)=>({top:l(a),left:a.right-c.width*.25-t,name:"arrow_nmw",...r&&{config:r}}),southEastArrowNorth:(a,c)=>({top:l(a),left:a.right-c.width/2,name:"arrow_n",...r&&{config:r}}),southEastArrowNorthMiddleEast:(a,c)=>({top:l(a),left:a.right-c.width*.75+t,name:"arrow_nme",...r&&{config:r}}),southEastArrowNorthEast:(a,c)=>({top:l(a),left:a.right-c.width+t,name:"arrow_ne",...r&&{config:r}}),westArrowEast:(a,c)=>({top:a.top+a.height/2-c.height/2,left:a.left-c.width-s,name:"arrow_e",...r&&{config:r}}),eastArrowWest:(a,c)=>({top:a.top+a.height/2-c.height/2,left:a.right+s,name:"arrow_w",...r&&{config:r}}),viewportStickyNorth:(a,c,h)=>{let f=new g(p.document.body).getIntersection(h.getVisible());if(!f)return null;let m=f.getVisible();return!a.getIntersection(m)||!(m.top-a.top-o<c.height&&m.bottom-a.bottom<c.height)?null:{top:m.top+o,left:a.left+a.width/2-c.width/2,name:"arrowless",config:{withArrow:!1,...r}}}};function n(a,c){return a.top-c.height-s}function l(a){return a.bottom+s}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=be;static defaultPositions=i.generatePositions()};function bt(i){return xe(i)?i:ys(i)?i.commonAncestorContainer:typeof i=="function"?bt(i()):null}var wn=50,_n=350,Oe=class extends fe(){editor;_balloonView=null;_showBalloonThrottled=xi(()=>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,s,o)=>{this._updateLastFocusedEditableElement(),o?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,s,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 V,s=this._createBadgeContent();return t.content.add(s),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"?kn(this._lastFocusedEditableElement,e):yn(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){let e=this.editor,t=e.ui.focusTracker.isFocused,s=e.ui.focusTracker.focusedElement;if(!t||!s){this._lastFocusedEditableElement=null;return}let o=Array.from(e.ui.getEditableElementsNames()).map(r=>e.ui.getEditableElement(r));o.includes(s)?this._lastFocusedEditableElement=s:this._lastFocusedEditableElement=o[0]}};function kn(i,e){return br(i,e,(t,s)=>t.left+t.width-s.width-e.horizontalOffset)}function yn(i,e){return br(i,e,t=>t.left+e.horizontalOffset)}function br(i,e,t){return(s,o)=>{let r=new g(i);if(r.width<_n||r.height<wn)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),c=s.clone().moveTo(l,n).getIntersection(o.clone().moveTo(l,n)).getVisible();return!c||c.getArea()<o.getArea()?null:{top:n,left:l,name:`position_${e.position}-side_${e.side}`,config:{withArrow:!1}
1}}}var xn="Powered by",Pt=class extends Oe{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){let e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;let s=e.config.get("licenseKey");if(s=="GPL")return!0;let o=yi(s.split(".")[1]);return o?!o.whiteLabel:!0}_createBadgeContent(){return new Wi(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},s=t.position||e.position,o=s==="inside"?5:e.verticalOffset;return{position:s,side:t.side||e.side,label:t.label===void 0?xn:t.label,verticalOffset:t.verticalOffset!==void 0?t.verticalOffset:o,horizontalOffset:t.horizontalOffset!==void 0?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}},Wi=class extends d{constructor(e,t){super(e);let s=new O,o=this.bindTemplate;s.set({content:vo,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]}]:[],s],on:{dragstart:o.to(r=>r.preventDefault())}}]})}},Pe=class extends b{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 d;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}},Hi=class extends us(b){},Bt=class extends us(A){};function us(i){class e extends i{_fileInputView;constructor(...s){super(...s),this._fileInputView=new zi(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 zi=class extends d{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()}},St=class extends d{buttonView;children;constructor(e,t){super(e);let s=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",s.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:s.if("isCollapsed","hidden"),"aria-labelledby":s.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){let e=new b(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:ee}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",s=>String(s))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",s=>!s),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}};function Tn(i,e){let t=i.t,s={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=s[o.label];return r&&r!=o.label&&(o.label=r),o}
1)}function vn(i){return i.map(gr).filter(e=>!!e)}function gr(i){return typeof i=="string"?{model:i,label:i,hasBorder:!1,view:{name:"span",styles:{color:i}}}:{model:i.color,label:i.label||i.color,hasBorder:i.hasBorder===void 0?!1:i.hasBorder,view:{name:"span",styles:{color:`${i.color}`}}}}var Be=class extends b{constructor(e){super(e);let t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=po,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",s=>S.isMediaForcedColors?null:s)},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%)"}},Se=class extends d{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);let s=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 _,this.keystrokes=new T,this.items.on("add",(r,n)=>{n.isOn=n.color===this.selectedColor}
1),s.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),pr({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 ds(i,e){if(!i)return"";let t=kr(i);if(!t)return"";if(t.space===e)return i;if(!Cn(t))return"";let o=Ii[t.space][e];if(!o)return"";let r=o(t.space==="hex"?t.hexValue:t.values);return Vn(r,e)}function wr(i){if(!i)return"";let e=kr(i);return e?e.space==="hex"?e.hexValue:ds(i,"hex"):"#000"}function _r(i,e){customElements.get(i)===void 0&&customElements.define(i,e)}function Vn(i,e){switch(e){case"hex":return`#${i}`;case"rgb":return`rgb(${i[0]}, ${i[1]}, ${i[2]})`;case"hsl":return`hsl(${i[0]}, ${i[1]}%, ${i[2]}%)`;case"hwb":return`hwb(${i[0]}, ${i[1]}, ${i[2]})`;case"lab":return`lab(${i[0]}% ${i[1]} ${i[2]})`;case"lch":return`lch(${i[0]}% ${i[1]} ${i[2]})`;default:return""}}function kr(i){if(i.startsWith("#")){let t=Ci(i);return{space:"hex",values:t.values,hexValue:i,alpha:t.alpha}}let e=Ci(i);return e.space?e:null}function Cn(i){return Object.keys(Ii).includes(i.space)}var Me=class extends d{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);let s=`ck-labeled-field-view-${W()}`,o=`ck-labeled-field-view-status-${W()}`;this.fieldView=t(this,s,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(s),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 j(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){let t=new d(this.locale),s=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",s.if("errorText","ck-labeled-field-view__status_error"),s.if("_statusText","ck-hidden",o=>!o)],id:e,role:s.if("errorText","alert")},children:[{text:s.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}},Le=class extends d{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 _,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);let t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...s)=>{this.fire("input",...s),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,s)=>{this._setDomElementValue(s),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=In(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}};function In(i){return!i.value}var Ae=class extends Le{constructor(e){super(e),this.set("inputMode","text");let t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}},Mt=class extends Ae{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}},Lt=class extends Ae{constructor(e,{min:t,max:s,step:o}={}){super(e);let r=this.bindTemplate;this.set("min",t),this.set("max",s),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")}})}},At=class extends Le{_resizeObserver;_isUpdateAutoGrowHeightPending=!1;constructor(e){super(e);let t=L("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._val
1idateMinMaxRows.bind(this)),this.on("change:maxRows",this._validateMinMaxRows.bind(this));let s=this.bindTemplate;this.template.tag="textarea",this.extendTemplate({attributes:{class:["ck-textarea"],style:{height:s.to("_height",o=>o?t(o):null),resize:s.to("resize")},rows:s.to("minRows")}})}render(){super.render();let e=!1;this.on("input",()=>{this._updateAutoGrowHeight(!0),this.fire("update")}),this.on("change:value",()=>{p.window.requestAnimationFrame(()=>{if(!M(this.element)){this._isUpdateAutoGrowHeightPending=!0;return}this._updateAutoGrowHeight(),this.fire("update")})}),this._resizeObserver=new Y(this.element,t=>{let s=!!t.contentRect.width&&!!t.contentRect.height;!e&&s&&this._isUpdateAutoGrowHeightPending&&p.window.requestAnimationFrame(()=>{this._updateAutoGrowHeight(),this.fire("update")}),e=s})}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 s=Qo(t,"1"),o=Qo(t,t.value),r=s.ownerDocument.defaultView.getComputedStyle(s),n=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),l=ks(s),a=parseFloat(r.lineHeight),c=l.top+l.bottom,h=new g(s).height,f=Math.round((o.scrollHeight-n)/a),m=this.maxRows*a+n+c,k=f===1?h:this.minRows*a+n+c;this._height=Math.min(Math.max(Math.max(f,this.minRows)*a+n+c,k),m),e&&(t.scrollTop=t.scrollHeight),s.remove(),o.remove()}_validateMinMaxRows(){if(this.minRows>this.maxRows)throw new y("ui-textarea-view-min-rows-greater-than-max-rows",{textareaView:this,minRows:this.minRows,maxRows:this.maxRows})}};function Qo(i,e){let t=i.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=i.ownerDocument.defaultView.getComputedStyle(i).width,t.tabIndex=-1,t.rows=1,t.value=e,i.parentNode.insertBefore(t,i),t}var Dt=class extends d{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",s=>`ck-dropdown__panel_${s}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(s=>{s.target.tagName.toLocaleLowerCase()!=="input"&&s.preventDefault()})}})}focus(){if(this.children.length){let e=this.children.first;typeof e.focus=="function"?e.focus():I("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()}}},Ft=class i extends d{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,s){super(e);let o=this.bindTemplate;this.buttonView=t,this.panelView=s,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 T,this.focusTracker=new _,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,s]}),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,s,o)=>{if(o)if(this.panelPosition==="auto"){let r=i._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,s)=>{this.isOpen&&(this.isOpen=!1,s())};this.keystrokes.set("arrowdown",(t,s)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,s())}),this.keystrokes.set("arrowright",(t,s)=>{this.isOpen&&s()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){let{south:e,north:t,southEast:s,southWest:o,northEast:r,northWest:n,southMiddleEast:l,southMiddleWest:a,northMiddleEast:c,northMiddleWest:h}=i.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[s,o,l,a,e,r,n,c,h,t]:[o,s,a,l,e,n,r,h,c,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)=>
1({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=be},Nt=class extends b{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 O;return e.content=ee,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}},De=class extends b{id;constructor(e,t,s){super(e),this.id=t,this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem",label:s}),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__item__button"]}})}},Rt=class extends A{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",s=>String(s)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new O;return e.content=ee,e.extendTemplate({attributes:{class:"ck-dropdown-menu-list__nested-menu__button__arrow"}}),e}},C=class extends d{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",s=>!s)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}},ce=class extends d{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}},q=class extends d{labelView;items;children;constructor(e,t=new j){super(e);let s=this.bindTemplate,o=new X(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",s.if("isVisible","ck-hidden",r=>!r)]},children:this.children})}focus(){if(this.items){let e=this.items.find(t=>!(t instanceof ce));e&&e.focus()}}},X=class extends d{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);let t=this.bindTemplate;this.focusables=new E,this.items=this.createCollection(),this.focusTracker=new _,this.keystrokes=new T,this._focusCycler=new P({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 q?this._registerFocusableItemsGroup(e):e instanceof C&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(let s of t.removed)s instanceof q?this._deregisterFocusableItemsGroup(s):s instanceof C&&this._deregisterFocusableListItem(s);for(let s of Array.from(t.added).reverse())s instanceof q?this._registerFocusableItemsGroup(s,t.index):this._registerFocusableListItem(s,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,s)=>{for(let o of s.removed)this._deregisterFocusableListItem(o);for(let o of Array.from(s.added).reverse())this._registerFocusableListItem(o,this.items.getIndex(e)+s.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 s=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,s),e.items.on("change",s)}_deregisterFocusableItemsGroup(e){for(let t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}},Fe=class extends X{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",s=>!s)]}})}};var dt=5,yr={eastSouth:i=>({top:i.top,left:i.right-dt,name:"es"}),eastNorth:(i,e)=>({top:i.top-e.height+i.height,left:i.right-dt,name:"en"}),westSouth:(i,e)=>({top:i.top,left:i.left-e.width+dt,name:"ws"}),westNorth:(i,e)=>({top:i.top-e.height+i.height,left:i.left-e.width+dt,name:"wn"})},Ne=class extends C{childView;constructor(e,t,s){super(e);let o=this.bindTemplate;this.childView=s,this.children.add(s),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__item"]},on:{mouseenter:o.to("mouseenter")}}),t&&(this.delegate("mouseenter").to(t),s instanceof De&&s.delegate("execute").to(t))}},Gi={toggleMenusAndFocusItemsOnHover(i){i.on("menu:mouseenter",e=>{let[t]=e.path;e.source.focus();for(let s of i.menus){let o=t instanceof Ne&&t.childView===s;s.isOpen=(e.path.includes(s)||o)&&s.isEnabled}})},closeMenuWhenAnotherOnTheSameLevelOpens(i){i.on("menu:change:isOpen",(e,t,s)=>{if(!s)return;let o=e.source;for(let r of i.menus)o.parentMenuView===r.parentMenuView&&o!==r&&(r.isOpen=!1)})}},U={openOnArrowRightKey(i){let e=i.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";i.keystrokes.set(e,(t,s)=>{i.focusTracker.focusedElement!==i.buttonView.element||!i.isEnabled||(i.isOpen||(i.isOpen=!0),i.panelView.focus(),s())})},openOnButtonClick(i){i.buttonView.on("execute",()=>{i.isEnabled&&(i.isOpen=!0)})},openAndFocusOnEnterKeyPress(i){i.keystrokes.set("enter",(e,t)=>{i.focusTracker.focusedElement===i.buttonView.element&&(i.isOpen=!0,i.panelView.focus(),t())})},closeOnArrowLeftKey(i){let e=i.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";i.keystrokes.set(e,(t,s)=>{i.isOpen&&(i.focus(),i.isOpen=!1,s())})},closeOnEscKey(i){i.keystrokes.set("esc",(e,t)=>{i.isOpen&&(i.focus(),i.isOpen=!1,t())})},closeOnParentClose(i,e){e.on("change:isOpen",(t,s,o)=>{!o&&t.source===e&&(i.isOpen=!1)})}},Wt=class extends V{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(s=>{s.target.tagName.toLocaleLowerCase()!=="input"&&s.preventDefault()})}})}focus(e=1){let{content:t}=this;t.length&&(e===1?t.first.focus():t.last.focus())}},Re=class i extends d{static DELEGATED_EVENTS=["mouseenter","execute","change:isOpen"];id;buttonView;panelView;listView;focusTracker;keystrokes;_bodyCollection;constructor(e,t,s,o,r){super(e),this._bodyCollection=t,this.id=s,this.set({isOpen:!1,isEnabled:!0,panelPosition:"w",class:void 0,parentMenuView:null}),this.keystrokes=new T,this.focusTracker=new _,this.buttonView=new Rt(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.buttonView.label=o,this.panelView=new Wt(e),this.panelView.isVisible=!0,this.listView=new Fe(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:s,eastNorth:o}=yr;return this.locale.uiLanguageDirection==="ltr"?[t,o,e,s]:[e,s,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(...i.DELEGATED_EVENTS).to(this.parentMenuView),U.closeOnParentClose(this,this.parentMenuView)}
1_attachBehaviors(){U.openOnButtonClick(this),U.openAndFocusOnEnterKeyPress(this),U.openOnArrowRightKey(this),U.closeOnEscKey(this),U.closeOnArrowLeftKey(this)}_mountPanelOnOpen(){let{panelView:e}=this;this.on("change:isOpen",(t,s,o)=>{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:s}=this;this._bodyCollection.has(e)||(this._bodyCollection.add(e),s.listenTo(e.element),e.pin({positions:this._panelPositions,limiter:p.document.body,element:e.element,target:t.element,fitInViewport:!0}))}},Ht=class extends Fe{_definition;_cachedMenus=[];_cachedButtons=[];_bodyCollection;constructor(e,t,s){super(e),this._bodyCollection=t,this._definition=s,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(),Gi.toggleMenusAndFocusItemsOnHover(this),Gi.closeMenuWhenAnotherOnTheSameLevelOpens(this)}closeMenus(){this.menus.forEach(e=>{e.isOpen=!1})}_createStructure(e,t){let s=[];for(let r of e){let n;"menu"in r?(n=new Re(this.locale,this._bodyCollection,r.id,r.menu,t),n.panelView.bind("class").to(this,"menuPanelClass"),t||n.delegate(...Re.DELEGATED_EVENTS).to(this,a=>`menu:${a}`),this._cachedMenus.push(n),this._createStructure(r.children,n)):(n=new De(this.locale,r.id,r.label),t||n.delegate("execute").to(this,"menu:execute"),this._cachedButtons.push(n));let l=new Ne(this.locale,t,n);t||l.delegate("mouseenter").to(this,"menu:mouseenter"),s.push(l)}(t?t.listView:this).items.addMany(s)}},We=class extends d{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}},zt=class extends d{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}};function xr(i){return i.bindTemplate.to(e=>{e.target===i.element&&e.preventDefault()})}function mi(i){if(Array.isArray(i))return{items:i,removeItems:[]};let e={items:[],removeItems:[]};return i?{...e,...i}:e}var Gt={alignLeft:ho,bold:uo,importExport:go,paragraph:ko,plus:xo,text:Vo,threeVerticalDots:st,pilcrow:yo,dragIndicator:mo},he=class extends d{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);let s=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 _,this.keystrokes=new T,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new $t(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();let r=e.uiLanguageDirection==="rtl";this._focusCycler=new P({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",s.to("class"),s.if("isCompact","ck-toolbar_compact"),s.if("isGrouping","ck-toolbar_grouping"),s.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&n.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:n,role:s.to("role"),"aria-label":s.to("ariaLabel"),style:{maxWidth:s.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:xr(this)}}),this._behavior=this.options.shouldGroupWhenFull?new Ut(this):new jt(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,s){this.items.addMany(this._buildItemsFromConfig(e,t,s))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new Ut(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new jt(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,s){let o=mi(e),r=s||o.removeItems;return this._cleanItemsConfiguration(o.items,t,r).map(l=>Q(l)?this._createNestedToolbarDropdown(l,t,r):l==="|"?new We:l==="-"?new zt:t.create(l)).filter(l=>!!l)}_cleanItemsConfiguration(e,t,s){let o=e.filter((r,n,l)=>r==="|"?!0:s.indexOf(r)!==-1?!1:r==="-"?this.options.shouldGroupWhenFull?(I("toolbarview-line-break-ignored-when-grouping-items",l),!1):!0:!Q(r)&&!t.has(r)?(I("toolbarview-item-unavailable",{item:r}),!1):!0);return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){let t=n=>n!=="-"&&n!=="|",s=e.length,o=e.findIndex(t);if(o===-1)return[];let r=s-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,s){let{label:o,icon:r,items:n,tooltip:l=!0,withText:a=!1}=e;if(n=this._cleanItemsConfiguration(n,t,s),!n.length)return null;
1let c=this.locale,h=bi(c);return o||I("toolbarview-nested-toolbar-dropdown-missing-label",e),h.class="ck-toolbar__nested-toolbar-dropdown",h.buttonView.set({label:o,tooltip:l,withText:!!a}),r!==!1?h.buttonView.icon=Gt[r]||r||st:h.buttonView.withText=!0,fs(h,()=>h.toolbarView._buildItemsFromConfig(n,t,s)),h}},$t=class extends d{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}},jt=class{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(t=>t),e.focusables.bindTo(e.items).using(t=>ue(t)?t:null)}render(){}destroy(){}},Ut=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,s)=>{let o=s.index,r=Array.from(s.added);for(let n of s.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 s=[...e.items][t];this.ungroupedItems.add(s,t)}this._updateGrouping()}}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!M(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,s=new g(e.lastChild),o=new g(e);if(!this.cachedPadding){let r=p.window.getComputedStyle(e),n=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[n])}return t==="ltr"?s.right>o.right-this.cachedPadding:s.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new Y(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 We),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,s=bi(e);return s.class="ck-toolbar__grouped-dropdown",s.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",fs(s,this.groupedItems),s.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:st}),s}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{ue(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}},Kt=class extends d{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);let s=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 T,this.focusTracker=new _,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",s.to("class"),s.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 b;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 b,t=e.bindTemplate;return e.icon=ee,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",s=>String(s))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}};function bi(i,e=Nt){let t=typeof e=="function"?new e(i):e,s=new Dt(i),o=new Ft(i,t,s);return t.bind("isEnabled").to(o),t instanceof Kt?t.arrowView.bind("isOn").to(o,"isOpen"):t.bind("isOn").to(o,"isOpen"),Pn(o),o}function En(i,e,t,s={}){i.menuView=new Ht(i.locale,e,t),i.focusTracker.add(i.menuView),i.isOpen?Zo(i,s):i.once("change:isOpen",()=>{Zo(i,s)},{priority:"highest"})}function Zo(i,e){let t=i.menuView,s=i.locale.t;t.delegate("menu:execute").to(i,"execute"),t.listenTo(i,"change:isOpen",(o,r,n)=>{n||t.closeMenus()},{priority:"low"}),i.panelView.children.add(t);for(let o of t.menus)i.focusTracker.add(o);t.ariaLabel=e.ariaLabel||s("Dropdown menu")}function fs(i,e,t={}){i.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),i.isOpen?Jo(i,e,t):i.once("change:isOpen",()=>Jo(i,e,t),{priority:"highest"}),t.enableActiveItemFocusOnDropdownOpen&&ps(i,()=>i.toolbarView.items.find(s=>s.isOn))}function Jo(i,e,t){let s=i.locale,o=s.t,r=i.toolbarView=new he(s),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 E?r.items.bindTo(n).using(l=>l):r.items.addMany(n),i.panelView.children.add(r),i.focusTracker.add(r),r.items.delegate("execute").to(i)}function On(i,e,t={}){i.isOpen?er(i,e,t):i.once("change:isOpen",()=>er(i,e,t),{priority:"highest"}),ps(i,()=>i.listView.items.find(s=>s instanceof C?s.children.first.isOn:!1))}function er(i,e,t){let s=i.locale,o=i.listView=new X(s),r=typeof e=="function"?e():e;o.ariaLabel=t.ariaLabel,o.role=t.role,vr(i,o.items,r,s),i.panelView.children.add(o),o.items.delegate("execute").to(i)}function ps(i,e){i.on("change:isOpen",()=>{if(!i.isOpen)return;let t=e();t&&(typeof t.focus=="function"?t.focus():I("ui-dropdown-focus-child-on-open-child-missing-focus",{view:t}))},{priority:Ts.low-10})}function Pn(i){Bn(i),Sn(i),Mn(i),Ln(i),An(i),Dn(i)}function Bn(i){pi({emitter:i,activator:()=>i.isRendered&&i.isOpen,callback:()=>{i.isOpen=!1},contextElements:()=>[i.element,...Tr(i.focusTracker).filter(e=>!i.element.contains(e))]})}function Tr(i){return[...i.elements,...i.externalViews.flatMap(e=>
1Tr(e.focusTracker))]}function Sn(i){i.on("execute",e=>{e.source instanceof Pe||(i.isOpen=!1)})}function Mn(i){i.focusTracker.on("change:isFocused",(e,t,s)=>{s||!i.isOpen||(i.isOpen=!1)})}function Ln(i){i.keystrokes.set("arrowdown",(e,t)=>{i.isOpen&&(i.panelView.focus(),t())}),i.keystrokes.set("arrowup",(e,t)=>{i.isOpen&&(i.panelView.focusLast(),t())})}function An(i){i.on("change:isOpen",(e,t,s)=>{if(s)return;i.focusTracker.elements.some(r=>r.contains(p.document.activeElement))&&i.buttonView.focus()})}function Dn(i){i.on("change:isOpen",(e,t,s)=>{s&&i.panelView.focus()},{priority:"low"})}function vr(i,e,t,s){Fn(e),e.bindTo(t).using(o=>{if(o.type==="separator")return new ce(s);if(o.type==="group"){let r=new q(s);return r.set({label:o.label}),vr(i,r.items,o.items,s),r.items.delegate("execute").to(i),r}else if(o.type==="button"||o.type==="switchbutton"){let r=o.model.role==="menuitemcheckbox"||o.model.role==="menuitemradio",n=new C(s),l;return o.type==="button"?(l=new A(s),l.set({isToggleable:r})):l=new Pe(s),l.bind(...Object.keys(o.model)).to(o.model),l.delegate("execute").to(n),n.children.add(l),n}return null})}function Fn(i){let e=0,t=r=>!(r instanceof C)||!(r.children.first instanceof A)?null:r.children.first,s=r=>{let n=t(r);return!n||!n.isToggleable?null:n},o=r=>{for(let n of i){let l=t(n);l&&(l.hasCheckSpace=r)}};i.on("change",(r,n)=>{let l=e>0;for(let c of n.removed)s(c)&&e--;for(let c of n.added){let h=t(c);h&&(h.isToggleable&&e++,h.hasCheckSpace=e>0)}let a=e>0;l!==a&&o(a)})}var ms=(i,e,t)=>{let s=new Mt(i.locale);return s.set({id:e,ariaDescribedById:t}),s.bind("isReadOnly").to(i,"isEnabled",o=>!o),s.bind("hasError").to(i,"errorText",o=>!!o),s.on("input",()=>{i.errorText=null}),i.bind("isEmpty","isFocused","placeholder").to(s),s},Nn=(i,e,t)=>{let s=new Lt(i.locale);return s.set({id:e,ariaDescribedById:t,inputMode:"numeric"}),s.bind("isReadOnly").to(i,"isEnabled",o=>!o),s.bind("hasError").to(i,"errorText",o=>!!o),s.on("input",()=>{i.errorText=null}),i.bind("isEmpty","isFocused","placeholder").to(s),s},Rn=(i,e,t)=>{let s=new At(i.locale);return s.set({id:e,ariaDescribedById:t}),s.bind("isReadOnly").to(i,"isEnabled",o=>!o),s.bind("hasError").to(i,"errorText",o=>!!o),s.on("input",()=>{i.errorText=null}),i.bind("isEmpty","isFocused","placeholder").to(s),s},Wn=(i,e,t)=>{let s=bi(i.locale);return s.set({id:e,ariaDescribedById:t}),s.bind("isEnabled").to(i),s},Hn=150,qt=class extends d{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();let s=this.createCollection();t.hideInput||s.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:s}),this._config=t,this._debounceColorPickerEvent=z(o=>{this.set("color",o),this.fire("colorSelected",{color:this.color})},Hn,{leading:!0}),this.on("set:color",(o,r,n)=>{o.return=ds(n,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=Mi(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),Mi(this.color)!=Mi(this._hexColor)&&(this.color=this._hexColor)})}render(){if(super.render(),_r("hex-color-picker",ut),this.picker=p.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&&(S.isGecko||S.isiOS||S.isSafari||S.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){let s=[...this.picker.shadowRoot.children].filter(o=>o.getAttribute("role")==="slider").map(o=>new Xt(o));
1this.slidersView=this.createCollection(),s.forEach(o=>{this.slidersView.add(o)})}_createInputRow(){let e=this._createColorInput();return new Yt(this.locale,e)}_createColorInput(){let e=new Me(this.locale,ms),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",s=>e.isFocused?e.fieldView.value:s.startsWith("#")?s.substring(1):s),e.fieldView.on("input",()=>{let s=e.fieldView.element.value;if(s){let o=bs(s);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 Mi(i){let e=wr(i);return e||(e="#000"),e.length===4&&(e="#"+[e[1],e[1],e[2],e[2],e[3],e[3]].join("")),e.toLowerCase()}var Xt=class extends d{constructor(e){super(),this.element=e}focus(){this.element.focus()}},$i=class extends d{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}},Yt=class extends d{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new $i,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return bs(this.inputView.fieldView.element.value)}};function bs(i){if(!i)return null;let e=i.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 Qt=class extends pe(Ke){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){return this.find(s=>s.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}},Zt=class extends d{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:s,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,focusTracker:a,focusables:c}){super(e);let h=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=s,this.documentColors=new Qt,this.documentColorsCount=n,this._focusables=c,this._removeButtonLabel=o,this._colorPickerLabel=l,this._documentColorsLabel=r,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",h.if("isVisible","ck-hidden",f=>!f)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){let s=e.document,o=this.documentColorsCount;this.documentColors.clear();for(let r of s.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,s=this.selectedColor;t.selectedColor=s,e&&(e.selectedColor=s)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){let e=x.bind(this.documentColors,this.documentColors),t=new d(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 b,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:fo,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){let e=new b;return e.set({withText:!0,icon:bo,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 Se(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(t,s)=>{this.fire("execute",{value:s.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){let e=x.bind(this.documentColors,this.documentColors),t=new Se(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(s=>{let o=new Be;return o.set({color:s.color,hasBorder:s.options?.hasBorder}),s.label&&o.set({label:s.label,tooltip:!0}),o.on("execute",()=>{this.fire("execute",{value:s.color,source:"documentColorsGrid"})}),o}),this.documentColors.on("change:isEmpty",(s,o,r)=>{r&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){let t=this.colorDefinitions.find(s=>s.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}},Jt=class extends d{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:s,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=s,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",c=>!c)]},children:this.items})}render(){super.render();let e=new qt(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,s,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 s=new d,o=this.createCollection();return o.add(e),o.add(t),s.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),s}_createActionButtons(){let e=this.locale,t=e.t,s=new b(e),o=new b(e);return s.set({icon:Vi,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:it,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),s.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),o.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:s,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}},ji=class extends d{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:s,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new _,this.keystrokes=new T,this._focusables=new E,this._colorPickerViewConfig=a,this._focusCycler=new P({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new Zt(e,{colors:t,columns:s,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new Jt(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",(c,h,f)=>{this.colorGridsFragmentView.set("selectedColor",f),this.colorPickerFragmentView.set("selectedColor",f)}),this.colorGridsFragmentView.on("change:selectedColor",(c,h,f)=>{this.set("selectedColor",f)}),this.colorPickerFragmentView.on("change:selectedColor",(c,h,f)=>{this.set("selectedColor",f)}),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))}},ei=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(Li(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new y("componentfactory-item-missing",this,{name:e});return this._components.get(Li(e)).callback(this.editor.locale)}has(e){return this._components.has(Li(e))}};function Li(i){return String(i).toLowerCase()}var tr="ck-tooltip",ti=class i extends fe(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=V.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(),i._editors.add(e),i._instance)return i._instance;i._instance=this,this.tooltipTextView=new d(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 V(e.locale),this.balloonPanelView.class=tr,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=zn(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=z(this._pinTooltip,600),this._unpinTooltipDebounced=z(this._unpinTooltip,400),this.listenTo(p.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(p.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(p.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(p.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(p.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(p.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){let t=e.ui.view&&e.ui.view.body;i._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),i._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),i._instance=null)}static getPositioningFunctions(e){let t=i.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 s=Ai(t);if(!s){e.name==="focus"&&this._unpinTooltip();return}if(s===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),e.name==="focus"&&!s.matches(":hover")||s.matches("[data-cke-tooltip-instant]")?this._pinTooltip(s,Di(s)):this._pinTooltipDebounced(s,Di(s))}_onLeaveOrBlur(e,{target:t,relatedTarget:s}){if(e.name==="mouseleave"){if(!xe(t))return;let o=this.balloonPanelView.element,r=o&&(o===s||o.contains(s)),n=!r&&t===o;if(r){this._unpinTooltipDebounced.cancel();return}if(!n&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;let l=Ai(t),a=Ai(s);(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:s,cssClass:o}){this._unpinTooltip();let r=ws(i._editors.values()).ui.view.body;r.has(this.balloonPanelView)||r.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[tr,o].filter(n=>n).join(" "),this.balloonPanelView.pin({target:e,positions:i.getPositioningFunctions(s)}),this._mutationObserver.attach(e);for(let n of i._editors)this.listenTo(n.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=s}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(let e of i._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=Di(this._currentElementWithTooltip);if(!M(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:i.getPositioningFunctions(e.position)})}};function Ai(i){return xe(i)?i.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function Di(i){return{text:i.dataset.ckeTooltipText,position:i.dataset.ckeTooltipPosition||"s",cssClass:i.dataset.ckeTooltipClass||""}}function zn(i){let e=new MutationObserver(()=>{i()});return{attach(t){e.observe(t,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}var ii=class extends Oe{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"),s=ir(t);return!!(s&&this.licenseTypeMessage[s])}_createBadgeContent(){let e=this.editor.config.get("licenseKey"),t=ir(e);return new Ui(this.editor.locale,this.licenseTypeMessage[t])}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},s=t.position||e.position,o=t.side||e.side;return{position:s,side:o==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}},Ui=class extends d{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 ir(i){if(i=="GPL")return"GPL";let e=yi(i.split(".")[1]);return e?e.licenseType||"production":null}var He=class extends C{constructor(e,t){super(e);let s=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:s.to("mouseenter")}}),this.delegate("mouseenter").to(t)}},ft=5,K={toggleMenusAndFocusItemsOnHover(i){i.on("menu:mouseenter",e=>{if(!(!i.isFocusBorderEnabled&&!i.isOpen)){if(i.isOpen)for(let t of i.menus){let s=e.path[0],o=s instanceof He&&s.children.first===t;t.isOpen=(e.path.includes(t)||o)&&t.isEnabled}
1e.source.focus()}})},focusCycleMenusOnArrows(i){let e=i.locale.uiLanguageDirection==="rtl";i.on("menu:arrowright",s=>{t(s.source,e?-1:1)}),i.on("menu:arrowleft",s=>{t(s.source,e?1:-1)});function t(s,o){let r=i.children.getIndex(s),n=s.isOpen,l=i.children.length,a=i.children.get((r+l+o)%l);s.isOpen=!1,n&&(a.isOpen=!0),a.buttonView.focus()}},closeMenusWhenTheBarCloses(i){i.on("change:isOpen",()=>{i.isOpen||i.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(i){i.on("menu:change:isOpen",(e,t,s)=>{s&&i.menus.filter(o=>e.source.parentMenuView===o.parentMenuView&&e.source!==o&&o.isOpen).forEach(o=>{o.isOpen=!1})})},closeOnClickOutside(i){pi({emitter:i,activator:()=>i.isOpen,callback:()=>i.close(),contextElements:()=>i.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(i){let e=!1;i.on("change:isOpen",(t,s,o)=>{o||(e||(i.isFocusBorderEnabled=!1),e=!1)}),i.listenTo(i.element,"keydown",()=>{e=!0},{useCapture:!0}),i.listenTo(i.element,"keyup",()=>{e=!1},{useCapture:!0}),i.listenTo(i.element,"focus",()=>{e&&(i.isFocusBorderEnabled=!0)},{useCapture:!0})}},R={openAndFocusPanelOnArrowDownKey(i){i.keystrokes.set("arrowdown",(e,t)=>{i.isEnabled&&i.focusTracker.focusedElement===i.buttonView.element&&(i.isOpen||(i.isOpen=!0),i.panelView.focus(),t())})},openOnArrowRightKey(i){let e=i.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";i.keystrokes.set(e,(t,s)=>{i.focusTracker.focusedElement!==i.buttonView.element||!i.isEnabled||(i.isOpen||(i.isOpen=!0),i.panelView.focus(),s())})},openOnButtonClick(i){i.buttonView.on("execute",()=>{i.isOpen=!0})},toggleOnButtonClick(i){i.buttonView.on("execute",()=>{i.isOpen=!i.isOpen})},openAndFocusOnEnterKeyPress(i){i.keystrokes.set("enter",(e,t)=>{i.focusTracker.focusedElement===i.buttonView.element&&(i.isOpen=!0,i.panelView.focus(),t())})},closeOnArrowLeftKey(i){let e=i.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";i.keystrokes.set(e,(t,s)=>{i.isOpen&&(i.isOpen=!1,i.focus(),s())})},closeOnEscKey(i){i.keystrokes.set("esc",(e,t)=>{i.isOpen&&(i.isOpen=!1,i.focus(),t())})},closeOnParentClose(i){i.parentMenuView.on("change:isOpen",(e,t,s)=>{!s&&e.source===i.parentMenuView&&(i.isOpen=!1)})}},Vr={southEast:i=>({top:i.bottom,left:i.left,name:"se"}),southWest:(i,e)=>({top:i.bottom,left:i.left-e.width+i.width,name:"sw"}),northEast:(i,e)=>({top:i.top-e.height,left:i.left,name:"ne"}),northWest:(i,e)=>({top:i.top-e.height,left:i.left-e.width+i.width,name:"nw"}),eastSouth:i=>({top:i.top,left:i.right-ft,name:"es"}),eastNorth:(i,e)=>({top:i.top-e.height,left:i.right-ft,name:"en"}),westSouth:(i,e)=>({top:i.top,left:i.left-e.width+ft,name:"ws"}),westNorth:(i,e)=>({top:i.top-e.height,left:i.left-e.width+ft,name:"wn"})},Cr=[{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 Ir(i){let e;return!("items"in i)||!i.items?e={items:ke(Cr),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...i}:e={items:i.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...i},e}function Er({normalizedConfig:i,locale:e,componentFactory:t,extraItems:s}){let o=ke(i);return sr(i,o,s),Gn(i,o),sr(i,o,o.addItems),$n(i,o,t),Or(i,o),jn(o,e),o}function Gn(i,e){let t=e.removeItems,s=[];e.items=e.items.filter(({menuId:o})=>t.includes(o)?(s.push(o),!1):!0),de(e.items,o=>{o.groups=o.groups.filter(({groupId:r})=>t.includes(r)?(s.push(r),!1):!0);for(let r of o.groups)r.items=r.items.filter(n=>{let l=Pr(n);return t.includes(l)?(s.push(l),!1):!0})});for(let o of t)s.includes(o)||I("menu-bar-item-could-not-be-removed",{menuBarConfig:i,itemName:o})}function sr(i,e,t){let s=[];if(t.length!=0){for(let o of t){let r=qn(o.position),n=Xn(o.position);if(Un(o))if(!n)r==="start"?(e.items.unshift(o.menu),s.push(o)):r==="end"&&(e.items.push(o.menu),s.push(o));else{let l=e.items.findIndex(a=>a.menuId===n);l!=-1?r==="before"?(e.items.splice(l,0,o.menu),s.push(o)):r==="after"&&(e.items.splice(l+1,0,o.menu),s.push(o)):or(e,o.menu,n,r)&&s.push(o)}else Kn(o)?de(e.items,l=>{if(l.menuId===n)r==="start"?(l.groups.unshift(o.group),s.push(o)):r==="end"&&(l.groups.push(o.group),s.push(o));else{let a=l.groups.findIndex(c=>c.groupId===n);a!==-1&&(r==="before"?(l.groups.splice(a,0,o.group),s.push(o)):r==="after"&&(l.groups.splice(a+1,0,o.group),s.push(o)))}}):or(e,o.item,n,r)&&s.push(o)}for(let o of t)s.includes(o)||I("menu-bar-item-could-not-be-added",{menuBarConfig:i,addedItemConfig:o})}}function or(i,e,t,s){let o=!1;return de(i.items,r=>{for(let{groupId:n,items:l}of r.groups){if(o)return;if(n===t)s==="start"?(l.unshift(e),o=!0):s==="end"&&(l.push(e),o=!0);else{let a=l.findIndex(c=>Pr(c)===t);a!==-1&&(s==="before"?(l.splice(a,0,e),o=!0):s==="after"&&(l.splice(a+1,0,e),o=!0))}}}),o}function $n(i,e,t){de(e.items,s=>{for(let o of s.groups)o.items=o.items.filter(r=>{let n=typeof r=="string"&&!t.has(r);return n&&!e.isUsingDefaultConfig&&I("menu-bar-item-unavailable",{menuBarConfig:i,parentMenuConfig:ke(s),componentName:r}),!n})})}function Or(i,e){let t=e.isUsingDefaultConfig,s=!1;if(e.items=e.items.filter(o=>o.groups.length?!0:(Fi(i,o,t),!1)),!e.items.length){Fi(i,i,t);return}de(e.items,o=>{o.groups=o.groups.filter(r=>r.items.length?!0:(s=!0,!1));for(let r of o.groups)r.items=r.items.filter(n=>Br(n)&&!n.groups.length?(Fi(i,n,t),s=!0,!1):!0)}),s&&Or(i,e)}function Fi(i,e,t){t||I("menu-bar-menu-empty",{menuBarConfig:i,emptyMenuConfig:e})}function jn(i,e){let t=e.t,s={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"})};de(i.items,o=>
1{o.label in s&&(o.label=s[o.label])})}function de(i,e){if(Array.isArray(i))for(let s of i)t(s);function t(s){e(s);for(let o of s.groups)for(let r of o.items)Br(r)&&t(r)}}function Un(i){return typeof i=="object"&&"menu"in i}function Kn(i){return typeof i=="object"&&"group"in i}function qn(i){return i.startsWith("start")?"start":i.startsWith("end")?"end":i.startsWith("after")?"after":"before"}function Xn(i){let e=i.match(/^[^:]+:(.+)/);return e?e[1]:null}function Pr(i){return typeof i=="string"?i:i.menuId}function Br(i){return typeof i=="object"&&"menuId"in i}var Ki=class extends pe(){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 ei(e),this.focusTracker=new _,this.tooltipManager=new ti(e),this.poweredBy=new Pt(e),this.evaluationBadge=new ii(e),this.ariaLiveAnnouncer=new _t(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()}get 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 s=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?s():this.once("ready",s)}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 s=Ir(this.editor.config.get("menuBar")||{});e.fillFromConfig(s,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 s=e.config.get("toolbar.viewportTopOffset");return s?(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:s}):{top:0}}_initFocusTracking(){let e=this.editor,t;e.keystrokes.set("Alt+F10",(s,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",(s,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:s,options:o}=t;(M(s.element)||o.beforeFocus)&&e.push(t)}return e.sort((t,s)=>rr(t)-rr(s)),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:s}}=e;return s&&s(),M(t.element)?(t.focus(),!0):!1}_handleScrollToTheSelection(e,t){let s={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=s.top,t.viewportOffset.bottom+=s.bottom,t.viewportOffset.left+=s.left,t.viewportOffset.right+=s.right}_bindBodyCollectionWithFocusTracker(){let e=this.view.body;for(let t of e)this.focusTracker.add(t.element);e.on("add",(t,s)=>{this.focusTracker.add(s.element)}),e.on("remove",(t,s)=>{this.focusTracker.remove(s.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(t,s,o)=>{let r=this._getVisualViewportTopOffset(o);o.visualTop!==r&&(t.return={...o,visualTop:r})}),this.set("viewportOffset",e)}
1_initVisualViewportSupport(){if(!p.window.visualViewport)return;let e=()=>{let t=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==t&&(this.viewportOffset={...this.viewportOffset,visualTop:t})};this._domEmitter=new(fe()),this._domEmitter.listenTo(p.window.visualViewport,"scroll",e),this._domEmitter.listenTo(p.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){let t=ge().top,s=e.top||0;return t>s?0:s-t}};function rr(i){let{toolbarView:e,options:t}=i,s=10;return M(e.element)&&s--,t.isContextual&&(s-=2),s}var si=class extends d{body;menuBarView;toolbar;constructor(e){super(e),this.body=new Ot(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}},qi=class extends si{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 j;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}},oi=class extends d{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,s){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=s,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?s(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 s(o){e.once("change:isRenderingInProgress",(r,n,l)=>{l?s(o):t(o)})}}},Xi=class extends oi{_options;constructor(e,t,s,o={}){super(e,t,s),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();let e=this._editingView;e.change(t=>{let s=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),s)})}getEditableAriaLabel(){let e=this.locale.t,t=this._options.label,s=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(s){let r=s.getAttribute("aria-label");if(r)return r}return e("Rich Text Editor. Editing area: %0",o)}},Yi=class extends d{children;constructor(e,t={}){super(e);let s=this.bindTemplate;this.set("class",["ck","ck-form__row",...we(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:s.to("class",o=>o.join(" ")),role:s.to("_role"),"aria-labelledby":s.to("_ariaLabelledBy")},children:this.children})}},Qi=class extends d{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()))}},Zi=class extends d{labelView;
1inputView;statusView;constructor(e,t){super(e);let s=`ck-input-${W()}`,o=`ck-status-${W()}`;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(s),this.inputView=this._createInputView(t,s,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 j(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createInputView(e,t,s){let o=new e(this.locale,s);return o.id=t,o.ariaDescribedById=s,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 d(this.locale),s=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__status",s.if("errorText","ck-labeled-input__status_error"),s.if("_statusText","ck-hidden",o=>!o)],id:e,role:s.if("errorText","alert")},children:[{text:s.to("_statusText")}]}),t}select(){this.inputView.select()}focus(){this.inputView.focus()}};function Yn(i,e){let t=0,s=0;for(let o of e){let r=o,n=r.items,l=i&&!!r.label.match(i);r.labelView.highlightText(l?i:null);for(let c of n){let h=c.children.first,f=h.labelView;if(!i)c.isVisible=!0,f.highlightText(null);else{let m=!!h.label.match(i);f.highlightText(m?i:null),c.isVisible=l||m}}let a=n.filter(c=>c.isVisible).length;t+=r.items.length,s+=l?r.items.length:a,r.isVisible=l||!!a}return{resultsCount:s,totalItemsCount:t}}var Ji=class extends co{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||""})}},ri=class extends pe(){constructor(e,t){super(),t&&et(this,t),e&&this.set(e)}},pt=L("px"),ze=class extends J{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 y("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 s=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),s.set(e.view,e),this._viewToStack.set(e.view,s),s===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new y("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 y("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new V(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(s=>s[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 ni(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(s,o)=>!o&&s>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(s,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 es(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,s)=>!s&&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:s=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=s,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}},ni=class extends d{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);let t=e.t,s=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new _,this.buttonPrevView=this._createButtonView(t("Previous"),To),this.buttonNextView=this._createButtonView(t("Next"),_o),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",s.to("isNavigationVisible",o=>o?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:s.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 s=new b(this.locale);return s.set({label:e,icon:t,tooltip:!0}),s}},es=class extends d{content;_balloonPanelView;constructor(e,t){super(e);let s=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",s.to("numberOfPanels",o=>o?"":"ck-hidden")],style:{top:s.to("top",pt),left:s.to("left",pt),width:s.to("width",pt),height:s.to("height",pt)}},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 d;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:s,height:o}=new g(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:s,height:o})}}},ne=L("px"),ts=class extends d{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 x({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",s=>s?"block":"none"),height:t.to("isSticky",s=>s?ne(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new x({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",s=>s?ne(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",s=>s&&ne(s)),bottom:t.to("_stickyBottomOffset",s=>s&&ne(s)),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(p.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),p.window.visualViewport&&(this.listenTo(p.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(p.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}let e=new g(this.limiterElement),t=e.getVisible();if(t){let r=new g(p.window);r.top+=this.viewportTopOffset,r.height-=this.viewportTopOffset,t=t.getIntersection(r)}let{left:s,top:o}=ge();if(e.moveBy(s,o),t&&t.moveBy(s,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=ne(-p.window.scrollX+ge().left)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=ne(-p.window.scrollX+ge().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new g(this.contentPanelElement)}},li=class extends Me{iconView;resetButtonView;_viewConfig;constructor(e,t){let s=e.t,o=Object.assign({},{showResetButton:!0,showIcon:!0,creator:ms},t);super(e,o.creator),this.label=t.label,this._viewConfig=o,this._viewConfig.showIcon&&(this.iconView=new O,this.iconView.content=wo,this.fieldWrapperChildren.add(this.iconView,0),this.extendTemplate({attributes:{class:"ck-search__query_with-icon"}})),this._viewConfig.showResetButton&&(this.resetButtonView=new b(e),this.resetButtonView.set({label:s("Clear"),icon:it,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)}},Ge=class extends d{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()}},ai=class extends d{focusTracker;children;_focusCycler;constructor(e){super(e),this.children=this.createCollection(),this.focusTracker=new _,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new P({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()}},ci=class extends d{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 _,this.keystrokes=new T,this.resultsView=new ai(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 Ge,this._enableDefaultInfoViewBehavior(),this.on("render",()=>{this.search("")})),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new P({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",(s,{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(Ti(e),"ig"):null,s=this.filteredView.filter(t);this.fire("search",{query:e,...s})}_createSearchTextQueryView(){let e=new li(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:s(l,r),secondaryText:s(a,r),isVisible:!0})}});function s(o,{query:r,resultsCount:n,totalItemsCount:l}){return typeof o=="function"?o(r,n,l):o}}},is=class i extends ci{_config;constructor(e,t){super(e,t),this._config=t;let s=L("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",s)}}}),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(p.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 g(this.queryView.fieldView.element).width;let e=i._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:i.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=be},$e=class extends d{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(Qn(this.text||"",e))}_updateInnerHTML(e){this.element.innerHTML=e||""}};function Qn(i,e){if(!e)return tt(i);let t=[],s=0,o=e.exec(i);for(;o!==null;){let n=o.index;
1n!==s&&t.push({text:i.substring(s,n),isMatch:!1}),t.push({text:o[0],isMatch:!0}),s=e.lastIndex,o=e.exec(i)}return s!==i.length&&t.push({text:i.substring(s),isMatch:!1}),t.map(n=>(n.text=tt(n.text),n)).map(n=>n.isMatch?`<mark>${n.text}</mark>`:n.text).join("")}var ss=class extends $e{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")}})}},os=class extends $e{id;constructor(){super(),this.set("for",void 0);let e=this.bindTemplate;this.id=`ck-editor__label_${W()}`,this.extendTemplate({attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")}})}},rs=class extends d{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"]}}]})}},Zn=L("px"),ns=class extends J{toolbarView;focusTracker;_balloonConfig;_resizeObserver=null;_balloon;_fireSelectionChangeDebounced;static get pluginName(){return"BalloonToolbar"}static get isOfficialPlugin(){return!0}static get requires(){return[ze]}constructor(e){super(e),this._balloonConfig=mi(e.config.get("balloonToolbar")),this.toolbarView=this._createToolbarView(),this.focusTracker=new _,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(ze),this._fireSelectionChangeDebounced=z(()=>this.fire("_selectionChangeDebounced"),200),this.decorate("show")}init(){let e=this.editor,t=e.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",(s,o,r)=>{let n=this._balloon.visibleView===this.toolbarView;!r&&n?this.hide():r&&this.show()}),this.listenTo(t,"change:range",(s,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 s=e.ui.view.editable.element;this._resizeObserver=new Y(s,o=>{this.toolbarView.maxWidth=Zn(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,s=new he(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return s.ariaLabel=e("Editor contextual toolbar"),s.render(),s}show(e=!1){let t=this.editor,s=t.model.document.selection,o=t.model.schema;this._balloon.hasView(this.toolbarView)||s.isCollapsed&&!e||Jn(s,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:s}=e;s.view.addObserver(class extends Ho{observe(r){t.add(r)}stopObserving(r){t.remove(r)}})}_getBalloonPositionData(){let t=this.editor.editing.view,s=t.document,o=s.selection,r=s.selection.isBackward;return{target:()=>{let n=r?o.getFirstRange():o.getLastRange(),l=g.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 s=S.isSafari&&S.isiOS?V.generatePositions({heightOffset:Math.max(V.arrowHeightOffset,Math.round(20/p.window.visualVie
1wport.scale))}):V.defaultPositions;return e?[s.northWestArrowSouth,s.northWestArrowSouthWest,s.northWestArrowSouthEast,s.northWestArrowSouthMiddleEast,s.northWestArrowSouthMiddleWest,s.southWestArrowNorth,s.southWestArrowNorthWest,s.southWestArrowNorthEast,s.southWestArrowNorthMiddleWest,s.southWestArrowNorthMiddleEast]:[s.southEastArrowNorth,s.southEastArrowNorthEast,s.southEastArrowNorthWest,s.southEastArrowNorthMiddleEast,s.southEastArrowNorthMiddleWest,s.northEastArrowSouth,s.northEastArrowSouthEast,s.northEastArrowSouthWest,s.northEastArrowSouthMiddleEast,s.northEastArrowSouthMiddleWest]}};function Jn(i,e){return i.rangeCount===1?!1:[...i.getRanges()].every(t=>{let s=t.getContainedElement();return s&&e.isSelectable(s)})}var nr=L("px"),hi=class extends b{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",s=>nr(s)),left:t.to("left",s=>nr(s))}}})}},Ve=L("px"),ls=class extends J{toolbarView;panelView;buttonView;_resizeObserver=null;_blockToolbarConfig;static get pluginName(){return"BlockToolbar"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this._blockToolbarConfig=mi(this.editor.config.get("blockToolbar")),this.toolbarView=this._createToolbarView(),this.panelView=this._createPanelView(),this.buttonView=this._createButtonView(),pi({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,s=t("Click to edit block"),o=t("Drag to move"),r=t("Edit block"),n=e.plugins.has("DragDropBlockToolbar"),l=n?`${s}
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,c)=>{c.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,c,h)=>{h?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,s=new he(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return s.ariaLabel=e("Editor block content toolbar"),s}_createPanelView(){let e=this.editor,t=new V(e.locale);return t.content.add(this.toolbarView),t.class="ck-toolbar-container",e.ui.view.body.add(t),this.toolbarView.keystrokes.set("Esc",(s,o)=>{this._hidePanel(!0),o()}),t}_createButtonView(){let e=this.editor,t=e.t,s=new hi(e.locale),o=this._blockToolbarConfig.icon,r=Gt[o]||o||Gt.dragIndicator;return s.set({label:t("Edit block"),icon:r,withText:!1}),s.bind("isOn").to(this.panelView,"isVisible"),s.bind("tooltip").to(this.panelView,"isVisible",n=>!n),this.listenTo(s,"execute",()=>{this.panelView.isVisible?this._hidePanel(!0):this._showPanel()}),this.listenTo(s,"change:isEnabled",(n,l,a)=>{!a&&this.panelView.isVisible&&this._hidePanel(!1)}),e.ui.view.body.add(s),s}_updateButton(){let e=this.editor,t=e.model,s=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=s.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,s=(o,r)=>{if(t)return;let n=this._getSelectedEditableElement();r.target!==p.document&&!_s(n).includes(r.target)||(t=!0,p.window.requestAnimationFrame(()=>{this._updateButton(),t=!1}))};e.on("change:isVisible",(o,r,n)=>{n?e.listenTo(p.document,"scroll",s,{useCapture:!0,usePassive:!0}):e.stopListening(p.document,"scroll",s)})}_attachButtonToElement(e){let t=this.buttonView.element,s=this._getSelectedEditableElement(),o=window.getComputedStyle(e),r=new g(s),n=parseInt(o.paddingTop,10),l=parseInt(o.lineHeight,10)||parseInt(o.fontSize,10)*1.2,a=new g(t),c=new g(e),h;this.editor.locale.uiLanguageDirection==="ltr"?h=r.left-a.width:h=r.right;let f=c.top+n+(l-a.height)/2;a.moveTo(h,f);let m=a.toAbsoluteRect();this.buttonView.top=m.top,this.buttonView.left=m.left,this._clipButtonToViewport(this.buttonView,s)}_clipButtonToViewport(e,t){let s=new g(e.element),o=new g(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<s.bottom){let l=Math.min(s.height,s.bottom-o.bottom);n(l>=s.height),r("0 0","100% 0",`100% calc(100% - ${Ve(l)})`,`0 calc(100% - ${Ve(l)}`)}else if(o&&o.top>s.top){let l=Math.min(s.height,o.top-s.top);n(l>=s.height),r(`0 ${Ve(l)}`,`100% ${Ve(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 Y(e,()=>{this.toolbarView.maxWidth=this._getToolbarMaxWidth(e)})))}_getToolbarMaxWidth(e){let t=new g(e),s=new g(this.buttonView.element),r=this.editor.locale.uiLanguageDirection==="rtl"?s.left-t.right+s.width:t.left-s.left;return Ve(t.width+r)}},ui=class extends A{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",s=>String(s)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new O;return e.content=ee,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}},di=class extends d{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",s=>`ck-menu-bar__menu__panel_position_${s}`),t.if("isVisible","ck-hidden",s=>!s)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(s=>{s.target.tagName.toLocaleLowerCase()!=="input"&&s.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}},le=class i extends d{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);let t=this.bindTemplate;this.buttonView=new ui(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new di(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new T,this.focusTracker=new _,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",s=>!s),t.if("parentMenuView","ck-menu-bar__menu_top-level",s=>!s)]},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),R.closeOnEscKey(this),this._repositionPanelOnOpen()}
2_attachBehaviors(){this.parentMenuView?(R.openOnButtonClick(this),R.openOnArrowRightKey(this),R.closeOnArrowLeftKey(this),R.openAndFocusOnEnterKeyPress(this),R.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),R.openAndFocusPanelOnArrowDownKey(this),R.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,s)=>{if(!s)return;let o=i._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:s,northWest:o,westSouth:r,eastSouth:n,westNorth:l,eastNorth:a}=Vr;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[n,a,r,l]:[e,t,s,o]:this.parentMenuView?[r,l,n,a]:[t,e,o,s]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=be},je=class extends X{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 s=lr(t);return s&&s.isToggleable});this.items.forEach(t=>{let s=lr(t);s&&(s.hasCheckSpace=e)})}};function lr(i){return i instanceof C?i.children.map(e=>el(e)?e.buttonView:e).find(e=>e instanceof A):null}function el(i){return typeof i=="object"&&"buttonView"in i&&i.buttonView instanceof b}var fi=class extends Bt{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}},ar=["mouseenter","arrowleft","arrowright","change:isOpen"],as=class extends d{children;menus=[];constructor(e){super(e);let t=e.t,s=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",s.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,s=[]){let o=this.locale,n=Er({normalizedConfig:e,locale:o,componentFactory:t,extraItems:s}).items.map(l=>this._createMenu({componentFactory:t,menuDefinition:l}));this.children.addMany(n)}render(){super.render(),K.toggleMenusAndFocusItemsOnHover(this),K.closeMenusWhenTheBarCloses(this),K.closeMenuWhenAnotherOnTheSameLevelOpens(this),K.focusCycleMenusOnArrows(this),K.closeOnClickOutside(this),K.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(...ar).to(t),e.parentMenuView=t):e.delegate(...ar).to(this,s=>"menu:"+s),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:s}){let o=this.locale,r=new le(o);return this.registerMenu(r,s),r.buttonView.set({label:t.label}),r.once("change:isOpen",()=>{let n=new je(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:s}){let o=this.locale,r=[];for(let n of e.groups){for(let l of n.items){let a=new He(o,t);if(Q(l))a.children.add(this._createMenu({componentFactory:s,menuDefinition:l,parentMenuView:t}));else{let c=this._createMenuItemContentFromFactory({componentName:l,componentFactory:s,parentMenuView:t});if(!c)continue;a.children.add(c)}r.push(a)}n!==e.groups[e.groups.length-1]&&r.push(new ce(o))}return r}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:s}){let o=s.create(e);return o instanceof le||o instanceof Ee||o instanceof fi?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):(I("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof le)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);let s=e.panelView.children.filter(r=>r instanceof je)[0];if(!s){e.delegate("mouseenter").to(t);return}let o=s.items.filter(r=>r instanceof C);for(let r of o)this._registerMenuTree(r.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,s,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(r=>r.isOpen)},0)})}};export{Ri as AccessibilityHelp,xt as AccessibilityHelpContentView,_t as AriaLiveAnnouncer,Ni as AriaLiveAnnouncerPoliteness,yt as AriaLiveAnnouncerRegionView,kt as AriaLiveAnnouncerView,is as AutocompleteView,Oe as Badge,V as BalloonPanelView,ns as BalloonToolbar,hi as BlockButtonView,ls as BlockToolbar,Ot as BodyCollection,qi as BoxedEditorUIView,Ie as ButtonLabelView,ss as ButtonLabelWithHighlightView,b as ButtonView,St as CollapsibleView,Se as ColorGridView,Zt as ColorGridsFragmentView,Jt as ColorPickerFragmentView,Yt as ColorPickerInputRowView,qt as ColorPickerView,ji as ColorSelectorView,Be as ColorTileView,ei as ComponentFactory,ze as ContextualBalloon,fn as CssTransitionDisablerMixin,Cr as DefaultMenuBarItems,It as Dialog,vt as DialogActionsView,Vt as DialogContentView,Ct as DialogView,v as DialogViewPosition,Qt as DocumentColorCollection,fr as DraggableViewMixin,Nt as DropdownButtonView,Rt as DropdownMenuButtonView,De as DropdownMenuListItemButtonView,Ne as DropdownMenuListItemView,Fe as DropdownMenuListView,Wt as DropdownMenuNestedMenuPanelView,Re as DropdownMenuNestedMenuView,yr as DropdownMenuPanelPositioningFunctions,Ht as DropdownMenuRootListView,Dt as DropdownPanelView,Ft as DropdownView,oi as EditableUIView,Ki as EditorUI,si as EditorUIView,ii as EvaluationBadge,Hi as FileDialogButtonView,Bt as FileDialogListItemButtonView,us as FileDialogViewMixin,P as FocusCycler,Tt as FormHeaderView,Yi as FormRowView,$e as HighlightedTextView,O as IconView,Qi as IframeView,Xi as InlineEditableUIView,Le as InputBase,Lt as InputNumberView,Mt as InputTextView,Ae as InputView,$t as ItemsView,j as LabelView,os as LabelWithHighlightView,Me as LabeledFieldView,Zi as LabeledInputVie
2w,A as ListItemButtonView,q as ListItemGroupView,C as ListItemView,ce as ListSeparatorView,X as ListView,ui as MenuBarMenuButtonView,Ee as MenuBarMenuListItemButtonView,fi as MenuBarMenuListItemFileDialogButtonView,He as MenuBarMenuListItemView,je as MenuBarMenuListView,di as MenuBarMenuPanelView,le as MenuBarMenuView,as as MenuBarView,Gt as NESTED_TOOLBAR_ICONS,Ji as Notification,Pt as PoweredBy,Ge as SearchInfoView,ai as SearchResultsView,ci as SearchTextView,Xt as SliderView,rs as SpinnerView,Kt as SplitButtonView,ts as StickyPanelView,Pe as SwitchButtonView,x as Template,At as TextareaView,zt as ToolbarLineBreakView,We as ToolbarSeparatorView,he as ToolbarView,ti as TooltipManager,ri as UIModel,d as View,E as ViewCollection,ri as ViewModel,Et as _CheckIconHolderView,St as _CollapsibleView,ni as _ContextualBalloonRotatorView,U as _DropdownMenuBehaviors,Gi as _DropdownRootMenuBehaviors,K as _MenuBarBehaviors,R as _MenuBarMenuBehaviors,Vr as _MenuBarMenuViewPanelPositioningFunctions,Ge as _SearchInfoView,li as _SearchTextQueryView,$ as _TemplateBinding,Ce as _TemplateIfBinding,gt as _TemplateToBinding,ds as _convertColor,wr as _convertColorToHex,xr as _preventUiViewDefault,Er as _processMenuBarConfig,_r as _registerCustomElement,bs as _tryNormalizeHexColor,pr as addKeyboardHandlingForGrid,On as addListToDropdown,En as addMenuToDropdown,fs as addToolbarToDropdown,pi as clickOutsideHandler,bi as createDropdown,Wn as createLabeledDropdown,Nn as createLabeledInputNumber,ms as createLabeledInputText,Rn as createLabeledTextarea,Yn as filterGroupAndItemNames,ps as focusChildOnDropdownOpen,Tn as getLocalizedColorOptions,ue as isFocusable,mr as isViewWithFocusCycler,vn as normalizeColorOptions,Ir as normalizeMenuBarConfig,gr as normalizeSingleColorDefinition,mi as normalizeToolbarConfig,pn 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.(LA5P7LXE).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.