import{ObservableMixin as x,insertToPriorityArray as ie,CKEditorError as c,EmitterMixin as se,Config as M,Locale as oe,Collection as F,KeystrokeHandler as re,env as E,global as I,uid as L,decodeLicenseKey as G,toArray as ae,crc32 as le,releaseDate as ce,logError as ue,isFeatureBlockedByLicenseKey as de,setDataInElement as B}from"@ckeditor/ckeditor5-utils";import{Model as fe,StylesProcessor as he,DataController as ge,EditingController as me,Conversion as ye}from"@ckeditor/ckeditor5-engine";import{EditorWatchdog as we,ContextWatchdog as pe}from"@ckeditor/ckeditor5-watchdog";/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class be extends x(){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",z,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",z),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function z(t){t.return=!1,t.stop()}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class W extends x(){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",n=>{if(!this.affectsData)return;const i=e.model.document.selection,a=!(i.getFirstPosition().root.rootName=="$graveyard")&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!a)&&(n.return=!1,n.stop())},{priority:"highest"}),this.on("execute",n=>{this.isEnabled||n.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",$,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",$),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function $(t){t.return=!1,t.stop()}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class _e extends W{_childCommandsDefinitions=[];refresh(){}execute(...e){const n=this._getFirstEnabledCommand();return!!n&&n.execute(e)}registerChildCommand(e,n={}){ie(this._childCommandsDefinitions,{command:e,priority:n.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:n})=>n.isEnabled);return e&&e.command}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class H{_commands;constructor(){this._commands=new Map}add(e,n){this._commands.set(e,n)}get(e){return this._commands.get(e)}execute(e,...n){const i=this.get(e);if(!i)throw new c("commandcollection-command-not-found",this,{commandName:e});return i.execute(...n)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Y extends se(){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,n=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const s of n)s.pluginName&&this._availablePlugins.set(s.pluginName,s);this._contextPlugins=new Map;for(const[s,a]of i)this._contextPlugins.set(s,a),this._contextPlugins.set(a,s),s.pluginName&&this._availablePlugins.set(s.pluginName,s)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const n=this._plugins.get(e);if(!n){let i=e;throw typeof e=="function"&&(i=e.pluginName||e.name),new c("plugincollection-plugin-not-loaded",this._context,{plugin:i})}return n}has(e){return this._plugins.has(e)}init(e,n=[],i=[]){const s=this,a=this._context;b(e),p(e);const h=e.filter(l=>!k(l,n)),u=[...P(h)];U(u,i);const w=N(u);return g(w,"init").then(()=>g(w,"afterInit")).then(()=>w);function y(l){return typeof l=="function"}function _(l){return y(l)&&!!l.isContextPlugin}function k(l,r){return r.some(o=>o===l||m(l)===o||m(o)===l)}function m(l){return y(l)?l.pluginName||l.name:l}function b(l,r=new Set){l.forEach(o=>{y(o)&&(r.has(o)||(r.add(o),o.pluginName&&!s._availablePlugins.has(o.pluginName)&&s._availablePlugins.set(o.pluginName,o),o.requires&&b(o.requires,r)))})}function P(l,r=new Set){return l.map(o=>y(o)?o:s._availablePlugins.get(o)).reduce((o,d)=>r.has(d)?o:(r.add(d),d.requires&&(p(d.requires,d),P(d.requires,r).forEach(f=>o.add(f))),o.add(d)),new Set)}function p(l,r=null){l.map(o=>y(o)?o:s._availablePlugins.get(o)||o).forEach(o=>{C(o,r),v(o,r),D(o,r)})}function C(l,r){if(!y(l))throw r?new c("plugincollection-soft-required",a,{missingPlugin:l,requiredBy:m(r)}):new c("plugincollection-plugin-not-found",a,{plugin:l})}function v(l,r){if(_(r)&&!_(l))throw new c("plugincollection-context-required",a,{plugin:m(l),requiredBy:m(r)})}function D(l,r){if(r&&k(l,n))throw new c("plugincollection-required",a,{plugin:m(l),requiredBy:m(r)})}function N(l){return l.map(r=>{let o=s._contextPlugins.get(r);return o=o||new r(a),s._add(r,o),o})}function g(l,r){return l.reduce((o,d)=>!d[r]||s._contextPlugins.has(d)?o:o.then(d[r].bind(d)),Promise.resolve())}function U(l,r){for(const o of r){if(typeof o!="function")throw new c("plugincollection-replace-plugin-invalid-type",null,{pluginItem:o});const d=o.pluginName;if(!d)throw new c("plugincollection-replace-plugin-missing-name",null,{pluginItem:o});if(o.requires&&o.requires.length)throw new c("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:d});const f=s._availablePlugins.get(d);if(!f)throw new c("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:d});const S=l.indexOf(f);if(S===-1){if(s._contextPlugins.has(f))return;throw new c("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:d})}if(f.requires&&f.requires.length)throw new c("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:d});l.splice(S,1,o),s._availablePlugins.set(d,o)}}}destroy(){const e=[];for(const[,n]of this)typeof n.destroy=="function"&&!this._contextPlugins.has(n)&&e.push(n.destroy());return Promise.all(e)}_add(e,n){this._plugins.set(e,n);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new c("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,n)}}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class T{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:n,...i}=e||{};this.config=new M(i,this.constructor.defaultConfig);const s=this.constructor.builtinPlugins;this.config.define("plugins",s),this.plugins=new Y(this,s);const a=this.config.get("language")||{};this.locale=new oe({uiLanguage:typeof a=="string"?a:a.ui,contentLanguage:this.config.get("language.content"),translations:n}),this.t=this.locale.t,this.editors=new F}initPlugins(){const e=this.config.get("plugins")||[],n=this.config.get("substitutePlugins")||[];for(const i of e.concat(n)){if(typeof i!="function")throw new c("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new c("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],n)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,n){if(this._contextOwner)throw new c("context-addeditor-private-context");this.editors.add(e),n&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const n of this.config.names())["plugins","removePlugins","extraPlugins"].includes(n)||(e[n]=this.config.get(n));return e}static create(e){return new Promise(n=>{const i=new this(e);n(i.initPlugins().then(()=>i))})}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class V extends x(){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class J extends re{editor;constructor(e){super(),this.editor=e}set(e,n,i={}){if(typeof n=="string"){const s=n;n=(a,h)=>{this.editor.execute(s),h()}}super.set(e,n,i)}}function O(t){return t==="__proto__"}function ke(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function X(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}function j(t){const e=[],n=t.length;if(n===0)return e;let i=0,s="",a="",h=!1;for(t.charCodeAt(0)===46&&(e.push(""),i++);i<n;){const u=t[i];a?u==="\\"&&i+1<n?(i++,s+=t[i]):u===a?a="":s+=u:h?u==='"'||u==="'"?a=u:u==="]"?(h=!1,e.push(s),s=""):s+=u:u==="["?(h=!0,s&&(e.push(s),s="")):u==="."?s&&(e.push(s),s=""):s+=u,i++}return s&&e.push(s),e}function Q(t,e,n){if(t==null)return n;switch(typeof e){case"string":{if(O(e))return n;const i=t[e];return i===void 0?ke(e)?Q(t,j(e),n):n:i}case"number":case"symbol":{typeof e=="number"&&(e=X(e));const i=t[e];return i===void 0?n:i}default:{if(Array.isArray(e))return Ee(t,e,n);if(Object.is(e?.valueOf(),-0)?e="-0":e=String(e),O(e))return n;const i=t[e];return i===void 0?n:i}}}function Ee(t,e,n){if(e.length===0)return n;let i=t;for(let s=0;s<e.length;s++){if(i==null||O(e[s]))return n;i=i[e[s]]}return i===void 0?n:i}function Z(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function Pe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}const xe=/^(?:0|[1-9]\d*)$/;function Se(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<e;case"symbol":return!1;case"string":return xe.test(t)}}function Oe(t){return typeof t=="symbol"||t instanceof Symbol}const Ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ve=/^\w*$/;function De(t,e){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||Oe(t)?!0:typeof t=="string"&&(ve.test(t)||!Ce.test(t))||e!=null&&Object.hasOwn(e,t)}const Ne=(t,e,n)=>{const i=t[e];(!(Object.hasOwn(t,e)&&Pe(i,n))||n===void 0&&!(e in t))&&(t[e]=n)};function Ie(t,e,n,i){if(t==null&&!Z(t))return t;const s=De(e,t)?[e]:Array.isArray(e)?e:typeof e=="string"?j(e):[e];let a=t;for(let h=0;h<s.length&&a!=null;h++){const u=X(s[h]);if(O(u))continue;let w;if(h===s.length-1)w=n(a[u]);else{const y=a[u],_=i?.(y,u,t);w=_!==void 0?_:Z(y)?y:Se(s[h+1])?[]:{}}Ne(a,u,w),a=a[u]}return t}function Le(t,e,n){return Ie(t,e,()=>n,()=>{})}function ee(t){return typeof t=="function"}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const A="contentEditing",R="common";class te{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const n=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:A,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const s=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];n&&s.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:s}]})}addKeystrokeInfoCategory({id:e,label:n,description:i,groups:s}){this.keystrokeInfos.set(e,{id:e,label:n,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:R}),s&&s.forEach(a=>{this.addKeystrokeInfoGroup({categoryId:e,...a})})}addKeystrokeInfoGroup({categoryId:e=A,id:n,label:i,keystrokes:s}){const a=this.keystrokeInfos.get(e);if(!a)throw new c("accessibility-unknown-keystroke-info-category",this._editor,{groupId:n,categoryId:e});a.groups.set(n,{id:n,label:i,keystrokes:s||[]})}addKeystrokeInfos({categoryId:e=A,groupId:n=R,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new c("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const s=this.keystrokeInfos.get(e);if(!s.groups.has(n))throw new c("accessibility-unknown-keystroke-info-group",this._editor,{groupId:n,categoryId:e,keystrokes:i});s.groups.get(n).keystrokes.push(...i)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function ne(t){return{sessionId:Ue(),pageSessionId:qe(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:Te(t),plugins:Ae(t.plugins),distribution:Re(),env:Ke(),integration:Object.create(null),menuBar:{isVisible:!!t.config.get("menuBar.isVisible")},language:{ui:t.locale.uiLanguage,content:t.locale.contentLanguage},toolbar:{main:K(t.config.get("toolbar")),block:K(t.config.get("blockToolbar")),balloon:K(t.config.get("balloonToolbar"))}}}function Te(t){return Object.getPrototypeOf(t).constructor.editorName}function Ae(t){return Array.from(t).filter(([e])=>!!e.pluginName).map(([e])=>{const{pluginName:n,isContextPlugin:i,isOfficialPlugin:s,isPremiumPlugin:a}=e;return{isContext:!!i,isOfficial:!!s,isPremium:!!a,name:n}})}function K(t){if(!t)return;const e=Array.isArray(t)?{items:t}:t,n=a(e.items||[]);return{isMultiline:n.includes("-"),shouldNotGroupWhenFull:!!e.shouldNotGroupWhenFull,items:s(n)};function s(h){return h.filter(u=>u!=="|"&&u!=="-")}function a(h){return h.flatMap(u=>typeof u=="string"?[u]:a(u.items))}}function Re(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function Ke(){let t="unknown",e="unknown";return E.isMac?t="mac":E.isWindows?t="windows":E.isiOS?t="ios":E.isAndroid&&(t="android"),E.isGecko?e="gecko":E.isBlink?e="blink":E.isSafari&&(e="safari"),{os:t,browser:e}}function Ue(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",L()),localStorage.getItem("__ckeditor-session-id")}function qe(){return I.window.CKEDITOR_PAGE_SESSION_ID=I.window.CKEDITOR_PAGE_SESSION_ID||L(),I.window.CKEDITOR_PAGE_SESSION_ID}function Me(t,{insertAt:e}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",window.litNonce&&i.setAttribute("nonce",window.litNonce),e==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}Me(":root{--ck-content-font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-content-font-size:medium;--ck-content-font-color:#000;--ck-content-line-height:1.5;--ck-content-word-break:break-word}.ck-content{color:var(--ck-content-font-color);font-family:var(--ck-content-font-family);font-size:var(--ck-content-font-size);line-height:var(--ck-content-line-height);word-break:var(--ck-content-word-break)}");/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Fe extends x(){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;constructor(e={}){if(super(),"sanitizeHtml"in e)throw new c("editor-config-sanitizehtml-not-supported");const n=this.constructor,{translations:i,...s}=n.defaultConfig||{},{translations:a=i,...h}=e,u=e.language||s.language;this._context=e.context||new T({language:u,translations:a}),this._context._addEditor(this,!e.context);const w=Array.from(n.builtinPlugins||[]);this.config=new M(h,s),this.config.define("plugins",w),this.config.define(this._context._getEditorConfig()),_(this.config),this.plugins=new Y(this,w,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new H,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new fe,this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const y=new he;this.data=new ge(this.model,y),this.editing=new me(this.model,y),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new ye([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new J(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new te(this),k(this);function _(m){let b=m.get("licenseKey");if(!b&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(b=window.CKEDITOR_GLOBAL_LICENSE_KEY,m.set("licenseKey",b)),!b)throw new c("license-key-missing")}function k(m){const b=m.config.get("licenseKey"),P=window[Symbol.for("cke distribution")]||"sh";function p(r,o){m.enableReadOnlyMode(Symbol("invalidLicense")),m._showLicenseError(r,o)}function C(r){return["exp","jti","vc"].every(d=>d in r)}function v(r){return Object.getOwnPropertyNames(r).sort().filter(f=>f!="vc"&&r[f]!=null).map(f=>r[f])}function D(r){const{hostname:o}=new URL(window.location.href);if(r.includes(o))return!0;const d=o.split(".");return r.filter(f=>f.includes("*")).map(f=>f.split(".")).filter(f=>f.length<=d.length).map(f=>Array(d.length-f.length).fill(f[0]==="*"?"*":"").concat(f)).some(f=>d.every((S,q)=>f[q]===S||f[q]==="*"))}function N(r){const o=r[0].toUpperCase()+r.slice(1),d=r==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${o} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`\u26A0\uFE0F You are using ${d} ${r} license of CKEditor 5${r==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(b=="GPL"){P=="cloud"&&p("distributionChannel");return}const g=G(b);if(!g){p("invalid");return}if(!C(g)){p("invalid");return}if(g.distributionChannel&&!ae(g.distributionChannel).includes(P)){p("distributionChannel");return}if(le(v(g))!=g.vc.toLowerCase()){p("invalid");return}if(new Date(g.exp*1e3)<ce){p("expired");return}const l=g.licensedHosts;if(l&&l.length>0&&!D(l)){p("domainLimit");return}if(["evaluation","trial"].includes(g.licenseType)&&g.exp*1e3<Date.now()){p("expired");return}if(["development","evaluation","trial"].includes(g.licenseType)){const{licenseType:r}=g;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[r]||(N(r),window.CKEDITOR_WARNING_SUPPRESSIONS[r]=!0)}if(["evaluation","trial"].includes(g.licenseType)){const r=g.licenseType,o=setTimeout(()=>{p(`${r}Limit`)},6e5);m.on("destroy",()=>{clearTimeout(o)})}g.usageEndpoint&&m.once("ready",()=>{const r={requestId:L(),requestTime:Math.round(Date.now()/1e3),license:b,editor:Ge(m)};m._sendUsageRequest(g.usageEndpoint,r).then(o=>{const{status:d,message:f}=o;f&&console.warn(f),d!="ok"&&p("usageLimit")},()=>{ue("license-key-validation-endpoint-not-reachable",{url:g.usageEndpoint})})},{priority:"high"})}}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new c("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new c("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new c("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,n=e.get("plugins"),i=e.get("removePlugins")||[],s=e.get("extraPlugins")||[],a=e.get("substitutePlugins")||[];return this.plugins.init(n.concat(s),i,a).then(u=>(h(this),u));function h(u){const w=u.config.get("licenseKey");if(w==="GPL")return;const y=G(w);if(!y)return;const _=[...u.plugins].map(([k])=>k).find(k=>!k.pluginName||!k.licenseFeatureCode?!1:de(y,k.licenseFeatureCode));_&&(u.enableReadOnlyMode(Symbol("invalidLicense")),u._showLicenseError("pluginNotAllowed",_.pluginName))}}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(n=>this.once("ready",n))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...n){try{return this.commands.execute(e,...n)}catch(i){/* istanbul ignore next -- @preserve */c.rethrowUnexpectedError(i,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=T;static EditorWatchdog=we;static ContextWatchdog=pe;_showLicenseError(e,n){setTimeout(()=>{if(e=="invalid")throw new c("invalid-license-key");if(e=="expired")throw new c("license-key-expired");if(e=="domainLimit")throw new c("license-key-domain-limit");if(e=="pluginNotAllowed")throw new c("license-key-plugin-not-allowed",null,{pluginName:n});if(e=="featureNotAllowed")throw new c("license-key-feature-not-allowed",null,{featureName:n});if(e=="evaluationLimit")throw new c("license-key-evaluation-limit");if(e=="trialLimit")throw new c("license-key-trial-limit");if(e=="developmentLimit")throw new c("license-key-development-limit");if(e=="usageLimit")throw new c("license-key-usage-limit");if(e=="distributionChannel")throw new c("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,n){const i=new Headers({"Content-Type":"application/json"}),s=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(n)});if(!s.ok)throw new Error(`HTTP Response: ${s.status}`);return s.json()}}function Ge(t){const e=ne(t);function n(i,s){if(Q(e,i)!==void 0)throw new c("editor-usage-data-path-already-set",{path:i});Le(e,i,s)}return t.fire("collectUsageData",{setUsageData:n}),e}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function Be(t){if(!ee(t.updateSourceElement))throw new c("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(ze(e)&&e.form){let n;const i=e.form,s=()=>t.updateSourceElement();ee(i.submit)&&(n=i.submit,i.submit=()=>{s(),n.apply(i)}),i.addEventListener("submit",s),t.on("destroy",()=>{i.removeEventListener("submit",s),n&&(i.submit=n)})}}function ze(t){return!!t&&t.tagName.toLowerCase()==="textarea"}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function We(t){class e extends t{sourceElement;updateSourceElement(i){if(!this.sourceElement)throw new c("editor-missing-sourceelement",this);const s=this.config.get("updateSourceElementOnDestroy"),a=this.sourceElement instanceof HTMLTextAreaElement;if(!s&&!a){B(this.sourceElement,"");return}const h=typeof i=="string"?i:this.data.get();B(this.sourceElement,h)}}return e}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function $e(t,e){if(e.ckeditorInstance)throw new c("editor-source-element-already-used",t);e.ckeditorInstance=t,t.once("destroy",()=>{delete e.ckeditorInstance})}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class He extends V{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new F({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new c("pendingactions-add-invalid-message",this);const n=new(x());return n.set("message",e),this._actions.add(n),this.hasAny=!0,n}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}export{te as Accessibility,W as Command,H as CommandCollection,T as Context,V as ContextPlugin,J as EditingKeystrokeHandler,Fe as Editor,We as ElementApiMixin,_e as MultiCommand,He as PendingActions,be as Plugin,R as _DEFAULT_ACCESSIBILITY_GROUP_ID,ne as _getEditorUsageData,Be as attachToForm,$e as secureSourceElement};
