@ncino/web-components 9.1.0 → 9.2.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/eq.js +1 -0
- package/dist/_virtual/getSymbols.js +1 -0
- package/dist/_virtual/getTag.js +1 -0
- package/dist/_virtual/isEqual.js +1 -0
- package/dist/_virtual/isEqual2.js +1 -0
- package/dist/_virtual/isEqualWith.js +1 -0
- package/dist/_virtual/isPlainObject.js +1 -0
- package/dist/_virtual/noop.js +1 -0
- package/dist/_virtual/tags.js +1 -0
- package/dist/assets/node_modules/.pnpm/{ckeditor5@47.3.0 → ckeditor5@47.4.0}/node_modules/ckeditor5/dist/ckeditor5.css +1 -1
- package/dist/components/input/gator/input-file/input-file.gator.js +1 -1
- package/dist/components/input-rich-text/ckeditor-config.js +1 -1
- package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-alignment@47.3.0 → @ckeditor_ckeditor5-alignment@47.4.0}/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@47.3.0 → @ckeditor_ckeditor5-autoformat@47.4.0}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@47.3.0 → @ckeditor_ckeditor5-autosave@47.4.0}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-basic-styles@47.3.0 → @ckeditor_ckeditor5-basic-styles@47.4.0}/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@47.3.0 → @ckeditor_ckeditor5-block-quote@47.4.0}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-clipboard@47.3.0 → @ckeditor_ckeditor5-clipboard@47.4.0}/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@47.3.0 → @ckeditor_ckeditor5-cloud-services@47.4.0}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@47.3.0 → @ckeditor_ckeditor5-code-block@47.4.0}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@47.4.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-editor-classic@47.3.0 → @ckeditor_ckeditor5-editor-classic@47.4.0}/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-engine@47.3.0 → @ckeditor_ckeditor5-engine@47.4.0}/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@47.3.0 → @ckeditor_ckeditor5-enter@47.4.0}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@47.3.0 → @ckeditor_ckeditor5-essentials@47.4.0}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-find-and-replace@47.3.0 → @ckeditor_ckeditor5-find-and-replace@47.4.0}/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-font@47.3.0 → @ckeditor_ckeditor5-font@47.4.0}/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@47.3.0 → @ckeditor_ckeditor5-heading@47.4.0}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-highlight@47.3.0 → @ckeditor_ckeditor5-highlight@47.4.0}/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-horizontal-line@47.3.0 → @ckeditor_ckeditor5-horizontal-line@47.4.0}/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-embed@47.3.0 → @ckeditor_ckeditor5-html-embed@47.4.0}/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-support@47.3.0 → @ckeditor_ckeditor5-html-support@47.4.0}/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@47.4.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-indent@47.3.0 → @ckeditor_ckeditor5-indent@47.4.0}/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@47.3.0 → @ckeditor_ckeditor5-language@47.4.0}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-link@47.3.0 → @ckeditor_ckeditor5-link@47.4.0}/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-list@47.3.0 → @ckeditor_ckeditor5-list@47.4.0}/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@47.3.0 → @ckeditor_ckeditor5-markdown-gfm@47.4.0}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@47.4.0/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@47.3.0 → @ckeditor_ckeditor5-mention@47.4.0}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-page-break@47.3.0 → @ckeditor_ckeditor5-page-break@47.4.0}/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@47.3.0 → @ckeditor_ckeditor5-paragraph@47.4.0}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paste-from-office@47.3.0 → @ckeditor_ckeditor5-paste-from-office@47.4.0}/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-remove-format@47.3.0 → @ckeditor_ckeditor5-remove-format@47.4.0}/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-select-all@47.3.0 → @ckeditor_ckeditor5-select-all@47.4.0}/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-show-blocks@47.3.0 → @ckeditor_ckeditor5-show-blocks@47.4.0}/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-source-editing@47.3.0 → @ckeditor_ckeditor5-source-editing@47.4.0}/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-special-characters@47.3.0 → @ckeditor_ckeditor5-special-characters@47.4.0}/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@47.3.0 → @ckeditor_ckeditor5-style@47.4.0}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.4.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@47.4.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@47.4.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@47.3.0 → @ckeditor_ckeditor5-undo@47.4.0}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@47.3.0 → @ckeditor_ckeditor5-upload@47.4.0}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-utils@47.3.0 → @ckeditor_ckeditor5-utils@47.4.0}/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-widget@47.3.0 → @ckeditor_ckeditor5-widget@47.4.0}/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@deltablot_dropzone@7.4.3/node_modules/@deltablot/dropzone/dist/dropzone.js +38 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/compat/isEqual.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/_internal/getSymbols2.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/_internal/getTag2.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/_internal/tags2.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/merge.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/util/eq2.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/function/noop.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/function/noop2.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqual.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqual2.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqualWith.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqualWith2.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isPlainObject.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isPlainObject2.js +1 -0
- package/dist/node_modules/.pnpm/mdast-util-from-markdown@2.0.2/node_modules/mdast-util-from-markdown/lib/index.js +1 -1
- package/dist/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-reference.js +1 -1
- package/dist/node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js +1 -1
- package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/storybook/dist/_browser-chunks/chunk-RP5RXKFU.js → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/_browser-chunks/chunk-Q5RYDXT3.js} +19 -19
- package/dist/node_modules/.pnpm/storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/_browser-chunks/chunk-VIJ7SQRO.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/core-events/index.js +1 -0
- package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/instrumenter/index.js +1 -1
- package/dist/node_modules/.pnpm/storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/test/index.js +156 -0
- package/package.json +14 -14
- package/web-types.json +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@47.3.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@47.3.0/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.3.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@47.3.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@deltablot_dropzone@7.3.1/node_modules/@deltablot/dropzone/dist/dropzone.js +0 -22
- package/dist/node_modules/.pnpm/storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/storybook/dist/_browser-chunks/chunk-EZSQOHRI.js +0 -1
- package/dist/node_modules/.pnpm/storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/storybook/dist/core-events/index.js +0 -1
- package/dist/node_modules/.pnpm/storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/storybook/dist/test/index.js +0 -152
- /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-icons@47.3.0 → @ckeditor_ckeditor5-icons@47.4.0}/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@47.3.0 → @ckeditor_ckeditor5-watchdog@47.4.0}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{decode-named-character-reference@1.2.0 → decode-named-character-reference@1.3.0}/node_modules/decode-named-character-reference/index.dom.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/storybook/dist/_browser-chunks/chunk-JP7NCOJX.js → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/storybook/dist/_browser-chunks/chunk-3LY4VQVK.js} +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/_browser-chunks/chunk-A242L54C.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/_browser-chunks/chunk-ZUWEVLDX.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.10_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.2.1_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.4_react@19.2.4__react@19.2.4}/node_modules/storybook/dist/client-logger/index.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getEnvKeystrokeText as Y,uid as Q,env as A,delay as Ft,createElement as x,KeystrokeHandler as E,FocusTracker as b,toUnit as te,global as d,Rect as T,getConstrainedViewportRect as At,DomEmitterMixin as ie,ObservableMixin as se,Collection as me,isIterable as Ee,CKEditorError as v,getOptimalPosition as we,logWarning as C,EmitterMixin as Je,getVisualViewportOffset as K,isVisible as O,isNode as et,priorities as Dt,isText as St,ResizeObserver as tt,toArray as oe,first as Mt,parseBase64EncodedObject as it,isRange as Nt}from"../../../../../@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Plugin as be,ContextPlugin as Wt}from"../../../../../@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconAccessibility as Ie,IconCancel as st,IconDropdownArrow as ne,IconDragIndicator as Gt,IconPilcrow as Rt,IconThreeVerticalDots as ge,IconText as Ht,IconPlus as zt,IconParagraph as Ut,IconImportExport as $t,IconBold as Kt,IconAlignLeft as jt,IconCheck as ot,IconPreviousArrow as Xt,IconNextArrow as qt,IconColorPalette as Yt,IconEraser as Qt,IconProjectLogo as Zt,IconColorTileCheck as Jt}from"../../../../../@ckeditor_ckeditor5-icons@47.3.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import Oe from"../../../../../color-parse@2.0.2/node_modules/color-parse/index.js";import nt from"../../../../../color-convert@3.1.0/node_modules/color-convert/index.js";import{HexBase as ei}from"../../../../../vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/entrypoints/hex.js";import"../../../../../@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{assignIn as ti}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/assignIn.js";import{isObject as Z}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{cloneDeep as _e}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeep.js";import{debounce as fe}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/debounce.js";import{isElement as ke}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{cloneDeepWith as ii}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";import{throttle as si}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";class B extends me{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,i,o)=>{this._renderViewIntoCollectionParent(i,o)}),this.on("remove",(t,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!oi(e))throw new v("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const o of e)i.delegate(o).to(t);this.on("add",(i,o)=>{for(const n of e)o.delegate(n).to(t)}),this.on("remove",(i,o)=>{for(const n of e)o.stopDelegating(n,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 oi(s){return s.every(e=>typeof e=="string")}const ni="http://www.w3.org/1999/xhtml";class V extends Je(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Be(Pe(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Ae(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new v("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(const i of t.children)J(i)?yield i:Te(i)&&(yield*e(i))}yield*e(this)}static bind(e,t){return{to(i,o){return new ri({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o})},if(i,o,n){return new rt({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}}static extend(e,t){if(e._isRendered)throw new v("template-extend-render",[this,e]);ht(e,Be(Pe(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new v("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||ni,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(""),j(this.text)?this._bindToObservable({schema:this.text,updater:ai(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const o in this.attributes){const n=t.getAttribute(o),r=this.attributes[o];i&&(i.attributes[o]=n);const a=Fe(r)?r[0].ns:null;if(j(r)){const l=Fe(r)?r[0].value:r;i&&De(o)&&l.unshift(n),this._bindToObservable({schema:l,updater:ci(t,o,a),data:e})}else if(o=="style"&&typeof r[0]!="string")this._renderStyleAttribute(r[0],e);else{i&&n&&De(o)&&r.unshift(n);const l=r.map(c=>c&&(c.value||c)).reduce((c,u)=>c.concat(u),[]).reduce(ct,"");M(l)||t.setAttributeNS(a,o,l)}}}_renderStyleAttribute(e,t){const i=t.node;for(const o in e){const n=e[o];j(n)?this._bindToObservable({schema:[n],updater:hi(i,o),data:t}):pe(o)?i.style.setProperty(o,n):i.style[o]=n}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let n=0;for(const r of this.children)if(ve(r)){if(!o){r.setParent(t);for(const a of r)i.appendChild(a.element)}}else if(J(r))o||(r.isRendered||r.render(),i.appendChild(r.element));else if(et(r))i.appendChild(r);else if(o){const a=e.revertData,l=Ae();a.children.push(l),r._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:l})}else i.appendChild(r.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map(o=>{const[n,r]=t.split("@");return o.activateDomEventListener(n,r,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const o=i.revertData;lt(e,t,i);const n=e.filter(r=>!M(r)).filter(r=>r.observable).map(r=>r.activateAttributeListener(e,t,i));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(const o of t.bindings)for(const n of o)n();if(t.text){e.textContent=t.text;return}const i=e;for(const o in t.attributes){const n=t.attributes[o];n===null?i.removeAttribute(o):i.setAttribute(o,n)}for(let o=0;o<t.children.length;++o)this._revertTemplateFromNode(i.childNodes[o],t.children[o])}}class H{attribute;observable;emitter;callback;constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){const o=()=>lt(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}}class ri extends H{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const o=(n,r)=>{(!t||r.target.matches(t))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(r):this.observable.fire(this.eventNameOrFunction,r))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}}class rt extends H{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){const t=super.getValue(e);return M(t)?!1:this.valueIfTrue||!0}}function j(s){return s?(s.value&&(s=s.value),Array.isArray(s)?s.some(j):s instanceof H):!1}function pe(s){return/^--[a-zA-Z_-][\w-]*$/.test(s)}function li(s,e){return s.map(t=>t instanceof H?t.getValue(e):t)}function lt(s,e,{node:t}){const i=li(s,t);let o;s.length==1&&s[0]instanceof rt?o=i[0]:o=i.reduce(ct,""),M(o)?e.remove():e.set(o)}function ai(s){return{set(e){s.textContent=e},remove(){s.textContent=""}}}function ci(s,e,t){return{set(i){s.setAttributeNS(t,e,i)},remove(){s.removeAttributeNS(t,e)}}}function hi(s,e){return{set(t){pe(e)?s.style.setProperty(e,t):s.style[e]=t},remove(){pe(e)?s.style.removeProperty(e):s.style[e]=null}}}function Pe(s){return ii(s,t=>{if(t&&(t instanceof H||Te(t)||J(t)||ve(t)))return t})}function Be(s){if(typeof s=="string"?s=fi(s):s.text&&pi(s),s.on&&(s.eventListeners=di(s.on),delete s.on),!s.text){s.attributes&&ui(s.attributes);const e=[];if(s.children)if(ve(s.children))e.push(s.children);else for(const t of s.children)Te(t)||J(t)||et(t)?e.push(t):e.push(new V(t));s.children=e}return s}function ui(s){for(const e in s)s[e].value&&(s[e].value=oe(s[e].value)),at(s,e)}function di(s){for(const e in s)at(s,e);return s}function fi(s){return{text:[s]}}function pi(s){s.text=oe(s.text)}function at(s,e){s[e]=oe(s[e])}function ct(s,e){return M(e)?s:M(s)?e:`${s} ${e}`}function Le(s,e){for(const t in e)s[t]?s[t].push(...e[t]):s[t]=e[t]}function ht(s,e){if(e.attributes&&(s.attributes||(s.attributes={}),Le(s.attributes,e.attributes)),e.eventListeners&&(s.eventListeners||(s.eventListeners={}),Le(s.eventListeners,e.eventListeners)),e.text&&s.text.push(...e.text),e.children&&e.children.length){if(s.children.length!=e.children.length)throw new v("ui-template-extend-children-mismatch",s);let t=0;for(const i of e.children)ht(s.children[t++],i)}}function M(s){return!s&&s!==0}function J(s){return s instanceof h}function Te(s){return s instanceof V}function ve(s){return s instanceof B}function Fe(s){return Z(s[0])&&s[0].ns}function Ae(){return{children:[],bindings:[],attributes:{}}}function De(s){return s=="class"||s=="style"}class h extends ie(se()){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 me,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=V.bind(this,this)}createCollection(e){const t=new B(e);return this._viewCollections.add(t),t}registerChild(e){Ee(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Ee(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new V(e)}extendTemplate(e){V.extend(this.template,e)}render(){if(this.isRendered)throw new v("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)}}const Se={POLITE:"polite",ASSERTIVE:"assertive"};class mi{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(const t of Object.values(Se))this.announce("",t)})}announce(e,t=Se.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new wi(i.locale),i.ui.view.body.add(this.view));const{politeness:o,isUnsafeHTML:n}=typeof t=="string"?{politeness:t}:t;let r=this.view.regionViews.find(a=>a.politeness===o);r||(r=new bi(i,o),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:n})}}class wi extends h{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class bi extends h{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;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}function ut({emitter:s,activator:e,callback:t,contextElements:i,listenerOptions:o}){s.listenTo(document,"mousedown",(n,r)=>{if(!e())return;const a=typeof r.composedPath=="function"?r.composedPath():[],l=typeof i=="function"?i():i;for(const c of l)if(c.contains(r.target)||a.includes(c))return;t()},o)}function so(s){class e extends s{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...i){super(...i),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return e}function gi(s){class e extends s{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...i){super(...i),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(d.document,"mouseup",this._onDragEndBound),this.listenTo(d.document,"touchend",this._onDragEndBound),this.listenTo(d.document,"mousemove",this._onDragBound),this.listenTo(d.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(d.document,"mouseup",this._onDragEndBound),this.stopListening(d.document,"touchend",this._onDragEndBound),this.stopListening(d.document,"mousemove",this._onDragBound),this.stopListening(d.document,"touchmove",this._onDragBound)}_onDragStart(i,o){if(!this._isHandleElementPressed(o))return;this._attachDragListeners();let n=0,r=0;o instanceof MouseEvent?(n=o.clientX,r=o.clientY):(n=o.touches[0].clientX,r=o.touches[0].clientY),this._lastDraggingCoordinates={x:n,y:r},this.isDragging=!0}_onDrag(i,o){if(!this.isDragging){this._detachDragListeners();return}let n=0,r=0;o instanceof MouseEvent?(n=o.clientX,r=o.clientY):(n=o.touches[0].clientX,r=o.touches[0].clientY),o.preventDefault(),this.fire("drag",{deltaX:Math.round(n-this._lastDraggingCoordinates.x),deltaY:Math.round(r-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:n,y:r}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(i){return this.dragHandleElement?this.dragHandleElement===i.target||i.target instanceof HTMLElement&&this.dragHandleElement.contains(i.target):!1}}return e}function oo({view:s}){s.listenTo(s.element,"submit",(e,t)=>{t.preventDefault(),s.fire("submit")},{useCapture:!0})}function _i({keystrokeHandler:s,focusTracker:e,gridItems:t,numberOfColumns:i,uiLanguageDirection:o}){const n=typeof i=="number"?()=>i:i;s.set("arrowright",r((c,u)=>o==="rtl"?l(c,u.length):a(c,u.length))),s.set("arrowleft",r((c,u)=>o==="rtl"?a(c,u.length):l(c,u.length))),s.set("arrowup",r((c,u)=>{let f=c-n();return f<0&&(f=c+n()*Math.floor(u.length/n()),f>u.length-1&&(f-=n())),f})),s.set("arrowdown",r((c,u)=>{let f=c+n();return f>u.length-1&&(f=c%n()),f}));function r(c){return u=>{const f=t.find(Lt=>Lt.element===e.focusedElement),w=t.getIndex(f),F=c(w,t);t.get(F).focus(),u.stopPropagation(),u.preventDefault()}}function a(c,u){return c===u-1?0:c+1}function l(c,u){return c===0?u-1:c-1}}class re extends h{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${Q()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class ki extends h{constructor(e,t){super(e);const i=e.t,o=new re;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[x(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map(t=>{const i=[x(document,"h3",{},t.label),...Array.from(t.groups.values()).map(o=>this._createGroup(o)).flat()];return t.description&&i.splice(1,0,x(document,"p",{},t.description)),x(document,"section",{},i)})}_createGroup(e){const t=e.keystrokes.sort((o,n)=>o.label.localeCompare(n.label)).map(o=>this._createGroupRow(o)).flat(),i=[x(document,"dl",{},t)];return e.label&&i.unshift(x(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=x(document,"dt"),o=x(document,"dd"),n=vi(e.keystroke),r=[];for(const a of n)r.push(a.map(Ti).join(""));return i.innerHTML=e.label,o.innerHTML=r.join(", ")+(e.mayRequireFn&&A.isMac?` ${t("(may require <kbd>Fn</kbd>)")}`:""),[i,o]}}function Ti(s){return Y(s).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}function vi(s){return typeof s=="string"?[[s]]:typeof s[0]=="string"?[s]:s}class L extends h{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();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",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){const t=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!t)throw new v("ui-iconview-invalid-svg",this);const i=t.getAttribute("viewBox");i&&(this.viewBox=i);for(const{name:o,value:n}of Array.from(t.attributes))L.presentationalAttributeNames.includes(o)&&this.element.setAttribute(o,n);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})}}class dt extends h{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class p extends h{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new dt){super(e);const i=this.bindTemplate,o=Q();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 L,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));const n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",r=>!r),i.if("isVisible","ck-hidden",r=>!r),i.to("isOn",r=>r?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",r=>r||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,r=>!r),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(r=>{this.isEnabled?this.fire("execute"):r.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(r,a,l)=>!a||Me(l)?!1:String(!!r)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(r,a,l)=>!a||!Me(l)?!1:String(!!r)),A.isSafari&&(this._focusDelayed||(this._focusDelayed=Ft(()=>this.focus(),0)),n.on.mousedown=i.to(()=>{this._focusDelayed()}),n.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(n)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new h;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Y(t))}]}),e}_getTooltipString(e,t,i){return e?typeof e=="string"?e:(i&&(i=Y(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function Me(s){switch(s){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class yi extends h{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new L,this.iconView.content=t.icon,this.children.add(this.iconView));const o=new h(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}}class N extends Je(){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(const t in e.actions){let i=e.actions[t];typeof i=="string"&&(i=[i]);for(const o of i)e.keystrokeHandler.set(o,(n,r)=>{this[t](),r()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(le)||null}get last(){return this.focusables.filter(le).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,i)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const 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){const t=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",i=>{const o=t();this.focusNext(),o!==t()&&i.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",i=>{const o=t();this.focusPrevious(),o!==t()&&i.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(i===null)return this[e===1?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{const r=this.focusables.get(n);if(le(r)){o=r;break}n=(n+t+e)%t}while(n!==i);return o}}function le(s){return z(s)&&O(s.element)}function z(s){return"focus"in s&&typeof s.focus=="function"}function Ci(s){return z(s)&&"focusCycler"in s&&s.focusCycler instanceof N}class Vi extends h{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new E,this._focusTracker=new b,this._focusables=new B,this.focusCycler=new N({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const i=new p(this.locale);let o;i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i);for(o in t)o!="onExecute"&&o!="onCreate"&&i.set(o,t[o]);this.children.add(i)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class xi extends h{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)}}const g={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"},Ne=te("px");class ye extends gi(h){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e);const n=this.bindTemplate,r=e.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",g.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new E,this.focusTracker=new b,this._focusables=new B,this._focusCycler=new N({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",n.if("isModal","ck-dialog-overlay__transparent",a=>!a),n.if("_isVisible","ck-hidden",a=>!a)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.if("isModal","ck-dialog_modal"),n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",a=>Ne(a)),left:n.to("_left",a=>Ne(a)),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())}),this.on("drag",(e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)}),this.listenTo(d.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(d.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,t,i)=>{i&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:n}){t&&(this.headerView=new yi(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),o&&(o instanceof h&&(o=[o]),this.contentView=new xi(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),n&&(this.actionsView=new Vi(this.locale),this.actionsView.setButtons(n),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){if(!this.element||!this.element.parentNode)return;const e=this._getViewportRect();let t=this.position,i;this._getCurrentDomRoot()?i=this._getVisibleDomRootRect(e):t=g.SCREEN_CENTER;const o=ye.defaultOffset,n=this._getDialogRect();if(this.position!=null){if(typeof this.position=="function"){const r=this.position(n,i);if(r==null){this._moveOffScreen();return}this._moveTo(r.left,r.top);return}switch(t){case g.EDITOR_TOP_SIDE:{if(i){const r=this.locale.contentLanguageDirection==="ltr"?i.right-n.width-o:i.left+o;this.moveTo(r,i.top+o)}else this._moveOffScreen();break}case g.EDITOR_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),Math.round(i.top+i.height/2-n.height/2)):this._moveOffScreen();break}case g.SCREEN_CENTER:{this.moveTo(Math.round((e.width-n.width)/2),Math.round((e.height-n.height)/2));break}case g.EDITOR_TOP_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.top+o):this._moveOffScreen();break}case g.EDITOR_BOTTOM_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.bottom-n.height-o):this._moveOffScreen();break}case g.EDITOR_ABOVE_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.top-n.height-o):this._moveOffScreen();break}case g.EDITOR_BELOW_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.bottom+o):this._moveOffScreen();break}}}}_getVisibleDomRootRect(e){let t=new T(this._getCurrentDomRoot()).getVisible();if(t){if(t=e.getIntersection(t),!t)return null}else return null;return t}_getDialogRect(){return new T(this.element.firstElementChild)}_getViewportRect(){const e=new T(d.window);return this.isModal?e:At(this._getViewportOffset())}_updateFocusCyclableItems(){const e=[];if(this.contentView)for(const t of this.contentView.children)z(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),Ci(t)&&this._focusCycler.chain(t.focusCycler)})}_createCloseButton(){const e=new p(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:st}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}}class y extends be{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const 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(),y._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",()=>{y._visibleDialogPlugin&&y._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",(t,i)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())})}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const i of t)i.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:r,className:a,isModal:l,position:c,onHide:u,keystrokeHandlerOptions:f}){const w=this.editor;this.view=new ye(w.locale,{getCurrentDomRoot:()=>w.editing.view.getDomRoot(w.model.document.selection.anchor.root.rootName),getViewportOffset:()=>w.ui.viewportOffset,keystrokeHandlerOptions:f});const F=this.view;F.on("close",()=>{this.hide()}),w.ui.view.body.add(F),w.keystrokes.listenTo(F.element),c||(c=l?g.SCREEN_CENTER:g.EDITOR_CENTER),l&&this._lockBodyScroll(),F.set({position:c,_isVisible:!0,className:a,isModal:l}),F.setupParts({icon:t,title:i,hasCloseButton:o,content:n,actionButtons:r}),this.id=e,u&&(this._onHide=u),this.isOpen=!0,y._visibleDialogPlugin=this}hide(){y._visibleDialogPlugin&&y._visibleDialogPlugin.fire(`hide:${y._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const 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,y._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class W extends p{_checkIconHolderView=new Ei;constructor(e,t=new dt){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(o,n)=>o||n)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{const{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)})}}class Ei extends h{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",t=>t?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{const{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)})}_createCheckIconView(){const e=new L;return e.content=ot,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class ft extends W{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class no extends be{contentView=null;static get requires(){return[y]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{const i=this._createButton(p);return i.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),i}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{const i=this._createButton(ft);return i.label=t("Accessibility"),i}),e.keystrokes.set("Alt+0",(i,o)=>{this._toggleDialog(),o()}),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),o=t.locale,n=new e(o);return n.set({keystroke:"Alt+0",icon:Ie,isToggleable:!0}),n.on("execute",()=>this._toggleDialog()),n.bind("isOn").to(i,"id",r=>r==="accessibilityHelp"),n}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;e.ui.on("ready",()=>{t.change(n=>{for(const r of t.document.roots)o(n,r)}),e.on("addRoot",(n,r)=>{const a=e.editing.view.document.getRoot(r.rootName);t.change(l=>o(l,a))},{priority:"low"})});function o(n,r){const l=[r.getAttribute("aria-label"),i("Press %0 for help.",[Y("Alt+0")])].filter(c=>c).join(". ");n.setAttribute("aria-label",l,r)}}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new ki(e.locale,e.accessibility.keystrokeInfos)),t.id==="accessibilityHelp"?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:Ie,hasCloseButton:!0,content:this.contentView})}}class _ extends B{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new V({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),(!_._bodyWrapper||!_._bodyWrapper.isConnected)&&(_._bodyWrapper=x(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(_._bodyWrapper)),_._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),_._bodyWrapper&&!_._bodyWrapper.childElementCount&&(_._bodyWrapper.remove(),delete _._bodyWrapper)}}const We=te("px"),Ii={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class k extends h{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",i=>`ck-balloon-panel_${i}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",We),left:t.to("left",We)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const t=X(e.target);if(t&&!O(t))return!1;this.show();const i=k.defaultPositions,o=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:d.document.body,fitInViewport:!0},e),n=k._getOptimalPosition(o)||Ii,r=parseInt(n.left),a=parseInt(n.top),l=n.name,c=n.config||{},{withArrow:u=!0}=c;return this.top=a,this.left=r,this.position=l,this.withArrow=u,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=X(e.target);const i=e.limiter?X(e.limiter):d.document.body;if(this.listenTo(d.document,"scroll",(o,n)=>{const r=n.target,a=t&&r.contains(t),l=i&&r.contains(i);(a||l||!t||!i)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(d.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(t&&St(t)&&(t=t.parentElement),t)){const o=()=>{O(t)||this.unpin()};this._resizeObserver=new tt(t,o)}return!0}_stopPinning(){this.stopListening(d.document,"scroll"),this.stopListening(d.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:t=k.arrowSideOffset,heightOffset:i=k.arrowHeightOffset,stickyVerticalOffset:o=k.stickyVerticalOffset,config:n}=e;return{northWestArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left-t,name:"arrow_sw",...n&&{config:n}}),northWestArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northWestArrowSouth:(l,c)=>({top:r(l,c),left:l.left-c.width/2,name:"arrow_s",...n&&{config:n}}),northWestArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northWestArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left-c.width+t,name:"arrow_se",...n&&{config:n}}),northArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-t,name:"arrow_sw",...n&&{config:n}}),northArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northArrowSouth:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width/2,name:"arrow_s",...n&&{config:n}}),northArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width+t,name:"arrow_se",...n&&{config:n}}),northEastArrowSouthWest:(l,c)=>({top:r(l,c),left:l.right-t,name:"arrow_sw",...n&&{config:n}}),northEastArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.right-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northEastArrowSouth:(l,c)=>({top:r(l,c),left:l.right-c.width/2,name:"arrow_s",...n&&{config:n}}),northEastArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.right-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northEastArrowSouthEast:(l,c)=>({top:r(l,c),left:l.right-c.width+t,name:"arrow_se",...n&&{config:n}}),southWestArrowNorthWest:l=>({top:a(l),left:l.left-t,name:"arrow_nw",...n&&{config:n}}),southWestArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southWestArrowNorth:(l,c)=>({top:a(l),left:l.left-c.width/2,name:"arrow_n",...n&&{config:n}}),southWestArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southWestArrowNorthEast:(l,c)=>({top:a(l),left:l.left-c.width+t,name:"arrow_ne",...n&&{config:n}}),southArrowNorthWest:l=>({top:a(l),left:l.left+l.width/2-t,name:"arrow_nw",...n&&{config:n}}),southArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southArrowNorth:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width/2,name:"arrow_n",...n&&{config:n}}),southArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southArrowNorthEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width+t,name:"arrow_ne",...n&&{config:n}}),southEastArrowNorthWest:l=>({top:a(l),left:l.right-t,name:"arrow_nw",...n&&{config:n}}),southEastArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.right-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southEastArrowNorth:(l,c)=>({top:a(l),left:l.right-c.width/2,name:"arrow_n",...n&&{config:n}}),southEastArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.right-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southEastArrowNorthEast:(l,c)=>({top:a(l),left:l.right-c.width+t,name:"arrow_ne",...n&&{config:n}}),westArrowEast:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.left-c.width-i,name:"arrow_e",...n&&{config:n}}),eastArrowWest:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.right+i,name:"arrow_w",...n&&{config:n}}),viewportStickyNorth:(l,c,u)=>{const f=new T(d.document.body).getIntersection(u.getVisible());if(!f)return null;const w=f.getVisible();return!l.getIntersection(w)||!(w.top-l.top-o<c.height&&w.bottom-l.bottom<c.height)?null:{top:w.top+o,left:l.left+l.width/2-c.width/2,name:"arrowless",config:{withArrow:!1,...n}}}};function r(l,c){return l.top-c.height-i}function a(l){return l.bottom+i}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=we;static defaultPositions=k.generatePositions()}function X(s){return ke(s)?s:Nt(s)?s.commonAncestorContainer:typeof s=="function"?X(s()):null}const Oi=50,Pi=350;class pt extends ie(){editor;_balloonView=null;_showBalloonThrottled=si(()=>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(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(t,i,o)=>{this._updateLastFocusedEditableElement(),o?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,i,o)=>{this._updateLastFocusedEditableElement(),o&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new k,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t=e.side==="right"?Bi(this._lastFocusedEditableElement,e):Li(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}const o=Array.from(e.ui.getEditableElementsNames()).map(n=>e.ui.getEditableElement(n));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}}function Bi(s,e){return mt(s,e,(t,i)=>t.left+t.width-i.width-e.horizontalOffset)}function Li(s,e){return mt(s,e,t=>t.left+e.horizontalOffset)}function mt(s,e,t){return(i,o)=>{const n=new T(s);if(n.width<Pi||n.height<Oi)return null;let r;e.position==="inside"?r=n.bottom-o.height:r=n.bottom-o.height/2,r-=e.verticalOffset;const a=t(n,o),c=i.clone().moveTo(a,r).getIntersection(o.clone().moveTo(a,r)).getVisible();return!c||c.getArea()<o.getArea()?null:{top:r,left:a,name:`position_${e.position}-side_${e.side}`,config:{withArrow:!1}}}}const Fi="Powered by";class Ai extends pt{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){const e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;const i=e.config.get("licenseKey");if(i=="GPL")return!0;const o=it(i.split(".")[1]);return o?!o.whiteLabel:!0}_createBadgeContent(){return new Di(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=i==="inside"?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:t.label===void 0?Fi:t.label,verticalOffset:t.verticalOffset!==void 0?t.verticalOffset:o,horizontalOffset:t.horizontalOffset!==void 0?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}}class Di extends h{constructor(e,t){super(e);const i=new L,o=this.bindTemplate;i.set({content:Zt,isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to(n=>n.preventDefault())}}]})}}class wt extends p{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(){const e=new h;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class ro extends bt(p){}class Si extends bt(W){}function bt(s){class e extends s{_fileInputView;constructor(...i){super(...i),this._fileInputView=new Mi(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}class Mi extends h{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class lo extends h{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new p(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:ne}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",i=>!i),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}function ao(s,e){const t=s.t,i={Black:t("Black"),"Dim grey":t("Dim grey"),Grey:t("Grey"),"Light grey":t("Light grey"),White:t("White"),Red:t("Red"),Orange:t("Orange"),Yellow:t("Yellow"),"Light green":t("Light green"),Green:t("Green"),Aquamarine:t("Aquamarine"),Turquoise:t("Turquoise"),"Light blue":t("Light blue"),Blue:t("Blue"),Purple:t("Purple")};return e.map(o=>{const n=i[o.label];return n&&n!=o.label&&(o.label=n),o})}function co(s){return s.map(Ni).filter(e=>!!e)}function Ni(s){return typeof s=="string"?{model:s,label:s,hasBorder:!1,view:{name:"span",styles:{color:s}}}:{model:s.color,label:s.label||s.color,hasBorder:s.hasBorder===void 0?!1:s.hasBorder,view:{name:"span",styles:{color:`${s.color}`}}}}class gt extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=Jt,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",i=>A.isMediaForcedColors?null:i)},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class Ge extends h{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this.items.on("add",(n,r)=>{r.isOn=r.color===this.selectedColor}),i.forEach(n=>{const r=new gt;r.set({color:n.color,label:n.label,tooltip:!0,hasBorder:n.options.hasBorder}),r.on("execute",()=>{this.fire("execute",{value:n.color,hasBorder:n.options.hasBorder,label:n.label})}),this.items.add(r)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(n,r,a)=>{for(const l of this.items)l.isOn=l.color===a})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),_i({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 _t(s,e){if(!s)return"";const t=kt(s);if(!t)return"";if(t.space===e)return s;if(!Hi(t))return"";const o=nt[t.space][e];if(!o)return"";const n=o(t.space==="hex"?t.hexValue:t.values);return Ri(n,e)}function Wi(s){if(!s)return"";const e=kt(s);return e?e.space==="hex"?e.hexValue:_t(s,"hex"):"#000"}function Gi(s,e){customElements.get(s)===void 0&&customElements.define(s,e)}function Ri(s,e){switch(e){case"hex":return`#${s}`;case"rgb":return`rgb(${s[0]}, ${s[1]}, ${s[2]})`;case"hsl":return`hsl(${s[0]}, ${s[1]}%, ${s[2]}%)`;case"hwb":return`hwb(${s[0]}, ${s[1]}, ${s[2]})`;case"lab":return`lab(${s[0]}% ${s[1]} ${s[2]})`;case"lch":return`lch(${s[0]}% ${s[1]} ${s[2]})`;default:return""}}function kt(s){if(s.startsWith("#")){const t=Oe(s);return{space:"hex",values:t.values,hexValue:s,alpha:t.alpha}}const e=Oe(s);return e.space?e:null}function Hi(s){return Object.keys(nt).includes(s.space)}class zi extends h{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${Q()}`,o=`ck-labeled-field-view-status-${Q()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(r,a)=>r||a);const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",r=>!r),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new re(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new h(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",o=>!o)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Ui extends h{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 b,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...i)=>{this.fire("input",...i),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=$i(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}}function $i(s){return!s.value}class Tt extends Ui{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Ki extends Tt{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class ji extends Tt{constructor(e,{min:t,max:i,step:o}={}){super(e);const n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}}class Xi extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",i=>`ck-dropdown__panel_${i}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;typeof e.focus=="function"?e.focus():C("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}}class ee extends h{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new E,this.focusTracker=new b,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",n=>!n)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(t,i,o)=>{if(o)if(this.panelPosition==="auto"){const n=ee._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=n?n.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const e=(t,i)=>{this.isOpen&&(this.isOpen=!1,i())};this.keystrokes.set("arrowdown",(t,i)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,i())}),this.keystrokes.set("arrowright",(t,i)=>{this.isOpen&&i()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:o,northEast:n,northWest:r,southMiddleEast:a,southMiddleWest:l,northMiddleEast:c,northMiddleWest:u}=ee.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[i,o,a,l,e,n,r,c,u,t]:[o,i,l,a,e,r,n,u,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)=>({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=we}class qi extends p{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(){const e=new L;return e.content=ne,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class P extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",i=>!i)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class Ce extends h{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class q extends h{labelView;items;children;constructor(e,t=new re){super(e);const i=this.bindTemplate,o=new Ve(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",n=>!n)]},children:this.children})}focus(){if(this.items){const e=this.items.find(t=>!(t instanceof Ce));e&&e.focus()}}}class Ve extends h{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new B,this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this._focusCycler=new N({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof q?this._registerFocusableItemsGroup(e):e instanceof P&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(const i of t.removed)i instanceof q?this._deregisterFocusableItemsGroup(i):i instanceof P&&this._deregisterFocusableListItem(i);for(const i of Array.from(t.added).reverse())i instanceof q?this._registerFocusableItemsGroup(i,t.index):this._registerFocusableListItem(i,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const o of i.removed)this._deregisterFocusableListItem(o);for(const o of Array.from(i.added).reverse())this._registerFocusableListItem(o,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((o,n)=>{const r=typeof t<"u"?t+n:void 0;this._registerFocusableListItem(o,r)});const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class vt extends h{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Yi extends h{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Qi(s){return s.bindTemplate.to(e=>{e.target===s.element&&e.preventDefault()})}function Zi(s){if(Array.isArray(s))return{items:s,removeItems:[]};const e={items:[],removeItems:[]};return s?{...e,...s}:e}const Ji={alignLeft:jt,bold:Kt,importExport:$t,paragraph:Ut,plus:zt,text:Ht,threeVerticalDots:ge,pilcrow:Rt,dragIndicator:Gt};class es extends h{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new ts(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n=e.uiLanguageDirection==="rtl";this._focusCycler=new N({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:Qi(this)}}),this._behavior=this.options.shouldGroupWhenFull?new He(this):new Re(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new He(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new Re(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){const o=Zi(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map(a=>Z(a)?this._createNestedToolbarDropdown(a,t,n):a==="|"?new vt:a==="-"?new Yi:t.create(a)).filter(a=>!!a)}_cleanItemsConfiguration(e,t,i){const o=e.filter((n,r,a)=>n==="|"?!0:i.indexOf(n)!==-1?!1:n==="-"?this.options.shouldGroupWhenFull?(C("toolbarview-line-break-ignored-when-grouping-items",a),!1):!0:!Z(n)&&!t.has(n)?(C("toolbarview-item-unavailable",{item:n}),!1):!0);return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){const t=r=>r!=="-"&&r!=="|",i=e.length,o=e.findIndex(t);if(o===-1)return[];const n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter((r,a,l)=>t(r)?!0:!(a>0&&l[a-1]===r))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:r,tooltip:a=!0,withText:l=!1}=e;if(r=this._cleanItemsConfiguration(r,t,i),!r.length)return null;const c=this.locale,u=xe(c);return o||C("toolbarview-nested-toolbar-dropdown-missing-label",e),u.class="ck-toolbar__nested-toolbar-dropdown",u.buttonView.set({label:o,tooltip:a,withText:!!l}),n!==!1?u.buttonView.icon=Ji[n]||n||ge:u.buttonView.withText=!0,yt(u,()=>u.toolbarView._buildItemsFromConfig(r,t,i)),u}}class ts extends h{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Re{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(t=>t),e.focusables.bindTo(e.items).using(t=>z(t)?t:null)}render(){}destroy(){}}class He{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(t,i)=>{const o=i.index,n=Array.from(i.added);for(const r of i.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(r):this.ungroupedItems.remove(r);for(let r=o;r<o+n.length;r++){const a=n[r-o];r>this.ungroupedItems.length?this.groupedItems.add(a,r-this.ungroupedItems.length):this.ungroupedItems.add(a,r)}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(){const e=this.view;if(e.items.length){for(let t=0;t<e.items.length;t++){const i=[...e.items][t];this.ungroupedItems.add(i,t)}this._updateGrouping()}}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!O(this.viewElement)){this.shouldUpdateGroupingOnNextResize=!0;return}const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new T(e.lastChild),o=new T(e);if(!this.cachedPadding){const n=d.window.getComputedStyle(e),r=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[r])}return t==="ltr"?i.right>o.right-this.cachedPadding:i.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new tt(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 vt),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,i=xe(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",yt(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:ge}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{z(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class is extends h{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new E,this.focusTracker=new b,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",o=>!o),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new p;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new p,t=e.bindTemplate;return e.icon=ne,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function xe(s,e=qi){const t=typeof e=="function"?new e(s):e,i=new Xi(s),o=new ee(s,t,i);return t.bind("isEnabled").to(o),t instanceof is?t.arrowView.bind("isOn").to(o,"isOpen"):t.bind("isOn").to(o,"isOpen"),ss(o),o}function yt(s,e,t={}){s.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),s.isOpen?ze(s,e,t):s.once("change:isOpen",()=>ze(s,e,t),{priority:"highest"}),t.enableActiveItemFocusOnDropdownOpen&&Ct(s,()=>s.toolbarView.items.find(i=>i.isOn))}function ze(s,e,t){const i=s.locale,o=i.t,n=s.toolbarView=new es(i),r=typeof e=="function"?e():e;n.ariaLabel=t.ariaLabel||o("Dropdown toolbar"),t.maxWidth&&(n.maxWidth=t.maxWidth),t.class&&(n.class=t.class),t.isCompact&&(n.isCompact=t.isCompact),t.isVertical&&(n.isVertical=!0),r instanceof B?n.items.bindTo(r).using(a=>a):n.items.addMany(r),s.panelView.children.add(n),s.focusTracker.add(n),n.items.delegate("execute").to(s)}function ho(s,e,t={}){s.isOpen?Ue(s,e,t):s.once("change:isOpen",()=>Ue(s,e,t),{priority:"highest"}),Ct(s,()=>s.listView.items.find(i=>i instanceof P?i.children.first.isOn:!1))}function Ue(s,e,t){const i=s.locale,o=s.listView=new Ve(i),n=typeof e=="function"?e():e;o.ariaLabel=t.ariaLabel,o.role=t.role,xt(s,o.items,n,i),s.panelView.children.add(o),o.items.delegate("execute").to(s)}function Ct(s,e){s.on("change:isOpen",()=>{if(!s.isOpen)return;const t=e();t&&(typeof t.focus=="function"?t.focus():C("ui-dropdown-focus-child-on-open-child-missing-focus",{view:t}))},{priority:Dt.low-10})}function ss(s){os(s),ns(s),rs(s),ls(s),as(s),cs(s)}function os(s){ut({emitter:s,activator:()=>s.isRendered&&s.isOpen,callback:()=>{s.isOpen=!1},contextElements:()=>[s.element,...Vt(s.focusTracker).filter(e=>!s.element.contains(e))]})}function Vt(s){return[...s.elements,...s.externalViews.flatMap(e=>Vt(e.focusTracker))]}function ns(s){s.on("execute",e=>{e.source instanceof wt||(s.isOpen=!1)})}function rs(s){s.focusTracker.on("change:isFocused",(e,t,i)=>{i||!s.isOpen||(s.isOpen=!1)})}function ls(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isOpen&&(s.panelView.focus(),t())}),s.keystrokes.set("arrowup",(e,t)=>{s.isOpen&&(s.panelView.focusLast(),t())})}function as(s){s.on("change:isOpen",(e,t,i)=>{if(i)return;s.focusTracker.elements.some(n=>n.contains(d.document.activeElement))&&s.buttonView.focus()})}function cs(s){s.on("change:isOpen",(e,t,i)=>{i&&s.panelView.focus()},{priority:"low"})}function xt(s,e,t,i){hs(e),e.bindTo(t).using(o=>{if(o.type==="separator")return new Ce(i);if(o.type==="group"){const n=new q(i);return n.set({label:o.label}),xt(s,n.items,o.items,i),n.items.delegate("execute").to(s),n}else if(o.type==="button"||o.type==="switchbutton"){const n=o.model.role==="menuitemcheckbox"||o.model.role==="menuitemradio",r=new P(i);let a;return o.type==="button"?(a=new W(i,o.labelView),a.set({isToggleable:n})):a=new wt(i),a.bind(...Object.keys(o.model)).to(o.model),a.delegate("execute").to(r),r.children.add(a),r}return null})}function hs(s){let e=0;const t=n=>!(n instanceof P)||!(n.children.first instanceof W)?null:n.children.first,i=n=>{const r=t(n);return!r||!r.isToggleable?null:r},o=n=>{for(const r of s){const a=t(r);a&&(a.hasCheckSpace=n)}};s.on("change",(n,r)=>{const a=e>0;for(const c of r.removed)i(c)&&e--;for(const c of r.added){const u=t(c);u&&(u.isToggleable&&e++,u.hasCheckSpace=e>0)}const l=e>0;a!==l&&o(l)})}const us=(s,e,t)=>{const i=new Ki(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},uo=(s,e,t)=>{const i=new ji(s.locale);return i.set({id:e,ariaDescribedById:t,inputMode:"numeric"}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},fo=(s,e,t)=>{const i=xe(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isEnabled").to(s),i},ds=150;class fs extends h{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=fe(o=>{this.set("color",o),this.fire("colorSelected",{color:this.color})},ds,{leading:!0}),this.on("set:color",(o,n,r)=>{o.return=_t(r,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=ae(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),ae(this.color)!=ae(this._hexColor)&&(this.color=this._hexColor)})}render(){if(super.render(),Gi("hex-color-picker",ei),this.picker=d.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){!this._config.hideInput&&(A.isGecko||A.isiOS||A.isSafari||A.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){const i=[...this.picker.shadowRoot.children].filter(o=>o.getAttribute("role")==="slider").map(o=>new ps(o));this.slidersView=this.createCollection(),i.forEach(o=>{this.slidersView.add(o)})}_createInputRow(){const e=this._createColorInput();return new ws(this.locale,e)}_createColorInput(){const e=new zi(this.locale,us),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",i=>e.isFocused?e.fieldView.value:i.startsWith("#")?i.substring(1):i),e.fieldView.on("input",()=>{const i=e.fieldView.element.value;if(i){const o=Et(i);o&&this._debounceColorPickerEvent(o)}}),e}isValid(){const{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 ae(s){let e=Wi(s);return e||(e="#000"),e.length===4&&(e="#"+[e[1],e[1],e[2],e[2],e[3],e[3]].join("")),e.toLowerCase()}class ps extends h{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class ms extends h{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class ws extends h{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new ms,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return Et(this.inputView.fieldView.element.value)}}function Et(s){if(!s)return null;const e=s.trim().replace(/^#/,"");return![3,4,6,8].includes(e.length)||!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(e)?null:`#${e}`}class bs extends se(me){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){return this.find(i=>i.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}class gs extends h{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,focusTracker:l,focusables:c}){super(e);const u=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=l,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new bs,this.documentColorsCount=r,this._focusables=c,this._removeButtonLabel=o,this._colorPickerLabel=a,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",u.if("isVisible","ck-hidden",f=>!f)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRoots()){const r=e.createRangeIn(n);for(const a of r.getItems())if(a.is("$textProxy")&&a.hasAttribute(t)&&(this._addColorToDocumentColors(a.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=V.bind(this.documentColors,this.documentColors),t=new h(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 p,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:Yt,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){const e=new p;return e.set({withText:!0,icon:Qt,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){const e=new Ge(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(t,i)=>{this.fire("execute",{value:i.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){const e=V.bind(this.documentColors,this.documentColors),t=new Ge(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(i=>{const o=new gt;return o.set({color:i.color,hasBorder:i.options?.hasBorder}),i.label&&o.set({label:i.label,tooltip:!0}),o.on("execute",()=>{this.fire("execute",{value:i.color,source:"documentColorsGrid"})}),o}),this.documentColors.on("change:isEmpty",(i,o,n)=>{n&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(i=>i.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class _s extends h{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;const r=this.bindTemplate,{saveButtonView:a,cancelButtonView:l}=this._createActionButtons();this.saveButtonView=a,this.cancelButtonView=l,this.actionBarView=this._createActionBarView({saveButtonView:a,cancelButtonView:l}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",r.if("isVisible","ck-hidden",c=>!c)]},children:this.items})}render(){super.render();const e=new fs(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,i,o)=>{e.color=o}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){const e=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(const t of this.colorPickerView.slidersView)this.focusTracker.add(t.element),this._focusables.add(t);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new h,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new p(e),o=new p(e);return i.set({icon:ot,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:st,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),o.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}}class po extends h{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,colorPickerViewConfig:l}){super(e),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this._focusables=new B,this._colorPickerViewConfig=l,this._focusCycler=new N({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new gs(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new _s(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:l}),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,u,f)=>{this.colorGridsFragmentView.set("selectedColor",f),this.colorPickerFragmentView.set("selectedColor",f)}),this.colorGridsFragmentView.on("change:selectedColor",(c,u,f)=>{this.set("selectedColor",f)}),this.colorPickerFragmentView.on("change:selectedColor",(c,u,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))}}class ks{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(ce(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new v("componentfactory-item-missing",this,{name:e});return this._components.get(ce(e)).callback(this.editor.locale)}has(e){return this._components.has(ce(e))}}function ce(s){return String(s).toLowerCase()}const $e="ck-tooltip";class m extends ie(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=k.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(),m._editors.add(e),m._instance)return m._instance;m._instance=this,this.tooltipTextView=new h(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 k(e.locale),this.balloonPanelView.class=$e,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=Ts(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=fe(this._pinTooltip,600),this._unpinTooltipDebounced=fe(this._unpinTooltip,400),this.listenTo(d.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(d.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(d.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(d.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(d.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(d.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;m._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),m._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),m._instance=null)}static getPositioningFunctions(e){const t=m.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){t.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=he(t);if(!i){e.name==="focus"&&this._unpinTooltip();return}if(i===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),e.name==="focus"&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,ue(i)):this._pinTooltipDebounced(i,ue(i))}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if(e.name==="mouseleave"){if(!ke(t))return;const o=this.balloonPanelView.element,n=o&&(o===i||o.contains(i)),r=!n&&t===o;if(n){this._unpinTooltipDebounced.cancel();return}if(!r&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const a=he(t),l=he(i);(r||a&&a!==l)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||a&&a.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();const n=Mt(m._editors.values()).ui.view.body;n.has(this.balloonPanelView)||n.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[$e,o].filter(r=>r).join(" "),this.balloonPanelView.pin({target:e,positions:m.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const r of m._editors)this.listenTo(r.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of m._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=ue(this._currentElementWithTooltip);if(!O(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:m.getPositioningFunctions(e.position)})}}function he(s){return ke(s)?s.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function ue(s){return{text:s.dataset.ckeTooltipText,position:s.dataset.ckeTooltipPosition||"s",cssClass:s.dataset.ckeTooltipClass||""}}function Ts(s){const e=new MutationObserver(()=>{s()});return{attach(t){e.observe(t,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}class vs extends pt{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(){const t=this.editor.config.get("licenseKey"),i=Ke(t);return!!(i&&this.licenseTypeMessage[i])}_createBadgeContent(){const e=this.editor.config.get("licenseKey"),t=Ke(e);return new ys(this.editor.locale,this.licenseTypeMessage[t])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=t.side||e.side;return{position:i,side:o==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class ys extends h{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 Ke(s){if(s=="GPL")return"GPL";const e=it(s.split(".")[1]);return e?e.licenseType||"production":null}class It extends P{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const U=5,D={toggleMenusAndFocusItemsOnHover(s){s.on("menu:mouseenter",e=>{if(!(!s.isFocusBorderEnabled&&!s.isOpen)){if(s.isOpen)for(const t of s.menus){const i=e.path[0],o=i instanceof It&&i.children.first===t;t.isOpen=(e.path.includes(t)||o)&&t.isEnabled}e.source.focus()}})},focusCycleMenusOnArrows(s){const e=s.locale.uiLanguageDirection==="rtl";s.on("menu:arrowright",i=>{t(i.source,e?-1:1)}),s.on("menu:arrowleft",i=>{t(i.source,e?1:-1)});function t(i,o){const n=s.children.getIndex(i),r=i.isOpen,a=s.children.length,l=s.children.get((n+a+o)%a);i.isOpen=!1,r&&(l.isOpen=!0),l.buttonView.focus()}},closeMenusWhenTheBarCloses(s){s.on("change:isOpen",()=>{s.isOpen||s.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(s){s.on("menu:change:isOpen",(e,t,i)=>{i&&s.menus.filter(o=>e.source.parentMenuView===o.parentMenuView&&e.source!==o&&o.isOpen).forEach(o=>{o.isOpen=!1})})},closeOnClickOutside(s){ut({emitter:s,activator:()=>s.isOpen,callback:()=>s.close(),contextElements:()=>s.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(s){let e=!1;s.on("change:isOpen",(t,i,o)=>{o||(e||(s.isFocusBorderEnabled=!1),e=!1)}),s.listenTo(s.element,"keydown",()=>{e=!0},{useCapture:!0}),s.listenTo(s.element,"keyup",()=>{e=!1},{useCapture:!0}),s.listenTo(s.element,"focus",()=>{e&&(s.isFocusBorderEnabled=!0)},{useCapture:!0})}},I={openAndFocusPanelOnArrowDownKey(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isEnabled&&s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen||(s.isOpen=!0),s.panelView.focus(),t())})},openOnArrowRightKey(s){const e=s.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";s.keystrokes.set(e,(t,i)=>{s.focusTracker.focusedElement!==s.buttonView.element||!s.isEnabled||(s.isOpen||(s.isOpen=!0),s.panelView.focus(),i())})},openOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!0})},toggleOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!s.isOpen})},openAndFocusOnEnterKeyPress(s){s.keystrokes.set("enter",(e,t)=>{s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen=!0,s.panelView.focus(),t())})},closeOnArrowLeftKey(s){const e=s.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";s.keystrokes.set(e,(t,i)=>{s.isOpen&&(s.isOpen=!1,s.focus(),i())})},closeOnEscKey(s){s.keystrokes.set("esc",(e,t)=>{s.isOpen&&(s.isOpen=!1,s.focus(),t())})},closeOnParentClose(s){s.parentMenuView.on("change:isOpen",(e,t,i)=>{!i&&e.source===s.parentMenuView&&(s.isOpen=!1)})}},Cs={southEast:s=>({top:s.bottom,left:s.left,name:"se"}),southWest:(s,e)=>({top:s.bottom,left:s.left-e.width+s.width,name:"sw"}),northEast:(s,e)=>({top:s.top-e.height,left:s.left,name:"ne"}),northWest:(s,e)=>({top:s.top-e.height,left:s.left-e.width+s.width,name:"nw"}),eastSouth:s=>({top:s.top,left:s.right-U,name:"es"}),eastNorth:(s,e)=>({top:s.top-e.height,left:s.right-U,name:"en"}),westSouth:(s,e)=>({top:s.top,left:s.left-e.width+U,name:"ws"}),westNorth:(s,e)=>({top:s.top-e.height,left:s.left-e.width+U,name:"wn"})},Vs=[{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:insertFootnote","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"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{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","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function xs(s){let e;return!("items"in s)||!s.items?e={items:_e(Vs),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...s}:e={items:s.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...s},e}function Es({normalizedConfig:s,locale:e,componentFactory:t,extraItems:i}){const o=_e(s);return je(s,o,i),Is(s,o),je(s,o,o.addItems),Os(s,o,t),Ot(s,o),Ps(o,e),o}function Is(s,e){const t=e.removeItems,i=[];e.items=e.items.filter(({menuId:o})=>t.includes(o)?(i.push(o),!1):!0),G(e.items,o=>{o.groups=o.groups.filter(({groupId:n})=>t.includes(n)?(i.push(n),!1):!0);for(const n of o.groups)n.items=n.items.filter(r=>{const a=Pt(r);return t.includes(a)?(i.push(a),!1):!0})});for(const o of t)i.includes(o)||C("menu-bar-item-could-not-be-removed",{menuBarConfig:s,itemName:o})}function je(s,e,t){const i=[];if(t.length!=0){for(const o of t){const n=Fs(o.position),r=As(o.position);if(Bs(o))if(!r)n==="start"?(e.items.unshift(o.menu),i.push(o)):n==="end"&&(e.items.push(o.menu),i.push(o));else{const a=e.items.findIndex(l=>l.menuId===r);a!=-1?n==="before"?(e.items.splice(a,0,o.menu),i.push(o)):n==="after"&&(e.items.splice(a+1,0,o.menu),i.push(o)):Xe(e,o.menu,r,n)&&i.push(o)}else Ls(o)?G(e.items,a=>{if(a.menuId===r)n==="start"?(a.groups.unshift(o.group),i.push(o)):n==="end"&&(a.groups.push(o.group),i.push(o));else{const l=a.groups.findIndex(c=>c.groupId===r);l!==-1&&(n==="before"?(a.groups.splice(l,0,o.group),i.push(o)):n==="after"&&(a.groups.splice(l+1,0,o.group),i.push(o)))}}):Xe(e,o.item,r,n)&&i.push(o)}for(const o of t)i.includes(o)||C("menu-bar-item-could-not-be-added",{menuBarConfig:s,addedItemConfig:o})}}function Xe(s,e,t,i){let o=!1;return G(s.items,n=>{for(const{groupId:r,items:a}of n.groups){if(o)return;if(r===t)i==="start"?(a.unshift(e),o=!0):i==="end"&&(a.push(e),o=!0);else{const l=a.findIndex(c=>Pt(c)===t);l!==-1&&(i==="before"?(a.splice(l,0,e),o=!0):i==="after"&&(a.splice(l+1,0,e),o=!0))}}}),o}function Os(s,e,t){G(e.items,i=>{for(const o of i.groups)o.items=o.items.filter(n=>{const r=typeof n=="string"&&!t.has(n);return r&&!e.isUsingDefaultConfig&&C("menu-bar-item-unavailable",{menuBarConfig:s,parentMenuConfig:_e(i),componentName:n}),!r})})}function Ot(s,e){const t=e.isUsingDefaultConfig;let i=!1;if(e.items=e.items.filter(o=>o.groups.length?!0:(de(s,o,t),!1)),!e.items.length){de(s,s,t);return}G(e.items,o=>{o.groups=o.groups.filter(n=>n.items.length?!0:(i=!0,!1));for(const n of o.groups)n.items=n.items.filter(r=>Bt(r)&&!r.groups.length?(de(s,r,t),i=!0,!1):!0)}),i&&Ot(s,e)}function de(s,e,t){t||C("menu-bar-menu-empty",{menuBarConfig:s,emptyMenuConfig:e})}function Ps(s,e){const t=e.t,i={File:t({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:t({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:t({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:t({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:t({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:t({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:t({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:t({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:t({string:"Font",id:"MENU_BAR_MENU_FONT"})};G(s.items,o=>{o.label in i&&(o.label=i[o.label])})}function G(s,e){if(Array.isArray(s))for(const i of s)t(i);function t(i){e(i);for(const o of i.groups)for(const n of o.items)Bt(n)&&t(n)}}function Bs(s){return typeof s=="object"&&"menu"in s}function Ls(s){return typeof s=="object"&&"group"in s}function Fs(s){return s.startsWith("start")?"start":s.startsWith("end")?"end":s.startsWith("after")?"after":"before"}function As(s){const e=s.match(/^[^:]+:(.+)/);return e?e[1]:null}function Pt(s){return typeof s=="string"?s:s.menuId}function Bt(s){return typeof s=="object"&&"menuId"in s}class mo extends se(){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new ks(e),this.focusTracker=new b,this.tooltipManager=new m(e),this.poweredBy=new Ai(e),this.evaluationBadge=new vs(e),this.ariaLiveAnnouncer=new mi(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(const 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);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),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){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=xs(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),n())}),this.editor.keystrokes.set("Alt+F9",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),n())})}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",(i,o)=>{this._saveLastFocusedForeignElement();const n=this._getCurrentFocusedToolbarDefinition();(!n||!t)&&(t=this._getFocusableCandidateToolbarDefinitions());for(let r=0;r<t.length;r++){const a=t.shift();if(t.push(a),a!==n&&this._focusFocusableCandidateToolbar(a)){n&&n.options.afterBlur&&n.options.afterBlur();break}}o()}),e.keystrokes.set("Esc",(i,o)=>{const n=this._getCurrentFocusedToolbarDefinition();n&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),o())})}_saveLastFocusedForeignElement(){const 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(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:o}=t;(O(i.element)||o.beforeFocus)&&e.push(t)}return e.sort((t,i)=>qe(t)-qe(i)),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),O(t.element)?(t.focus(),!0):!1}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",(t,i)=>{this.focusTracker.add(i.element)}),e.on("remove",(t,i)=>{this.focusTracker.remove(i.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(t,i,o)=>{const n=this._getVisualViewportTopOffset(o);o.visualTop!==n&&(t.return={...o,visualTop:n})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!d.window.visualViewport)return;const e=()=>{const t=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==t&&(this.viewportOffset={...this.viewportOffset,visualTop:t})};this._domEmitter=new(ie()),this._domEmitter.listenTo(d.window.visualViewport,"scroll",e),this._domEmitter.listenTo(d.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){const t=K().top,i=e.top||0;return t>i?0:i-t}}function qe(s){const{toolbarView:e,options:t}=s;let i=10;return O(e.element)&&i--,t.isContextual&&(i-=2),i}class Ds extends h{body;menuBarView;toolbar;constructor(e){super(e),this.body=new _(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class wo extends Ds{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(){const e=this.t,t=new re;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class Ss extends h{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;e.isRenderingInProgress?i(this):t(this);function t(o){e.change(n=>{const r=e.document.getRoot(o.name);n.addClass(o.isFocused?"ck-focused":"ck-blurred",r),n.removeClass(o.isFocused?"ck-blurred":"ck-focused",r)})}function i(o){e.once("change:isRenderingInProgress",(n,r,a)=>{a?i(o):t(o)})}}}class bo extends Ss{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change(t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if(typeof t=="string")return t;if(typeof t=="object")return t[o];if(typeof t=="function")return t(this);if(i){const n=i.getAttribute("aria-label");if(n)return n}return e("Rich Text Editor. Editing area: %0",o)}}class go extends h{children;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...oe(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach(o=>this.children.add(o)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",o=>o.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}class _o extends Wt{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){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class ko extends se(){constructor(e,t){super(),t&&ti(this,t),e&&this.set(e)}}const $=te("px");class To extends be{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=()=>{const 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 v("contextualballoon-add-view-exist",[this,e]);const 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}const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new v("contextualballoon-remove-view-not-exist",[this,e]);const 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;const t=this._idToStack.get(e);if(!t)throw new v("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new k(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(i=>i[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Ms(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(i,o)=>!o&&i>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(i,o)=>{if(o<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,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(){const e=new Ns(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,i)=>!i&&t>=2?Math.min(t-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}}class Ms extends h{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new b,this.buttonPrevView=this._createButtonView(t("Previous"),Xt),this.buttonNextView=this._createButtonView(t("Next"),qt),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",o=>o?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new p(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class Ns extends h{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",o=>o?"":"ck-hidden")],style:{top:i.to("top",$),left:i.to("left",$),width:i.to("width",$),height:i.to("height",$)}},children:this.content}),this.on("change:numberOfPanels",(o,n,r,a)=>{r>a?this._addPanels(r-a):this._removePanels(a-r),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new h;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new T(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}const S=te("px");class vo extends h{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new V({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",i=>i?"block":"none"),height:t.to("isSticky",i=>i?S(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new V({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",i=>i?S(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",i=>i&&S(i)),bottom:t.to("_stickyBottomOffset",i=>i&&S(i)),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(d.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),d.window.visualViewport&&(this.listenTo(d.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(d.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}const e=new T(this.limiterElement);let t=e.getVisible();if(t){const n=new T(d.window);n.top+=this.viewportTopOffset,n.height-=this.viewportTopOffset,t=t.getIntersection(n)}const{left:i,top:o}=K();if(e.moveBy(i,o),t&&t.moveBy(i,o),t&&e.top<t.top)if(this._contentPanelRect.height+this.limiterBottomOffset>t.height){const n=Math.max(e.bottom-t.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+n+1<e.height?this._stickToBottomOfLimiter(n):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=S(-d.window.scrollX+K().left)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=S(-d.window.scrollX+K().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new T(this.contentPanelElement)}}class Ws extends W{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",i=>String(i)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new L;return e.content=ne,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class Gs extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",i=>`ck-menu-bar__menu__panel_position_${i}`),t.if("isVisible","ck-hidden",i=>!i)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}}class R extends h{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new Ws(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Gs(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new E,this.focusTracker=new b,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",i=>!i),t.if("parentMenuView","ck-menu-bar__menu_top-level",i=>!i)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),I.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(I.openOnButtonClick(this),I.openOnArrowRightKey(this),I.closeOnArrowLeftKey(this),I.openAndFocusOnEnterKeyPress(this),I.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),I.openAndFocusPanelOnArrowDownKey(this),I.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,t)=>{this.fire("arrowright"),t()}),this.keystrokes.set("arrowleft",(e,t)=>{this.fire("arrowleft"),t()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,t,i)=>{if(!i)return;const o=R._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(){const{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:n,eastSouth:r,westNorth:a,eastNorth:l}=Cs;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[r,l,n,a]:[e,t,i,o]:this.parentMenuView?[n,a,r,l]:[t,e,o,i]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=we}class Ye extends Ve{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some(t=>{const i=Qe(t);return i&&i.isToggleable});this.items.forEach(t=>{const i=Qe(t);i&&(i.hasCheckSpace=e)})}}function Qe(s){return s instanceof P?s.children.map(e=>Rs(e)?e.buttonView:e).find(e=>e instanceof W):null}function Rs(s){return typeof s=="object"&&"buttonView"in s&&s.buttonView instanceof p}class Hs extends Si{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const Ze=["mouseenter","arrowleft","arrowright","change:isOpen"];class yo extends h{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const o=this.locale,r=Es({normalizedConfig:e,locale:o,componentFactory:t,extraItems:i}).items.map(a=>this._createMenu({componentFactory:t,menuDefinition:a}));this.children.addMany(r)}render(){super.render(),D.toggleMenusAndFocusItemsOnHover(this),D.closeMenusWhenTheBarCloses(this),D.closeMenuWhenAnotherOnTheSameLevelOpens(this),D.focusCycleMenusOnArrows(this),D.closeOnClickOutside(this),D.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...Ze).to(t),e.parentMenuView=t):e.delegate(...Ze).to(this,i=>"menu:"+i),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const o=this.locale,n=new R(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",()=>{const r=new Ye(o);r.ariaLabel=t.label,n.panelView.children.add(r),r.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))}),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const o=this.locale,n=[];for(const r of e.groups){for(const a of r.items){const l=new It(o,t);if(Z(a))l.children.add(this._createMenu({componentFactory:i,menuDefinition:a,parentMenuView:t}));else{const c=this._createMenuItemContentFromFactory({componentName:a,componentFactory:i,parentMenuView:t});if(!c)continue;l.children.add(c)}n.push(l)}r!==e.groups[e.groups.length-1]&&n.push(new Ce(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const o=i.create(e);return o instanceof R||o instanceof ft||o instanceof Hs?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):(C("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof R)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);const i=e.panelView.children.filter(n=>n instanceof Ye)[0];if(!i){e.delegate("mouseenter").to(t);return}const o=i.items.filter(n=>n instanceof P);for(const n of o)this._registerMenuTree(n.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(n=>n.isOpen)},0)})}}export{no as AccessibilityHelp,ki as AccessibilityHelpContentView,mi as AriaLiveAnnouncer,Se as AriaLiveAnnouncerPoliteness,bi as AriaLiveAnnouncerRegionView,wi as AriaLiveAnnouncerView,pt as Badge,k as BalloonPanelView,_ as BodyCollection,wo as BoxedEditorUIView,dt as ButtonLabelView,p as ButtonView,lo as CollapsibleView,Ge as ColorGridView,gs as ColorGridsFragmentView,_s as ColorPickerFragmentView,ws as ColorPickerInputRowView,fs as ColorPickerView,po as ColorSelectorView,gt as ColorTileView,ks as ComponentFactory,To as ContextualBalloon,so as CssTransitionDisablerMixin,Vs as DefaultMenuBarItems,y as Dialog,Vi as DialogActionsView,xi as DialogContentView,ye as DialogView,g as DialogViewPosition,bs as DocumentColorCollection,gi as DraggableViewMixin,qi as DropdownButtonView,Xi as DropdownPanelView,ee as DropdownView,Ss as EditableUIView,mo as EditorUI,Ds as EditorUIView,vs as EvaluationBadge,ro as FileDialogButtonView,Si as FileDialogListItemButtonView,bt as FileDialogViewMixin,N as FocusCycler,yi as FormHeaderView,go as FormRowView,L as IconView,bo as InlineEditableUIView,Ui as InputBase,ji as InputNumberView,Ki as InputTextView,Tt as InputView,ts as ItemsView,re as LabelView,zi as LabeledFieldView,W as ListItemButtonView,q as ListItemGroupView,P as ListItemView,Ce as ListSeparatorView,Ve as ListView,Ws as MenuBarMenuButtonView,ft as MenuBarMenuListItemButtonView,Hs as MenuBarMenuListItemFileDialogButtonView,It as MenuBarMenuListItemView,Ye as MenuBarMenuListView,Gs as MenuBarMenuPanelView,R as MenuBarMenuView,yo as MenuBarView,Ji as NESTED_TOOLBAR_ICONS,_o as Notification,Ai as PoweredBy,ps as SliderView,is as SplitButtonView,vo as StickyPanelView,wt as SwitchButtonView,V as Template,Yi as ToolbarLineBreakView,vt as ToolbarSeparatorView,es as ToolbarView,m as TooltipManager,ko as UIModel,h as View,B as ViewCollection,ko as ViewModel,Ei as _CheckIconHolderView,lo as _CollapsibleView,Ms as _ContextualBalloonRotatorView,D as _MenuBarBehaviors,I as _MenuBarMenuBehaviors,Cs as _MenuBarMenuViewPanelPositioningFunctions,H as _TemplateBinding,rt as _TemplateIfBinding,ri as _TemplateToBinding,_t as _convertColor,Wi as _convertColorToHex,Qi as _preventUiViewDefault,Es as _processMenuBarConfig,Gi as _registerCustomElement,Et as _tryNormalizeHexColor,_i as addKeyboardHandlingForGrid,ho as addListToDropdown,yt as addToolbarToDropdown,ut as clickOutsideHandler,xe as createDropdown,fo as createLabeledDropdown,uo as createLabeledInputNumber,us as createLabeledInputText,Ct as focusChildOnDropdownOpen,ao as getLocalizedColorOptions,z as isFocusable,Ci as isViewWithFocusCycler,co as normalizeColorOptions,xs as normalizeMenuBarConfig,Ni as normalizeSingleColorDefinition,Zi as normalizeToolbarConfig,oo as submitHandler};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
function E(n){return n&&n.__esModule?n.default:n}class v{on(e,i){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(i),this}emit(e,...i){this._callbacks=this._callbacks||{};let t=this._callbacks[e];if(t)for(let s of t)s.apply(this,i);return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+e,{args:i})),this}makeEvent(e,i){let t={bubbles:!0,cancelable:!0,detail:i};if(typeof window.CustomEvent=="function")return new CustomEvent(e,t);var s=document.createEvent("CustomEvent");return s.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s}off(e,i){if(!this._callbacks||arguments.length===0)return this._callbacks={},this;let t=this._callbacks[e];if(!t)return this;if(arguments.length===1)return delete this._callbacks[e],this;for(let s=0;s<t.length;s++)if(t[s]===i){t.splice(s,1);break}return this}}var F={};F=`<html><head></head><body><div class="dz-preview dz-file-preview">
|
|
2
|
-
<div class="dz-image"><img data-dz-thumbnail=""></div>
|
|
3
|
-
<div class="dz-details">
|
|
4
|
-
<div class="dz-size"><span data-dz-size=""></span></div>
|
|
5
|
-
<div class="dz-filename"><span data-dz-name=""></span></div>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="dz-progress">
|
|
8
|
-
<span class="dz-upload" data-dz-uploadprogress=""></span>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="dz-error-message"><span data-dz-errormessage=""></span></div>
|
|
11
|
-
<div class="dz-success-mark">
|
|
12
|
-
<svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<path d="M10.2071 29.7929L14.2929 25.7071C14.6834 25.3166 15.3166 25.3166 15.7071 25.7071L21.2929 31.2929C21.6834 31.6834 22.3166 31.6834 22.7071 31.2929L38.2929 15.7071C38.6834 15.3166 39.3166 15.3166 39.7071 15.7071L43.7929 19.7929C44.1834 20.1834 44.1834 20.8166 43.7929 21.2071L22.7071 42.2929C22.3166 42.6834 21.6834 42.6834 21.2929 42.2929L10.2071 31.2071C9.81658 30.8166 9.81658 30.1834 10.2071 29.7929Z"></path>
|
|
14
|
-
</svg>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="dz-error-mark">
|
|
17
|
-
<svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
-
<path d="M26.2929 20.2929L19.2071 13.2071C18.8166 12.8166 18.1834 12.8166 17.7929 13.2071L13.2071 17.7929C12.8166 18.1834 12.8166 18.8166 13.2071 19.2071L20.2929 26.2929C20.6834 26.6834 20.6834 27.3166 20.2929 27.7071L13.2071 34.7929C12.8166 35.1834 12.8166 35.8166 13.2071 36.2071L17.7929 40.7929C18.1834 41.1834 18.8166 41.1834 19.2071 40.7929L26.2929 33.7071C26.6834 33.3166 27.3166 33.3166 27.7071 33.7071L34.7929 40.7929C35.1834 41.1834 35.8166 41.1834 36.2071 40.7929L40.7929 36.2071C41.1834 35.8166 41.1834 35.1834 40.7929 34.7929L33.7071 27.7071C33.3166 27.3166 33.3166 26.6834 33.7071 26.2929L40.7929 19.2071C41.1834 18.8166 41.1834 18.1834 40.7929 17.7929L36.2071 13.2071C35.8166 12.8166 35.1834 12.8166 34.7929 13.2071L27.7071 20.2929C27.3166 20.6834 26.6834 20.6834 26.2929 20.2929Z"></path>
|
|
19
|
-
</svg>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</body></html>`;let C={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2097152,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,defaultHeaders:!0,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You cannot upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init(){},params(n,e,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept(n,e){return e()},chunksUploaded:function(n,e){e()},binaryBody:!1,fallback(){let n;this.element.className=`${this.element.className} dz-browser-not-supported`;for(let i of this.element.getElementsByTagName("div"))if(/(^| )dz-message($| )/.test(i.className)){n=i,i.className="dz-message";break}n||(n=r.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(n));let e=n.getElementsByTagName("span")[0];return e&&(e.textContent!=null?e.textContent=this.options.dictFallbackMessage:e.innerText!=null&&(e.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(n,e,i,t){let s={srcX:0,srcY:0,srcWidth:n.width,srcHeight:n.height},l=n.width/n.height;e==null&&i==null?(e=s.srcWidth,i=s.srcHeight):e==null?e=i*l:i==null&&(i=e/l),e=Math.min(e,s.srcWidth),i=Math.min(i,s.srcHeight);let a=e/i;if(s.srcWidth>e||s.srcHeight>i)if(t==="crop")l>a?(s.srcHeight=n.height,s.srcWidth=s.srcHeight*a):(s.srcWidth=n.width,s.srcHeight=s.srcWidth/a);else if(t==="contain")l>a?i=e/l:e=i*l;else throw new Error(`Unknown resizeMethod '${t}'`);return s.srcX=(n.width-s.srcWidth)/2,s.srcY=(n.height-s.srcHeight)/2,s.trgWidth=e,s.trgHeight=i,s},transformFile(n,e){return(this.options.resizeWidth||this.options.resizeHeight)&&n.type.match(/image.*/)?this.resizeImage(n,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,e):e(n)},previewTemplate:E(F),drop(n){return this.element.classList.remove("dz-drag-hover")},dragstart(n){},dragend(n){return this.element.classList.remove("dz-drag-hover")},dragenter(n){return this.element.classList.add("dz-drag-hover")},dragover(n){return this.element.classList.add("dz-drag-hover")},dragleave(n){return this.element.classList.remove("dz-drag-hover")},paste(n){},reset(){return this.element.classList.remove("dz-started")},addedfile(n){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){n.previewElement=r.createElement(this.options.previewTemplate.trim()),n.previewTemplate=n.previewElement,this.previewsContainer.appendChild(n.previewElement);for(var e of n.previewElement.querySelectorAll("[data-dz-name]"))e.textContent=n.name;for(e of n.previewElement.querySelectorAll("[data-dz-size]"))e.innerHTML=this.filesize(n.size);this.options.addRemoveLinks&&(n._removeLink=r.createElement(`<a class="dz-remove" href="javascript:undefined;" data-dz-remove>${this.options.dictRemoveFile}</a>`),n.previewElement.appendChild(n._removeLink));let i=t=>(t.preventDefault(),t.stopPropagation(),n.status===r.UPLOADING?this.options.dictCancelUploadConfirmation?r.confirm(this.options.dictCancelUploadConfirmation,()=>this.removeFile(n)):this.removeFile(n):this.options.dictRemoveFileConfirmation?r.confirm(this.options.dictRemoveFileConfirmation,()=>this.removeFile(n)):this.removeFile(n));for(let t of n.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",i)}},removedfile(n){return n.previewElement!=null&&n.previewElement.parentNode!=null&&n.previewElement.parentNode.removeChild(n.previewElement),this._updateMaxFilesReachedClass()},thumbnail(n,e){if(n.previewElement){n.previewElement.classList.remove("dz-file-preview");for(let i of n.previewElement.querySelectorAll("[data-dz-thumbnail]"))i.alt=n.name,i.src=e;return setTimeout(()=>n.previewElement.classList.add("dz-image-preview"),1)}},error(n,e){if(n.previewElement){n.previewElement.classList.add("dz-error"),typeof e!="string"&&e.error&&(e=e.error);for(let i of n.previewElement.querySelectorAll("[data-dz-errormessage]"))i.textContent=e}},errormultiple(){},processing(n){if(n.previewElement&&(n.previewElement.classList.add("dz-processing"),n._removeLink))return n._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(n,e,i){if(n.previewElement)for(let t of n.previewElement.querySelectorAll("[data-dz-uploadprogress]"))t.nodeName==="PROGRESS"?t.value=e:t.style.width=`${e}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(n){if(n.previewElement)return n.previewElement.classList.add("dz-success")},successmultiple(){},canceled(n){return this.emit("error",n,this.options.dictUploadCanceled)},canceledmultiple(){},complete(n){if(n._removeLink&&(n._removeLink.innerHTML=this.options.dictRemoveFile),n.previewElement)return n.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){},emptyfolder(){}};var w=C;class r extends v{static initClass(){this.prototype.Emitter=v,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete","emptyfolder"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}constructor(e,i){super();let t,s;if(this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],typeof this.element=="string"&&(this.element=document.querySelector(this.element)),this.element===null||!this.element instanceof HTMLElement)throw new Error("Invalid dropzone element: not an instance of HTMLElement.");if(this.element.dropzone)throw new Error("Dropzone already attached.");r.instances.push(this),this.element.dropzone=this;let l=(s=r.optionsForElement(this.element))!=null?s:{};if(this.options=Object.assign({},w,l,i??{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!r.isBrowserSupported())return this.options.fallback.call(this);if(this.options.url==null&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");typeof this.options.method=="string"&&(this.options.method=this.options.method.toUpperCase()),(t=this.getExistingFallback())&&t.parentNode&&t.parentNode.removeChild(t),this.options.previewsContainer!==!1&&(this.options.previewsContainer?this.previewsContainer=r.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(this.options.clickable===!0?this.clickableElements=[this.element]:this.clickableElements=r.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter(e=>e.accepted).map(e=>e)}getRejectedFiles(){return this.files.filter(e=>!e.accepted).map(e=>e)}getFilesWithStatus(e){return this.files.filter(i=>i.status===e).map(i=>i)}getQueuedFiles(){return this.getFilesWithStatus(r.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(r.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(r.ADDED)}getActiveFiles(){return this.files.filter(e=>e.status===r.UPLOADING||e.status===r.QUEUED).map(e=>e)}init(){if(this.element.tagName==="form"&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(r.createElement(`<div class="dz-default dz-message"><button class="dz-button" type="button">${this.options.dictDefaultMessage}</button></div>`)),this.clickableElements.length){let t=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode?.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),this.hiddenFileInput.setAttribute("form",this.element.id),(this.options.maxFiles===null||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",this.options.acceptedFiles!==null&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),this.options.capture!==null&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",r.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",()=>{let{files:s}=this.hiddenFileInput;if(s.length)for(let l of s)this.addFile(l);this.emit("addedfiles",s),t()})};t()}this.URL=window.URL!==null?window.URL:window.webkitURL;for(let t of this.events)this.on(t,this.options[t]);this.on("uploadprogress",()=>this.updateTotalUploadProgress()),this.on("removedfile",()=>this.updateTotalUploadProgress()),this.on("canceled",t=>this.emit("complete",t)),this.on("complete",t=>{if(this.getAddedFiles().length===0&&this.getUploadingFiles().length===0&&this.getQueuedFiles().length===0)return setTimeout(()=>this.emit("queuecomplete"),0)});const e=function(t){return t.dataTransfer.types&&t.dataTransfer.types.includes("Files")};let i=function(t){if(e(t))return t.stopPropagation(),t.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:t=>this.emit("dragstart",t),dragenter:t=>(i(t),this.emit("dragenter",t)),dragover:t=>{const s=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect=s==="move"||s==="linkMove"?"move":"copy",i(t),this.emit("dragover",t)},dragleave:t=>this.emit("dragleave",t),drop:t=>(i(t),this.drop(t)),dragend:t=>this.emit("dragend",t)}}],this.clickableElements.forEach(t=>this.listeners.push({element:t,events:{click:s=>((t!==this.element||s.target===this.element||r.elementInside(s.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}})),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),this.hiddenFileInput!=null&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,r.instances.splice(r.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,i=0,t=0;if(this.getActiveFiles().length){for(let l of this.getActiveFiles())i+=l.upload.bytesSent,t+=l.upload.total;e=100*i/t}else e=100;return this.emit("totaluploadprogress",e,t,i)}_getParamName(e){return typeof this.options.paramName=="function"?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){const i={...e,name:e.name.replace(/\u202F/g," ")};return typeof this.options.renameFile!="function"?i.name:this.options.renameFile(i)}getFallbackForm(){let e,i;if(e=this.getExistingFallback())return e;let t='<div class="dz-fallback">';this.options.dictFallbackText&&(t+=`<p>${this.options.dictFallbackText}</p>`),t+=`<input type="file" name="${this._getParamName(0)}" ${this.options.uploadMultiple?'multiple="multiple"':void 0} /><input type="submit" value="Upload!"></div>`;let s=r.createElement(t);return this.element.tagName!=="FORM"?(i=r.createElement(`<form action="${this.options.url}" enctype="multipart/form-data" method="${this.options.method}"></form>`),i.appendChild(s)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),i??s}getExistingFallback(){let e=function(t){for(let s of t)if(/(^| )fallback($| )/.test(s.className))return s};for(let t of["div","form"]){var i;if(i=e(this.element.getElementsByTagName(t)))return i}}setupEventListeners(){return this.listeners.map(e=>(()=>{let i=[];for(let t in e.events){let s=e.events[t];i.push(e.element.addEventListener(t,s,!1))}return i})())}removeEventListeners(){return this.listeners.map(e=>(()=>{let i=[];for(let t in e.events){let s=e.events[t];i.push(e.element.removeEventListener(t,s,!1))}return i})())}disable(){return this.clickableElements.forEach(e=>e.classList.remove("dz-clickable")),this.removeEventListeners(),this.disabled=!0,this.files.map(e=>this.cancelUpload(e))}enable(){return delete this.disabled,this.clickableElements.forEach(e=>e.classList.add("dz-clickable")),this.setupEventListeners()}filesize(e){let i=0,t="b";if(e>0){let s=["tb","gb","mb","kb","b"];for(let l=0;l<s.length;l++){let a=s[l],u=Math.pow(this.options.filesizeBase,4-l)/10;if(e>=u){i=e/Math.pow(this.options.filesizeBase,4-l),t=a;break}}i=Math.round(10*i)/10}return`<strong>${i}</strong> ${this.options.dictFileSizeUnits[t]}`}_updateMaxFilesReachedClass(){return this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let i=[];for(let t=0;t<e.dataTransfer.files.length;t++)i[t]=e.dataTransfer.files[t];if(i.length){let{items:t}=e.dataTransfer;t&&t.length&&t[0].webkitGetAsEntry!=null?this._addFilesFromItems(t):this.handleFiles(i)}this.emit("addedfiles",i)}paste(e){if(S(e?.clipboardData,t=>t.items)==null)return;this.emit("paste",e);let{items:i}=e.clipboardData;if(i.length)return this._addFilesFromItems(i)}handleFiles(e){for(let i of e)this.addFile(i)}_addFilesFromItems(e){return(()=>{let i=[];for(let s of e){var t;s.webkitGetAsEntry!=null&&(t=s.webkitGetAsEntry())?t.isFile?i.push(this.addFile(s.getAsFile())):t.isDirectory?i.push(this._addFilesFromDirectory(t,t.name)):i.push(void 0):s.getAsFile!=null&&(s.kind==null||s.kind==="file")?i.push(this.addFile(s.getAsFile())):i.push(void 0)}return i})()}_addFilesFromDirectory(e,i){let t=e.createReader(),s=u=>T(console,"log",d=>d.log(u)),l=0;var a=()=>t.readEntries(u=>{if(u.length>0){for(let d of u)d.isFile?(++l,d.file(o=>{if(!(this.options.ignoreHiddenFiles&&o.name.substring(0,1)==="."))return o.fullPath=`${i}/${o.name}`,this.addFile(o)})):d.isDirectory&&this._addFilesFromDirectory(d,`${i}/${d.name}`);a()}else l===0&&this.emit("emptyfolder",i);return null},s);return a()}accept(e,i){this.options.maxFilesize&&e.size>this.options.maxFilesize*1048576?i(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):r.isValidFile(e,this.options.acceptedFiles)?this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(i(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,i):i(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():r.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=r.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,i=>{i?(e.accepted=!1,this._errorProcessing([e],i)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()})}enqueueFiles(e){for(let i of e)this.enqueueFile(i);return null}enqueueFile(e){if(e.status===r.ADDED&&e.accepted===!0){if(e.status=r.QUEUED,this.options.autoProcessQueue)return setTimeout(()=>this.processQueue(),0)}else throw new Error("This file can't be queued because it has already been processed or was rejected.")}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=this.options.maxThumbnailFilesize*1048576)return this._thumbnailQueue.push(e),setTimeout(()=>this._processThumbnailQueue(),0)}_processThumbnailQueue(){if(this._processingThumbnail||this._thumbnailQueue.length===0)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,i=>(this.emit("thumbnail",e,i),this._processingThumbnail=!1,this._processThumbnailQueue()))}removeFile(e){if(e.status===r.UPLOADING&&this.cancelUpload(e),this.files=k(this.files,e),this.emit("removedfile",e),this.files.length===0)return this.emit("reset")}removeAllFiles(e){e==null&&(e=!1);for(let i of this.files.slice())(i.status!==r.UPLOADING||e)&&this.removeFile(i);return null}resizeImage(e,i,t,s,l){return this.createThumbnail(e,i,t,s,!0,(a,u)=>{if(u==null)return l(e);{let{resizeMimeType:d}=this.options;d==null&&(d=e.type);let o=u.toDataURL(d,this.options.resizeQuality);return(d==="image/jpeg"||d==="image/jpg")&&(o=A(e.dataURL,o)),l(r.dataURItoBlob(o))}},!0)}createThumbnail(e,i,t,s,l,a,u=!1){let d=new FileReader;d.onload=()=>{if(e.dataURL=d.result,e.type==="image/svg+xml"){a?.(d.result);return}this.createThumbnailFromUrl(e,i,t,s,l,a,void 0,u)},d.readAsDataURL(e)}displayExistingFile(e,i,t,s,l=!0){if(this.emit("addedfile",e),this.emit("complete",e),!l)this.emit("thumbnail",e,i),t&&t();else{let a=u=>{this.emit("thumbnail",e,u),t&&t()};e.dataURL=i,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,a,s)}}createThumbnailFromUrl(e,i,t,s,l,a,u,d=!1){let o=document.createElement("img");u&&(o.crossOrigin=u),l=getComputedStyle(document.body).imageOrientation=="from-image"?!1:l,o.onload=()=>{let g=f=>f(1);return typeof EXIF<"u"&&EXIF!==null&&l&&(g=f=>EXIF.getData(o,function(){return f(EXIF.getTag(this,"Orientation"))})),g(f=>{e.width=o.width,e.height=o.height;let p=this.options.resize.call(this,e,i,t,s),m=document.createElement("canvas"),c=m.getContext("2d");switch(m.width=p.trgWidth,m.height=p.trgHeight,f>4&&(m.width=p.trgHeight,m.height=p.trgWidth),f){case 2:c.translate(m.width,0),c.scale(-1,1);break;case 3:c.translate(m.width,m.height),c.rotate(Math.PI);break;case 4:c.translate(0,m.height),c.scale(1,-1);break;case 5:c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:c.rotate(.5*Math.PI),c.translate(0,-m.width);break;case 7:c.rotate(.5*Math.PI),c.translate(m.height,-m.width),c.scale(-1,1);break;case 8:c.rotate(-.5*Math.PI),c.translate(-m.height,0);break}L(c,o,p.srcX!=null?p.srcX:0,p.srcY!=null?p.srcY:0,p.srcWidth,p.srcHeight,p.trgX!=null?p.trgX:0,p.trgY!=null?p.trgY:0,p.trgWidth,p.trgHeight);let y=m.toDataURL("image/png");if(a!=null)return a(y,m)})},a!=null&&(o.onerror=a);var h=e.dataURL;return d&&(h=U(h)),o.src=h}processQueue(){let{parallelUploads:e}=this.options,i=this.getUploadingFiles().length,t=i;if(i>=e)return;let s=this.getQueuedFiles();if(s.length>0){if(this.options.uploadMultiple)return this.processFiles(s.slice(0,e-i));for(;t<e;){if(!s.length)return;this.processFile(s.shift()),t++}}}processFile(e){return this.processFiles([e])}processFiles(e){for(let i of e)i.processing=!0,i.status=r.UPLOADING,this.emit("processing",i);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}_getFilesWithXhr(e){return this.files.filter(i=>i.xhr===e).map(i=>i)}cancelUpload(e){if(e.status===r.UPLOADING){let i=this._getFilesWithXhr(e.xhr);for(let t of i)t.status=r.CANCELED;typeof e.xhr<"u"&&e.xhr.abort();for(let t of i)this.emit("canceled",t);this.options.uploadMultiple&&this.emit("canceledmultiple",i)}else(e.status===r.ADDED||e.status===r.QUEUED)&&(e.status=r.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...i){return typeof e=="function"?e.apply(this,i):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,i=>{if(this.options.chunking){let t=i[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||t.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(t.size/this.options.chunkSize),t.size===0&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){let t=e[0],s=i[0];t.upload.chunks=[];let l=()=>{let a=0;for(;t.upload.chunks[a]!==void 0;)a++;if(a>=t.upload.totalChunkCount)return;let u=a*this.options.chunkSize,d=Math.min(u+this.options.chunkSize,s.size),o={name:this._getParamName(0),data:s.webkitSlice?s.webkitSlice(u,d):s.slice(u,d),filename:t.upload.filename,chunkIndex:a};t.upload.chunks[a]={file:t,index:a,dataBlock:o,status:r.UPLOADING,progress:0,retries:0},this._uploadData(e,[o])};if(t.upload.finishedChunkUpload=(a,u)=>{let d=!0;a.status=r.SUCCESS,a.dataBlock=null,a.response=a.xhr.responseText,a.responseHeaders=a.xhr.getAllResponseHeaders(),a.xhr=null;for(let o=0;o<t.upload.totalChunkCount;o++){if(t.upload.chunks[o]===void 0)return l();t.upload.chunks[o].status!==r.SUCCESS&&(d=!1)}d&&this.options.chunksUploaded(t,()=>{this._finished(e,u,null)})},this.options.parallelChunkUploads){const a=Math.min(this.options.parallelChunkUploads===!0?this.options.parallelUploads:this.options.parallelChunkUploads,t.upload.totalChunkCount);for(let u=0;u<a;u++)l()}else l()}else{let t=[];for(let s=0;s<e.length;s++)t[s]={name:this._getParamName(s),data:i[s],filename:e[s].upload.filename};this._uploadData(e,t)}})}_getChunk(e,i){for(let t=0;t<e.upload.totalChunkCount;t++)if(e.upload.chunks[t]!==void 0&&e.upload.chunks[t].xhr===i)return e.upload.chunks[t]}_uploadData(e,i){let t=new XMLHttpRequest;for(let o of e)o.xhr=t;e[0].upload.chunked&&(e[0].upload.chunks[i[0].chunkIndex].xhr=t);let s=this.resolveOption(this.options.method,e,i),l=this.resolveOption(this.options.url,e,i);t.open(s,l,!0),this.resolveOption(this.options.timeout,e)&&(t.timeout=this.resolveOption(this.options.timeout,e)),t.withCredentials=!!this.options.withCredentials,t.onload=o=>{this._finishedUploading(e,t,o)},t.ontimeout=()=>{this._handleUploadError(e,t,`Request timedout after ${this.options.timeout/1e3} seconds`)},t.onerror=()=>{this._handleUploadError(e,t)};let u=t.upload!=null?t.upload:t;u.onprogress=o=>this._updateFilesUploadProgress(e,t,o);let d=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(d["Content-Type"]=e[0].type),this.options.headers&&Object.assign(d,this.options.headers);for(let o in d){let h=d[o];h&&t.setRequestHeader(o,h)}if(this.options.binaryBody){for(let o of e)this.emit("sending",o,t);this.options.uploadMultiple&&this.emit("sendingmultiple",e,t),this.submitRequest(t,null,e)}else{let o=new FormData;if(this.options.params){let h=this.options.params;typeof h=="function"&&(h=h.call(this,e,t,e[0].upload.chunked?this._getChunk(e[0],t):null));for(let g in h){let f=h[g];if(Array.isArray(f))for(let p=0;p<f.length;p++)o.append(g,f[p]);else o.append(g,f)}}for(let h of e)this.emit("sending",h,t,o);this.options.uploadMultiple&&this.emit("sendingmultiple",e,t,o),this._addFormElementData(o);for(let h=0;h<i.length;h++){let g=i[h];o.append(g.name,g.data,g.filename)}this.submitRequest(t,o,e)}}_transformFiles(e,i){let t=[],s=0;for(let l=0;l<e.length;l++)this.options.transformFile.call(this,e[l],a=>{t[l]=a,++s===e.length&&i(t)})}_addFormElementData(e){if(this.element.tagName==="FORM")for(let i of this.element.querySelectorAll("input, textarea, select, button")){let t=i.getAttribute("name"),s=i.getAttribute("type");if(s&&(s=s.toLowerCase()),!(typeof t>"u"||t===null))if(i.tagName==="SELECT"&&i.hasAttribute("multiple"))for(let l of i.options)l.selected&&e.append(t,l.value);else(!s||s!=="checkbox"&&s!=="radio"||i.checked)&&e.append(t,i.value)}}_updateFilesUploadProgress(e,i,t){if(e[0].upload.chunked){let s=e[0],l=this._getChunk(s,i);t?(l.progress=100*t.loaded/t.total,l.total=t.total,l.bytesSent=t.loaded):(l.progress=100,l.bytesSent=l.total),s.upload.progress=0,s.upload.total=0,s.upload.bytesSent=0;for(let a=0;a<s.upload.totalChunkCount;a++)s.upload.chunks[a]&&typeof s.upload.chunks[a].progress<"u"&&(s.upload.progress+=s.upload.chunks[a].progress,s.upload.total+=s.upload.chunks[a].total,s.upload.bytesSent+=s.upload.chunks[a].bytesSent);s.upload.progress=s.upload.progress/s.upload.totalChunkCount,this.emit("uploadprogress",s,s.upload.progress,s.upload.bytesSent)}else for(let s of e)s.upload.total&&s.upload.bytesSent&&s.upload.bytesSent==s.upload.total||(t?(s.upload.progress=100*t.loaded/t.total,s.upload.total=t.total,s.upload.bytesSent=t.loaded):(s.upload.progress=100,s.upload.bytesSent=s.upload.total),this.emit("uploadprogress",s,s.upload.progress,s.upload.bytesSent))}_finishedUploading(e,i,t){let s;if(e[0].status!==r.CANCELED&&i.readyState===4){if(i.responseType!=="arraybuffer"&&i.responseType!=="blob"&&(s=i.responseText,i.getResponseHeader("content-type")&&~i.getResponseHeader("content-type").indexOf("application/json")))try{s=JSON.parse(s)}catch(l){t=l,s="Invalid JSON response from server."}this._updateFilesUploadProgress(e,i),200<=i.status&&i.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],i),s):this._finished(e,s,t):this._handleUploadError(e,i,s)}}_handleUploadError(e,i,t){if(e[0].status!==r.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){let s=this._getChunk(e[0],i);if(s.retries++<this.options.retryChunksLimit){this._uploadData(e,[s.dataBlock]);return}else console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,t||this.options.dictResponseError.replace("{{statusCode}}",i.status),i)}}submitRequest(e,i,t){if(e.readyState!=1){console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");return}if(this.options.binaryBody)if(t[0].upload.chunked){const s=this._getChunk(t[0],e);e.send(s.dataBlock.data)}else e.send(t[0]);else e.send(i)}_finished(e,i,t){for(let s of e)s.status=r.SUCCESS,this.emit("success",s,i,t),this.emit("complete",s);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,i,t),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}_errorProcessing(e,i,t){for(let s of e)s.status=r.ERROR,this.emit("error",s,i,t),this.emit("complete",s);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,i,t),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}static uuidv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}}r.initClass();r.options={};r.optionsForElement=function(n){if(n.getAttribute("id")&&typeof r.options<"u")return r.options[z(n.getAttribute("id"))]};r.instances=[];r.forElement=function(n){if(typeof n=="string"&&(n=document.querySelector(n)),n?.dropzone==null)throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return n.dropzone};r.discover=function(){let n;if(document.querySelectorAll)n=document.querySelectorAll(".dropzone");else{n=[];let e=i=>(()=>{let t=[];for(let s of i)/(^| )dropzone($| )/.test(s.className)?t.push(n.push(s)):t.push(void 0);return t})();e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return(()=>{let e=[];for(let i of n)r.optionsForElement(i)!==!1?e.push(new r(i)):e.push(void 0);return e})()};r.isBrowserSupported=function(){return typeof Promise<"u"};r.dataURItoBlob=function(n){let e=atob(n.split(",")[1]),i=n.split(",")[0].split(":")[1].split(";")[0],t=new ArrayBuffer(e.length),s=new Uint8Array(t);for(let l=0,a=e.length,u=0<=a;u?l<=a:l>=a;u?l++:l--)s[l]=e.charCodeAt(l);return new Blob([t],{type:i})};const k=(n,e)=>n.filter(i=>i!==e).map(i=>i),z=n=>n.replace(/[\-_](\w)/g,e=>e.charAt(1).toUpperCase());r.createElement=function(n){let e=document.createElement("div");return e.innerHTML=n,e.childNodes[0]};r.elementInside=function(n,e){if(n===e)return!0;for(;n=n.parentNode;)if(n===e)return!0;return!1};r.getElement=function(n,e){let i;if(typeof n=="string"?i=document.querySelector(n):n.nodeType!=null&&(i=n),i==null)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector or a plain HTML element.`);return i};r.getElements=function(n,e){let i,t;if(n instanceof Array){t=[];try{for(i of n)t.push(this.getElement(i,e))}catch{t=null}}else if(typeof n=="string"){t=[];for(i of document.querySelectorAll(n))t.push(i)}else n.nodeType!=null&&(t=[n]);if(t==null||!t.length)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return t};r.confirm=function(n,e,i){if(window.confirm(n))return e();if(i!=null)return i()};r.isValidFile=function(n,e){if(!e)return!0;e=e.split(",");let i=n.type,t=i.replace(/\/.*$/,"");for(let s of e)if(s=s.trim(),s.charAt(0)==="."){if(n.name.toLowerCase().indexOf(s.toLowerCase(),n.name.length-s.length)!==-1)return!0}else if(/\/\*$/.test(s)){if(t===s.replace(/\/.*$/,""))return!0}else if(i===s)return!0;return!1};typeof jQuery<"u"&&jQuery!==null&&(jQuery.fn.dropzone=function(n){return this.each(function(){return new r(this,n)})});r.ADDED="added";r.QUEUED="queued";r.ACCEPTED=r.QUEUED;r.UPLOADING="uploading";r.PROCESSING=r.UPLOADING;r.CANCELED="canceled";r.ERROR="error";r.SUCCESS="success";let b=function(n){let e=n.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=e;let t=i.getContext("2d");t.drawImage(n,0,0);let{data:s}=t.getImageData(1,0,1,e),l=0,a=e,u=e;for(;u>l;)s[(u-1)*4+3]===0?a=u:l=u,u=a+l>>1;let d=u/e;return d===0?1:d};var L=function(n,e,i,t,s,l,a,u,d,o){let h=b(e);return n.drawImage(e,i,t,s,l,a,u,d,o/h)};function U(n){var e="data:image/jpeg;base64,";if(!n.startsWith(e))return n;var i=window.atob(n.slice(e.length));if(!i.startsWith("ÿØÿ"))return n;for(var t=0,s="";t<i.length;)if(i.slice(t,t+2)=="ÿÚ"){s+=i.slice(t);break}else if(i.slice(t,t+2)=="ÿØ")s+=i.slice(t,t+2),t+=2;else{var l=i.charCodeAt(t+2)*256+i.charCodeAt(t+3),a=t+l+2,u=i.slice(t,a);u.startsWith("ÿá")||(s+=u),t=a}return e+window.btoa(s)}function A(n,e){var i="data:image/jpeg;base64,";if(!(n.startsWith(i)&&e.startsWith(i)))return e;var t=window.atob(n.slice(i.length));if(!t.startsWith("ÿØÿ"))return e;for(var s=0,l="";s<t.length&&t.slice(s,s+2)!="ÿÚ";)if(t.slice(s,s+2)=="ÿØ")s+=2;else{var a=t.charCodeAt(s+2)*256+t.charCodeAt(s+3),u=s+a+2,d=t.slice(s,u);d.startsWith("ÿá")&&(l+=d),s=u}if(l=="")return e;var o=window.atob(e.slice(i.length));if(!o.startsWith("ÿØÿ"))return e;var h=4+o.charCodeAt(4)*256+o.charCodeAt(5);return o=o.slice(0,h)+l+o.slice(h),i+window.btoa(o)}function S(n,e){return typeof n<"u"&&n!==null?e(n):void 0}function T(n,e,i){if(typeof n<"u"&&n!==null&&typeof n[e]=="function")return i(n,e)}export{r as Dropzone,r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__commonJS as t}from"./chunk-A242L54C.js";var l=t({"../node_modules/picocolors/picocolors.browser.js"(i,e){var r=String,g=function(){return{isColorSupported:!1,reset:r,bold:r,dim:r,italic:r,underline:r,inverse:r,hidden:r,strikethrough:r,black:r,red:r,green:r,yellow:r,blue:r,magenta:r,cyan:r,white:r,gray:r,bgBlack:r,bgRed:r,bgGreen:r,bgYellow:r,bgBlue:r,bgMagenta:r,bgCyan:r,bgWhite:r,blackBright:r,redBright:r,greenBright:r,yellowBright:r,blueBright:r,magentaBright:r,cyanBright:r,whiteBright:r,bgBlackBright:r,bgRedBright:r,bgGreenBright:r,bgYellowBright:r,bgBlueBright:r,bgMagentaBright:r,bgCyanBright:r,bgWhiteBright:r}};e.exports=g(),e.exports.createColors=g}});export{l as require_picocolors_browser};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var R=(E=>(E.CHANNEL_WS_DISCONNECT="channelWSDisconnect",E.CHANNEL_CREATED="channelCreated",E.CONFIG_ERROR="configError",E.STORY_INDEX_INVALIDATED="storyIndexInvalidated",E.STORY_SPECIFIED="storySpecified",E.SET_CONFIG="setConfig",E.SET_STORIES="setStories",E.SET_INDEX="setIndex",E.SET_CURRENT_STORY="setCurrentStory",E.CURRENT_STORY_WAS_SET="currentStoryWasSet",E.FORCE_RE_RENDER="forceReRender",E.FORCE_REMOUNT="forceRemount",E.PRELOAD_ENTRIES="preloadStories",E.STORY_PREPARED="storyPrepared",E.DOCS_PREPARED="docsPrepared",E.STORY_CHANGED="storyChanged",E.STORY_UNCHANGED="storyUnchanged",E.STORY_RENDERED="storyRendered",E.STORY_FINISHED="storyFinished",E.STORY_MISSING="storyMissing",E.STORY_ERRORED="storyErrored",E.STORY_THREW_EXCEPTION="storyThrewException",E.STORY_RENDER_PHASE_CHANGED="storyRenderPhaseChanged",E.STORY_HOT_UPDATED="storyHotUpdated",E.PLAY_FUNCTION_THREW_EXCEPTION="playFunctionThrewException",E.UNHANDLED_ERRORS_WHILE_PLAYING="unhandledErrorsWhilePlaying",E.UPDATE_STORY_ARGS="updateStoryArgs",E.STORY_ARGS_UPDATED="storyArgsUpdated",E.RESET_STORY_ARGS="resetStoryArgs",E.SET_FILTER="setFilter",E.SET_GLOBALS="setGlobals",E.UPDATE_GLOBALS="updateGlobals",E.GLOBALS_UPDATED="globalsUpdated",E.REGISTER_SUBSCRIPTION="registerSubscription",E.PREVIEW_INITIALIZED="previewInitialized",E.PREVIEW_KEYDOWN="previewKeydown",E.PREVIEW_BUILDER_PROGRESS="preview_builder_progress",E.SELECT_STORY="selectStory",E.STORIES_COLLAPSE_ALL="storiesCollapseAll",E.STORIES_EXPAND_ALL="storiesExpandAll",E.DOCS_RENDERED="docsRendered",E.SHARED_STATE_CHANGED="sharedStateChanged",E.SHARED_STATE_SET="sharedStateSet",E.NAVIGATE_URL="navigateUrl",E.UPDATE_QUERY_PARAMS="updateQueryParams",E.REQUEST_WHATS_NEW_DATA="requestWhatsNewData",E.RESULT_WHATS_NEW_DATA="resultWhatsNewData",E.SET_WHATS_NEW_CACHE="setWhatsNewCache",E.TOGGLE_WHATS_NEW_NOTIFICATIONS="toggleWhatsNewNotifications",E.TELEMETRY_ERROR="telemetryError",E.FILE_COMPONENT_SEARCH_REQUEST="fileComponentSearchRequest",E.FILE_COMPONENT_SEARCH_RESPONSE="fileComponentSearchResponse",E.SAVE_STORY_REQUEST="saveStoryRequest",E.SAVE_STORY_RESPONSE="saveStoryResponse",E.ARGTYPES_INFO_REQUEST="argtypesInfoRequest",E.ARGTYPES_INFO_RESPONSE="argtypesInfoResponse",E.CREATE_NEW_STORYFILE_REQUEST="createNewStoryfileRequest",E.CREATE_NEW_STORYFILE_RESPONSE="createNewStoryfileResponse",E.OPEN_IN_EDITOR_REQUEST="openInEditorRequest",E.OPEN_IN_EDITOR_RESPONSE="openInEditorResponse",E.MANAGER_INERT_ATTRIBUTE_CHANGED="managerInertAttributeChanged",E))(R||{}),{CHANNEL_WS_DISCONNECT:_,CHANNEL_CREATED:S,CONFIG_ERROR:T,CREATE_NEW_STORYFILE_REQUEST:N,CREATE_NEW_STORYFILE_RESPONSE:A,CURRENT_STORY_WAS_SET:O,DOCS_PREPARED:I,DOCS_RENDERED:D,FILE_COMPONENT_SEARCH_REQUEST:r,FILE_COMPONENT_SEARCH_RESPONSE:C,FORCE_RE_RENDER:P,FORCE_REMOUNT:o,GLOBALS_UPDATED:L,NAVIGATE_URL:a,PLAY_FUNCTION_THREW_EXCEPTION:Y,UNHANDLED_ERRORS_WHILE_PLAYING:U,PRELOAD_ENTRIES:G,PREVIEW_INITIALIZED:H,PREVIEW_BUILDER_PROGRESS:W,PREVIEW_KEYDOWN:d,REGISTER_SUBSCRIPTION:i,RESET_STORY_ARGS:t,SELECT_STORY:F,SET_CONFIG:l,SET_CURRENT_STORY:p,SET_FILTER:y,SET_GLOBALS:e,SET_INDEX:c,SET_STORIES:h,SHARED_STATE_CHANGED:g,SHARED_STATE_SET:u,STORIES_COLLAPSE_ALL:s,STORIES_EXPAND_ALL:M,STORY_ARGS_UPDATED:Q,STORY_CHANGED:V,STORY_ERRORED:f,STORY_INDEX_INVALIDATED:w,STORY_MISSING:B,STORY_PREPARED:X,STORY_RENDER_PHASE_CHANGED:b,STORY_RENDERED:m,STORY_FINISHED:q,STORY_SPECIFIED:x,STORY_THREW_EXCEPTION:K,STORY_UNCHANGED:Z,STORY_HOT_UPDATED:z,UPDATE_GLOBALS:j,UPDATE_QUERY_PARAMS:k,UPDATE_STORY_ARGS:J,REQUEST_WHATS_NEW_DATA:$,RESULT_WHATS_NEW_DATA:n,SET_WHATS_NEW_CACHE:v,TOGGLE_WHATS_NEW_NOTIFICATIONS:EE,TELEMETRY_ERROR:RE,SAVE_STORY_REQUEST:_E,SAVE_STORY_RESPONSE:SE,ARGTYPES_INFO_REQUEST:TE,ARGTYPES_INFO_RESPONSE:NE,OPEN_IN_EDITOR_REQUEST:AE,OPEN_IN_EDITOR_RESPONSE:OE,MANAGER_INERT_ATTRIBUTE_CHANGED:IE}=R;export{TE as ARGTYPES_INFO_REQUEST,NE as ARGTYPES_INFO_RESPONSE,S as CHANNEL_CREATED,_ as CHANNEL_WS_DISCONNECT,T as CONFIG_ERROR,N as CREATE_NEW_STORYFILE_REQUEST,A as CREATE_NEW_STORYFILE_RESPONSE,O as CURRENT_STORY_WAS_SET,I as DOCS_PREPARED,D as DOCS_RENDERED,r as FILE_COMPONENT_SEARCH_REQUEST,C as FILE_COMPONENT_SEARCH_RESPONSE,o as FORCE_REMOUNT,P as FORCE_RE_RENDER,L as GLOBALS_UPDATED,IE as MANAGER_INERT_ATTRIBUTE_CHANGED,a as NAVIGATE_URL,AE as OPEN_IN_EDITOR_REQUEST,OE as OPEN_IN_EDITOR_RESPONSE,Y as PLAY_FUNCTION_THREW_EXCEPTION,G as PRELOAD_ENTRIES,W as PREVIEW_BUILDER_PROGRESS,H as PREVIEW_INITIALIZED,d as PREVIEW_KEYDOWN,i as REGISTER_SUBSCRIPTION,$ as REQUEST_WHATS_NEW_DATA,t as RESET_STORY_ARGS,n as RESULT_WHATS_NEW_DATA,_E as SAVE_STORY_REQUEST,SE as SAVE_STORY_RESPONSE,F as SELECT_STORY,l as SET_CONFIG,p as SET_CURRENT_STORY,y as SET_FILTER,e as SET_GLOBALS,c as SET_INDEX,h as SET_STORIES,v as SET_WHATS_NEW_CACHE,g as SHARED_STATE_CHANGED,u as SHARED_STATE_SET,s as STORIES_COLLAPSE_ALL,M as STORIES_EXPAND_ALL,Q as STORY_ARGS_UPDATED,V as STORY_CHANGED,f as STORY_ERRORED,q as STORY_FINISHED,z as STORY_HOT_UPDATED,w as STORY_INDEX_INVALIDATED,B as STORY_MISSING,X as STORY_PREPARED,m as STORY_RENDERED,b as STORY_RENDER_PHASE_CHANGED,x as STORY_SPECIFIED,K as STORY_THREW_EXCEPTION,Z as STORY_UNCHANGED,RE as TELEMETRY_ERROR,EE as TOGGLE_WHATS_NEW_NOTIFICATIONS,U as UNHANDLED_ERRORS_WHILE_PLAYING,j as UPDATE_GLOBALS,k as UPDATE_QUERY_PARAMS,J as UPDATE_STORY_ARGS};
|