diff --git a/source/dist/viur-shop-components.es.js b/source/dist/viur-shop-components.es.js index 245110d..1b205d5 100644 --- a/source/dist/viur-shop-components.es.js +++ b/source/dist/viur-shop-components.es.js @@ -1,10 +1,10 @@ -var WE = Object.defineProperty; -var KE = (h, y, _) => y in h ? WE(h, y, { enumerable: !0, configurable: !0, writable: !0, value: _ }) : h[y] = _; -var tb = (h, y, _) => KE(h, typeof y != "symbol" ? y + "" : y, _); -import { reactive as he, computed as oe, useCssVars as GE, openBlock as L, createBlock as Ue, Transition as ZE, withCtx as Cr, createElementBlock as $, createElementVNode as M, createCommentVNode as re, pushScopeId as st, popScopeId as at, Fragment as ie, createTextVNode as ae, toDisplayString as fe, onBeforeMount as jn, withDirectives as gn, vModelText as ri, ref as Bt, renderList as We, createVNode as yr, unref as et, Teleport as JE, resolveDynamicComponent as Nn, mergeProps as YE, normalizeClass as yo, vShow as dl, defineComponent as Ve, inject as Se, onMounted as Qe, readonly as QE, getCurrentScope as XE, onScopeDispose as ex, watchEffect as Sr, watch as Eo, getCurrentInstance as tx, resolveComponent as Ln, withModifiers as Er, shallowRef as hn, renderSlot as _b, provide as Ar, withKeys as al } from "vue"; +var KE = Object.defineProperty; +var GE = (h, y, _) => y in h ? KE(h, y, { enumerable: !0, configurable: !0, writable: !0, value: _ }) : h[y] = _; +var tb = (h, y, _) => GE(h, typeof y != "symbol" ? y + "" : y, _); +import { reactive as he, computed as oe, useCssVars as ZE, openBlock as L, createBlock as Ue, Transition as JE, withCtx as Cr, createElementBlock as $, createElementVNode as M, createCommentVNode as re, pushScopeId as st, popScopeId as at, Fragment as ie, createTextVNode as ae, toDisplayString as fe, onBeforeMount as jn, withDirectives as gn, vModelText as ri, ref as Bt, renderList as We, createVNode as yr, unref as et, Teleport as YE, resolveDynamicComponent as Nn, mergeProps as QE, normalizeClass as yo, vShow as dl, defineComponent as Ve, inject as Se, onMounted as Qe, readonly as XE, getCurrentScope as ex, onScopeDispose as tx, watchEffect as Sr, watch as Eo, getCurrentInstance as nx, resolveComponent as Ln, withModifiers as Er, shallowRef as en, renderSlot as _b, provide as Ar, withKeys as al } from "vue"; import { Request as ul } from "@viur/vue-utils"; import { defineStore as gl } from "pinia"; -import { ViURShopClient as nx } from "@viur/viur-shop-client"; +import { ViURShopClient as ox } from "@viur/viur-shop-client"; import "vue-router"; const we = (h, y) => { const _ = h.__vccOpts || h; @@ -41,7 +41,7 @@ const we = (h, y) => { return { state: _ }; } }, nb = () => { - GE((h) => ({ + ZE((h) => ({ "93747d92": h.state.outerSize, "284424e5": h.state.shadow, "6485ca5e": h.state.logoSize, @@ -51,25 +51,25 @@ const we = (h, y) => { })); }, ob = ml.setup; ml.setup = ob ? (h, y) => (nb(), ob(h, y)) : nb; -const ox = (h) => (st("data-v-46c45785"), h = h(), at(), h), ix = { +const ix = (h) => (st("data-v-46c45785"), h = h(), at(), h), rx = { key: 0, class: "loading" -}, rx = /* @__PURE__ */ ox(() => /* @__PURE__ */ M("sl-spinner", { class: "loader" }, null, -1)), sx = { class: "logo" }, ax = ["src"]; -function lx(h, y, _, O, S, F) { - return L(), Ue(ZE, null, { +}, sx = /* @__PURE__ */ ix(() => /* @__PURE__ */ M("sl-spinner", { class: "loader" }, null, -1)), ax = { class: "logo" }, lx = ["src"]; +function cx(h, y, _, O, S, F) { + return L(), Ue(JE, null, { default: Cr(() => [ - _.active ? (L(), $("div", ix, [ - rx, - M("div", sx, [ - M("sl-icon", { src: _.logo }, null, 8, ax) + _.active ? (L(), $("div", rx, [ + sx, + M("div", ax, [ + M("sl-icon", { src: _.logo }, null, 8, lx) ]) ])) : re("", !0) ]), _: 1 }); } -const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c45785"]]), ai = gl("cartstore", () => { - const h = new nx({ +const dx = /* @__PURE__ */ we(ml, [["render", cx], ["__scopeId", "data-v-46c45785"]]), ai = gl("cartstore", () => { + const h = new ox({ host_url: window.location.origin === "http://localhost:8081" ? "http://localhost:8080" : window.location.origin }), y = he({ basketRootNode: {}, @@ -132,7 +132,7 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 getAdressStructure: C, getChildren: O }; -}), dx = { +}), ux = { __name: "CartNode", props: { node: { type: Object, required: !0 } @@ -143,13 +143,13 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 M("pre", null, fe(h.node.name), 1) ], 64)); } -}, li = (h) => (st("data-v-0e24135f"), h = h(), at(), h), ux = { +}, li = (h) => (st("data-v-0e24135f"), h = h(), at(), h), hx = { horizontal: "", class: "viur-shop-cart-card" -}, hx = ["src"], gx = { +}, gx = ["src"], mx = { class: "viur-shop-cart-card-header", slot: "header" -}, mx = { class: "viur-shop-cart-card-headline headline" }, px = { class: "viur-shop-cart-card-body-row" }, fx = { class: "viur-shop-cart-card-body-info" }, bx = /* @__PURE__ */ li(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-card-descr" }, [ +}, px = { class: "viur-shop-cart-card-headline headline" }, fx = { class: "viur-shop-cart-card-body-row" }, bx = { class: "viur-shop-cart-card-body-info" }, kx = /* @__PURE__ */ li(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-card-descr" }, [ /* @__PURE__ */ ae(" Version: 900x900x2000 "), /* @__PURE__ */ M("br"), /* @__PURE__ */ ae(" Farbe: Chromoptik "), @@ -159,7 +159,7 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 /* @__PURE__ */ ae(" Anschlag: Beidseitig variabel"), /* @__PURE__ */ M("br"), /* @__PURE__ */ ae(" Griff: Stangengriff Exklusiv (56) ") -], -1)), kx = { class: "viur-shop-cart-card-body-footer" }, wx = /* @__PURE__ */ li(() => /* @__PURE__ */ M("sl-button", { +], -1)), wx = { class: "viur-shop-cart-card-body-footer" }, Ax = /* @__PURE__ */ li(() => /* @__PURE__ */ M("sl-button", { size: "small", outline: "", class: "viur-shop-cart-card-add-to-favourites-btn", @@ -170,15 +170,15 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 name: "heart", slot: "prefix" }) -], -1)), Ax = /* @__PURE__ */ li(() => /* @__PURE__ */ M("sl-icon", { +], -1)), _x = /* @__PURE__ */ li(() => /* @__PURE__ */ M("sl-icon", { name: "trash", slot: "prefix" -}, null, -1)), _x = [ - Ax -], vx = { class: "viur-shop-cart-card-body-amount" }, Cx = { +}, null, -1)), vx = [ + _x +], Cx = { class: "viur-shop-cart-card-body-amount" }, yx = { class: "viur-shop-cart-card-price-wrap", slot: "footer" -}, yx = /* @__PURE__ */ li(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-card-price-label" }, "Preis", -1)), Ex = { class: "viur-shop-cart-card-price" }, xx = /* @__PURE__ */ li(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-card-small-print" }, "Brutto / Stk.", -1)), Sx = { +}, Ex = /* @__PURE__ */ li(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-card-price-label" }, "Preis", -1)), xx = { class: "viur-shop-cart-card-price" }, Sx = /* @__PURE__ */ li(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-card-small-print" }, "Brutto / Stk.", -1)), Dx = { __name: "CartLeaf", props: { leaf: { type: Object, required: !0 }, @@ -207,20 +207,20 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 S.leaf = _.leaf; }), (m, C) => (L(), $(ie, null, [ ae(" cartleafe "), - M("sl-card", ux, [ + M("sl-card", hx, [ M("img", { class: "viur-shop-cart-card-img", slot: "image", src: F(S.leaf.shop_image ? S.leaf.shop_image : void 0) - }, null, 8, hx), - M("div", gx, [ - M("h4", mx, fe(S.leaf.shop_name) + " | " + fe(h.leaf.shop_art_no_or_gtin), 1) + }, null, 8, gx), + M("div", mx, [ + M("h4", px, fe(S.leaf.shop_name) + " | " + fe(h.leaf.shop_art_no_or_gtin), 1) ]), - M("div", px, [ - M("div", fx, [ - bx, - M("div", kx, [ - wx, + M("div", fx, [ + M("div", bx, [ + kx, + M("div", wx, [ + Ax, M("sl-button", { size: "small", outline: "", @@ -228,10 +228,10 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 variant: "primary", title: "Remove from cart", onClick: C[0] || (C[0] = (D) => x(S.leaf, S.leaf.article.dest.key, h.node)) - }, _x) + }, vx) ]) ]), - M("div", vx, [ + M("div", Cx, [ gn(M("sl-input", { class: "amount-input", type: "number", @@ -249,25 +249,25 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 [ri, S.leaf.quantity] ]) ]), - M("div", Cx, [ - yx, - M("div", Ex, fe(S.leaf.price.retail) + " € ", 1), - xx + M("div", yx, [ + Ex, + M("div", xx, fe(S.leaf.price.retail) + " € ", 1), + Sx ]) ]) ]) ], 64)); } -}, Dx = /* @__PURE__ */ we(Sx, [["__scopeId", "data-v-0e24135f"]]), jt = (h) => (st("data-v-7aae4815"), h = h(), at(), h), Bx = { key: 0 }, Tx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("p", null, "Möchten Sie den Artikel wirklich aus dem Warenkorb entfernen?", -1)), Ix = { +}, Bx = /* @__PURE__ */ we(Dx, [["__scopeId", "data-v-0e24135f"]]), jt = (h) => (st("data-v-7aae4815"), h = h(), at(), h), Tx = { key: 0 }, Ix = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("p", null, "Möchten Sie den Artikel wirklich aus dem Warenkorb entfernen?", -1)), Px = { class: "footer-wrap", slot: "footer" -}, Px = { key: 0 }, Rx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Zusammenfassung", -1)), Ox = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("br", null, null, -1)), zx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("sl-input", { label: "Rabattcode eingeben" }, null, -1)), Mx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("br", null, null, -1)), Fx = { class: "viur-shop-cart-sidebar-info-line" }, Nx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("span", null, "Zwischensumme", -1)), Vx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ +}, Rx = { key: 0 }, Ox = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Zusammenfassung", -1)), zx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("br", null, null, -1)), Mx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("sl-input", { label: "Rabattcode eingeben" }, null, -1)), Fx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("br", null, null, -1)), Nx = { class: "viur-shop-cart-sidebar-info-line" }, Vx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("span", null, "Zwischensumme", -1)), Lx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ /* @__PURE__ */ M("span", null, "Rabatt"), /* @__PURE__ */ ae(" 0 € ") -], -1)), Lx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ +], -1)), jx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ /* @__PURE__ */ M("span", null, "Versandkosten"), /* @__PURE__ */ ae(" 0 € ") -], -1)), jx = { class: "viur-shop-cart-sidebar-info-line total" }, $x = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("span", null, "Gesamt:", -1)), Hx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-btn-wrap" }, [ +], -1)), $x = { class: "viur-shop-cart-sidebar-info-line total" }, Hx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("span", null, "Gesamt:", -1)), qx = /* @__PURE__ */ jt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-btn-wrap" }, [ /* @__PURE__ */ M("sl-button", { variant: "info", size: "small" @@ -282,7 +282,7 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 }), /* @__PURE__ */ ae(" Paypal ") ]) -], -1)), qx = { +], -1)), Ux = { __name: "CartView", props: { mode: { type: String, default: "basket" }, @@ -336,8 +336,8 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 ref: O, onSlHide: m }, [ - Tx, - M("div", Ix, [ + Ix, + M("div", Px, [ M("sl-button", { variant: "danger", onClick: f[0] || (f[0] = (A) => O.value.hide()), @@ -352,8 +352,8 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 ], 544), (L(!0), $(ie, null, We(S.nodes, (A) => (L(), $("div", null, [ Object.keys(S.leaves).includes(A.key) ? (L(), $(ie, { key: 0 }, [ - yr(dx, { node: A }, null, 8, ["node"]), - (L(!0), $(ie, null, We(S.leaves[A.key], (P) => (L(), Ue(Dx, { + yr(ux, { node: A }, null, 8, ["node"]), + (L(!0), $(ie, null, We(S.leaves[A.key], (P) => (L(), Ue(Bx, { key: P.key, leaf: P, node: A, @@ -362,29 +362,29 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 }, null, 8, ["leaf", "node"]))), 128)) ], 64)) : re("", !0) ]))), 256)), - h.sidebar ? (L(), $("div", Px, [ - Rx, + h.sidebar ? (L(), $("div", Rx, [ Ox, zx, Mx, - M("div", Fx, [ - Nx, + Fx, + M("div", Nx, [ + Vx, ae(" --> " + fe(h.mode === "basket" ? et(_).state.basketRootNode.total : et(_).state.whishlistRootNodes[h.cartKey].total) + " € ", 1) ]), - Vx, Lx, - M("div", jx, [ - $x, + jx, + M("div", $x, [ + Hx, ae(" " + fe(h.mode === "basket" ? et(_).state.basketRootNode.total : et(_).state.whishlistRootNodes[h.cartKey].total) + " € ", 1) ]), - Hx + qx ])) : re("", !0) - ], 64)) : (L(), $("sl-spinner", Bx)); + ], 64)) : (L(), $("sl-spinner", Tx)); } -}, vb = /* @__PURE__ */ we(qx, [["__scopeId", "data-v-7aae4815"]]), mt = (h) => (st("data-v-75e70e9a"), h = h(), at(), h), Ux = { +}, vb = /* @__PURE__ */ we(Ux, [["__scopeId", "data-v-7aae4815"]]), mt = (h) => (st("data-v-75e70e9a"), h = h(), at(), h), Wx = { key: 1, class: "list" -}, Wx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-headline headline" }, "Bestellung prüfen", -1)), Kx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("br", null, null, -1)), Gx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-address-wrap" }, [ +}, Kx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-headline headline" }, "Bestellung prüfen", -1)), Gx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("br", null, null, -1)), Zx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-address-wrap" }, [ /* @__PURE__ */ M("div", { class: "viur-shop-cart-address" }, [ /* @__PURE__ */ M("div", { class: "viur-shop-cart-address-headline" }, [ /* @__PURE__ */ ae(" Versandadresse "), @@ -433,7 +433,7 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 /* @__PURE__ */ M("br"), /* @__PURE__ */ ae(" 0231 21 34 68 90 ") ]) -], -1)), Zx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-payment" }, [ +], -1)), Jx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-payment" }, [ /* @__PURE__ */ M("div", { class: "viur-shop-cart-payment-method" }, [ /* @__PURE__ */ M("span", null, "Zahlungsmethode:"), /* @__PURE__ */ ae(" Paypal ") @@ -447,22 +447,22 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 slot: "prefix" }) ]) -], -1)), Jx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-headline headline" }, "Warenkorb", -1)), Yx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("br", null, null, -1)), Qx = { +], -1)), Yx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-headline headline" }, "Warenkorb", -1)), Qx = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("br", null, null, -1)), Xx = { horizontal: "", class: "viur-shop-cart-mini-card" -}, Xx = ["src"], e5 = { +}, e5 = ["src"], t5 = { class: "viur-shop-cart-mini-cart-header", slot: "header" -}, t5 = { class: "viur-shop-cart-mini-headline headline" }, n5 = { class: "viur-shop-cart-mini-card-body-row" }, o5 = { class: "viur-shop-cart-mini-card-body-info" }, i5 = { class: "viur-shop-cart-mini-card-info-wrap" }, r5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-mini-card-info" }, [ +}, n5 = { class: "viur-shop-cart-mini-headline headline" }, o5 = { class: "viur-shop-cart-mini-card-body-row" }, i5 = { class: "viur-shop-cart-mini-card-body-info" }, r5 = { class: "viur-shop-cart-mini-card-info-wrap" }, s5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-mini-card-info" }, [ /* @__PURE__ */ M("span", null, "Anzahl: "), /* @__PURE__ */ ae(" 1 ") -], -1)), s5 = { class: "viur-shop-cart-mini-card-info" }, a5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("span", null, "Preis: ", -1)), l5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Jetzt Bestellen", -1)), c5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("br", null, null, -1)), d5 = { class: "viur-shop-cart-sidebar-info-line" }, u5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("span", null, "Zwischensumme", -1)), h5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ +], -1)), a5 = { class: "viur-shop-cart-mini-card-info" }, l5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("span", null, "Preis: ", -1)), c5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Jetzt Bestellen", -1)), d5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("br", null, null, -1)), u5 = { class: "viur-shop-cart-sidebar-info-line" }, h5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("span", null, "Zwischensumme", -1)), g5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ /* @__PURE__ */ M("span", null, "Rabatt"), /* @__PURE__ */ ae(" 0 € ") -], -1)), g5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ +], -1)), m5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("div", { class: "viur-shop-cart-sidebar-info-line" }, [ /* @__PURE__ */ M("span", null, "Versandkosten"), /* @__PURE__ */ ae(" 0 € ") -], -1)), m5 = { class: "viur-shop-cart-sidebar-info-line total" }, p5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("span", null, "Gesamt:", -1)), f5 = { class: "viur-shop-cart-sidebar-btn-wrap" }, b5 = ["variant", "disabled"], k5 = { +], -1)), p5 = { class: "viur-shop-cart-sidebar-info-line total" }, f5 = /* @__PURE__ */ mt(() => /* @__PURE__ */ M("span", null, "Gesamt:", -1)), b5 = { class: "viur-shop-cart-sidebar-btn-wrap" }, k5 = ["variant", "disabled"], w5 = { __name: "ConfirmView", setup(h) { const y = ai(), _ = he({ @@ -484,59 +484,59 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 } return jn(async () => { await y.init(); - }), (F, k) => _.cartIsInit ? (L(), $("div", Ux, [ - Wx, + }), (F, k) => _.cartIsInit ? (L(), $("div", Wx, [ Kx, Gx, Zx, Jx, Yx, - (L(!0), $(ie, null, We(et(y).state.carts[et(y).state.basket].items, (x) => (L(), $("sl-card", Qx, [ + Qx, + (L(!0), $(ie, null, We(et(y).state.carts[et(y).state.basket].items, (x) => (L(), $("sl-card", Xx, [ M("img", { class: "viur-shop-cart-mini-card-img", slot: "image", src: O(x.article.dest.key) - }, null, 8, Xx), - M("div", e5, [ - M("h4", t5, fe(x.article.dest.shop_name) + " | 425018", 1) + }, null, 8, e5), + M("div", t5, [ + M("h4", n5, fe(x.article.dest.shop_name) + " | 425018", 1) ]), - M("div", n5, [ - M("div", o5, [ - M("div", i5, [ - r5, - M("div", s5, [ - a5, + M("div", o5, [ + M("div", i5, [ + M("div", r5, [ + s5, + M("div", a5, [ + l5, ae(" " + fe(x.article.dest.shop_price_recommended) + " € ", 1) ]) ]) ]) ]) ]))), 256)), - (L(), Ue(JE, { to: "#order_sidebar" }, [ - l5, + (L(), Ue(YE, { to: "#order_sidebar" }, [ c5, - M("div", d5, [ - u5, + d5, + M("div", u5, [ + h5, ae(" " + fe(et(y).state.carts[et(y).state.basket].info.total) + " € ", 1) ]), - h5, g5, - M("div", m5, [ - p5, + m5, + M("div", p5, [ + f5, ae(" " + fe(et(y).state.carts[et(y).state.basket].info.total) + " € ", 1) ]), M("sl-checkbox", { onSlChange: S }, " Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen ", 32), - M("div", f5, [ + M("div", b5, [ M("sl-button", { variant: _.showOrderButton ? "info" : "disabled", size: "small", disabled: !_.showOrderButton - }, " Zahlungspflichtig bestellen ", 8, b5) + }, " Zahlungspflichtig bestellen ", 8, k5) ]) ])) - ])) : (L(), Ue(cx, { key: 0 })); + ])) : (L(), Ue(dx, { key: 0 })); } -}, w5 = /* @__PURE__ */ we(k5, [["__scopeId", "data-v-75e70e9a"]]), A5 = (h) => (st("data-v-61488015"), h = h(), at(), h), _5 = { class: "bind viur-shop-wrap" }, v5 = ["panel", "disabled"], C5 = { class: "viur-shop-order-step" }, y5 = ["name", "library"], E5 = { class: "viur-shop-order-status-text" }, x5 = { +}, Cb = /* @__PURE__ */ we(w5, [["__scopeId", "data-v-75e70e9a"]]), A5 = (h) => (st("data-v-61488015"), h = h(), at(), h), _5 = { class: "bind viur-shop-wrap" }, v5 = ["panel", "disabled"], C5 = { class: "viur-shop-order-step" }, y5 = ["name", "library"], E5 = { class: "viur-shop-order-status-text" }, x5 = { key: 0, name: "chevron-right", class: "viur-shop-order-tab-check" @@ -601,7 +601,7 @@ const cx = /* @__PURE__ */ we(ml, [["render", lx], ["__scopeId", "data-v-46c4578 name: f, key: f }, [ - (L(), Ue(Nn(h.tabs[f].component), YE({ ref_for: !0 }, h.tabs[f].props ? h.tabs[f].props : ""), null, 16)), + (L(), Ue(Nn(h.tabs[f].component), QE({ ref_for: !0 }, h.tabs[f].props ? h.tabs[f].props : ""), null, 16)), A !== S.tabNames.length - 1 ? (L(), $("div", { key: 0, class: yo(["viur-shop-form-footer", { "flex-end": S.isFirstTab(A) }]) @@ -718,7 +718,7 @@ function G5(h, y, _, O, S, F) { } const ib = /* @__PURE__ */ we(W5, [["render", G5], ["__scopeId", "data-v-b45a1311"]]); function Z5(h) { - return XE() ? (ex(h), !0) : !1; + return ex() ? (tx(h), !0) : !1; } function J5(h) { return typeof h == "function" ? h() : et(h); @@ -742,7 +742,7 @@ function Br(h, y, _ = {}) { }, J5(y)); } return O && (S.value = !0, Y5 && m()), Z5(x), { - isPending: QE(S), + isPending: XE(S), start: m, stop: x }; @@ -1154,7 +1154,7 @@ const db = /* @__PURE__ */ we(pS, [["render", AS], ["__scopeId", "data-v-0ccf18c y.emit("change", x); } Qe(() => { - tx().appContext.components.Bone ? O.globalRegistration = !0 : O.globalRegistration = !1, y.emit("change", h.name, h.value, h.lang, h.index); + nx().appContext.components.Bone ? O.globalRegistration = !0 : O.globalRegistration = !1, y.emit("change", h.name, h.value, h.lang, h.index); }); function F(x) { console.log(x); @@ -1210,7 +1210,7 @@ function ES(h, y, _, O, S, F) { ])), 128)) ])) : (L(), $("sl-alert", vS, " In Order to use this Bone register the bone component globally in your main file ")); } -const Cb = /* @__PURE__ */ we(_S, [["render", ES], ["__scopeId", "data-v-e6fcfbca"]]), xS = Ve({ +const yb = /* @__PURE__ */ we(_S, [["render", ES], ["__scopeId", "data-v-e6fcfbca"]]), xS = Ve({ inheritAttrs: !1, props: { name: String, @@ -1218,7 +1218,7 @@ const Cb = /* @__PURE__ */ we(_S, [["render", ES], ["__scopeId", "data-v-e6fcfbc index: Number, lang: String }, - components: { Wrapper_nested: Cb }, + components: { Wrapper_nested: yb }, emits: ["change"], setup(h, y) { const _ = Se("boneState"), O = he({ @@ -1630,7 +1630,7 @@ const VS = Ve({ index: Number, lang: String }, - components: { Wrapper_nested: Cb }, + components: { Wrapper_nested: yb }, emits: ["change"], setup(h, y) { const _ = Se("boneState"), O = Se("formatString"), S = he({ @@ -9205,8 +9205,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } function P(Y, ne) { for (var T = {}, ee = [], Te = 0; Te < Y.length; Te++) { - var Me = Y[Te], Le = ne.base ? Me[0] + ne.base : Me[0], en = T[Le] || 0, Tt = "".concat(Le, " ").concat(en); - T[Le] = en + 1; + var Me = Y[Te], Le = ne.base ? Me[0] + ne.base : Me[0], tn = T[Le] || 0, Tt = "".concat(Le, " ").concat(tn); + T[Le] = tn + 1; var It = A(Tt), Hn = { css: Me[1], media: Me[2], sourceMap: Me[3] }; It !== -1 ? (f[It].references++, f[It].updater(Hn)) : f.push({ identifier: Tt, updater: se(Hn, ne), references: 1 }), ee.push(Tt); } @@ -9277,8 +9277,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho var Me = A(T[Te]); f[Me].references--; } - for (var Le = P(ee, ne), en = 0; en < T.length; en++) { - var Tt = A(T[en]); + for (var Le = P(ee, ne), tn = 0; tn < T.length; tn++) { + var Tt = A(T[tn]); f[Tt].references === 0 && (f[Tt].updater(), f.splice(Tt, 1)); } T = Le; @@ -9478,7 +9478,7 @@ Read more: ${ne}#error-${o}`; const t = Te(o); return e ? [o, e, t] : [o, t]; } - const Le = "38.0.1", en = new Date(2023, 4, 23), Tt = typeof window == "object" ? window : S.g; + const Le = "38.0.1", tn = new Date(2023, 4, 23), Tt = typeof window == "object" ? window : S.g; if (Tt.CKEDITOR_VERSION) throw new T("ckeditor-duplicated-modules", null); Tt.CKEDITOR_VERSION = Le; const It = Symbol("listeningTo"), Hn = Symbol("emitterId"), $t = Symbol("delegations"), kl = _e(Object); @@ -9645,7 +9645,7 @@ Read more: ${ne}#error-${o}`; return e.forEach((i) => { const r = { property: i, to: [] }; t.set(i, r), n.set(i, r); - }), { to: Sb, toMany: Db, _observable: this, _bindProperties: e, _to: [], _bindings: n }; + }), { to: Db, toMany: Bb, _observable: this, _bindProperties: e, _to: [], _bindings: n }; } unbind(...e) { if (!this[di]) return; @@ -9685,7 +9685,7 @@ Read more: ${ne}#error-${o}`; function Or(o) { o[di] || (Object.defineProperty(o, di, { value: /* @__PURE__ */ new Map() }), Object.defineProperty(o, ui, { value: /* @__PURE__ */ new Map() }), Object.defineProperty(o, hi, { value: /* @__PURE__ */ new Map() })); } - function Sb(...o) { + function Db(...o) { const e = function(...r) { if (!r.length) throw new T("observable-bind-to-parse-error", null); const s = { to: [] }; @@ -9726,7 +9726,7 @@ Read more: ${ne}#error-${o}`; xl(this._observable, r); }); } - function Db(o, e, t) { + function Bb(o, e, t) { if (this._bindings.size > 1) throw new T("observable-bind-to-many-not-one-binding", this); this.to(...function(n, i) { const r = n.map((s) => [s, i]); @@ -9771,30 +9771,30 @@ Read more: ${ne}#error-${o}`; return !(!o || !o[Symbol.iterator]); } const Dl = typeof vr == "object" && vr && vr.Object === Object && vr; - var Bb = typeof self == "object" && self && self.Object === Object && self; - const Et = Dl || Bb || Function("return this")(), Pt = Et.Symbol; - var Bl = Object.prototype, Tb = Bl.hasOwnProperty, Ib = Bl.toString, xo = Pt ? Pt.toStringTag : void 0; - const Pb = function(o) { - var e = Tb.call(o, xo), t = o[xo]; + var Tb = typeof self == "object" && self && self.Object === Object && self; + const Et = Dl || Tb || Function("return this")(), Pt = Et.Symbol; + var Bl = Object.prototype, Ib = Bl.hasOwnProperty, Pb = Bl.toString, xo = Pt ? Pt.toStringTag : void 0; + const Rb = function(o) { + var e = Ib.call(o, xo), t = o[xo]; try { o[xo] = void 0; var n = !0; } catch { } - var i = Ib.call(o); + var i = Pb.call(o); return n && (e ? o[xo] = t : delete o[xo]), i; }; - var Rb = Object.prototype.toString; - const Ob = function(o) { - return Rb.call(o); + var Ob = Object.prototype.toString; + const zb = function(o) { + return Ob.call(o); }; var Tl = Pt ? Pt.toStringTag : void 0; - const tn = function(o) { - return o == null ? o === void 0 ? "[object Undefined]" : "[object Null]" : Tl && Tl in Object(o) ? Pb(o) : Ob(o); + const nn = function(o) { + return o == null ? o === void 0 ? "[object Undefined]" : "[object Null]" : Tl && Tl in Object(o) ? Rb(o) : zb(o); }, rt = Array.isArray, _t = function(o) { return o != null && typeof o == "object"; }, Il = function(o) { - return typeof o == "string" || !rt(o) && _t(o) && tn(o) == "[object String]"; + return typeof o == "string" || !rt(o) && _t(o) && nn(o) == "[object String]"; }; function Mr(o, e, t = {}, n = []) { const i = t && t.xmlns, r = i ? o.createElementNS(i, e) : o.createElement(e); @@ -9808,14 +9808,14 @@ Read more: ${ne}#error-${o}`; return o(e(t)); }; }, Fr = Pl(Object.getPrototypeOf, Object); - var zb = Function.prototype, Mb = Object.prototype, Rl = zb.toString, Fb = Mb.hasOwnProperty, Nb = Rl.call(Object); + var Mb = Function.prototype, Fb = Object.prototype, Rl = Mb.toString, Nb = Fb.hasOwnProperty, Vb = Rl.call(Object); const lt = function(o) { - if (!_t(o) || tn(o) != "[object Object]") return !1; + if (!_t(o) || nn(o) != "[object Object]") return !1; var e = Fr(o); if (e === null) return !0; - var t = Fb.call(e, "constructor") && e.constructor; - return typeof t == "function" && t instanceof t && Rl.call(t) == Nb; - }, Vb = function() { + var t = Nb.call(e, "constructor") && e.constructor; + return typeof t == "function" && t instanceof t && Rl.call(t) == Vb; + }, Lb = function() { this.__data__ = [], this.size = 0; }, So = function(o, e) { return o === e || o != o && e != e; @@ -9823,16 +9823,16 @@ Read more: ${ne}#error-${o}`; for (var t = o.length; t--; ) if (So(o[t][0], e)) return t; return -1; }; - var Lb = Array.prototype.splice; - const jb = function(o) { + var jb = Array.prototype.splice; + const $b = function(o) { var e = this.__data__, t = gi(e, o); - return !(t < 0) && (t == e.length - 1 ? e.pop() : Lb.call(e, t, 1), --this.size, !0); - }, $b = function(o) { + return !(t < 0) && (t == e.length - 1 ? e.pop() : jb.call(e, t, 1), --this.size, !0); + }, Hb = function(o) { var e = this.__data__, t = gi(e, o); return t < 0 ? void 0 : e[t][1]; - }, Hb = function(o) { + }, qb = function(o) { return gi(this.__data__, o) > -1; - }, qb = function(o, e) { + }, Ub = function(o, e) { var t = this.__data__, n = gi(t, o); return n < 0 ? (++this.size, t.push([o, e])) : t[n][1] = e, this; }; @@ -9843,33 +9843,33 @@ Read more: ${ne}#error-${o}`; this.set(n[0], n[1]); } } - Un.prototype.clear = Vb, Un.prototype.delete = jb, Un.prototype.get = $b, Un.prototype.has = Hb, Un.prototype.set = qb; - const mi = Un, Ub = function() { + Un.prototype.clear = Lb, Un.prototype.delete = $b, Un.prototype.get = Hb, Un.prototype.has = qb, Un.prototype.set = Ub; + const mi = Un, Wb = function() { this.__data__ = new mi(), this.size = 0; - }, Wb = function(o) { + }, Kb = function(o) { var e = this.__data__, t = e.delete(o); return this.size = e.size, t; - }, Kb = function(o) { - return this.__data__.get(o); }, Gb = function(o) { + return this.__data__.get(o); + }, Zb = function(o) { return this.__data__.has(o); }, mn = function(o) { if (!ze(o)) return !1; - var e = tn(o); + var e = nn(o); return e == "[object Function]" || e == "[object GeneratorFunction]" || e == "[object AsyncFunction]" || e == "[object Proxy]"; }, Nr = Et["__core-js_shared__"]; var Ol = function() { var o = /[^.]+$/.exec(Nr && Nr.keys && Nr.keys.IE_PROTO || ""); return o ? "Symbol(src)_1." + o : ""; }(); - const Zb = function(o) { + const Jb = function(o) { return !!Ol && Ol in o; }; - var Jb = Function.prototype.toString; + var Yb = Function.prototype.toString; const pn = function(o) { if (o != null) { try { - return Jb.call(o); + return Yb.call(o); } catch { } try { @@ -9879,34 +9879,34 @@ Read more: ${ne}#error-${o}`; } return ""; }; - var Yb = /^\[object .+?Constructor\]$/, Qb = Function.prototype, Xb = Object.prototype, ek = Qb.toString, tk = Xb.hasOwnProperty, nk = RegExp("^" + ek.call(tk).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); - const ok = function(o) { - return !(!ze(o) || Zb(o)) && (mn(o) ? nk : Yb).test(pn(o)); - }, ik = function(o, e) { + var Qb = /^\[object .+?Constructor\]$/, Xb = Function.prototype, ek = Object.prototype, tk = Xb.toString, nk = ek.hasOwnProperty, ok = RegExp("^" + tk.call(nk).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); + const ik = function(o) { + return !(!ze(o) || Jb(o)) && (mn(o) ? ok : Qb).test(pn(o)); + }, rk = function(o, e) { return o == null ? void 0 : o[e]; }, fn = function(o, e) { - var t = ik(o, e); - return ok(t) ? t : void 0; - }, Do = fn(Et, "Map"), Bo = fn(Object, "create"), rk = function() { + var t = rk(o, e); + return ik(t) ? t : void 0; + }, Do = fn(Et, "Map"), Bo = fn(Object, "create"), sk = function() { this.__data__ = Bo ? Bo(null) : {}, this.size = 0; - }, sk = function(o) { + }, ak = function(o) { var e = this.has(o) && delete this.__data__[o]; return this.size -= e ? 1 : 0, e; }; - var ak = Object.prototype.hasOwnProperty; - const lk = function(o) { + var lk = Object.prototype.hasOwnProperty; + const ck = function(o) { var e = this.__data__; if (Bo) { var t = e[o]; return t === "__lodash_hash_undefined__" ? void 0 : t; } - return ak.call(e, o) ? e[o] : void 0; + return lk.call(e, o) ? e[o] : void 0; }; - var ck = Object.prototype.hasOwnProperty; - const dk = function(o) { + var dk = Object.prototype.hasOwnProperty; + const uk = function(o) { var e = this.__data__; - return Bo ? e[o] !== void 0 : ck.call(e, o); - }, uk = function(o, e) { + return Bo ? e[o] !== void 0 : dk.call(e, o); + }, hk = function(o, e) { var t = this.__data__; return this.size += this.has(o) ? 0 : 1, t[o] = Bo && e === void 0 ? "__lodash_hash_undefined__" : e, this; }; @@ -9917,23 +9917,23 @@ Read more: ${ne}#error-${o}`; this.set(n[0], n[1]); } } - Wn.prototype.clear = rk, Wn.prototype.delete = sk, Wn.prototype.get = lk, Wn.prototype.has = dk, Wn.prototype.set = uk; - const zl = Wn, hk = function() { + Wn.prototype.clear = sk, Wn.prototype.delete = ak, Wn.prototype.get = ck, Wn.prototype.has = uk, Wn.prototype.set = hk; + const zl = Wn, gk = function() { this.size = 0, this.__data__ = { hash: new zl(), map: new (Do || mi)(), string: new zl() }; - }, gk = function(o) { + }, mk = function(o) { var e = typeof o; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? o !== "__proto__" : o === null; }, pi = function(o, e) { var t = o.__data__; - return gk(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map; - }, mk = function(o) { + return mk(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map; + }, pk = function(o) { var e = pi(this, o).delete(o); return this.size -= e ? 1 : 0, e; - }, pk = function(o) { - return pi(this, o).get(o); }, fk = function(o) { + return pi(this, o).get(o); + }, bk = function(o) { return pi(this, o).has(o); - }, bk = function(o, e) { + }, kk = function(o, e) { var t = pi(this, o), n = t.size; return t.set(o, e), this.size += t.size == n ? 0 : 1, this; }; @@ -9944,8 +9944,8 @@ Read more: ${ne}#error-${o}`; this.set(n[0], n[1]); } } - Kn.prototype.clear = hk, Kn.prototype.delete = mk, Kn.prototype.get = pk, Kn.prototype.has = fk, Kn.prototype.set = bk; - const fi = Kn, kk = function(o, e) { + Kn.prototype.clear = gk, Kn.prototype.delete = pk, Kn.prototype.get = fk, Kn.prototype.has = bk, Kn.prototype.set = kk; + const fi = Kn, wk = function(o, e) { var t = this.__data__; if (t instanceof mi) { var n = t.__data__; @@ -9958,8 +9958,8 @@ Read more: ${ne}#error-${o}`; var e = this.__data__ = new mi(o); this.size = e.size; } - Gn.prototype.clear = Ub, Gn.prototype.delete = Wb, Gn.prototype.get = Kb, Gn.prototype.has = Gb, Gn.prototype.set = kk; - const To = Gn, wk = function(o, e) { + Gn.prototype.clear = Wb, Gn.prototype.delete = Kb, Gn.prototype.get = Gb, Gn.prototype.has = Zb, Gn.prototype.set = wk; + const To = Gn, Ak = function(o, e) { for (var t = -1, n = o == null ? 0 : o.length; ++t < n && e(o[t], t, o) !== !1; ) ; return o; }, bi = function() { @@ -9971,10 +9971,10 @@ Read more: ${ne}#error-${o}`; }(), Vr = function(o, e, t) { e == "__proto__" && bi ? bi(o, e, { configurable: !0, enumerable: !0, value: t, writable: !0 }) : o[e] = t; }; - var Ak = Object.prototype.hasOwnProperty; + var _k = Object.prototype.hasOwnProperty; const Lr = function(o, e, t) { var n = o[e]; - Ak.call(o, e) && So(n, t) && (t !== void 0 || e in o) || Vr(o, e, t); + _k.call(o, e) && So(n, t) && (t !== void 0 || e in o) || Vr(o, e, t); }, Zn = function(o, e, t, n) { var i = !t; t || (t = {}); @@ -9983,33 +9983,33 @@ Read more: ${ne}#error-${o}`; l === void 0 && (l = o[a]), i ? Vr(t, a, l) : Lr(t, a, l); } return t; - }, _k = function(o, e) { + }, vk = function(o, e) { for (var t = -1, n = Array(o); ++t < o; ) n[t] = e(t); return n; }, Ml = function(o) { - return _t(o) && tn(o) == "[object Arguments]"; + return _t(o) && nn(o) == "[object Arguments]"; }; - var Fl = Object.prototype, vk = Fl.hasOwnProperty, Ck = Fl.propertyIsEnumerable; + var Fl = Object.prototype, Ck = Fl.hasOwnProperty, yk = Fl.propertyIsEnumerable; const jr = Ml(/* @__PURE__ */ function() { return arguments; }()) ? Ml : function(o) { - return _t(o) && vk.call(o, "callee") && !Ck.call(o, "callee"); - }, yk = function() { + return _t(o) && Ck.call(o, "callee") && !yk.call(o, "callee"); + }, Ek = function() { return !1; }; var Nl = y && !y.nodeType && y, Vl = Nl && !0 && h && !h.nodeType && h, Ll = Vl && Vl.exports === Nl ? Et.Buffer : void 0; - const Io = (Ll ? Ll.isBuffer : void 0) || yk; - var Ek = /^(?:0|[1-9]\d*)$/; + const Io = (Ll ? Ll.isBuffer : void 0) || Ek; + var xk = /^(?:0|[1-9]\d*)$/; const $r = function(o, e) { var t = typeof o; - return !!(e = e ?? 9007199254740991) && (t == "number" || t != "symbol" && Ek.test(o)) && o > -1 && o % 1 == 0 && o < e; + return !!(e = e ?? 9007199254740991) && (t == "number" || t != "symbol" && xk.test(o)) && o > -1 && o % 1 == 0 && o < e; }, jl = function(o) { return typeof o == "number" && o > -1 && o % 1 == 0 && o <= 9007199254740991; }; var Re = {}; Re["[object Float32Array]"] = Re["[object Float64Array]"] = Re["[object Int8Array]"] = Re["[object Int16Array]"] = Re["[object Int32Array]"] = Re["[object Uint8Array]"] = Re["[object Uint8ClampedArray]"] = Re["[object Uint16Array]"] = Re["[object Uint32Array]"] = !0, Re["[object Arguments]"] = Re["[object Array]"] = Re["[object ArrayBuffer]"] = Re["[object Boolean]"] = Re["[object DataView]"] = Re["[object Date]"] = Re["[object Error]"] = Re["[object Function]"] = Re["[object Map]"] = Re["[object Number]"] = Re["[object Object]"] = Re["[object RegExp]"] = Re["[object Set]"] = Re["[object String]"] = Re["[object WeakMap]"] = !1; - const xk = function(o) { - return _t(o) && jl(o.length) && !!Re[tn(o)]; + const Sk = function(o) { + return _t(o) && jl(o.length) && !!Re[nn(o)]; }, Hr = function(o) { return function(e) { return o(e); @@ -10024,44 +10024,44 @@ Read more: ${ne}#error-${o}`; } }(); var Hl = Jn && Jn.isTypedArray; - const Ur = Hl ? Hr(Hl) : xk; - var Sk = Object.prototype.hasOwnProperty; + const Ur = Hl ? Hr(Hl) : Sk; + var Dk = Object.prototype.hasOwnProperty; const ql = function(o, e) { - var t = rt(o), n = !t && jr(o), i = !t && !n && Io(o), r = !t && !n && !i && Ur(o), s = t || n || i || r, a = s ? _k(o.length, String) : [], l = a.length; - for (var c in o) !e && !Sk.call(o, c) || s && (c == "length" || i && (c == "offset" || c == "parent") || r && (c == "buffer" || c == "byteLength" || c == "byteOffset") || $r(c, l)) || a.push(c); + var t = rt(o), n = !t && jr(o), i = !t && !n && Io(o), r = !t && !n && !i && Ur(o), s = t || n || i || r, a = s ? vk(o.length, String) : [], l = a.length; + for (var c in o) !e && !Dk.call(o, c) || s && (c == "length" || i && (c == "offset" || c == "parent") || r && (c == "buffer" || c == "byteLength" || c == "byteOffset") || $r(c, l)) || a.push(c); return a; }; - var Dk = Object.prototype; + var Bk = Object.prototype; const Wr = function(o) { var e = o && o.constructor; - return o === (typeof e == "function" && e.prototype || Dk); - }, Bk = Pl(Object.keys, Object); - var Tk = Object.prototype.hasOwnProperty; - const Ik = function(o) { - if (!Wr(o)) return Bk(o); + return o === (typeof e == "function" && e.prototype || Bk); + }, Tk = Pl(Object.keys, Object); + var Ik = Object.prototype.hasOwnProperty; + const Pk = function(o) { + if (!Wr(o)) return Tk(o); var e = []; - for (var t in Object(o)) Tk.call(o, t) && t != "constructor" && e.push(t); + for (var t in Object(o)) Ik.call(o, t) && t != "constructor" && e.push(t); return e; }, ki = function(o) { return o != null && jl(o.length) && !mn(o); }, Kr = function(o) { - return ki(o) ? ql(o) : Ik(o); - }, Pk = function(o, e) { + return ki(o) ? ql(o) : Pk(o); + }, Rk = function(o, e) { return o && Zn(e, Kr(e), o); - }, Rk = function(o) { + }, Ok = function(o) { var e = []; if (o != null) for (var t in Object(o)) e.push(t); return e; }; - var Ok = Object.prototype.hasOwnProperty; - const zk = function(o) { - if (!ze(o)) return Rk(o); + var zk = Object.prototype.hasOwnProperty; + const Mk = function(o) { + if (!ze(o)) return Ok(o); var e = Wr(o), t = []; - for (var n in o) (n != "constructor" || !e && Ok.call(o, n)) && t.push(n); + for (var n in o) (n != "constructor" || !e && zk.call(o, n)) && t.push(n); return t; }, Yn = function(o) { - return ki(o) ? ql(o, !0) : zk(o); - }, Mk = function(o, e) { + return ki(o) ? ql(o, !0) : Mk(o); + }, Fk = function(o, e) { return o && Zn(e, Yn(e), o); }; var Ul = y && !y.nodeType && y, Wl = Ul && !0 && h && !h.nodeType && h, Kl = Wl && Wl.exports === Ul ? Et.Buffer : void 0, Gl = Kl ? Kl.allocUnsafe : void 0; @@ -10073,7 +10073,7 @@ Read more: ${ne}#error-${o}`; var t = -1, n = o.length; for (e || (e = Array(n)); ++t < n; ) e[t] = o[t]; return e; - }, Fk = function(o, e) { + }, Nk = function(o, e) { for (var t = -1, n = o == null ? 0 : o.length, i = 0, r = []; ++t < n; ) { var s = o[t]; e(s, t, o) && (r[i++] = s); @@ -10082,12 +10082,12 @@ Read more: ${ne}#error-${o}`; }, Jl = function() { return []; }; - var Nk = Object.prototype.propertyIsEnumerable, Yl = Object.getOwnPropertySymbols; + var Vk = Object.prototype.propertyIsEnumerable, Yl = Object.getOwnPropertySymbols; const Zr = Yl ? function(o) { - return o == null ? [] : (o = Object(o), Fk(Yl(o), function(e) { - return Nk.call(o, e); + return o == null ? [] : (o = Object(o), Nk(Yl(o), function(e) { + return Vk.call(o, e); })); - } : Jl, Vk = function(o, e) { + } : Jl, Lk = function(o, e) { return Zn(o, Zr(o), e); }, Ql = function(o, e) { for (var t = -1, n = e.length, i = o.length; ++t < n; ) o[i + t] = e[t]; @@ -10095,57 +10095,57 @@ Read more: ${ne}#error-${o}`; }, Xl = Object.getOwnPropertySymbols ? function(o) { for (var e = []; o; ) Ql(e, Zr(o)), o = Fr(o); return e; - } : Jl, Lk = function(o, e) { + } : Jl, jk = function(o, e) { return Zn(o, Xl(o), e); }, ec = function(o, e, t) { var n = e(o); return rt(o) ? n : Ql(n, t(o)); }, Jr = function(o) { return ec(o, Kr, Zr); - }, jk = function(o) { + }, $k = function(o) { return ec(o, Yn, Xl); }, Yr = fn(Et, "DataView"), Qr = fn(Et, "Promise"), Xr = fn(Et, "Set"), es = fn(Et, "WeakMap"); - var tc = "[object Map]", nc = "[object Promise]", oc = "[object Set]", ic = "[object WeakMap]", rc = "[object DataView]", $k = pn(Yr), Hk = pn(Do), qk = pn(Qr), Uk = pn(Xr), Wk = pn(es), bn = tn; + var tc = "[object Map]", nc = "[object Promise]", oc = "[object Set]", ic = "[object WeakMap]", rc = "[object DataView]", Hk = pn(Yr), qk = pn(Do), Uk = pn(Qr), Wk = pn(Xr), Kk = pn(es), bn = nn; (Yr && bn(new Yr(new ArrayBuffer(1))) != rc || Do && bn(new Do()) != tc || Qr && bn(Qr.resolve()) != nc || Xr && bn(new Xr()) != oc || es && bn(new es()) != ic) && (bn = function(o) { - var e = tn(o), t = e == "[object Object]" ? o.constructor : void 0, n = t ? pn(t) : ""; + var e = nn(o), t = e == "[object Object]" ? o.constructor : void 0, n = t ? pn(t) : ""; if (n) switch (n) { - case $k: - return rc; case Hk: - return tc; + return rc; case qk: - return nc; + return tc; case Uk: - return oc; + return nc; case Wk: + return oc; + case Kk: return ic; } return e; }); const Ro = bn; - var Kk = Object.prototype.hasOwnProperty; - const Gk = function(o) { + var Gk = Object.prototype.hasOwnProperty; + const Zk = function(o) { var e = o.length, t = new o.constructor(e); - return e && typeof o[0] == "string" && Kk.call(o, "index") && (t.index = o.index, t.input = o.input), t; + return e && typeof o[0] == "string" && Gk.call(o, "index") && (t.index = o.index, t.input = o.input), t; }, wi = Et.Uint8Array, ts = function(o) { var e = new o.constructor(o.byteLength); return new wi(e).set(new wi(o)), e; - }, Zk = function(o, e) { + }, Jk = function(o, e) { var t = e ? ts(o.buffer) : o.buffer; return new o.constructor(t, o.byteOffset, o.byteLength); }; - var Jk = /\w*$/; - const Yk = function(o) { - var e = new o.constructor(o.source, Jk.exec(o)); + var Yk = /\w*$/; + const Qk = function(o) { + var e = new o.constructor(o.source, Yk.exec(o)); return e.lastIndex = o.lastIndex, e; }; var sc = Pt ? Pt.prototype : void 0, ac = sc ? sc.valueOf : void 0; - const Qk = function(o) { + const Xk = function(o) { return ac ? Object(ac.call(o)) : {}; }, lc = function(o, e) { var t = e ? ts(o.buffer) : o.buffer; return new o.constructor(t, o.byteOffset, o.length); - }, Xk = function(o, e, t) { + }, ew = function(o, e, t) { var n = o.constructor; switch (e) { case "[object ArrayBuffer]": @@ -10154,7 +10154,7 @@ Read more: ${ne}#error-${o}`; case "[object Date]": return new n(+o); case "[object DataView]": - return Zk(o, t); + return Jk(o, t); case "[object Float32Array]": case "[object Float64Array]": case "[object Int8Array]": @@ -10172,13 +10172,13 @@ Read more: ${ne}#error-${o}`; case "[object String]": return new n(o); case "[object RegExp]": - return Yk(o); - case "[object Symbol]": return Qk(o); + case "[object Symbol]": + return Xk(o); } }; var cc = Object.create; - const ew = /* @__PURE__ */ function() { + const tw = /* @__PURE__ */ function() { function o() { } return function(e) { @@ -10189,16 +10189,16 @@ Read more: ${ne}#error-${o}`; return o.prototype = void 0, t; }; }(), dc = function(o) { - return typeof o.constructor != "function" || Wr(o) ? {} : ew(Fr(o)); - }, tw = function(o) { + return typeof o.constructor != "function" || Wr(o) ? {} : tw(Fr(o)); + }, nw = function(o) { return _t(o) && Ro(o) == "[object Map]"; }; var uc = Jn && Jn.isMap; - const nw = uc ? Hr(uc) : tw, ow = function(o) { + const ow = uc ? Hr(uc) : nw, iw = function(o) { return _t(o) && Ro(o) == "[object Set]"; }; var hc = Jn && Jn.isSet; - const iw = hc ? Hr(hc) : ow; + const rw = hc ? Hr(hc) : iw; var gc = "[object Arguments]", mc = "[object Function]", pc = "[object Object]", Ie = {}; Ie[gc] = Ie["[object Array]"] = Ie["[object ArrayBuffer]"] = Ie["[object DataView]"] = Ie["[object Boolean]"] = Ie["[object Date]"] = Ie["[object Float32Array]"] = Ie["[object Float64Array]"] = Ie["[object Int8Array]"] = Ie["[object Int16Array]"] = Ie["[object Int32Array]"] = Ie["[object Map]"] = Ie["[object Number]"] = Ie[pc] = Ie["[object RegExp]"] = Ie["[object Set]"] = Ie["[object String]"] = Ie["[object Symbol]"] = Ie["[object Uint8Array]"] = Ie["[object Uint8ClampedArray]"] = Ie["[object Uint16Array]"] = Ie["[object Uint32Array]"] = !0, Ie["[object Error]"] = Ie[mc] = Ie["[object WeakMap]"] = !1; const ns = function o(e, t, n, i, r, s) { @@ -10207,27 +10207,27 @@ Read more: ${ne}#error-${o}`; if (!ze(e)) return e; var u = rt(e); if (u) { - if (a = Gk(e), !l) return Gr(e, a); + if (a = Zk(e), !l) return Gr(e, a); } else { var g = Ro(e), p = g == mc || g == "[object GeneratorFunction]"; if (Io(e)) return Zl(e, l); if (g == pc || g == gc || p && !r) { - if (a = c || p ? {} : dc(e), !l) return c ? Lk(e, Mk(a, e)) : Vk(e, Pk(a, e)); + if (a = c || p ? {} : dc(e), !l) return c ? jk(e, Fk(a, e)) : Lk(e, Rk(a, e)); } else { if (!Ie[g]) return r ? e : {}; - a = Xk(e, g, l); + a = ew(e, g, l); } } s || (s = new To()); var b = s.get(e); if (b) return b; - s.set(e, a), iw(e) ? e.forEach(function(E) { + s.set(e, a), rw(e) ? e.forEach(function(E) { a.add(o(E, t, n, E, e, s)); - }) : nw(e) && e.forEach(function(E, I) { + }) : ow(e) && e.forEach(function(E, I) { a.set(I, o(E, t, n, I, e, s)); }); - var w = u ? void 0 : (d ? c ? jk : Jr : c ? Yn : Kr)(e); - return wk(w || e, function(E, I) { + var w = u ? void 0 : (d ? c ? $k : Jr : c ? Yn : Kr)(e); + return Ak(w || e, function(E, I) { w && (E = e[I = E]), Lr(a, I, o(E, t, n, I, e, s)); }), a; }, os = function(o, e) { @@ -10278,12 +10278,12 @@ Read more: ${ne}#error-${o}`; } } function bc(o) { - return os(o, rw); + return os(o, sw); } - function rw(o) { + function sw(o) { return Qn(o) ? o : void 0; } - function nn(o) { + function on(o) { if (o) { if (o.defaultView) return o instanceof o.defaultView.Document; if (o.ownerDocument && o.ownerDocument.defaultView) return o instanceof o.ownerDocument.defaultView.Node; @@ -10294,17 +10294,17 @@ Read more: ${ne}#error-${o}`; const e = Object.prototype.toString.apply(o); return e == "[object Window]" || e == "[object global]"; } - const kc = on(_e()); - function on(o) { + const kc = rn(_e()); + function rn(o) { return o ? class extends o { listenTo(e, t, n, i = {}) { - if (nn(e) || Ai(e)) { - const r = { capture: !!i.useCapture, passive: !!i.usePassive }, s = this._getProxyEmitter(e, r) || new sw(e, r); + if (on(e) || Ai(e)) { + const r = { capture: !!i.useCapture, passive: !!i.usePassive }, s = this._getProxyEmitter(e, r) || new aw(e, r); this.listenTo(s, t, n, i); } else super.listenTo(e, t, n, i); } stopListening(e, t, n) { - if (nn(e) || Ai(e)) { + if (on(e) || Ai(e)) { const i = this._getAllProxyEmitters(e); for (const r of i) this.stopListening(r, t, n); } else super.stopListening(e, t, n); @@ -10321,9 +10321,9 @@ Read more: ${ne}#error-${o}`; } : kc; } ["_getProxyEmitter", "_getAllProxyEmitters", "on", "once", "off", "listenTo", "stopListening", "fire", "delegate", "stopDelegating", "_addEventListener", "_removeEventListener"].forEach((o) => { - on[o] = kc.prototype[o]; + rn[o] = kc.prototype[o]; }); - class sw extends _e() { + class aw extends _e() { constructor(e, t) { super(), wl(this, wc(e, t)), this._domNode = e, this._options = t; } @@ -10501,7 +10501,7 @@ Read more: ${ne}#error-${o}`; } }; let Ci = Ke; - function aw(o, e) { + function lw(o, e) { o instanceof HTMLTextAreaElement && (o.value = e), o.innerHTML = e; } function rs(o) { @@ -10606,13 +10606,13 @@ Read more: ${ne}#error-${o}`; const e = o.parentNode; e && e.removeChild(o); } - function lw({ window: o, rect: e, alignToTop: t, forceScroll: n, viewportOffset: i }) { + function cw({ window: o, rect: e, alignToTop: t, forceScroll: n, viewportOffset: i }) { const r = e.clone().moveBy(0, i), s = e.clone().moveBy(0, -i), a = new Fe(o).excludeScrollbarsAndBorders(), l = t && n, c = [s, r].every((b) => a.contains(b)); let { scrollX: d, scrollY: u } = o; const g = d, p = u; l ? u -= a.top - e.top + i : c || (Pc(s, a) ? u -= a.top - e.top + i : Ic(r, a) && (u += t ? e.top - a.top - i : e.bottom - a.bottom + i)), c || (Rc(e, a) ? d -= a.left - e.left + i : Oc(e, a) && (d += e.right - a.right + i)), d == g && u === p || o.scrollTo(d, u); } - function cw({ parent: o, getRect: e, alignToTop: t, forceScroll: n, ancestorOffset: i = 0 }) { + function dw({ parent: o, getRect: e, alignToTop: t, forceScroll: n, ancestorOffset: i = 0 }) { const r = as(o), s = t && n; let a, l, c; for (; o != r.document.body; ) l = e(), a = new Fe(o).excludeScrollbarsAndBorders(), c = a.contains(l), s ? o.scrollTop -= a.top - l.top + i : c || (Pc(l, a) ? o.scrollTop -= a.top - l.top + i : Ic(l, a) && (o.scrollTop += t ? l.top - a.top - i : l.bottom - a.bottom + i)), c || (Rc(l, a) ? o.scrollLeft -= a.left - l.left + i : Oc(l, a) && (o.scrollLeft += l.right - a.right + i)), o = o.parentNode; @@ -10632,7 +10632,7 @@ Read more: ${ne}#error-${o}`; function as(o) { return _i(o) ? o.startContainer.ownerDocument.defaultView : o.ownerDocument.defaultView; } - function dw(o) { + function uw(o) { if (_i(o)) { let e = o.commonAncestorContainer; return je(e) && (e = e.parentNode), e; @@ -10651,7 +10651,7 @@ Read more: ${ne}#error-${o}`; } return n; } - const uw = { ctrl: "⌃", cmd: "⌘", alt: "⌥", shift: "⇧" }, hw = { ctrl: "Ctrl+", alt: "Alt+", shift: "Shift+" }, ge = function() { + const hw = { ctrl: "⌃", cmd: "⌘", alt: "⌥", shift: "⇧" }, gw = { ctrl: "Ctrl+", alt: "Alt+", shift: "Shift+" }, ge = function() { const o = { arrowleft: 37, arrowup: 38, arrowright: 39, arrowdown: 40, backspace: 8, delete: 46, enter: 13, space: 32, esc: 27, tab: 9, ctrl: 1114112, shift: 2228224, alt: 4456448, cmd: 8912896 }; for (let e = 65; e <= 90; e++) o[String.fromCharCode(e).toLowerCase()] = e; @@ -10659,7 +10659,7 @@ Read more: ${ne}#error-${o}`; for (let e = 112; e <= 123; e++) o["f" + (e - 111)] = e; for (const e of "`-=[];',./\\") o[e] = e.charCodeAt(0); return o; - }(), gw = Object.fromEntries(Object.entries(ge).map(([o, e]) => [e, o.charAt(0).toUpperCase() + o.slice(1)])); + }(), mw = Object.fromEntries(Object.entries(ge).map(([o, e]) => [e, o.charAt(0).toUpperCase() + o.slice(1)])); function eo(o) { let e; if (typeof o == "string") { @@ -10678,7 +10678,7 @@ Read more: ${ne}#error-${o}`; } function Mc(o) { let e = Ei(o); - return Object.entries(f.isMac ? uw : hw).reduce((t, [n, i]) => (e & ge[n] && (e &= ~ge[n], t += i), t), "") + (e ? gw[e] : ""); + return Object.entries(f.isMac ? hw : gw).reduce((t, [n, i]) => (e & ge[n] && (e &= ~ge[n], t += i), t), "") + (e ? mw[e] : ""); } function ls(o, e) { const t = e === "ltr"; @@ -10696,7 +10696,7 @@ Read more: ${ne}#error-${o}`; function $e(o) { return Array.isArray(o) ? o : [o]; } - function mw(o, e, t = 1) { + function pw(o, e, t = 1) { if (typeof t != "number") throw new T("translation-service-quantity-not-a-number", null, { quantity: t }); const n = Object.keys(ce.window.CKEDITOR_TRANSLATIONS).length; n === 1 && (o = Object.keys(ce.window.CKEDITOR_TRANSLATIONS)[0]); @@ -10708,11 +10708,11 @@ Read more: ${ne}#error-${o}`; return typeof a == "string" ? a : a[Number(s(t))]; } ce.window.CKEDITOR_TRANSLATIONS || (ce.window.CKEDITOR_TRANSLATIONS = {}); - const pw = ["ar", "ara", "fa", "per", "fas", "he", "heb", "ku", "kur", "ug", "uig"]; + const fw = ["ar", "ara", "fa", "per", "fas", "he", "heb", "ku", "kur", "ug", "uig"]; function Fc(o) { - return pw.includes(o) ? "rtl" : "ltr"; + return fw.includes(o) ? "rtl" : "ltr"; } - class fw { + class bw { constructor({ uiLanguage: e = "en", contentLanguage: t } = {}) { this.uiLanguage = e, this.contentLanguage = t || this.uiLanguage, this.uiLanguageDirection = Fc(this.uiLanguage), this.contentLanguageDirection = Fc(this.contentLanguage), this.t = (n, i) => this._t(n, i); } @@ -10724,7 +10724,7 @@ Read more: ${ne}#error-${o}`; const n = e.plural ? t[0] : 1; return function(i, r) { return i.replace(/%(\d+)/g, (s, a) => a < r.length ? r[a] : s); - }(mw(this.uiLanguage, e, n), t); + }(pw(this.uiLanguage, e, n), t); } } class vt extends _e() { @@ -10847,7 +10847,7 @@ Read more: ${ne}#error-${o}`; const e = o.next(); return e.done ? null : e.value; } - class xt extends on(ve()) { + class xt extends rn(ve()) { constructor() { super(), this._elements = /* @__PURE__ */ new Set(), this._nextEventLoopTimeout = null, this.set("isFocused", !1), this.set("focusedElement", null); } @@ -10872,7 +10872,7 @@ Read more: ${ne}#error-${o}`; } class Ht { constructor() { - this._listener = new (on())(); + this._listener = new (rn())(); } listenTo(e) { this._listener.listenTo(e, "keydown", (t, n) => { @@ -10923,12 +10923,12 @@ Read more: ${ne}#error-${o}`; return !!(t = o.charAt(e)) && t.length == 1 && /[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t); var t; } - const bw = function() { + const kw = function() { const o = [new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}", "u"), new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}", "u"), new RegExp("\\p{Emoji}\\u{FE0F}", "u"), new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*", "u")], e = new RegExp("\\p{Regional_Indicator}{2}", "u").source, t = "(?:" + o.map((n) => n.source).join("|") + ")"; return new RegExp(`${e}|${t}(?:‍${t})*`, "ug"); }(); function Nc(o, e) { - const t = String(o).matchAll(bw); + const t = String(o).matchAll(kw); return Array.from(t).some((n) => n.index < e && e < n.index + n[0].length); } class wn extends vt { @@ -10964,9 +10964,9 @@ Read more: ${ne}#error-${o}`; return super.remove(e); } } - var kw = S(6062), J = S.n(kw), Vc = S(4793), ww = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Vc.Z, ww), Vc.Z.locals; - class ue extends on(ve()) { + var ww = S(6062), J = S.n(ww), Vc = S(4793), Aw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Vc.Z, Aw), Vc.Z.locals; + class ue extends rn(ve()) { constructor(e) { super(), this.element = null, this.isRendered = !1, this.locale = e, this.t = e && e.t, this._viewCollections = new vt(), this._unboundChildren = this.createCollection(), this._viewCollections.on("add", (t, n) => { n.locale = e, n.t = e && e.t; @@ -11022,7 +11022,7 @@ Read more: ${ne}#error-${o}`; }(this); } static bind(e, t) { - return { to: (n, i) => new Aw({ eventNameOrFunction: n, attribute: n, observable: e, emitter: t, callback: i }), if: (n, i, r) => new Lc({ observable: e, emitter: t, attribute: n, valueIfTrue: i, callback: r }) }; + return { to: (n, i) => new _w({ eventNameOrFunction: n, attribute: n, observable: e, emitter: t, callback: i }), if: (n, i, r) => new Lc({ observable: e, emitter: t, attribute: n, valueIfTrue: i, callback: r }) }; } static extend(e, t) { if (e._isRendered) throw new T("template-extend-render", [this, e]); @@ -11039,7 +11039,7 @@ Read more: ${ne}#error-${o}`; } _renderText(e) { let t = e.node; - return t ? e.revertData.text = t.textContent : t = e.node = document.createTextNode(""), xi(this.text) ? this._bindToObservable({ schema: this.text, updater: _w(t), data: e }) : t.textContent = this.text.join(""), t; + return t ? e.revertData.text = t.textContent : t = e.node = document.createTextNode(""), xi(this.text) ? this._bindToObservable({ schema: this.text, updater: vw(t), data: e }) : t.textContent = this.text.join(""), t; } _renderAttributes(e) { if (!this.attributes) return; @@ -11050,7 +11050,7 @@ Read more: ${ne}#error-${o}`; const a = Gc(s) ? s[0].ns : null; if (xi(s)) { const l = Gc(s) ? s[0].value : s; - n && Zc(i) && l.unshift(r), this._bindToObservable({ schema: l, updater: vw(t, i, a), data: e }); + n && Zc(i) && l.unshift(r), this._bindToObservable({ schema: l, updater: Cw(t, i, a), data: e }); } else if (i == "style" && typeof s[0] != "string") this._renderStyleAttribute(s[0], e); else { n && r && Zc(i) && s.unshift(r); @@ -11063,7 +11063,7 @@ Read more: ${ne}#error-${o}`; const n = t.node; for (const i in e) { const r = e[i]; - xi(r) ? this._bindToObservable({ schema: [r], updater: Cw(n, i), data: t }) : n.style[i] = r; + xi(r) ? this._bindToObservable({ schema: [r], updater: yw(n, i), data: t }) : n.style[i] = r; } } _renderElementChildren(e) { @@ -11075,7 +11075,7 @@ Read more: ${ne}#error-${o}`; for (const a of s) n.appendChild(a.element); } } else if (Si(s)) i || (s.isRendered || s.render(), n.appendChild(s.element)); - else if (nn(s)) n.appendChild(s); + else if (on(s)) n.appendChild(s); else if (i) { const a = { children: [], bindings: [], attributes: {} }; e.revertData.children.push(a), s._renderNode({ intoFragment: !1, node: n.childNodes[r++], isApplying: !0, revertData: a }); @@ -11123,7 +11123,7 @@ Read more: ${ne}#error-${o}`; }; } } - class Aw extends Oo { + class _w extends Oo { constructor(e) { super(e), this.eventNameOrFunction = e.eventNameOrFunction; } @@ -11154,21 +11154,21 @@ Read more: ${ne}#error-${o}`; let i; i = o.length == 1 && o[0] instanceof Lc ? n[0] : n.reduce(Uc, ""), to(i) ? e.remove() : e.set(i); } - function _w(o) { + function vw(o) { return { set(e) { o.textContent = e; }, remove() { o.textContent = ""; } }; } - function vw(o, e, t) { + function Cw(o, e, t) { return { set(n) { o.setAttributeNS(t, e, n); }, remove() { o.removeAttributeNS(t, e); } }; } - function Cw(o, e) { + function yw(o, e) { return { set(t) { o.style[e] = t; }, remove() { @@ -11194,7 +11194,7 @@ Read more: ${ne}#error-${o}`; }(o.attributes); const e = []; if (o.children) if (gs(o.children)) e.push(o.children); - else for (const t of o.children) hs(t) || Si(t) || nn(t) ? e.push(t) : e.push(new Rt(t)); + else for (const t of o.children) hs(t) || Si(t) || on(t) ? e.push(t) : e.push(new Rt(t)); o.children = e; } return o; @@ -11233,7 +11233,7 @@ Read more: ${ne}#error-${o}`; function Zc(o) { return o == "class" || o == "style"; } - class yw extends wn { + class Ew extends wn { constructor(e, t = []) { super(t), this.locale = e; } @@ -11248,8 +11248,8 @@ Read more: ${ne}#error-${o}`; e && e.childElementCount == 0 && e.remove(); } } - var Jc = S(6574), Ew = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Jc.Z, Ew), Jc.Z.locals; + var Jc = S(6574), xw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Jc.Z, xw), Jc.Z.locals; const Yc = class extends ue { constructor() { super(); @@ -11280,8 +11280,8 @@ Read more: ${ne}#error-${o}`; }; let zo = Yc; zo.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"]; - var Qc = S(4906), xw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Qc.Z, xw), Qc.Z.locals; + var Qc = S(4906), Sw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Qc.Z, Sw), Qc.Z.locals; class De extends ue { constructor(e) { super(e), this._focusDelayed = null; @@ -11317,8 +11317,8 @@ Read more: ${ne}#error-${o}`; return e ? typeof e == "string" ? e : (n && (n = Mc(n)), e instanceof Function ? e(t, n) : `${t}${n ? ` (${n})` : ""}`) : ""; } } - var Xc = S(6758), Sw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Xc.Z, Sw), Xc.Z.locals; + var Xc = S(6758), Dw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Xc.Z, Dw), Xc.Z.locals; class Di extends De { constructor(e) { super(e), this.isToggleable = !0, this.toggleSwitchView = this._createToggleView(), this.extendTemplate({ attributes: { class: "ck-switchbutton" } }); @@ -11331,10 +11331,10 @@ Read more: ${ne}#error-${o}`; return e.setTemplate({ tag: "span", attributes: { class: ["ck", "ck-button__toggle"] }, children: [{ tag: "span", attributes: { class: ["ck", "ck-button__toggle__inner"] } }] }), e; } } - var ed = S(6781), Dw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(ed.Z, Dw), ed.Z.locals, S(1103), S(841); - var td = S(3662), Bw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(td.Z, Bw), td.Z.locals; + var ed = S(6781), Bw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(ed.Z, Bw), ed.Z.locals, S(1103), S(841); + var td = S(3662), Tw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(td.Z, Tw), td.Z.locals; class nd extends ue { constructor(e) { super(e), this.set("text", void 0), this.set("for", void 0), this.id = `ck-editor__label_${Q()}`; @@ -11342,8 +11342,8 @@ Read more: ${ne}#error-${o}`; this.setTemplate({ tag: "label", attributes: { class: ["ck", "ck-label"], id: this.id, for: t.to("for") }, children: [{ text: t.to("text") }] }); } } - var od = S(2577), Tw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(od.Z, Tw), od.Z.locals; + var od = S(2577), Iw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(od.Z, Iw), od.Z.locals; class id extends ue { constructor(e, t) { super(e); @@ -11364,9 +11364,9 @@ Read more: ${ne}#error-${o}`; this.fieldView.focus(); } } - var rd = S(4879), Iw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(rd.Z, Iw), rd.Z.locals; - class Pw extends ue { + var rd = S(4879), Pw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(rd.Z, Pw), rd.Z.locals; + class Rw extends ue { constructor(e) { super(e), this.set("value", void 0), this.set("id", void 0), this.set("placeholder", void 0), this.set("isReadOnly", !1), this.set("hasError", !1), this.set("ariaDescribedById", void 0), this.focusTracker = new xt(), this.bind("isFocused").to(this.focusTracker), this.set("isEmpty", !0), this.set("inputMode", "text"); const t = this.bindTemplate; @@ -11395,12 +11395,12 @@ Read more: ${ne}#error-${o}`; this.element.value = e || e === 0 ? e : ""; } } - class Rw extends Pw { + class Ow extends Rw { constructor(e) { super(e), this.extendTemplate({ attributes: { type: "text", class: ["ck-input-text"] } }); } } - class Ow extends ue { + class zw extends ue { constructor(e) { super(e); const t = this.bindTemplate; @@ -11421,8 +11421,8 @@ Read more: ${ne}#error-${o}`; } } } - var sd = S(5485), zw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(sd.Z, zw), sd.Z.locals; + var sd = S(5485), Mw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(sd.Z, Mw), sd.Z.locals; const ms = class extends ue { constructor(o, e, t) { super(o); @@ -11532,7 +11532,7 @@ Read more: ${ne}#error-${o}`; super(e), this.setTemplate({ tag: "span", attributes: { class: ["ck", "ck-toolbar__separator"] } }); } } - class Mw extends ue { + class Fw extends ue { constructor(e) { super(e), this.setTemplate({ tag: "span", attributes: { class: ["ck", "ck-toolbar__line-break"] } }); } @@ -11720,7 +11720,7 @@ Read more: ${ne}#error-${o}`; const t = this.constructor.builtinPlugins; this.config.define("plugins", t), this.plugins = new md(this, t); const n = this.config.get("language") || {}; - this.locale = new fw({ uiLanguage: typeof n == "string" ? n : n.ui, contentLanguage: this.config.get("language.content") }), this.t = this.locale.t, this.editors = new vt(); + this.locale = new bw({ uiLanguage: typeof n == "string" ? n : n.ui, contentLanguage: this.config.get("language.content") }), this.t = this.locale.t, this.editors = new vt(); } initPlugins() { const e = this.config.get("plugins") || [], t = this.config.get("substitutePlugins") || []; @@ -11763,7 +11763,7 @@ Read more: ${ne}#error-${o}`; return !0; } } - class Fw extends Ht { + class Nw extends Ht { constructor(e) { super(), this.editor = e; } @@ -11777,10 +11777,10 @@ Read more: ${ne}#error-${o}`; super.set(e, t, n); } } - var fd = S(4717), Nw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(fd.Z, Nw), fd.Z.locals; + var fd = S(4717), Vw = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(fd.Z, Vw), fd.Z.locals; const Ti = /* @__PURE__ */ new WeakMap(); - function Vw(o, e) { + function Lw(o, e) { return !!e.hasClass("ck-placeholder") && (o.removeClass("ck-placeholder", e), !0); } function bs(o, e) { @@ -11789,7 +11789,7 @@ Read more: ${ne}#error-${o}`; for (const [r, s] of t) s.isDirectHost && (n.push(r), bd(e, r, s) && (i = !0)); for (const [r, s] of t) { if (s.isDirectHost) continue; - const a = Lw(r); + const a = jw(r); a && (n.includes(a) || (s.hostElement = a, bd(e, r, s) && (i = !0))); } return i; @@ -11803,9 +11803,9 @@ Read more: ${ne}#error-${o}`; return !(c.isComposing && d && d.parent === a || !l && c.isFocused && (!d || d.parent === a)); }(r, t.keepOnFocus) ? function(a, l) { return !l.hasClass("ck-placeholder") && (a.addClass("ck-placeholder", l), !0); - }(o, r) && (s = !0) : Vw(o, r) && (s = !0), s; + }(o, r) && (s = !0) : Lw(o, r) && (s = !0), s; } - function Lw(o) { + function jw(o) { if (o.childCount) { const e = o.getChild(0); if (e.is("element") && !e.is("uiElement") && !e.is("attributeElement")) return e; @@ -12007,13 +12007,13 @@ Read more: ${ne}#error-${o}`; }), n.length && !(r.length < n.length)) return r; } const Ii = function(o) { - return typeof o == "symbol" || _t(o) && tn(o) == "[object Symbol]"; + return typeof o == "symbol" || _t(o) && nn(o) == "[object Symbol]"; }; - var jw = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, $w = /^\w*$/; - const Hw = function(o, e) { + var $w = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Hw = /^\w*$/; + const qw = function(o, e) { if (rt(o)) return !1; var t = typeof o; - return !(t != "number" && t != "symbol" && t != "boolean" && o != null && !Ii(o)) || $w.test(o) || !jw.test(o) || e != null && o in Object(e); + return !(t != "number" && t != "symbol" && t != "boolean" && o != null && !Ii(o)) || Hw.test(o) || !$w.test(o) || e != null && o in Object(e); }; function ws(o, e) { if (typeof o != "function" || e != null && typeof e != "function") throw new TypeError("Expected a function"); @@ -12026,34 +12026,34 @@ Read more: ${ne}#error-${o}`; return t.cache = new (ws.Cache || fi)(), t; } ws.Cache = fi; - const qw = ws, Uw = function(o) { - var e = qw(o, function(n) { + const Uw = ws, Ww = function(o) { + var e = Uw(o, function(n) { return t.size === 500 && t.clear(), n; }), t = e.cache; return e; }; - var Ww = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Kw = /\\(\\)?/g, Gw = Uw(function(o) { + var Kw = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Gw = /\\(\\)?/g, Zw = Ww(function(o) { var e = []; - return o.charCodeAt(0) === 46 && e.push(""), o.replace(Ww, function(t, n, i, r) { - e.push(i ? r.replace(Kw, "$1") : n || t); + return o.charCodeAt(0) === 46 && e.push(""), o.replace(Kw, function(t, n, i, r) { + e.push(i ? r.replace(Gw, "$1") : n || t); }), e; }); - const Zw = Gw, Jw = function(o, e) { + const Jw = Zw, Yw = function(o, e) { for (var t = -1, n = o == null ? 0 : o.length, i = Array(n); ++t < n; ) i[t] = e(o[t], t, o); return i; }; var Ad = Pt ? Pt.prototype : void 0, _d = Ad ? Ad.toString : void 0; - const Yw = function o(e) { + const Qw = function o(e) { if (typeof e == "string") return e; - if (rt(e)) return Jw(e, o) + ""; + if (rt(e)) return Yw(e, o) + ""; if (Ii(e)) return _d ? _d.call(e) : ""; var t = e + ""; return t == "0" && 1 / e == -1 / 0 ? "-0" : t; }, As = function(o) { - return o == null ? "" : Yw(o); + return o == null ? "" : Qw(o); }, _s = function(o, e) { - return rt(o) ? o : Hw(o, e) ? [o] : Zw(As(o)); - }, Qw = function(o) { + return rt(o) ? o : qw(o, e) ? [o] : Jw(As(o)); + }, Xw = function(o) { var e = o == null ? 0 : o.length; return e ? o[e - 1] : void 0; }, vs = function(o) { @@ -12068,18 +12068,18 @@ Read more: ${ne}#error-${o}`; e < 0 && (e = -e > i ? 0 : i + e), (t = t > i ? i : t) < 0 && (t += i), i = e > t ? 0 : t - e >>> 0, e >>>= 0; for (var r = Array(i); ++n < i; ) r[n] = o[n + e]; return r; - }, Xw = function(o, e) { - return e.length < 2 ? o : vd(o, Cd(e, 0, -1)); }, eA = function(o, e) { - return e = _s(e, o), (o = Xw(o, e)) == null || delete o[vs(Qw(e))]; + return e.length < 2 ? o : vd(o, Cd(e, 0, -1)); }, tA = function(o, e) { - return o == null || eA(o, e); + return e = _s(e, o), (o = eA(o, e)) == null || delete o[vs(Xw(e))]; + }, nA = function(o, e) { + return o == null || tA(o, e); }, Pi = function(o, e, t) { var n = o == null ? void 0 : vd(o, e); return n === void 0 ? t : n; }, Cs = function(o, e, t) { (t !== void 0 && !So(o[e], t) || t === void 0 && !(e in o)) && Vr(o, e, t); - }, nA = /* @__PURE__ */ function(o) { + }, oA = /* @__PURE__ */ function(o) { return function(e, t, n) { for (var i = -1, r = Object(e), s = n(e), a = s.length; a--; ) { var l = s[++i]; @@ -12087,26 +12087,26 @@ Read more: ${ne}#error-${o}`; } return e; }; - }(), oA = function(o) { + }(), iA = function(o) { return _t(o) && ki(o); }, ys = function(o, e) { if ((e !== "constructor" || typeof o[e] != "function") && e != "__proto__") return o[e]; - }, iA = function(o) { + }, rA = function(o) { return Zn(o, Yn(o)); - }, rA = function(o, e, t, n, i, r, s) { + }, sA = function(o, e, t, n, i, r, s) { var a = ys(o, t), l = ys(e, t), c = s.get(l); if (c) Cs(o, t, c); else { var d = r ? r(a, l, t + "", o, e, s) : void 0, u = d === void 0; if (u) { var g = rt(l), p = !g && Io(l), b = !g && !p && Ur(l); - d = l, g || p || b ? rt(a) ? d = a : oA(a) ? d = Gr(a) : p ? (u = !1, d = Zl(l, !0)) : b ? (u = !1, d = lc(l, !0)) : d = [] : lt(l) || jr(l) ? (d = a, jr(a) ? d = iA(a) : ze(a) && !mn(a) || (d = dc(l))) : u = !1; + d = l, g || p || b ? rt(a) ? d = a : iA(a) ? d = Gr(a) : p ? (u = !1, d = Zl(l, !0)) : b ? (u = !1, d = lc(l, !0)) : d = [] : lt(l) || jr(l) ? (d = a, jr(a) ? d = rA(a) : ze(a) && !mn(a) || (d = dc(l))) : u = !1; } u && (s.set(l, d), i(d, l, n, r, s), s.delete(l)), Cs(o, t, d); } }, yd = function o(e, t, n, i, r) { - e !== t && nA(t, function(s, a) { - if (r || (r = new To()), ze(s)) rA(e, t, a, n, o, i, r); + e !== t && oA(t, function(s, a) { + if (r || (r = new To()), ze(s)) sA(e, t, a, n, o, i, r); else { var l = i ? i(ys(e, a), s, a + "", e, t, r) : void 0; l === void 0 && (l = s), Cs(e, a, l); @@ -12114,7 +12114,7 @@ Read more: ${ne}#error-${o}`; }, Yn); }, vn = function(o) { return o; - }, sA = function(o, e, t) { + }, aA = function(o, e, t) { switch (t.length) { case 0: return o.call(e); @@ -12128,40 +12128,40 @@ Read more: ${ne}#error-${o}`; return o.apply(e, t); }; var Ed = Math.max; - const aA = function(o, e, t) { + const lA = function(o, e, t) { return e = Ed(e === void 0 ? o.length - 1 : e, 0), function() { for (var n = arguments, i = -1, r = Ed(n.length - e, 0), s = Array(r); ++i < r; ) s[i] = n[e + i]; i = -1; for (var a = Array(e + 1); ++i < e; ) a[i] = n[i]; - return a[e] = t(s), sA(o, this, a); + return a[e] = t(s), aA(o, this, a); }; - }, lA = function(o) { + }, cA = function(o) { return function() { return o; }; - }, cA = bi ? function(o, e) { - return bi(o, "toString", { configurable: !0, enumerable: !1, value: lA(e), writable: !0 }); + }, dA = bi ? function(o, e) { + return bi(o, "toString", { configurable: !0, enumerable: !1, value: cA(e), writable: !0 }); } : vn; - var dA = Date.now; - const uA = function(o) { + var uA = Date.now; + const hA = function(o) { var e = 0, t = 0; return function() { - var n = dA(), i = 16 - (n - t); + var n = uA(), i = 16 - (n - t); if (t = n, i > 0) { if (++e >= 800) return arguments[0]; } else e = 0; return o.apply(void 0, arguments); }; - }(cA), xd = function(o, e) { - return uA(aA(o, e, vn), o + ""); - }, hA = function(o, e, t) { + }(dA), xd = function(o, e) { + return hA(lA(o, e, vn), o + ""); + }, gA = function(o, e, t) { if (!ze(t)) return !1; var n = typeof e; return !!(n == "number" ? ki(t) && $r(e, t.length) : n == "string" && e in t) && So(t[e], o); }, Es = function(o) { return xd(function(e, t) { var n = -1, i = t.length, r = i > 1 ? t[i - 1] : void 0, s = i > 2 ? t[2] : void 0; - for (r = o.length > 3 && typeof r == "function" ? (i--, r) : void 0, s && hA(t[0], t[1], s) && (r = i < 3 ? void 0 : r, i = 1), e = Object(e); ++n < i; ) { + for (r = o.length > 3 && typeof r == "function" ? (i--, r) : void 0, s && gA(t[0], t[1], s) && (r = i < 3 ? void 0 : r, i = 1), e = Object(e); ++n < i; ) { var a = t[n]; a && o(e, a, n, r); } @@ -12169,7 +12169,7 @@ Read more: ${ne}#error-${o}`; }); }, Sd = Es(function(o, e, t) { yd(o, e, t); - }), gA = function(o, e, t, n) { + }), mA = function(o, e, t, n) { if (!ze(o)) return o; for (var i = -1, r = (e = _s(e, o)).length, s = r - 1, a = o; a != null && ++i < r; ) { var l = vs(e[i]), c = t; @@ -12181,10 +12181,10 @@ Read more: ${ne}#error-${o}`; Lr(a, l, c), a = a[l]; } return o; - }, mA = function(o, e, t) { - return o == null ? o : gA(o, e, t); + }, pA = function(o, e, t) { + return o == null ? o : mA(o, e, t); }; - class pA { + class fA { constructor(e) { this._styles = {}, this._styleProcessor = e; } @@ -12235,7 +12235,7 @@ Read more: ${ne}#error-${o}`; } remove(e) { const t = xs(e); - tA(this._styles, t), delete this._styles[e], this._cleanEmptyObjectsOnPath(t); + nA(this._styles, t), delete this._styles[e], this._cleanEmptyObjectsOnPath(t); } getNormalized(e) { return this._styleProcessor.getNormalized(e, this._styles); @@ -12267,7 +12267,7 @@ Read more: ${ne}#error-${o}`; i && !Array.from(Object.keys(i)).length && this.remove(n); } } - class fA { + class bA { constructor() { this._normalizers = /* @__PURE__ */ new Map(), this._extractors = /* @__PURE__ */ new Map(), this._reducers = /* @__PURE__ */ new Map(), this._consumables = /* @__PURE__ */ new Map(); } @@ -12325,7 +12325,7 @@ Read more: ${ne}#error-${o}`; } function Ss(o, e, t) { let n = t; - ze(t) && (n = Sd({}, Pi(o, e), t)), mA(o, e, n); + ze(t) && (n = Sd({}, Pi(o, e), t)), pA(o, e, n); } class ft extends _n { constructor(e, t, n, i) { @@ -12337,7 +12337,7 @@ Read more: ${ne}#error-${o}`; const r = this._attrs.get("class"); Dd(this._classes, r), this._attrs.delete("class"); } - this._styles = new pA(this.document.stylesProcessor), this._attrs.has("style") && (this._styles.setTo(this._attrs.get("style")), this._attrs.delete("style")); + this._styles = new fA(this.document.stylesProcessor), this._attrs.has("style") && (this._styles.setTo(this._attrs.get("style")), this._attrs.delete("style")); } get childCount() { return this._children.length; @@ -13105,7 +13105,7 @@ Read more: ${ne}#error-${o}`; } class yn extends ft { constructor(e, t, n, i) { - super(e, t, n, i), this._priority = 10, this._id = null, this._clonesGroup = null, this.getFillerOffset = bA; + super(e, t, n, i), this._priority = 10, this._id = null, this._clonesGroup = null, this.getFillerOffset = kA; } get priority() { return this._priority; @@ -13125,7 +13125,7 @@ Read more: ${ne}#error-${o}`; return t._priority = this._priority, t._id = this._id, t; } } - function bA() { + function kA() { if (Ps(this)) return null; let o = this.parent; for (; o && o.is("attributeElement"); ) { @@ -13142,14 +13142,14 @@ Read more: ${ne}#error-${o}`; }; class Rs extends ft { constructor(e, t, n, i) { - super(e, t, n, i), this.getFillerOffset = kA; + super(e, t, n, i), this.getFillerOffset = wA; } _insertChild(e, t) { if (t && (t instanceof _n || Array.from(t).length > 0)) throw new T("view-emptyelement-cannot-add", [this, t]); return 0; } } - function kA() { + function wA() { return null; } Rs.prototype.is = function(o, e) { @@ -13157,7 +13157,7 @@ Read more: ${ne}#error-${o}`; }; class zi extends ft { constructor(e, t, n, i) { - super(e, t, n, i), this.getFillerOffset = AA; + super(e, t, n, i), this.getFillerOffset = _A; } _insertChild(e, t) { if (t && (t instanceof _n || Array.from(t).length > 0)) throw new T("view-uielement-cannot-add", [this, t]); @@ -13172,7 +13172,7 @@ Read more: ${ne}#error-${o}`; return t; } } - function wA(o) { + function AA(o) { o.document.on("arrowKey", (e, t) => function(n, i, r) { if (i.keyCode == ge.arrowright) { const s = i.domTarget.ownerDocument.defaultView.getSelection(), a = s.rangeCount == 1 && s.getRangeAt(0).collapsed; @@ -13189,7 +13189,7 @@ Read more: ${ne}#error-${o}`; } }(0, t, o.domConverter), { priority: "low" }); } - function AA() { + function _A() { return null; } zi.prototype.is = function(o, e) { @@ -13197,7 +13197,7 @@ Read more: ${ne}#error-${o}`; }; class Os extends ft { constructor(e, t, n, i) { - super(e, t, n, i), this.getFillerOffset = _A; + super(e, t, n, i), this.getFillerOffset = vA; } _insertChild(e, t) { if (t && (t instanceof _n || Array.from(t).length > 0)) throw new T("view-rawelement-cannot-add", [this, t]); @@ -13206,7 +13206,7 @@ Read more: ${ne}#error-${o}`; render(e, t) { } } - function _A() { + function vA() { return null; } Os.prototype.is = function(o, e) { @@ -13499,7 +13499,7 @@ Read more: ${ne}#error-${o}`; for (; r < n; ) { const l = e.getChild(r), c = l.is("$text"), d = l.is("attributeElement"); if (d && this._wrapAttributeElement(i, l)) s.push(new G(e, r)); - else if (c || !d || vA(i, l)) { + else if (c || !d || CA(i, l)) { const u = i._clone(); l._remove(), u._appendChild(l), e._insertChild(r, u), this._addToClonedElementsGroup(u), s.push(new G(e, r)); } else this._wrapChildren(l, 0, l.childCount, i); @@ -13618,7 +13618,7 @@ Read more: ${ne}#error-${o}`; } return e; } - function vA(o, e) { + function CA(o, e) { return o.priority < e.priority || !(o.priority > e.priority) && o.getIdentity() < e.getIdentity(); } function zd(o) { @@ -13637,10 +13637,10 @@ Read more: ${ne}#error-${o}`; const t = o.data.length; return o._data += e.data, e._remove(), new G(o, t); } - const CA = [Ce, yn, Fo, Rs, Os, zi]; + const yA = [Ce, yn, Fo, Rs, Os, zi]; function Fd(o, e) { for (const t of o) { - if (!CA.some((n) => t instanceof n)) throw new T("view-writer-insert-invalid-node-type", e); + if (!yA.some((n) => t instanceof n)) throw new T("view-writer-insert-invalid-node-type", e); t.is("$text") || Fd(t.getChildren(), e); } } @@ -13670,7 +13670,7 @@ Read more: ${ne}#error-${o}`; function $d(o) { return bt(o) ? o.data.slice(Mt) : o.data; } - function yA(o, e) { + function EA(o, e) { if (e.keyCode == ge.arrowleft) { const t = e.domTarget.ownerDocument.defaultView.getSelection(); if (t.rangeCount == 1 && t.getRangeAt(0).collapsed) { @@ -13679,9 +13679,9 @@ Read more: ${ne}#error-${o}`; } } } - var Hd = S(9315), EA = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Hd.Z, EA), Hd.Z.locals; - class xA extends ve() { + var Hd = S(9315), xA = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Hd.Z, xA), Hd.Z.locals; + class SA extends ve() { constructor(e, t) { super(), this.domDocuments = /* @__PURE__ */ new Set(), this.markedAttributes = /* @__PURE__ */ new Set(), this.markedChildren = /* @__PURE__ */ new Set(), this.markedTexts = /* @__PURE__ */ new Set(), this._inlineFiller = null, this._fakeSelectionContainer = null, this.domConverter = e, this.selection = t, this.set("isFocused", !1), this.set("isSelecting", !1), f.isBlink && !f.isAndroid && this.on("change:isSelecting", () => { this.isSelecting || this.render(); @@ -13718,7 +13718,7 @@ Read more: ${ne}#error-${o}`; } _updateChildrenMappings(e) { if (!this.domConverter.mapViewToDom(e)) return; - const t = Array.from(this.domConverter.mapViewToDom(e).childNodes), n = Array.from(this.domConverter.viewChildrenToDom(e, { withChildren: !1 })), i = this._diffNodeLists(t, n), r = this._findUpdateActions(i, t, n, SA); + const t = Array.from(this.domConverter.mapViewToDom(e).childNodes), n = Array.from(this.domConverter.viewChildrenToDom(e, { withChildren: !1 })), i = this._diffNodeLists(t, n), r = this._findUpdateActions(i, t, n, DA); if (r.indexOf("update") !== -1) { const s = { equal: 0, insert: 0, delete: 0 }; for (const a of r) if (a === "update") { @@ -13783,7 +13783,7 @@ Read more: ${ne}#error-${o}`; } const i = t.inlineFillerPosition, r = n.childNodes, s = Array.from(this.domConverter.viewChildrenToDom(e, { bind: !0 })); i && i.parent === e && qd(n.ownerDocument, s, i.offset); - const a = this._diffNodeLists(r, s), l = this._findUpdateActions(a, r, s, DA); + const a = this._diffNodeLists(r, s), l = this._findUpdateActions(a, r, s, BA); let c = 0; const d = /* @__PURE__ */ new Set(); for (const u of l) u === "delete" ? (d.add(r[c]), Tc(r[c])) : u !== "equal" && u !== "update" || c++; @@ -13795,7 +13795,7 @@ Read more: ${ne}#error-${o}`; return e = function(n, i) { const r = Array.from(n); return r.length == 0 || !i || r[r.length - 1] == i && r.pop(), r; - }(e, this._fakeSelectionContainer), N(e, t, BA.bind(null, this.domConverter)); + }(e, this._fakeSelectionContainer), N(e, t, TA.bind(null, this.domConverter)); } _findUpdateActions(e, t, n, i) { if (e.indexOf("insert") === -1 || e.indexOf("delete") === -1) return e; @@ -13876,13 +13876,13 @@ Read more: ${ne}#error-${o}`; return Array.isArray(e) ? n.splice(t, 0, r) : Ec(e, t, r), r; } } - function SA(o, e) { - return nn(o) && nn(e) && !je(o) && !je(e) && !Xn(o) && !Xn(e) && o.tagName.toLowerCase() === e.tagName.toLowerCase(); - } function DA(o, e) { - return nn(o) && nn(e) && je(o) && je(e); + return on(o) && on(e) && !je(o) && !je(e) && !Xn(o) && !Xn(e) && o.tagName.toLowerCase() === e.tagName.toLowerCase(); } - function BA(o, e, t) { + function BA(o, e) { + return on(o) && on(e) && je(o) && je(e); + } + function TA(o, e, t) { return e === t || (je(e) && je(t) ? e.data === t.data : !(!o.isBlockFiller(e) || !o.isBlockFiller(t))); } function Ud(o, e) { @@ -13891,7 +13891,7 @@ Read more: ${ne}#error-${o}`; const n = P(t, e); for (const i of n) i.type === "insert" ? o.insertData(i.index, i.values.join("")) : o.deleteData(i.index, i.howMany); } - const TA = jd(ce.document), IA = Vd(ce.document), PA = Ld(ce.document), Fi = "data-ck-unsafe-attribute-", Wd = "data-ck-unsafe-element"; + const IA = jd(ce.document), PA = Vd(ce.document), RA = Ld(ce.document), Fi = "data-ck-unsafe-attribute-", Wd = "data-ck-unsafe-element"; class Kd { constructor(e, { blockFillerMode: t, renderingMode: n = "editing" } = {}) { this._domToViewMapping = /* @__PURE__ */ new WeakMap(), this._viewToDomMapping = /* @__PURE__ */ new WeakMap(), this._fakeSelectionMapping = /* @__PURE__ */ new WeakMap(), this._rawContentElementMatcher = new no(), this._encounteredRawContentDomNodes = /* @__PURE__ */ new WeakSet(), this.document = e, this.renderingMode = n, this.blockFillerMode = t || (n === "editing" ? "br" : "nbsp"), this.preElements = ["pre"], this.blockElements = ["address", "article", "aside", "blockquote", "caption", "center", "dd", "details", "dir", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "legend", "li", "main", "menu", "nav", "ol", "p", "pre", "section", "summary", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "ul"], this.inlineObjectElements = ["object", "iframe", "input", "button", "textarea", "select", "option", "video", "embed", "audio", "img", "canvas"], this.unsafeElements = ["script", "style"], this._domDocument = this.renderingMode === "editing" ? ce.document : ce.document.implementation.createHTMLDocument(""); @@ -14118,8 +14118,8 @@ Read more: ${ne}#error-${o}`; return e && e.nodeType == Node.DOCUMENT_FRAGMENT_NODE; } isBlockFiller(e) { - return this.blockFillerMode == "br" ? e.isEqualNode(TA) : !(e.tagName !== "BR" || !Zd(e, this.blockElements) || e.parentNode.childNodes.length !== 1) || e.isEqualNode(PA) || function(t, n) { - return t.isEqualNode(IA) && Zd(t, n) && t.parentNode.childNodes.length === 1; + return this.blockFillerMode == "br" ? e.isEqualNode(IA) : !(e.tagName !== "BR" || !Zd(e, this.blockElements) || e.parentNode.childNodes.length !== 1) || e.isEqualNode(RA) || function(t, n) { + return t.isEqualNode(PA) && Zd(t, n) && t.parentNode.childNodes.length === 1; }(e, this.blockElements); } isDomSelectionBackward(e) { @@ -14253,7 +14253,7 @@ Read more: ${ne}#error-${o}`; function Jd(o) { o === "script" && ee("domconverter-unsafe-script-element-detected"), o === "style" && ee("domconverter-unsafe-style-element-detected"); } - class Ft extends on() { + class Ft extends rn() { constructor(e) { super(), this._isEnabled = !1, this.view = e, this.document = e.document; } @@ -14290,7 +14290,7 @@ Read more: ${ne}#error-${o}`; this.domEvent.stopPropagation(); } } - class rn extends Ft { + class sn extends Ft { constructor() { super(...arguments), this.useCapture = !1; } @@ -14308,7 +14308,7 @@ Read more: ${ne}#error-${o}`; this.isEnabled && this.document.fire(e, new ro(this.view, t, n)); } } - class RA extends rn { + class OA extends sn { constructor() { super(...arguments), this.domEventType = ["keydown", "keyup"]; } @@ -14322,16 +14322,16 @@ Read more: ${ne}#error-${o}`; const Ns = function() { return Et.Date.now(); }; - var OA = /\s/; - const zA = function(o) { - for (var e = o.length; e-- && OA.test(o.charAt(e)); ) ; + var zA = /\s/; + const MA = function(o) { + for (var e = o.length; e-- && zA.test(o.charAt(e)); ) ; return e; }; - var MA = /^\s+/; - const FA = function(o) { - return o && o.slice(0, zA(o) + 1).replace(MA, ""); + var FA = /^\s+/; + const NA = function(o) { + return o && o.slice(0, MA(o) + 1).replace(FA, ""); }; - var NA = /^[-+]0x[0-9a-f]+$/i, VA = /^0b[01]+$/i, LA = /^0o[0-7]+$/i, jA = parseInt; + var VA = /^[-+]0x[0-9a-f]+$/i, LA = /^0b[01]+$/i, jA = /^0o[0-7]+$/i, $A = parseInt; const Qd = function(o) { if (typeof o == "number") return o; if (Ii(o)) return NaN; @@ -14340,11 +14340,11 @@ Read more: ${ne}#error-${o}`; o = ze(e) ? e + "" : e; } if (typeof o != "string") return o === 0 ? o : +o; - o = FA(o); - var t = VA.test(o); - return t || LA.test(o) ? jA(o.slice(2), t ? 2 : 8) : NA.test(o) ? NaN : +o; + o = NA(o); + var t = LA.test(o); + return t || jA.test(o) ? $A(o.slice(2), t ? 2 : 8) : VA.test(o) ? NaN : +o; }; - var $A = Math.max, HA = Math.min; + var HA = Math.max, qA = Math.min; const jo = function(o, e, t) { var n, i, r, s, a, l, c = 0, d = !1, u = !1, g = !0; if (typeof o != "function") throw new TypeError("Expected a function"); @@ -14361,7 +14361,7 @@ Read more: ${ne}#error-${o}`; if (b(z)) return E(z); a = setTimeout(w, function(H) { var X = e - (H - l); - return u ? HA(X, r - (H - c)) : X; + return u ? qA(X, r - (H - c)) : X; }(z)); } function E(z) { @@ -14377,13 +14377,13 @@ Read more: ${ne}#error-${o}`; } return a === void 0 && (a = setTimeout(w, e)), s; } - return e = Qd(e) || 0, ze(t) && (d = !!t.leading, r = (u = "maxWait" in t) ? $A(Qd(t.maxWait) || 0, e) : r, g = "trailing" in t ? !!t.trailing : g), I.cancel = function() { + return e = Qd(e) || 0, ze(t) && (d = !!t.leading, r = (u = "maxWait" in t) ? HA(Qd(t.maxWait) || 0, e) : r, g = "trailing" in t ? !!t.trailing : g), I.cancel = function() { a !== void 0 && clearTimeout(a), c = 0, n = l = i = a = void 0; }, I.flush = function() { return a === void 0 ? s : E(Ns()); }, I; }; - class qA extends Ft { + class UA extends Ft { constructor(e) { super(e), this._fireSelectionChangeDoneDebounced = jo((t) => { this.document.fire("selectionChangeDone", t); @@ -14409,27 +14409,27 @@ Read more: ${ne}#error-${o}`; this.document.fire("selectionChange", i), this._fireSelectionChangeDoneDebounced(i); } } - const UA = function(o) { + const WA = function(o) { return this.__data__.set(o, "__lodash_hash_undefined__"), this; - }, WA = function(o) { + }, KA = function(o) { return this.__data__.has(o); }; function Ni(o) { var e = -1, t = o == null ? 0 : o.length; for (this.__data__ = new fi(); ++e < t; ) this.add(o[e]); } - Ni.prototype.add = Ni.prototype.push = UA, Ni.prototype.has = WA; - const KA = Ni, GA = function(o, e) { + Ni.prototype.add = Ni.prototype.push = WA, Ni.prototype.has = KA; + const GA = Ni, ZA = function(o, e) { for (var t = -1, n = o == null ? 0 : o.length; ++t < n; ) if (e(o[t], t, o)) return !0; return !1; - }, ZA = function(o, e) { + }, JA = function(o, e) { return o.has(e); }, Xd = function(o, e, t, n, i, r) { var s = 1 & t, a = o.length, l = e.length; if (a != l && !(s && l > a)) return !1; var c = r.get(o), d = r.get(e); if (c && d) return c == e && d == o; - var u = -1, g = !0, p = 2 & t ? new KA() : void 0; + var u = -1, g = !0, p = 2 & t ? new GA() : void 0; for (r.set(o, e), r.set(e, o); ++u < a; ) { var b = o[u], w = e[u]; if (n) var E = s ? n(w, b, u, e, o, r) : n(b, w, u, o, e, r); @@ -14439,8 +14439,8 @@ Read more: ${ne}#error-${o}`; break; } if (p) { - if (!GA(e, function(I, z) { - if (!ZA(p, z) && (b === I || i(b, I, t, n, r))) return p.push(z); + if (!ZA(e, function(I, z) { + if (!JA(p, z) && (b === I || i(b, I, t, n, r))) return p.push(z); })) { g = !1; break; @@ -14451,19 +14451,19 @@ Read more: ${ne}#error-${o}`; } } return r.delete(o), r.delete(e), g; - }, JA = function(o) { + }, YA = function(o) { var e = -1, t = Array(o.size); return o.forEach(function(n, i) { t[++e] = [i, n]; }), t; - }, YA = function(o) { + }, QA = function(o) { var e = -1, t = Array(o.size); return o.forEach(function(n) { t[++e] = n; }), t; }; var eu = Pt ? Pt.prototype : void 0, Vs = eu ? eu.valueOf : void 0; - const QA = function(o, e, t, n, i, r, s) { + const XA = function(o, e, t, n, i, r, s) { switch (t) { case "[object DataView]": if (o.byteLength != e.byteLength || o.byteOffset != e.byteOffset) return !1; @@ -14480,10 +14480,10 @@ Read more: ${ne}#error-${o}`; case "[object String]": return o == e + ""; case "[object Map]": - var a = JA; + var a = YA; case "[object Set]": var l = 1 & n; - if (a || (a = YA), o.size != e.size && !l) return !1; + if (a || (a = QA), o.size != e.size && !l) return !1; var c = s.get(o); if (c) return c == e; n |= 2, s.set(o, e); @@ -14494,13 +14494,13 @@ Read more: ${ne}#error-${o}`; } return !1; }; - var XA = Object.prototype.hasOwnProperty; - const e0 = function(o, e, t, n, i, r) { + var e0 = Object.prototype.hasOwnProperty; + const t0 = function(o, e, t, n, i, r) { var s = 1 & t, a = Jr(o), l = a.length; if (l != Jr(e).length && !s) return !1; for (var c = l; c--; ) { var d = a[c]; - if (!(s ? d in e : XA.call(e, d))) return !1; + if (!(s ? d in e : e0.call(e, d))) return !1; } var u = r.get(o), g = r.get(e); if (u && g) return u == e && g == o; @@ -14522,13 +14522,13 @@ Read more: ${ne}#error-${o}`; return r.delete(o), r.delete(e), p; }; var tu = "[object Arguments]", nu = "[object Array]", Vi = "[object Object]", ou = Object.prototype.hasOwnProperty; - const t0 = function(o, e, t, n, i, r) { + const n0 = function(o, e, t, n, i, r) { var s = rt(o), a = rt(e), l = s ? nu : Ro(o), c = a ? nu : Ro(e), d = (l = l == tu ? Vi : l) == Vi, u = (c = c == tu ? Vi : c) == Vi, g = l == c; if (g && Io(o)) { if (!Io(e)) return !1; s = !0, d = !1; } - if (g && !d) return r || (r = new To()), s || Ur(o) ? Xd(o, e, t, n, i, r) : QA(o, e, l, t, n, i, r); + if (g && !d) return r || (r = new To()), s || Ur(o) ? Xd(o, e, t, n, i, r) : XA(o, e, l, t, n, i, r); if (!(1 & t)) { var p = d && ou.call(o, "__wrapped__"), b = u && ou.call(e, "__wrapped__"); if (p || b) { @@ -14536,10 +14536,10 @@ Read more: ${ne}#error-${o}`; return r || (r = new To()), i(w, E, t, n, r); } } - return !!g && (r || (r = new To()), e0(o, e, t, n, i, r)); + return !!g && (r || (r = new To()), t0(o, e, t, n, i, r)); }, iu = function o(e, t, n, i, r) { - return e === t || (e == null || t == null || !_t(e) && !_t(t) ? e != e && t != t : t0(e, t, n, i, o, r)); - }, n0 = function(o, e, t) { + return e === t || (e == null || t == null || !_t(e) && !_t(t) ? e != e && t != t : n0(e, t, n, i, o, r)); + }, o0 = function(o, e, t) { var n = (t = typeof t == "function" ? t : void 0) ? t(o, e) : void 0; return n === void 0 ? iu(o, e, void 0, t) : !!n; }; @@ -14587,7 +14587,7 @@ Read more: ${ne}#error-${o}`; for (const s of n) r = !0, this.renderer.markToSync("text", s); for (const s of i) { const a = t.mapViewToDom(s), l = Array.from(s.getChildren()), c = Array.from(t.domChildrenToView(a, { withChildren: !1 })); - n0(l, c, o0) || (r = !0, this.renderer.markToSync("children", s)); + o0(l, c, i0) || (r = !0, this.renderer.markToSync("children", s)); } r && this.view.forceRender(); } @@ -14596,10 +14596,10 @@ Read more: ${ne}#error-${o}`; return e.nextSibling === null && e.removedNodes.length === 0 && e.addedNodes.length == 1 && (t = this.domConverter.domToView(e.addedNodes[0], { withChildren: !1 })), t && t.is("element", "br"); } } - function o0(o, e) { + function i0(o, e) { if (!Array.isArray(o)) return o === e || !(!o.is("$text") || !e.is("$text")) && o.data === e.data; } - class Ls extends rn { + class Ls extends sn { constructor(e) { super(e), this._isFocusChanging = !1, this.domEventType = ["focus", "blur"], this.useCapture = !0; const t = this.document; @@ -14624,7 +14624,7 @@ Read more: ${ne}#error-${o}`; this._renderTimeoutId && clearTimeout(this._renderTimeoutId), super.destroy(); } } - class i0 extends Ft { + class r0 extends Ft { constructor(e) { super(e), this.mutationObserver = e.getObserver(ru), this.focusObserver = e.getObserver(Ls), this.selection = this.document.selection, this.domConverter = e.domConverter, this._documents = /* @__PURE__ */ new WeakSet(), this._fireSelectionChangeDoneDebounced = jo((t) => { this.document.fire("selectionChangeDone", t); @@ -14667,7 +14667,7 @@ Read more: ${ne}#error-${o}`; this._loopbackCounter = 0; } } - class r0 extends rn { + class s0 extends sn { constructor(e) { super(e), this.domEventType = ["compositionstart", "compositionupdate", "compositionend"]; const t = this.document; @@ -14720,7 +14720,7 @@ Read more: ${ne}#error-${o}`; const e = Array.from(o.files || []), t = Array.from(o.items || []); return e.length ? e : t.filter((n) => n.kind === "file").map((n) => n.getAsFile()); } - class s0 extends rn { + class a0 extends sn { constructor() { super(...arguments), this.domEventType = "beforeinput"; } @@ -14746,7 +14746,7 @@ Read more: ${ne}#error-${o}`; } else this.fire(e.type, e, { data: s, dataTransfer: r, targetRanges: a, inputType: e.inputType, isComposing: e.isComposing }); } } - class a0 extends Ft { + class l0 extends Ft { constructor(e) { super(e), this.document.on("keydown", (t, n) => { if (this.isEnabled && ((i = n.keyCode) == ge.arrowright || i == ge.arrowleft || i == ge.arrowup || i == ge.arrowdown)) { @@ -14761,7 +14761,7 @@ Read more: ${ne}#error-${o}`; stopObserving() { } } - class l0 extends Ft { + class c0 extends Ft { constructor(e) { super(e); const t = this.document; @@ -14776,9 +14776,9 @@ Read more: ${ne}#error-${o}`; stopObserving() { } } - class c0 extends ve() { + class d0 extends ve() { constructor(e) { - super(), this.domRoots = /* @__PURE__ */ new Map(), this._initialDomRootAttributes = /* @__PURE__ */ new WeakMap(), this._observers = /* @__PURE__ */ new Map(), this._ongoingChange = !1, this._postFixersInProgress = !1, this._renderingDisabled = !1, this._hasChangedSinceTheLastRendering = !1, this.document = new Rd(e), this.domConverter = new Kd(this.document), this.set("isRenderingInProgress", !1), this.set("hasDomSelection", !1), this._renderer = new xA(this.domConverter, this.document.selection), this._renderer.bind("isFocused", "isSelecting", "isComposing").to(this.document, "isFocused", "isSelecting", "isComposing"), this._writer = new Od(this.document), this.addObserver(ru), this.addObserver(Ls), this.addObserver(i0), this.addObserver(RA), this.addObserver(qA), this.addObserver(r0), this.addObserver(a0), this.addObserver(s0), this.addObserver(l0), this.document.on("arrowKey", yA, { priority: "low" }), wA(this), this.on("render", () => { + super(), this.domRoots = /* @__PURE__ */ new Map(), this._initialDomRootAttributes = /* @__PURE__ */ new WeakMap(), this._observers = /* @__PURE__ */ new Map(), this._ongoingChange = !1, this._postFixersInProgress = !1, this._renderingDisabled = !1, this._hasChangedSinceTheLastRendering = !1, this.document = new Rd(e), this.domConverter = new Kd(this.document), this.set("isRenderingInProgress", !1), this.set("hasDomSelection", !1), this._renderer = new SA(this.domConverter, this.document.selection), this._renderer.bind("isFocused", "isSelecting", "isComposing").to(this.document, "isFocused", "isSelecting", "isComposing"), this._writer = new Od(this.document), this.addObserver(ru), this.addObserver(Ls), this.addObserver(r0), this.addObserver(OA), this.addObserver(UA), this.addObserver(s0), this.addObserver(l0), this.addObserver(a0), this.addObserver(c0), this.document.on("arrowKey", EA, { priority: "low" }), AA(this), this.on("render", () => { this._render(), this.document.fire("layoutChanged"), this._hasChangedSinceTheLastRendering = !1; }), this.listenTo(this.document.selection, "change", () => { this._hasChangedSinceTheLastRendering = !0; @@ -14834,9 +14834,9 @@ Read more: ${ne}#error-${o}`; let g = u, p = null; for (; g; ) { let b; - b = dw(g == u ? s : p), cw({ parent: b, getRect: () => zc(s, g), alignToTop: c, ancestorOffset: l, forceScroll: d }); + b = uw(g == u ? s : p), dw({ parent: b, getRect: () => zc(s, g), alignToTop: c, ancestorOffset: l, forceScroll: d }); const w = zc(s, g); - if (lw({ window: g, rect: w, viewportOffset: a, alignToTop: c, forceScroll: d }), g.parent != g) { + if (cw({ window: g, rect: w, viewportOffset: a, alignToTop: c, forceScroll: d }), g.parent != g) { if (p = g.frameElement, g = g.parent, !p) return; } else g = null; } @@ -14896,12 +14896,12 @@ Read more: ${ne}#error-${o}`; this.isRenderingInProgress = !0, this.disableObservers(), this._renderer.render(), this.enableObservers(), this.isRenderingInProgress = !1; } } - class sn { + class an { is() { throw new Error("is() method is abstract"); } } - class xn extends sn { + class xn extends an { constructor(e) { super(), this.parent = null, this._attrs = qt(e); } @@ -15093,7 +15093,7 @@ Read more: ${ne}#error-${o}`; ye.prototype.is = function(o) { return o === "$text" || o === "model:$text" || o === "text" || o === "model:text" || o === "node" || o === "model:node"; }; - class St extends sn { + class St extends an { constructor(e, t, n) { if (super(), this.textNode = e, t < 0 || t > e.offsetSize) throw new T("model-textproxy-wrong-offsetintext", this); if (n < 0 || t + n > e.offsetSize) throw new T("model-textproxy-wrong-length", this); @@ -15286,7 +15286,7 @@ Read more: ${ne}#error-${o}`; function Sn(o, e, t, n, i) { return { done: !1, value: { type: o, item: e, previousPosition: t, nextPosition: n, length: i } }; } - class U extends sn { + class U extends an { constructor(e, t, n = "toNone") { if (super(), !e.is("element") && !e.is("documentFragment")) throw new T("model-position-root-invalid", e); if (!(t instanceof Array) || t.length === 0) throw new T("model-position-path-incorrect-format", e, { path: t }); @@ -15533,7 +15533,7 @@ Read more: ${ne}#error-${o}`; U.prototype.is = function(o) { return o === "position" || o === "model:position"; }; - class V extends sn { + class V extends an { constructor(e, t) { super(), this.start = U._createAt(e), this.end = t ? U._createAt(t) : U._createAt(e), this.start.stickiness = this.isCollapsed ? "toNone" : "toNext", this.end.stickiness = this.isCollapsed ? "toNone" : "toPrevious"; } @@ -15845,7 +15845,7 @@ Read more: ${ne}#error-${o}`; return t instanceof Ce ? new G(t, t.data.length) : n instanceof Ce ? new G(n, 0) : e; } } - class d0 { + class u0 { constructor() { this._consumable = /* @__PURE__ */ new Map(), this._textProxyRegistry = /* @__PURE__ */ new Map(); } @@ -15894,11 +15894,11 @@ Read more: ${ne}#error-${o}`; const e = o.split(":"); return e[0] == "insert" ? e[0] : e[0] == "addMarker" || e[0] == "removeMarker" ? o : e.length > 1 ? e[0] + ":" + e[1] : e[0]; } - var u0 = Object.defineProperty, h0 = Object.defineProperties, g0 = Object.getOwnPropertyDescriptors, hu = Object.getOwnPropertySymbols, m0 = Object.prototype.hasOwnProperty, p0 = Object.prototype.propertyIsEnumerable, gu = (o, e, t) => e in o ? u0(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, $s = (o, e) => { - for (var t in e || (e = {})) m0.call(e, t) && gu(o, t, e[t]); - if (hu) for (var t of hu(e)) p0.call(e, t) && gu(o, t, e[t]); + var h0 = Object.defineProperty, g0 = Object.defineProperties, m0 = Object.getOwnPropertyDescriptors, hu = Object.getOwnPropertySymbols, p0 = Object.prototype.hasOwnProperty, f0 = Object.prototype.propertyIsEnumerable, gu = (o, e, t) => e in o ? h0(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, $s = (o, e) => { + for (var t in e || (e = {})) p0.call(e, t) && gu(o, t, e[t]); + if (hu) for (var t of hu(e)) f0.call(e, t) && gu(o, t, e[t]); return o; - }, mu = (o, e) => h0(o, g0(e)); + }, mu = (o, e) => g0(o, m0(e)); class pu extends _e() { constructor(e) { super(), this._conversionApi = $s({ dispatcher: this }, e), this._firedEventsMap = /* @__PURE__ */ new WeakMap(); @@ -15926,7 +15926,7 @@ Read more: ${ne}#error-${o}`; if (this._addConsumablesForSelection(r.consumable, e, i), this.fire("selection", { selection: e }, r), e.isCollapsed) { for (const s of i) { const a = s.getRange(); - if (!f0(e.getFirstPosition(), s, r.mapper)) continue; + if (!b0(e.getFirstPosition(), s, r.mapper)) continue; const l = { item: e, markerName: s.name, markerRange: a }; r.consumable.test(e, "addMarker:" + s.name) && this.fire(`addMarker:${s.name}`, l, r); } @@ -16010,11 +16010,11 @@ Read more: ${ne}#error-${o}`; for (const i of n.item.getAttributeKeys()) n.attributeKey = i, n.attributeOldValue = null, n.attributeNewValue = n.item.getAttribute(i), this._testAndFire(`attribute:${i}`, n, t); } _createConversionApi(e, t = /* @__PURE__ */ new Set(), n = {}) { - const i = mu($s({}, this._conversionApi), { consumable: new d0(), writer: e, options: n, convertItem: (r) => this._convertInsert(V._createOn(r), i), convertChildren: (r) => this._convertInsert(V._createIn(r), i, { doNotAddConsumables: !0 }), convertAttributes: (r) => this._testAndFireAddAttributes(r, i), canReuseView: (r) => !t.has(i.mapper.toModelElement(r)) }); + const i = mu($s({}, this._conversionApi), { consumable: new u0(), writer: e, options: n, convertItem: (r) => this._convertInsert(V._createOn(r), i), convertChildren: (r) => this._convertInsert(V._createIn(r), i, { doNotAddConsumables: !0 }), convertAttributes: (r) => this._testAndFireAddAttributes(r, i), canReuseView: (r) => !t.has(i.mapper.toModelElement(r)) }); return this._firedEventsMap.set(i, /* @__PURE__ */ new Map()), i; } } - function f0(o, e, t) { + function b0(o, e, t) { const n = e.getRange(), i = Array.from(o.getAncestors()); return i.shift(), i.reverse(), !i.some((r) => { if (n.containsItem(r)) @@ -16024,7 +16024,7 @@ Read more: ${ne}#error-${o}`; function fu(o) { return { item: o.item, range: V._createFromPositionAndShift(o.previousPosition, o.length) }; } - class kt extends _e(sn) { + class kt extends _e(an) { constructor(...e) { super(), this._lastRangeBackward = !1, this._attrs = /* @__PURE__ */ new Map(), this._ranges = [], e.length && this.setTo(...e); } @@ -16147,13 +16147,13 @@ Read more: ${ne}#error-${o}`; const e = /* @__PURE__ */ new WeakSet(); for (const t of this.getRanges()) { const n = ku(t.start, e); - k0(n, t) && (yield n); + w0(n, t) && (yield n); for (const r of t.getWalker()) { const s = r.item; - r.type == "elementEnd" && b0(s, e, t) && (yield s); + r.type == "elementEnd" && k0(s, e, t) && (yield s); } const i = ku(t.end, e); - w0(i, t) && (yield i); + A0(i, t) && (yield i); } } containsEntireContent(e = this.anchor.root) { @@ -16180,7 +16180,7 @@ Read more: ${ne}#error-${o}`; function bu(o, e) { return !e.has(o) && (e.add(o), o.root.document.model.schema.isBlock(o) && !!o.parent); } - function b0(o, e, t) { + function k0(o, e, t) { return bu(o, e) && Hs(o, t); } function ku(o, e) { @@ -16200,10 +16200,10 @@ Read more: ${ne}#error-${o}`; }(o); return t ? !e.containsRange(V._createOn(t), !0) : !0; } - function k0(o, e) { + function w0(o, e) { return !!o && (!(!e.isCollapsed && !o.isEmpty) || !e.start.isTouching(U._createAt(o, o.maxOffset)) && Hs(o, e)); } - function w0(o, e) { + function A0(o, e) { return !!o && (!(!e.isCollapsed && !o.isEmpty) || !e.end.isTouching(U._createAt(o, 0)) && Hs(o, e)); } kt.prototype.is = function(o) { @@ -16211,7 +16211,7 @@ Read more: ${ne}#error-${o}`; }; class Ut extends _e(V) { constructor(e, t) { - super(e, t), A0.call(this); + super(e, t), _0.call(this); } detach() { this.stopListening(); @@ -16223,13 +16223,13 @@ Read more: ${ne}#error-${o}`; return new Ut(e.start, e.end); } } - function A0() { + function _0() { this.listenTo(this.root.document.model, "applyOperation", (o, e) => { const t = e[0]; - t.isDocumentOperation && _0.call(this, t); + t.isDocumentOperation && v0.call(this, t); }, { priority: "low" }); } - function _0(o) { + function v0(o) { const e = this.getTransformedByOperation(o), t = V._createFromRanges(e), n = !t.isEqual(this), i = function(s, a) { switch (a.type) { case "insert": @@ -16255,9 +16255,9 @@ Read more: ${ne}#error-${o}`; return o === "liveRange" || o === "model:liveRange" || o == "range" || o === "model:range"; }; const ji = "selection:"; - class Dt extends _e(sn) { + class Dt extends _e(an) { constructor(e) { - super(), this._selection = new v0(e), this._selection.delegate("change:range").to(this), this._selection.delegate("change:attribute").to(this), this._selection.delegate("change:marker").to(this); + super(), this._selection = new C0(e), this._selection.delegate("change:range").to(this), this._selection.delegate("change:attribute").to(this), this._selection.delegate("change:marker").to(this); } get isCollapsed() { return this._selection.isCollapsed; @@ -16362,7 +16362,7 @@ Read more: ${ne}#error-${o}`; Dt.prototype.is = function(o) { return o === "selection" || o == "model:selection" || o == "documentSelection" || o == "model:documentSelection"; }; - class v0 extends kt { + class C0 extends kt { constructor(e) { super(), this.markers = new vt({ idProperty: "name" }), this._attributePriority = /* @__PURE__ */ new Map(), this._selectionRestorePosition = null, this._hasChangedRange = !1, this._overriddenGravityRegister = /* @__PURE__ */ new Set(), this._observedMarkers = /* @__PURE__ */ new Set(), this._model = e.model, this._document = e, this.listenTo(this._model, "applyOperation", (t, n) => { const i = n[0]; @@ -16571,15 +16571,15 @@ Read more: ${ne}#error-${o}`; return this; } } - const an = function(o) { + const ln = function(o) { return ns(o, 5); }; - class C0 extends wu { + class y0 extends wu { elementToElement(e) { return this.add(function(t) { const n = vu(t.model), i = qo(t.view, "container"); return n.attributes.length && (n.children = !0), (r) => { - r.on(`insert:${n.name}`, /* @__PURE__ */ function(s, a = E0) { + r.on(`insert:${n.name}`, /* @__PURE__ */ function(s, a = x0) { return (l, c, d) => { if (!a(c.item, d.consumable, { preflight: !0 })) return; const u = s(c.item, d, c); @@ -16637,7 +16637,7 @@ Read more: ${ne}#error-${o}`; } attributeToElement(e) { return this.add(function(t) { - t = an(t); + t = ln(t); let n = t.model; typeof n == "string" && (n = { key: n }); let i = `attribute:${n.key}`; @@ -16664,7 +16664,7 @@ Read more: ${ne}#error-${o}`; } attributeToAttribute(e) { return this.add(function(t) { - t = an(t); + t = ln(t); let n = t.model; typeof n == "string" && (n = { key: n }); let i = `attribute:${n.key}`; @@ -16770,7 +16770,7 @@ Read more: ${ne}#error-${o}`; } markerToData(e) { return this.add(function(t) { - t = an(t); + t = ln(t); const n = t.model; let i = t.view; return i || (i = (r) => ({ group: n, name: r.substr(t.model.length + 1) })), (r) => { @@ -16899,15 +16899,15 @@ Read more: ${ne}#error-${o}`; }; } function Su(o, e, t, n) { - for (const i of e) y0(o.root, i, t, n) || t.convertItem(i); + for (const i of e) E0(o.root, i, t, n) || t.convertItem(i); } - function y0(o, e, t, n) { + function E0(o, e, t, n) { const { writer: i, mapper: r } = t; if (!n.reconversion) return !1; const s = r.toViewElement(e); return !(!s || s.root == o) && !!t.canReuseView(s) && (i.move(i.createRangeOn(s), r.toViewPosition(U._createBefore(e))), !0); } - function E0(o, e, { preflight: t } = {}) { + function x0(o, e, { preflight: t } = {}) { return t ? e.test(o, "insert") : e.consume(o, "insert"); } function Du(o) { @@ -16926,14 +16926,14 @@ Read more: ${ne}#error-${o}`; const t = e.createElement("paragraph"); return e.insert(t, o), e.createPositionAt(t, 0); } - var x0 = Object.defineProperty, S0 = Object.defineProperties, D0 = Object.getOwnPropertyDescriptors, Iu = Object.getOwnPropertySymbols, B0 = Object.prototype.hasOwnProperty, T0 = Object.prototype.propertyIsEnumerable, Pu = (o, e, t) => e in o ? x0(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; - class I0 extends wu { + var S0 = Object.defineProperty, D0 = Object.defineProperties, B0 = Object.getOwnPropertyDescriptors, Iu = Object.getOwnPropertySymbols, T0 = Object.prototype.hasOwnProperty, I0 = Object.prototype.propertyIsEnumerable, Pu = (o, e, t) => e in o ? S0(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; + class P0 extends wu { elementToElement(e) { return this.add(Ru(e)); } elementToAttribute(e) { return this.add(function(t) { - t = an(t), Ou(t); + t = ln(t), Ou(t); const n = zu(t, !1), i = Us(t.view), r = i ? `element:${i}` : "element"; return (s) => { s.on(r, n, { priority: t.converterPriority || "low" }); @@ -16942,7 +16942,7 @@ Read more: ${ne}#error-${o}`; } attributeToAttribute(e) { return this.add(function(t) { - t = an(t); + t = ln(t); let n = null; (typeof t.view == "string" || t.view.key) && (n = function(r) { typeof r.view == "string" && (r.view = { key: r.view }); @@ -16965,16 +16965,16 @@ Read more: ${ne}#error-${o}`; }; }(t.model); return Ru((i = ((s, a) => { - for (var l in a || (a = {})) B0.call(a, l) && Pu(s, l, a[l]); - if (Iu) for (var l of Iu(a)) T0.call(a, l) && Pu(s, l, a[l]); + for (var l in a || (a = {})) T0.call(a, l) && Pu(s, l, a[l]); + if (Iu) for (var l of Iu(a)) I0.call(a, l) && Pu(s, l, a[l]); return s; - })({}, t), r = { model: n }, S0(i, D0(r)))); + })({}, t), r = { model: n }, D0(i, B0(r)))); var i, r; }(e)); } dataToMarker(e) { return this.add(function(t) { - t = an(t), t.model || (t.model = (s) => s ? t.view + ":" + s : t.view); + t = ln(t), t.model || (t.model = (s) => s ? t.view + ":" + s : t.view); const n = { view: t.view, model: t.model }, i = Ws(Mu(n, "start")), r = Ws(Mu(n, "end")); return (s) => { s.on(`element:${t.view}-start`, i, { priority: t.converterPriority || "normal" }), s.on(`element:${t.view}-end`, r, { priority: t.converterPriority || "normal" }); @@ -16996,7 +16996,7 @@ Read more: ${ne}#error-${o}`; } } function Ru(o) { - const e = Ws(o = an(o)), t = Us(o.view), n = t ? `element:${t}` : "element"; + const e = Ws(o = ln(o)), t = Us(o.view), n = t ? `element:${t}` : "element"; return (i) => { i.on(n, e, { priority: o.converterPriority || "normal" }); }; @@ -17045,7 +17045,7 @@ Read more: ${ne}#error-${o}`; return n.writer.createElement("$marker", { "data-name": r }); } }; } - function P0(o) { + function R0(o) { o.document.registerPostFixer((e) => function(t, n) { const i = n.document.selection, r = n.schema, s = []; let a = !1; @@ -17111,9 +17111,9 @@ Read more: ${ne}#error-${o}`; function Vu(o, e) { return o && e.isSelectable(o); } - class R0 extends ve() { + class O0 extends ve() { constructor(e, t) { - super(), this.model = e, this.view = new c0(t), this.mapper = new uu(), this.downcastDispatcher = new pu({ mapper: this.mapper, schema: e.schema }); + super(), this.model = e, this.view = new d0(t), this.mapper = new uu(), this.downcastDispatcher = new pu({ mapper: this.mapper, schema: e.schema }); const n = this.model.document, i = n.selection, r = this.model.markers; var s, a, l; this.listenTo(this.model, "_beforeChanges", () => { @@ -17190,7 +17190,7 @@ Read more: ${ne}#error-${o}`; } add(e, t) { let n; - e.is("$text") || e.is("documentFragment") ? this._consumables.set(e, !0) : (this._consumables.has(e) ? n = this._consumables.get(e) : (n = new O0(e), this._consumables.set(e, n)), n.add(t)); + e.is("$text") || e.is("documentFragment") ? this._consumables.set(e, !0) : (this._consumables.has(e) ? n = this._consumables.get(e) : (n = new z0(e), this._consumables.set(e, n)), n.add(t)); } test(e, t) { const n = this._consumables.get(e); @@ -17220,7 +17220,7 @@ Read more: ${ne}#error-${o}`; } } const Hi = ["attributes", "classes", "styles"]; - class O0 { + class z0 { constructor(e) { this.element = e, this._canConsumeName = null, this._consumables = { attributes: /* @__PURE__ */ new Map(), styles: /* @__PURE__ */ new Map(), classes: /* @__PURE__ */ new Map() }; } @@ -17282,7 +17282,7 @@ Read more: ${ne}#error-${o}`; } } } - class z0 extends ve() { + class M0 extends ve() { constructor() { super(), this._sourceDefinitions = {}, this._attributeProperties = {}, this.decorate("checkChild"), this.decorate("checkAttribute"), this.on("checkAttribute", (e, t) => { t[0] = new Dn(t[0]); @@ -17454,12 +17454,12 @@ Read more: ${ne}#error-${o}`; } _compile() { const e = {}, t = this._sourceDefinitions, n = Object.keys(t); - for (const i of n) e[i] = M0(t[i], i); - for (const i of n) F0(e, i); + for (const i of n) e[i] = F0(t[i], i); for (const i of n) N0(e, i); for (const i of n) V0(e, i); - for (const i of n) L0(e, i), j0(e, i); - for (const i of n) $0(e, i), H0(e, i), q0(e, i); + for (const i of n) L0(e, i); + for (const i of n) j0(e, i), $0(e, i); + for (const i of n) H0(e, i), q0(e, i), U0(e, i); this._compiledDefinitions = e; } _checkContextMatch(e, t, n = t.length - 1) { @@ -17483,7 +17483,7 @@ Read more: ${ne}#error-${o}`; constructor(e) { if (e instanceof Dn) return e; let t; - t = typeof e == "string" ? [e] : Array.isArray(e) ? e : e.getAncestors({ includeSelf: !0 }), this._items = t.map(W0); + t = typeof e == "string" ? [e] : Array.isArray(e) ? e : e.getAncestors({ includeSelf: !0 }), this._items = t.map(K0); } get length() { return this._items.length; @@ -17511,7 +17511,7 @@ Read more: ${ne}#error-${o}`; return Array.from(this.getNames()).join(" ").startsWith(e); } } - function M0(o, e) { + function F0(o, e) { const t = { name: e, allowIn: [], allowContentOf: [], allowWhere: [], allowAttributes: [], allowAttributesOf: [], allowChildren: [], inheritTypesFrom: [] }; return function(n, i) { for (const r of n) { @@ -17525,7 +17525,7 @@ Read more: ${ne}#error-${o}`; } }(o, t), t; } - function F0(o, e) { + function N0(o, e) { const t = o[e]; for (const n of t.allowChildren) { const i = o[n]; @@ -17533,13 +17533,13 @@ Read more: ${ne}#error-${o}`; } t.allowChildren.length = 0; } - function N0(o, e) { - for (const t of o[e].allowContentOf) o[t] && U0(o, t).forEach((n) => { + function V0(o, e) { + for (const t of o[e].allowContentOf) o[t] && W0(o, t).forEach((n) => { n.allowIn.push(e); }); delete o[e].allowContentOf; } - function V0(o, e) { + function L0(o, e) { for (const t of o[e].allowWhere) { const n = o[t]; if (n) { @@ -17549,7 +17549,7 @@ Read more: ${ne}#error-${o}`; } delete o[e].allowWhere; } - function L0(o, e) { + function j0(o, e) { for (const t of o[e].allowAttributesOf) { const n = o[t]; if (n) { @@ -17559,7 +17559,7 @@ Read more: ${ne}#error-${o}`; } delete o[e].allowAttributesOf; } - function j0(o, e) { + function $0(o, e) { const t = o[e]; for (const n of t.inheritTypesFrom) { const i = o[n]; @@ -17570,16 +17570,16 @@ Read more: ${ne}#error-${o}`; } delete t.inheritTypesFrom; } - function $0(o, e) { + function H0(o, e) { const t = o[e], n = t.allowIn.filter((i) => o[i]); t.allowIn = Array.from(new Set(n)); } - function H0(o, e) { + function q0(o, e) { const t = o[e]; for (const n of t.allowIn) o[n].allowChildren.push(e); } - function q0(o, e) { + function U0(o, e) { const t = o[e]; t.allowAttributes = Array.from(new Set(t.allowAttributes)); } @@ -17589,12 +17589,12 @@ Read more: ${ne}#error-${o}`; typeof i == "string" ? e[t].push(i) : Array.isArray(i) && e[t].push(...i); } } - function U0(o, e) { + function W0(o, e) { const t = o[e]; return (n = o, Object.keys(n).map((i) => n[i])).filter((i) => i.allowIn.includes(t.name)); var n; } - function W0(o) { + function K0(o) { return typeof o == "string" || o.is("documentFragment") ? { name: typeof o == "string" ? o : "$documentFragment", *getAttributeKeys() { }, getAttribute() { } } : { name: o.is("element") ? o.name : "$text", *getAttributeKeys() { @@ -17604,15 +17604,15 @@ Read more: ${ne}#error-${o}`; function Lu(o, e, t) { for (const n of e.getAttributeKeys()) o.checkAttribute(e, n) || t.removeAttribute(n, e); } - var K0 = Object.defineProperty, G0 = Object.defineProperties, Z0 = Object.getOwnPropertyDescriptors, ju = Object.getOwnPropertySymbols, J0 = Object.prototype.hasOwnProperty, Y0 = Object.prototype.propertyIsEnumerable, $u = (o, e, t) => e in o ? K0(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; - class Q0 extends _e() { + var G0 = Object.defineProperty, Z0 = Object.defineProperties, J0 = Object.getOwnPropertyDescriptors, ju = Object.getOwnPropertySymbols, Y0 = Object.prototype.hasOwnProperty, Q0 = Object.prototype.propertyIsEnumerable, $u = (o, e, t) => e in o ? G0(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; + class X0 extends _e() { constructor(e) { var t; super(), this._splitParts = /* @__PURE__ */ new Map(), this._cursorParents = /* @__PURE__ */ new Map(), this._modelCursor = null, this._emptyElementsToKeep = /* @__PURE__ */ new Set(), this.conversionApi = (t = ((n, i) => { - for (var r in i || (i = {})) J0.call(i, r) && $u(n, r, i[r]); - if (ju) for (var r of ju(i)) Y0.call(i, r) && $u(n, r, i[r]); + for (var r in i || (i = {})) Y0.call(i, r) && $u(n, r, i[r]); + if (ju) for (var r of ju(i)) Q0.call(i, r) && $u(n, r, i[r]); return n; - })({}, e), G0(t, Z0({ consumable: null, writer: null, store: null, convertItem: (n, i) => this._convertItem(n, i), convertChildren: (n, i) => this._convertChildren(n, i), safeInsert: (n, i) => this._safeInsert(n, i), updateConversionResult: (n, i) => this._updateConversionResult(n, i), splitToAllowedParent: (n, i) => this._splitToAllowedParent(n, i), getSplitParts: (n) => this._getSplitParts(n), keepEmptyElement: (n) => this._keepEmptyElement(n) }))); + })({}, e), Z0(t, J0({ consumable: null, writer: null, store: null, convertItem: (n, i) => this._convertItem(n, i), convertChildren: (n, i) => this._convertChildren(n, i), safeInsert: (n, i) => this._safeInsert(n, i), updateConversionResult: (n, i) => this._updateConversionResult(n, i), splitToAllowedParent: (n, i) => this._splitToAllowedParent(n, i), getSplitParts: (n) => this._getSplitParts(n), keepEmptyElement: (n) => this._keepEmptyElement(n) }))); } convert(e, t, n = ["$root"]) { this.fire("viewCleanup", e), this._modelCursor = function(s, a) { @@ -17700,15 +17700,15 @@ Read more: ${ne}#error-${o}`; e && this._removeEmptyElements(); } } - class X0 { + class e_ { getHtml(e) { const t = document.implementation.createHTMLDocument("").createElement("div"); return t.appendChild(e), t.innerHTML; } } - class e_ { + class t_ { constructor(e) { - this.skipComments = !0, this.domParser = new DOMParser(), this.domConverter = new Kd(e, { renderingMode: "data" }), this.htmlWriter = new X0(); + this.skipComments = !0, this.domParser = new DOMParser(), this.domConverter = new Kd(e, { renderingMode: "data" }), this.htmlWriter = new e_(); } toData(e) { const t = this.domConverter.viewToDom(e); @@ -17731,7 +17731,7 @@ Read more: ${ne}#error-${o}`; return n; } } - class t_ extends _e() { + class n_ extends _e() { constructor(e, t) { super(), this.model = e, this.mapper = new uu(), this.downcastDispatcher = new pu({ mapper: this.mapper, schema: e.schema }), this.downcastDispatcher.on("insert:$text", (n, i, r) => { if (!r.consumable.consume(i.item, n.name)) return; @@ -17739,7 +17739,7 @@ Read more: ${ne}#error-${o}`; s.insert(a, l); }, { priority: "lowest" }), this.downcastDispatcher.on("insert", (n, i, r) => { r.convertAttributes(i.item), i.reconversion || !i.item.is("element") || i.item.isEmpty || r.convertChildren(i.item); - }, { priority: "lowest" }), this.upcastDispatcher = new Q0({ schema: e.schema }), this.viewDocument = new Rd(t), this.stylesProcessor = t, this.htmlProcessor = new e_(this.viewDocument), this.processor = this.htmlProcessor, this._viewWriter = new Od(this.viewDocument), this.upcastDispatcher.on("text", (n, i, { schema: r, consumable: s, writer: a }) => { + }, { priority: "lowest" }), this.upcastDispatcher = new X0({ schema: e.schema }), this.viewDocument = new Rd(t), this.stylesProcessor = t, this.htmlProcessor = new t_(this.viewDocument), this.processor = this.htmlProcessor, this._viewWriter = new Od(this.viewDocument), this.upcastDispatcher.on("text", (n, i, { schema: r, consumable: s, writer: a }) => { let l = i.modelCursor; if (!s.test(i.viewItem)) return; if (!r.checkChild(l, "$text")) { @@ -17858,7 +17858,7 @@ Read more: ${ne}#error-${o}`; return !0; } } - class n_ { + class o_ { constructor(e, t) { this._helpers = /* @__PURE__ */ new Map(), this._downcast = $e(e), this._createConversionHelpers({ name: "downcast", dispatchers: this._downcast, isDowncast: !0 }), this._upcast = $e(t), this._createConversionHelpers({ name: "upcast", dispatchers: this._upcast, isDowncast: !1 }); } @@ -17885,7 +17885,7 @@ Read more: ${ne}#error-${o}`; } _createConversionHelpers({ name: e, dispatchers: t, isDowncast: n }) { if (this._helpers.has(e)) throw new T("conversion-group-exists", this); - const i = n ? new C0(t) : new I0(t); + const i = n ? new y0(t) : new P0(t); this._helpers.set(e, i); } } @@ -18369,7 +18369,7 @@ Read more: ${ne}#error-${o}`; } const Ct = {}; Ct[Ze.className] = Ze, Ct[tt.className] = tt, Ct[ct.className] = ct, Ct[be.className] = be, Ct[Xe.className] = Xe, Ct[wt.className] = wt, Ct[dt.className] = dt, Ct[Wt.className] = Wt, Ct[Vt.className] = Vt, Ct[xe.className] = xe, Ct[He.className] = He; - class o_ { + class i_ { static fromJSON(e, t) { return Ct[e.__className].fromJSON(e, t); } @@ -18379,13 +18379,13 @@ Read more: ${ne}#error-${o}`; let n = Zs.get(o); n || (n = /* @__PURE__ */ new Map(), Zs.set(o, n)), n.set(e, t); } - function i_(o) { + function r_(o) { return [o]; } function Ku(o, e, t = {}) { const n = function(i, r) { const s = Zs.get(i); - return s && s.has(r) ? s.get(r) : i_; + return s && s.has(r) ? s.get(r) : r_; }(o.constructor, e.constructor); try { return n(o = o.clone(), e, t); @@ -18393,9 +18393,9 @@ Read more: ${ne}#error-${o}`; throw i; } } - function r_(o, e, t) { + function s_(o, e, t) { o = o.slice(), e = e.slice(); - const n = new s_(t.document, t.useRelations, t.forceWeakRemove); + const n = new a_(t.document, t.useRelations, t.forceWeakRemove); n.setOriginalOperations(o), n.setOriginalOperations(e); const i = n.originalOperations; if (o.length == 0 || e.length == 0) return { operationsA: o, operationsB: e, originalOperations: i }; @@ -18416,7 +18416,7 @@ Read more: ${ne}#error-${o}`; } return Gu(o, s.nextBaseVersionB), Gu(e, s.nextBaseVersionA), { operationsA: o, operationsB: e, originalOperations: i }; } - class s_ { + class a_ { constructor(e, t, n = !1) { this.originalOperations = /* @__PURE__ */ new Map(), this._history = e.history, this._useRelations = t, this._forceWeakRemove = !!n, this._relations = /* @__PURE__ */ new Map(); } @@ -18721,7 +18721,7 @@ Read more: ${ne}#error-${o}`; class ut extends _e(U) { constructor(e, t, n = "toNone") { if (super(e, t, n), !this.root.is("rootElement")) throw new T("model-liveposition-root-not-rootelement", e); - a_.call(this); + l_.call(this); } detach() { this.stopListening(); @@ -18733,13 +18733,13 @@ Read more: ${ne}#error-${o}`; return new this(e.root, e.path.slice(), t || e.stickiness); } } - function a_() { + function l_() { this.listenTo(this.root.document.model, "applyOperation", (o, e) => { const t = e[0]; - t.isDocumentOperation && l_.call(this, t); + t.isDocumentOperation && c_.call(this, t); }, { priority: "low" }); } - function l_(o) { + function c_(o) { const e = this.getTransformedByOperation(o); if (!this.isEqual(e)) { const t = this.toPosition(); @@ -18766,8 +18766,8 @@ Read more: ${ne}#error-${o}`; return e.batch = this, this.operations.push(e), e; } } - var c_ = Object.defineProperty, Yu = Object.getOwnPropertySymbols, d_ = Object.prototype.hasOwnProperty, u_ = Object.prototype.propertyIsEnumerable, Qu = (o, e, t) => e in o ? c_(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; - class h_ { + var d_ = Object.defineProperty, Yu = Object.getOwnPropertySymbols, u_ = Object.prototype.hasOwnProperty, h_ = Object.prototype.propertyIsEnumerable, Qu = (o, e, t) => e in o ? d_(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; + class g_ { constructor(e) { this._changesInElement = /* @__PURE__ */ new Map(), this._elementSnapshots = /* @__PURE__ */ new Map(), this._changedMarkers = /* @__PURE__ */ new Map(), this._changedRoots = /* @__PURE__ */ new Map(), this._changeCount = 0, this._cachedChanges = null, this._cachedChangesWithGraveyard = null, this._refreshedItems = /* @__PURE__ */ new Set(), this._markerCollection = e; } @@ -18864,7 +18864,7 @@ Read more: ${ne}#error-${o}`; if (this._cachedChanges) return e.includeChangesInGraveyard ? this._cachedChangesWithGraveyard.slice() : this._cachedChanges.slice(); let t = []; for (const n of this._changesInElement.keys()) { - const i = this._changesInElement.get(n).sort((d, u) => d.offset === u.offset ? d.type != u.type ? d.type == "remove" ? -1 : 1 : 0 : d.offset < u.offset ? -1 : 1), r = this._elementSnapshots.get(n), s = Xu(n.getChildren()), a = g_(r.length, i); + const i = this._changesInElement.get(n).sort((d, u) => d.offset === u.offset ? d.type != u.type ? d.type == "remove" ? -1 : 1 : 0 : d.offset < u.offset ? -1 : 1), r = this._elementSnapshots.get(n), s = Xu(n.getChildren()), a = m_(r.length, i); let l = 0, c = 0; for (const d of a) if (d === "i") t.push(this._getInsertDiff(n, l, s[l])), l++; else if (d === "r") t.push(this._getRemoveDiff(n, l, r[c])), c++; @@ -18886,13 +18886,13 @@ Read more: ${ne}#error-${o}`; } t = t.filter((n) => n); for (const n of t) delete n.changeCount, n.type == "attribute" && (delete n.position, delete n.length); - return this._changeCount = 0, this._cachedChangesWithGraveyard = t, this._cachedChanges = t.filter(m_), e.includeChangesInGraveyard ? this._cachedChangesWithGraveyard.slice() : this._cachedChanges.slice(); + return this._changeCount = 0, this._cachedChangesWithGraveyard = t, this._cachedChanges = t.filter(p_), e.includeChangesInGraveyard ? this._cachedChangesWithGraveyard.slice() : this._cachedChanges.slice(); } getChangedRoots() { return Array.from(this._changedRoots.values()).map((e) => { const t = ((n, i) => { - for (var r in i || (i = {})) d_.call(i, r) && Qu(n, r, i[r]); - if (Yu) for (var r of Yu(i)) u_.call(i, r) && Qu(n, r, i[r]); + for (var r in i || (i = {})) u_.call(i, r) && Qu(n, r, i[r]); + if (Yu) for (var r of Yu(i)) h_.call(i, r) && Qu(n, r, i[r]); return n; })({}, e); return t.state !== void 0 && delete t.attributes, t; @@ -19042,7 +19042,7 @@ Read more: ${ne}#error-${o}`; else e.push({ name: t.name, attributes: new Map(t.getAttributes()) }); return e; } - function g_(o, e) { + function m_(o, e) { const t = []; let n = 0, i = 0; for (const r of e) { @@ -19061,11 +19061,11 @@ Read more: ${ne}#error-${o}`; if (i < o) for (let r = 0; r < o - i - n; r++) t.push("e"); return t; } - function m_(o) { + function p_(o) { const e = "position" in o && o.position.root.rootName == "$graveyard", t = "range" in o && o.range.root.rootName == "$graveyard"; return !e && !t; } - class p_ { + class f_ { constructor() { this._operations = [], this._undoPairs = /* @__PURE__ */ new Map(), this._undoneOperations = /* @__PURE__ */ new Set(), this._baseVersionToOperationIndex = /* @__PURE__ */ new Map(), this._version = 0, this._gaps = /* @__PURE__ */ new Map(); } @@ -19131,15 +19131,15 @@ Read more: ${ne}#error-${o}`; Ui.prototype.is = function(o, e) { return e ? e === this.name && (o === "rootElement" || o === "model:rootElement" || o === "element" || o === "model:element") : o === "rootElement" || o === "model:rootElement" || o === "element" || o === "model:element" || o === "node" || o === "model:node"; }; - var f_ = Object.defineProperty, b_ = Object.defineProperties, k_ = Object.getOwnPropertyDescriptors, eh = Object.getOwnPropertySymbols, w_ = Object.prototype.hasOwnProperty, A_ = Object.prototype.propertyIsEnumerable, th = (o, e, t) => e in o ? f_(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, nh = (o, e) => { - for (var t in e || (e = {})) w_.call(e, t) && th(o, t, e[t]); - if (eh) for (var t of eh(e)) A_.call(e, t) && th(o, t, e[t]); + var b_ = Object.defineProperty, k_ = Object.defineProperties, w_ = Object.getOwnPropertyDescriptors, eh = Object.getOwnPropertySymbols, A_ = Object.prototype.hasOwnProperty, __ = Object.prototype.propertyIsEnumerable, th = (o, e, t) => e in o ? b_(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, nh = (o, e) => { + for (var t in e || (e = {})) A_.call(e, t) && th(o, t, e[t]); + if (eh) for (var t of eh(e)) __.call(e, t) && th(o, t, e[t]); return o; - }, oh = (o, e) => b_(o, k_(e)); + }, oh = (o, e) => k_(o, w_(e)); const Js = "$graveyard"; - class __ extends _e() { + class v_ extends _e() { constructor(e) { - super(), this.model = e, this.history = new p_(), this.selection = new Dt(this), this.roots = new vt({ idProperty: "rootName" }), this.differ = new h_(e.markers), this.isReadOnly = !1, this._postFixers = /* @__PURE__ */ new Set(), this._hasSelectionChangedFromTheLastChangeBlock = !1, this.createRoot("$root", Js), this.listenTo(e, "applyOperation", (t, n) => { + super(), this.model = e, this.history = new f_(), this.selection = new Dt(this), this.roots = new vt({ idProperty: "rootName" }), this.differ = new g_(e.markers), this.isReadOnly = !1, this._postFixers = /* @__PURE__ */ new Set(), this._hasSelectionChangedFromTheLastChangeBlock = !1, this.createRoot("$root", Js), this.listenTo(e, "applyOperation", (t, n) => { const i = n[0]; i.isDocumentOperation && this.differ.bufferOperation(i); }, { priority: "high" }), this.listenTo(e, "applyOperation", (t, n) => { @@ -19222,8 +19222,8 @@ Read more: ${ne}#error-${o}`; } return !0; } - var v_ = Object.defineProperty, C_ = Object.defineProperties, y_ = Object.getOwnPropertyDescriptors, rh = Object.getOwnPropertySymbols, E_ = Object.prototype.hasOwnProperty, x_ = Object.prototype.propertyIsEnumerable, sh = (o, e, t) => e in o ? v_(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; - class S_ extends _e() { + var C_ = Object.defineProperty, y_ = Object.defineProperties, E_ = Object.getOwnPropertyDescriptors, rh = Object.getOwnPropertySymbols, x_ = Object.prototype.hasOwnProperty, S_ = Object.prototype.propertyIsEnumerable, sh = (o, e, t) => e in o ? C_(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; + class D_ extends _e() { constructor() { super(...arguments), this._markers = /* @__PURE__ */ new Map(); } @@ -19249,10 +19249,10 @@ Read more: ${ne}#error-${o}`; const a = Ut.fromRange(t), l = new lo(r, a, n, i); var c; return this._markers.set(r, l), this.fire(`update:${r}`, l, null, t, (c = ((d, u) => { - for (var g in u || (u = {})) E_.call(u, g) && sh(d, g, u[g]); - if (rh) for (var g of rh(u)) x_.call(u, g) && sh(d, g, u[g]); + for (var g in u || (u = {})) x_.call(u, g) && sh(d, g, u[g]); + if (rh) for (var g of rh(u)) S_.call(u, g) && sh(d, g, u[g]); return d; - })({}, l.getData()), C_(c, y_({ range: null })))), l; + })({}, l.getData()), y_(c, E_({ range: null })))), l; } _remove(e) { const t = e instanceof lo ? e.name : e, n = this._markers.get(t); @@ -19281,7 +19281,7 @@ Read more: ${ne}#error-${o}`; e.stopListening(), e._detachLiveRange(); } } - class lo extends _e(sn) { + class lo extends _e(an) { constructor(e, t, n, i) { super(), this.name = e, this._liveRange = this._attachLiveRange(t), this._managedUsingOperations = n, this._affectsData = i; } @@ -19318,7 +19318,7 @@ Read more: ${ne}#error-${o}`; lo.prototype.is = function(o) { return o === "marker" || o === "model:marker"; }; - class D_ extends wt { + class B_ extends wt { constructor(e, t) { super(null), this.sourcePosition = e.clone(), this.howMany = t; } @@ -19342,7 +19342,7 @@ Read more: ${ne}#error-${o}`; return "DetachOperation"; } } - class Kt extends sn { + class Kt extends an { constructor(e) { super(), this.markers = /* @__PURE__ */ new Map(), this._children = new $o(), e && this._insertChild(0, e); } @@ -19431,7 +19431,7 @@ Read more: ${ne}#error-${o}`; Kt.prototype.is = function(o) { return o === "documentFragment" || o === "model:documentFragment"; }; - class B_ { + class T_ { constructor(e, t) { this.model = e, this.batch = t; } @@ -19511,7 +19511,7 @@ Read more: ${ne}#error-${o}`; remove(e) { this._assertWriterUsedCorrectly(); const t = (e instanceof V ? e : V._createOn(e)).getMinimalFlatRanges().reverse(); - for (const n of t) this._addOperationForAffectedMarkers("move", n), T_(n.start, n.end.offset - n.start.offset, this.batch, this.model); + for (const n of t) this._addOperationForAffectedMarkers("move", n), I_(n.start, n.end.offset - n.start.offset, this.batch, this.model); } merge(e) { this._assertWriterUsedCorrectly(); @@ -19707,18 +19707,18 @@ Read more: ${ne}#error-${o}`; const r = o.model, s = r.document, a = new ct(e, t, n, r.markers, !!i, s.version); o.batch.addOperation(a), r.applyOperation(a); } - function T_(o, e, t, n) { + function I_(o, e, t, n) { let i; if (o.root.document) { const r = n.document, s = new U(r.graveyard, [0]); i = new be(o, e, s, r.version); - } else i = new D_(o, e); + } else i = new B_(o, e); t.addOperation(i), n.applyOperation(i); } function ch(o, e) { return o === e || o instanceof Ui && e instanceof Ui; } - function I_(o, e, t = {}) { + function P_(o, e, t = {}) { if (e.isCollapsed) return; const n = e.getFirstRange(); if (n.root.rootName == "$graveyard") return; @@ -19824,7 +19824,7 @@ Read more: ${ne}#error-${o}`; } }); } - class P_ { + class R_ { constructor(e, t, n) { this._firstNode = null, this._lastNode = null, this._lastAutoParagraph = null, this._filterAttributesOf = [], this._affectedStart = null, this._affectedEnd = null, this._nodeToSelect = null, this.model = e, this.writer = t, this.position = n, this.canMergeWith = /* @__PURE__ */ new Set([this.position.parent]), this.schema = e.schema, this._documentFragment = t.createDocumentFragment(), this._documentFragmentPosition = t.createPositionAt(this._documentFragment, 0); } @@ -19933,7 +19933,7 @@ Read more: ${ne}#error-${o}`; const r = e.createPositionAfter(i); return o.focus.isTouching(r) ? e.createRange(r) : e.createRange(e.createPositionBefore(i)); } - function R_(o, e, t, n = {}) { + function O_(o, e, t, n = {}) { if (!o.schema.isObject(e)) throw new T("insertobject-element-not-an-object", o, { object: e }); const i = t || o.document.selection; let r = i; @@ -19955,16 +19955,16 @@ Read more: ${ne}#error-${o}`; }(l, e, n.setSelection, a), u; }); } - const O_ = ' ,.?!:;"-()'; - function z_(o, e) { + const z_ = ' ,.?!:;"-()'; + function M_(o, e) { const { isForward: t, walker: n, unit: i, schema: r, treatEmojiAsSingleUnit: s } = o, { type: a, item: l, nextPosition: c } = e; if (a == "text") return o.unit === "word" ? function(d, u) { let g = d.position.textNode; for (g || (g = u ? d.position.nodeAfter : d.position.nodeBefore); g && g.is("$text"); ) { const p = d.position.offset - g.startOffset; - if (N_(g, p, u)) g = u ? d.position.nodeAfter : d.position.nodeBefore; + if (V_(g, p, u)) g = u ? d.position.nodeAfter : d.position.nodeBefore; else { - if (F_(g.data, p, u)) break; + if (N_(g.data, p, u)) break; d.next(); } } @@ -19986,29 +19986,29 @@ Read more: ${ne}#error-${o}`; if (r.checkChild(c, "$text")) return c; } } - function M_(o, e) { + function F_(o, e) { const t = o.root, n = U._createAt(t, e ? "end" : 0); return e ? new V(o, n) : new V(n, o); } - function F_(o, e, t) { + function N_(o, e, t) { const n = e + (t ? 0 : -1); - return O_.includes(o.charAt(n)); + return z_.includes(o.charAt(n)); } - function N_(o, e, t) { + function V_(o, e, t) { return e === (t ? o.offsetSize : 0); } - class V_ extends ve() { + class L_ extends ve() { constructor() { - super(), this.markers = new S_(), this.document = new __(this), this.schema = new z0(), this._pendingChanges = [], this._currentWriter = null, ["deleteContent", "modifySelection", "getSelectedContent", "applyOperation"].forEach((e) => this.decorate(e)), this.on("applyOperation", (e, t) => { + super(), this.markers = new D_(), this.document = new v_(this), this.schema = new M0(), this._pendingChanges = [], this._currentWriter = null, ["deleteContent", "modifySelection", "getSelectedContent", "applyOperation"].forEach((e) => this.decorate(e)), this.on("applyOperation", (e, t) => { t[0]._validate(); }, { priority: "highest" }), this.schema.register("$root", { isLimit: !0 }), this.schema.register("$container", { allowIn: ["$root", "$container"] }), this.schema.register("$block", { allowIn: ["$root", "$container"], isBlock: !0 }), this.schema.register("$blockObject", { allowWhere: "$block", isBlock: !0, isObject: !0 }), this.schema.register("$inlineObject", { allowWhere: "$text", allowAttributesOf: "$text", isInline: !0, isObject: !0 }), this.schema.register("$text", { allowIn: "$block", isInline: !0, isContent: !0 }), this.schema.register("$clipboardHolder", { allowContentOf: "$root", allowChildren: "$text", isLimit: !0 }), this.schema.register("$documentFragment", { allowContentOf: "$root", allowChildren: "$text", isLimit: !0 }), this.schema.register("$marker"), this.schema.addChildCheck((e, t) => { if (t.name === "$marker") return !0; - }), P0(this), this.document.registerPostFixer(Du), this.on("insertContent", (e, [t, n]) => { + }), R0(this), this.document.registerPostFixer(Du), this.on("insertContent", (e, [t, n]) => { e.return = function(i, r, s) { return i.change((a) => { const l = s || i.document.selection; l.isCollapsed || i.deleteContent(l, { doNotAutoparagraph: !0 }); - const c = new P_(i, a, l.anchor), d = []; + const c = new R_(i, a, l.anchor), d = []; let u; if (r.is("documentFragment")) { if (r.markers.size) { @@ -20053,7 +20053,7 @@ Read more: ${ne}#error-${o}`; }); }(this, t, n); }), this.on("insertObject", (e, [t, n, i]) => { - e.return = R_(this, t, n, i); + e.return = O_(this, t, n, i); }), this.on("canEditAt", (e) => { const t = !this.document.isReadOnly; e.return = t, t || e.stop(); @@ -20085,15 +20085,15 @@ Read more: ${ne}#error-${o}`; return this.fire("insertObject", [e, s, i, i, ...r]); } deleteContent(e, t) { - I_(this, e, t); + P_(this, e, t); } modifySelection(e, t) { (function(n, i, r = {}) { - const s = n.schema, a = r.direction != "backward", l = r.unit ? r.unit : "character", c = !!r.treatEmojiAsSingleUnit, d = i.focus, u = new Nt({ boundaries: M_(d, a), singleCharacters: !0, direction: a ? "forward" : "backward" }), g = { walker: u, schema: s, isForward: a, unit: l, treatEmojiAsSingleUnit: c }; + const s = n.schema, a = r.direction != "backward", l = r.unit ? r.unit : "character", c = !!r.treatEmojiAsSingleUnit, d = i.focus, u = new Nt({ boundaries: F_(d, a), singleCharacters: !0, direction: a ? "forward" : "backward" }), g = { walker: u, schema: s, isForward: a, unit: l, treatEmojiAsSingleUnit: c }; let p; for (; p = u.next(); ) { if (p.done) return; - const b = z_(g, p.value); + const b = M_(g, p.value); if (b) return void (i instanceof Dt ? n.change((w) => { w.setSelectionFocus(b); }) : i.setFocus(b)); @@ -20161,7 +20161,7 @@ Read more: ${ne}#error-${o}`; return new ao(e); } createOperationFromJSON(e) { - return o_.fromJSON(e, this.document); + return i_.fromJSON(e, this.document); } destroy() { this.document.destroy(), this.stopListening(); @@ -20172,7 +20172,7 @@ Read more: ${ne}#error-${o}`; try { for (; this._pendingChanges.length; ) { const t = this._pendingChanges[0].batch; - this._currentWriter = new B_(this, t); + this._currentWriter = new T_(this, t); const n = this._pendingChanges[0].callback(this._currentWriter); e.push(n), this.document._handleChangeBlock(this._currentWriter), this._pendingChanges.shift(), this._currentWriter = null; } @@ -20185,7 +20185,7 @@ Read more: ${ne}#error-${o}`; function Qs(o, e) { if (o) return o instanceof kt || o instanceof Dt ? o : o instanceof xn ? e || e === 0 ? new kt(o, e) : o.is("rootElement") ? new kt(o, "in") : new kt(o, "on") : new kt(o); } - class L_ extends rn { + class j_ extends sn { constructor() { super(...arguments), this.domEventType = "click"; } @@ -20193,7 +20193,7 @@ Read more: ${ne}#error-${o}`; this.fire(e.type, e); } } - class Xs extends rn { + class Xs extends sn { constructor() { super(...arguments), this.domEventType = ["mousedown", "mouseup", "mouseover", "mouseout"]; } @@ -20295,23 +20295,23 @@ Read more: ${ne}#error-${o}`; return new zt(...e); } } - function j_(o = "") { + function $_(o = "") { if (o === "") return { top: void 0, right: void 0, bottom: void 0, left: void 0 }; const e = o.replace(/, /g, ",").split(" ").map((r) => r.replace(/,/g, ", ")), t = e[0], n = e[2] || t, i = e[1] || t; return { top: t, bottom: n, right: i, left: e[3] || i }; } - function $_({ top: o, right: e, bottom: t, left: n }) { + function H_({ top: o, right: e, bottom: t, left: n }) { const i = []; return n !== e ? i.push(o, e, t, n) : t !== o ? i.push(o, e, t) : e !== o ? i.push(o, e) : i.push(o), i.join(" "); } - function H_(o) { + function q_(o) { var e, t; - o.setNormalizer("margin", (e = "margin", (n) => ({ path: e, value: j_(n) }))), o.setNormalizer("margin-top", (n) => ({ path: "margin.top", value: n })), o.setNormalizer("margin-right", (n) => ({ path: "margin.right", value: n })), o.setNormalizer("margin-bottom", (n) => ({ path: "margin.bottom", value: n })), o.setNormalizer("margin-left", (n) => ({ path: "margin.left", value: n })), o.setReducer("margin", (t = "margin", (n) => { + o.setNormalizer("margin", (e = "margin", (n) => ({ path: e, value: $_(n) }))), o.setNormalizer("margin-top", (n) => ({ path: "margin.top", value: n })), o.setNormalizer("margin-right", (n) => ({ path: "margin.right", value: n })), o.setNormalizer("margin-bottom", (n) => ({ path: "margin.bottom", value: n })), o.setNormalizer("margin-left", (n) => ({ path: "margin.left", value: n })), o.setReducer("margin", (t = "margin", (n) => { const { top: i, right: r, bottom: s, left: a } = n, l = []; - return [i, r, a, s].every((c) => !!c) ? l.push([t, $_(n)]) : (i && l.push([t + "-top", i]), r && l.push([t + "-right", r]), s && l.push([t + "-bottom", s]), a && l.push([t + "-left", a])), l; + return [i, r, a, s].every((c) => !!c) ? l.push([t, H_(n)]) : (i && l.push([t + "-top", i]), r && l.push([t + "-right", r]), s && l.push([t + "-bottom", s]), a && l.push([t + "-left", a])), l; })), o.setStyleRelation("margin", ["margin-top", "margin-right", "margin-bottom", "margin-left"]); } - class q_ { + class U_ { constructor() { this._commands = /* @__PURE__ */ new Map(); } @@ -20339,17 +20339,17 @@ Read more: ${ne}#error-${o}`; for (const e of this.commands()) e.destroy(); } } - class U_ extends ve() { + class W_ extends ve() { constructor(e = {}) { super(); const t = this.constructor, n = e.language || t.defaultConfig && t.defaultConfig.language; this._context = e.context || new pd({ language: n }), this._context._addEditor(this, !e.context); const i = Array.from(t.builtinPlugins || []); - this.config = new fc(e, t.defaultConfig), this.config.define("plugins", i), this.config.define(this._context._getEditorConfig()), this.plugins = new md(this, i, this._context.plugins), this.locale = this._context.locale, this.t = this.locale.t, this._readOnlyLocks = /* @__PURE__ */ new Set(), this.commands = new q_(), this.set("state", "initializing"), this.once("ready", () => this.state = "ready", { priority: "high" }), this.once("destroy", () => this.state = "destroyed", { priority: "high" }), this.model = new V_(), this.on("change:isReadOnly", () => { + this.config = new fc(e, t.defaultConfig), this.config.define("plugins", i), this.config.define(this._context._getEditorConfig()), this.plugins = new md(this, i, this._context.plugins), this.locale = this._context.locale, this.t = this.locale.t, this._readOnlyLocks = /* @__PURE__ */ new Set(), this.commands = new U_(), this.set("state", "initializing"), this.once("ready", () => this.state = "ready", { priority: "high" }), this.once("destroy", () => this.state = "destroyed", { priority: "high" }), this.model = new L_(), this.on("change:isReadOnly", () => { this.model.document.isReadOnly = this.isReadOnly; }); - const r = new fA(); - this.data = new t_(this.model, r), this.editing = new R0(this.model, r), this.editing.view.document.bind("isReadOnly").to(this), this.conversion = new n_([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 Fw(this), this.keystrokes.listenTo(this.editing.view.document); + const r = new bA(); + this.data = new n_(this.model, r), this.editing = new O0(this.model, r), this.editing.view.document.bind("isReadOnly").to(this), this.conversion = new o_([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 Nw(this), this.keystrokes.listenTo(this.editing.view.document); } get isReadOnly() { return this._readOnlyLocks.size > 0; @@ -20410,7 +20410,7 @@ Read more: ${ne}#error-${o}`; updateSourceElement(e = this.data.get()) { if (!this.sourceElement) throw new T("editor-missing-sourceelement", this); const t = this.config.get("updateSourceElementOnDestroy"), n = this.sourceElement instanceof HTMLTextAreaElement; - aw(this.sourceElement, t || n ? e : ""); + lw(this.sourceElement, t || n ? e : ""); } }; } @@ -20438,21 +20438,21 @@ Read more: ${ne}#error-${o}`; } } const Pe = { bold: '', cancel: '', caption: '', check: '', cog: '', eraser: '', image: '', lowVision: '', importExport: '', paragraph: '', plus: '', text: '', alignBottom: '', alignMiddle: '', alignTop: '', alignLeft: '', alignCenter: '', alignRight: '', alignJustify: '', objectLeft: '', objectCenter: '', objectRight: '', objectFullWidth: '', objectInline: '', objectBlockLeft: '', objectBlockRight: '', objectSizeFull: '', objectSizeLarge: '', objectSizeSmall: '', objectSizeMedium: '', pencil: '', pilcrow: '', quote: '', threeVerticalDots: '' }; - var fh = S(5542), W_ = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(fh.Z, W_), fh.Z.locals; - const { threeVerticalDots: bh } = Pe, K_ = { alignLeft: Pe.alignLeft, bold: Pe.bold, importExport: Pe.importExport, paragraph: Pe.paragraph, plus: Pe.plus, text: Pe.text, threeVerticalDots: Pe.threeVerticalDots }; + var fh = S(5542), K_ = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(fh.Z, K_), fh.Z.locals; + const { threeVerticalDots: bh } = Pe, G_ = { alignLeft: Pe.alignLeft, bold: Pe.bold, importExport: Pe.importExport, paragraph: Pe.paragraph, plus: Pe.plus, text: Pe.text, threeVerticalDots: Pe.threeVerticalDots }; class ta extends ue { constructor(e, t) { super(e); const n = this.bindTemplate, i = this.t; - this.options = t || {}, this.set("ariaLabel", i("Editor toolbar")), this.set("maxWidth", "auto"), this.items = this.createCollection(), this.focusTracker = new xt(), this.keystrokes = new Ht(), this.set("class", void 0), this.set("isCompact", !1), this.itemsView = new G_(e), this.children = this.createCollection(), this.children.add(this.itemsView), this.focusables = this.createCollection(); + this.options = t || {}, this.set("ariaLabel", i("Editor toolbar")), this.set("maxWidth", "auto"), this.items = this.createCollection(), this.focusTracker = new xt(), this.keystrokes = new Ht(), this.set("class", void 0), this.set("isCompact", !1), this.itemsView = new Z_(e), this.children = this.createCollection(), this.children.add(this.itemsView), this.focusables = this.createCollection(); const r = e.uiLanguageDirection === "rtl"; this._focusCycler = new Mo({ focusables: this.focusables, focusTracker: this.focusTracker, keystrokeHandler: this.keystrokes, actions: { focusPrevious: [r ? "arrowright" : "arrowleft", "arrowup"], focusNext: [r ? "arrowleft" : "arrowright", "arrowdown"] } }); const s = ["ck", "ck-toolbar", n.to("class"), n.if("isCompact", "ck-toolbar_compact")]; var a; this.options.shouldGroupWhenFull && this.options.isFloating && s.push("ck-toolbar_floating"), this.setTemplate({ tag: "div", attributes: { class: s, role: "toolbar", "aria-label": n.to("ariaLabel"), style: { maxWidth: n.to("maxWidth") }, tabindex: -1 }, children: this.children, on: { mousedown: (a = this, a.bindTemplate.to((l) => { l.target === a.element && l.preventDefault(); - })) } }), this._behavior = this.options.shouldGroupWhenFull ? new J_(this) : new Z_(this); + })) } }), this._behavior = this.options.shouldGroupWhenFull ? new Y_(this) : new J_(this); } render() { super.render(), this.focusTracker.add(this.element); @@ -20477,7 +20477,7 @@ Read more: ${ne}#error-${o}`; } _buildItemsFromConfig(e, t, n) { const i = dd(e), r = n || i.removeItems; - return this._cleanItemsConfiguration(i.items, t, r).map((s) => ze(s) ? this._createNestedToolbarDropdown(s, t, r) : s === "|" ? new cd() : s === "-" ? new Mw() : t.create(s)).filter((s) => !!s); + return this._cleanItemsConfiguration(i.items, t, r).map((s) => ze(s) ? this._createNestedToolbarDropdown(s, t, r) : s === "|" ? new cd() : s === "-" ? new Fw() : t.create(s)).filter((s) => !!s); } _cleanItemsConfiguration(e, t, n) { const i = e.filter((r, s, a) => r === "|" || n.indexOf(r) === -1 && (r === "-" ? !this.options.shouldGroupWhenFull || (ee("toolbarview-line-break-ignored-when-grouping-items", a), !1) : !(!ze(r) && !t.has(r)) || (ee("toolbarview-item-unavailable", { item: r }), !1))); @@ -20493,15 +20493,15 @@ Read more: ${ne}#error-${o}`; let { label: i, icon: r, items: s, tooltip: a = !0, withText: l = !1 } = e; if (s = this._cleanItemsConfiguration(s, t, n), !s.length) return null; const c = Gt(this.locale); - return i || ee("toolbarview-nested-toolbar-dropdown-missing-label", e), c.class = "ck-toolbar__nested-toolbar-dropdown", c.buttonView.set({ label: i, tooltip: a, withText: !!l }), r !== !1 ? c.buttonView.icon = K_[r] || r || bh : c.buttonView.withText = !0, Zi(c, () => c.toolbarView._buildItemsFromConfig(s, t, n)), c; + return i || ee("toolbarview-nested-toolbar-dropdown-missing-label", e), c.class = "ck-toolbar__nested-toolbar-dropdown", c.buttonView.set({ label: i, tooltip: a, withText: !!l }), r !== !1 ? c.buttonView.icon = G_[r] || r || bh : c.buttonView.withText = !0, Zi(c, () => c.toolbarView._buildItemsFromConfig(s, t, n)), c; } } - class G_ extends ue { + class Z_ extends ue { constructor(e) { super(e), this.children = this.createCollection(), this.setTemplate({ tag: "div", attributes: { class: ["ck", "ck-toolbar__items"] }, children: this.children }); } } - class Z_ { + class J_ { constructor(e) { const t = e.bindTemplate; e.set("isVertical", !1), e.itemsView.children.bindTo(e.items).using((n) => n), e.focusables.bindTo(e.items).using((n) => n), e.extendTemplate({ attributes: { class: [t.if("isVertical", "ck-toolbar_vertical")] } }); @@ -20511,7 +20511,7 @@ Read more: ${ne}#error-${o}`; destroy() { } } - class J_ { + class Y_ { constructor(e) { this.resizeObserver = null, this.cachedPadding = null, this.shouldUpdateGroupingOnNextResize = !1, this.view = e, this.viewChildren = e.children, this.viewFocusables = e.focusables, this.viewItemsView = e.itemsView, this.viewFocusTracker = e.focusTracker, this.viewLocale = e.locale, this.ungroupedItems = e.createCollection(), this.groupedItems = e.createCollection(), this.groupedItemsDropdown = this._createGroupedItemsDropdown(), e.itemsView.children.bindTo(this.ungroupedItems).using((t) => t), this.ungroupedItems.on("change", this._updateFocusCycleableItems.bind(this)), e.children.on("change", this._updateFocusCycleableItems.bind(this)), e.items.on("change", (t, n) => { const i = n.index, r = Array.from(n.added); @@ -20577,9 +20577,9 @@ Read more: ${ne}#error-${o}`; }), this.groupedItems.length && this.viewFocusables.add(this.groupedItemsDropdown); } } - var kh = S(1046), Y_ = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(kh.Z, Y_), kh.Z.locals; - class Q_ extends ue { + var kh = S(1046), Q_ = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(kh.Z, Q_), kh.Z.locals; + class X_ extends ue { constructor(e) { super(e); const t = this.bindTemplate; @@ -20614,13 +20614,13 @@ Read more: ${ne}#error-${o}`; this.children.first.focus(); } } - class X_ extends ue { + class ev extends ue { constructor(e) { super(e), this.setTemplate({ tag: "li", attributes: { class: ["ck", "ck-list__separator"] } }); } } - var Ah = S(7686), ev = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Ah.Z, ev), Ah.Z.locals; + var Ah = S(7686), tv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Ah.Z, tv), Ah.Z.locals; class na extends ue { constructor(e) { super(e); @@ -20649,12 +20649,12 @@ Read more: ${ne}#error-${o}`; return e.icon = ad, e.extendTemplate({ attributes: { class: ["ck-splitbutton__arrow"], "data-cke-tooltip-disabled": t.to("isOn"), "aria-haspopup": !0, "aria-expanded": t.to("isOn", (n) => String(n)) } }), e.bind("isEnabled").to(this), e.bind("label").to(this), e.bind("tooltip").to(this), e.delegate("execute").to(this, "open"), e; } } - var _h = S(7339), tv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(_h.Z, tv), _h.Z.locals; - var vh = S(3949), nv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(vh.Z, nv), vh.Z.locals; + var _h = S(7339), nv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(_h.Z, nv), _h.Z.locals; + var vh = S(3949), ov = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(vh.Z, ov), vh.Z.locals; function Gt(o, e = ld) { - const t = new e(o), n = new Ow(o), i = new ps(o, t, n); + const t = new e(o), n = new zw(o), i = new ps(o, t, n); return t.bind("isEnabled").to(i), t instanceof na ? t.arrowView.bind("isOn").to(i, "isOpen") : t.bind("isOn").to(i, "isOpen"), function(r) { (function(s) { s.on("render", () => { @@ -20700,9 +20700,9 @@ Read more: ${ne}#error-${o}`; o.isOpen ? yh(o, e, t) : o.once("change:isOpen", () => yh(o, e, t), { priority: "highest" }), Eh(o, () => o.listView.items.find((n) => n instanceof wh && n.children.first.isOn)); } function yh(o, e, t) { - const n = o.locale, i = o.listView = new Q_(n), r = typeof e == "function" ? e() : e; + const n = o.locale, i = o.listView = new X_(n), r = typeof e == "function" ? e() : e; i.ariaLabel = t.ariaLabel, i.role = t.role, i.items.bindTo(r).using((s) => { - if (s.type === "separator") return new X_(n); + if (s.type === "separator") return new ev(n); if (s.type === "button" || s.type === "switchbutton") { const a = new wh(n); let l; @@ -20719,28 +20719,28 @@ Read more: ${ne}#error-${o}`; }, { priority: se.low - 10 }); } function xh(o, e, t) { - const n = new Rw(o.locale); + const n = new Ow(o.locale); return n.set({ id: e, ariaDescribedById: t }), n.bind("isReadOnly").to(o, "isEnabled", (i) => !i), n.bind("hasError").to(o, "errorText", (i) => !!i), n.on("input", () => { o.errorText = null; }), o.bind("isEmpty", "isFocused", "placeholder").to(n), n; } - const Jo = (o, e = 0, t = 1) => o > t ? t : o < e ? e : o, nt = (o, e = 0, t = Math.pow(10, e)) => Math.round(t * o) / t, ia = (o) => (o[0] === "#" && (o = o.substring(1)), o.length < 6 ? { r: parseInt(o[0] + o[0], 16), g: parseInt(o[1] + o[1], 16), b: parseInt(o[2] + o[2], 16), a: o.length === 4 ? nt(parseInt(o[3] + o[3], 16) / 255, 2) : 1 } : { r: parseInt(o.substring(0, 2), 16), g: parseInt(o.substring(2, 4), 16), b: parseInt(o.substring(4, 6), 16), a: o.length === 8 ? nt(parseInt(o.substring(6, 8), 16) / 255, 2) : 1 }), ov = ({ h: o, s: e, v: t, a: n }) => { + const Jo = (o, e = 0, t = 1) => o > t ? t : o < e ? e : o, nt = (o, e = 0, t = Math.pow(10, e)) => Math.round(t * o) / t, ia = (o) => (o[0] === "#" && (o = o.substring(1)), o.length < 6 ? { r: parseInt(o[0] + o[0], 16), g: parseInt(o[1] + o[1], 16), b: parseInt(o[2] + o[2], 16), a: o.length === 4 ? nt(parseInt(o[3] + o[3], 16) / 255, 2) : 1 } : { r: parseInt(o.substring(0, 2), 16), g: parseInt(o.substring(2, 4), 16), b: parseInt(o.substring(4, 6), 16), a: o.length === 8 ? nt(parseInt(o.substring(6, 8), 16) / 255, 2) : 1 }), iv = ({ h: o, s: e, v: t, a: n }) => { const i = (200 - e) * t / 100; return { h: nt(o), s: nt(i > 0 && i < 200 ? e * t / 100 / (i <= 100 ? i : 200 - i) * 100 : 0), l: nt(i / 2), a: nt(n, 2) }; }, ra = (o) => { - const { h: e, s: t, l: n } = ov(o); + const { h: e, s: t, l: n } = iv(o); return `hsl(${e}, ${t}%, ${n}%)`; - }, iv = ({ h: o, s: e, v: t, a: n }) => { + }, rv = ({ h: o, s: e, v: t, a: n }) => { o = o / 360 * 6, e /= 100, t /= 100; const i = Math.floor(o), r = t * (1 - e), s = t * (1 - (o - i) * e), a = t * (1 - (1 - o + i) * e), l = i % 6; return { r: nt(255 * [t, s, r, r, a, t][l]), g: nt(255 * [a, t, t, s, r, r][l]), b: nt(255 * [r, r, a, t, t, s][l]), a: nt(n, 2) }; }, Ji = (o) => { const e = o.toString(16); return e.length < 2 ? "0" + e : e; - }, rv = ({ r: o, g: e, b: t, a: n }) => { + }, sv = ({ r: o, g: e, b: t, a: n }) => { const i = n < 1 ? Ji(nt(255 * n)) : ""; return "#" + Ji(o) + Ji(e) + Ji(t) + i; - }, sv = ({ r: o, g: e, b: t, a: n }) => { + }, av = ({ r: o, g: e, b: t, a: n }) => { const i = Math.max(o, e, t), r = i - Math.min(o, e, t), s = r ? i === o ? (e - t) / r : i === e ? 2 + (t - o) / r : 4 + (o - e) / r : 0; return { h: nt(60 * (s < 0 ? s + 6 : s)), s: nt(i ? r / i * 100 : 0), v: nt(i / 255 * 100), a: n }; }, Sh = (o, e) => { @@ -20797,7 +20797,7 @@ Read more: ${ne}#error-${o}`; }); } } - class av extends Ih { + class lv extends Ih { constructor(e) { super(e, "hue", 'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"', !1); } @@ -20808,7 +20808,7 @@ Read more: ${ne}#error-${o}`; return { h: t ? Jo(this.h + 360 * e.x, 0, 360) : 360 * e.x }; } } - class lv extends Ih { + class cv extends Ih { constructor(e) { super(e, "saturation", 'aria-label="Color"', !0); } @@ -20820,7 +20820,7 @@ Read more: ${ne}#error-${o}`; } } const Yi = Symbol("same"), la = Symbol("color"), Ph = Symbol("hsva"), ca = Symbol("update"), Rh = Symbol("parts"), Oh = Symbol("css"), zh = Symbol("sliders"); - class cv extends HTMLElement { + class dv extends HTMLElement { static get observedAttributes() { return ["color"]; } @@ -20828,7 +20828,7 @@ Read more: ${ne}#error-${o}`; return [':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}', "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]; } get [zh]() { - return [lv, av]; + return [cv, lv]; } get color() { return this[la]; @@ -20866,17 +20866,17 @@ Read more: ${ne}#error-${o}`; this[Ph] = e, this[Rh].forEach((t) => t.update(e)); } } - const dv = { defaultColor: "#000", toHsva: (o) => sv(ia(o)), fromHsva: ({ h: o, s: e, v: t }) => rv(iv({ h: o, s: e, v: t, a: 1 })), equal: (o, e) => o.toLowerCase() === e.toLowerCase() || Sh(ia(o), ia(e)), fromAttr: (o) => o }; - class uv extends cv { + const uv = { defaultColor: "#000", toHsva: (o) => av(ia(o)), fromHsva: ({ h: o, s: e, v: t }) => sv(rv({ h: o, s: e, v: t, a: 1 })), equal: (o, e) => o.toLowerCase() === e.toLowerCase() || Sh(ia(o), ia(e)), fromAttr: (o) => o }; + class hv extends dv { get colorModel() { - return dv; + return uv; } } - customElements.define("hex-color-picker", class extends uv { + customElements.define("hex-color-picker", class extends hv { }); - var Mh = S(3398), hv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Mh.Z, hv), Mh.Z.locals; - class gv { + var Mh = S(3398), gv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Mh.Z, gv), Mh.Z.locals; + class mv { constructor(e) { this._components = /* @__PURE__ */ new Map(), this.editor = e; } @@ -20897,11 +20897,11 @@ Read more: ${ne}#error-${o}`; function da(o) { return String(o).toLowerCase(); } - var Fh = S(8793), mv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Fh.Z, mv), Fh.Z.locals; - var pv = Object.defineProperty, Nh = Object.getOwnPropertySymbols, fv = Object.prototype.hasOwnProperty, bv = Object.prototype.propertyIsEnumerable, Vh = (o, e, t) => e in o ? pv(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, pe = (o, e) => { - for (var t in e || (e = {})) fv.call(e, t) && Vh(o, t, e[t]); - if (Nh) for (var t of Nh(e)) bv.call(e, t) && Vh(o, t, e[t]); + var Fh = S(8793), pv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Fh.Z, pv), Fh.Z.locals; + var fv = Object.defineProperty, Nh = Object.getOwnPropertySymbols, bv = Object.prototype.hasOwnProperty, kv = Object.prototype.propertyIsEnumerable, Vh = (o, e, t) => e in o ? fv(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, pe = (o, e) => { + for (var t in e || (e = {})) bv.call(e, t) && Vh(o, t, e[t]); + if (Nh) for (var t of Nh(e)) kv.call(e, t) && Vh(o, t, e[t]); return o; }; const Lh = rs("px"), jh = ce.document.body, ua = class extends ue { @@ -20958,9 +20958,9 @@ Read more: ${ne}#error-${o}`; } } ht.arrowSideOffset = 25, ht.arrowHeightOffset = 10, ht.stickyVerticalOffset = 20, ht._getOptimalPosition = Dc, ht.defaultPositions = $h(); - var Hh = S(3332), kv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Hh.Z, kv), Hh.Z.locals; - const qh = "ck-tooltip", gt = class extends on() { + var Hh = S(3332), wv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Hh.Z, wv), Hh.Z.locals; + const qh = "ck-tooltip", gt = class extends rn() { constructor(o) { if (super(), this._currentElementWithTooltip = null, this._currentTooltipPosition = null, this._resizeObserver = null, gt._editors.add(o), gt._instance) return gt._instance; gt._instance = this, this.tooltipTextView = new ue(o.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 ht(o.locale), this.balloonPanelView.class = qh, this.balloonPanelView.content.add(this.tooltipTextView), this._pinTooltipDebounced = jo(this._pinTooltip, 600), this.listenTo(ce.document, "mouseenter", this._onEnterOrFocus.bind(this), { useCapture: !0 }), this.listenTo(ce.document, "mouseleave", this._onLeaveOrBlur.bind(this), { useCapture: !0 }), this.listenTo(ce.document, "focus", this._onEnterOrFocus.bind(this), { useCapture: !0 }), this.listenTo(ce.document, "blur", this._onLeaveOrBlur.bind(this), { useCapture: !0 }), this.listenTo(ce.document, "scroll", this._onScroll.bind(this), { useCapture: !0 }), this._watchdogExcluded = !0; @@ -21018,13 +21018,13 @@ Read more: ${ne}#error-${o}`; if (typeof o != "function") throw new TypeError("Expected a function"); return ze(t) && (n = "leading" in t ? !!t.leading : n, i = "trailing" in t ? !!t.trailing : i), jo(o, e, { leading: n, maxWait: e, trailing: i }); }; - var wv = Object.defineProperty, Uh = Object.getOwnPropertySymbols, Av = Object.prototype.hasOwnProperty, _v = Object.prototype.propertyIsEnumerable, Wh = (o, e, t) => e in o ? wv(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, vv = (o, e) => { - for (var t in e || (e = {})) Av.call(e, t) && Wh(o, t, e[t]); - if (Uh) for (var t of Uh(e)) _v.call(e, t) && Wh(o, t, e[t]); + var Av = Object.defineProperty, Uh = Object.getOwnPropertySymbols, _v = Object.prototype.hasOwnProperty, vv = Object.prototype.propertyIsEnumerable, Wh = (o, e, t) => e in o ? Av(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, Cv = (o, e) => { + for (var t in e || (e = {})) _v.call(e, t) && Wh(o, t, e[t]); + if (Uh) for (var t of Uh(e)) vv.call(e, t) && Wh(o, t, e[t]); return o; }; - const Cv = 50, yv = 350, Ev = "Powered by", Xi = { top: -99999, left: -99999, name: "invalid", config: { withArrow: !1 } }; - class xv extends on() { + const yv = 50, Ev = 350, xv = "Powered by", Xi = { top: -99999, left: -99999, name: "invalid", config: { withArrow: !1 } }; + class Sv extends rn() { constructor(e) { super(), this.editor = e, this._balloonView = null, this._lastFocusedEditableElement = null, this._showBalloonThrottled = ma(this._showBalloon.bind(this), 50, { leading: !0 }), e.on("ready", this._handleEditorReady.bind(this)); } @@ -21069,7 +21069,7 @@ Read more: ${ne}#error-${o}`; } if (r.length !== 8) return "INVALID"; const c = Number(r.substring(0, 4)), d = Number(r.substring(4, 6)) - 1, u = Number(r.substring(6, 8)), g = new Date(c, d, u); - return g < en || isNaN(Number(g)) ? "INVALID" : "VALID"; + return g < tn || isNaN(Number(g)) ? "INVALID" : "VALID"; })(e.config.get("licenseKey")) !== "VALID" && e.ui.view && (e.ui.focusTracker.on("change:isFocused", (t, n, i) => { this._updateLastFocusedEditableElement(), i ? this._showBalloon() : this._hideBalloon(); }), e.ui.focusTracker.on("change:focusedElement", (t, n, i) => { @@ -21079,7 +21079,7 @@ Read more: ${ne}#error-${o}`; })); } _createBalloonView() { - const e = this.editor, t = this._balloonView = new ht(), n = Gh(e), i = new Sv(e.locale, n.label); + const e = this.editor, t = this._balloonView = new ht(), n = Gh(e), i = new Dv(e.locale, n.label); t.content.add(i), t.set({ class: "ck-powered-by-balloon" }), e.ui.view.body.add(t), e.ui.focusTracker.add(t.element), this._balloonView = t; } _showBalloon() { @@ -21104,7 +21104,7 @@ Read more: ${ne}#error-${o}`; i.includes(n) ? this._lastFocusedEditableElement = n : this._lastFocusedEditableElement = i[0]; } } - class Sv extends ue { + class Dv extends ue { constructor(e, t) { super(e); const n = new zo(), i = this.bindTemplate; @@ -21115,7 +21115,7 @@ Read more: ${ne}#error-${o}`; function Kh(o, e, t) { return (n, i) => { const r = n.getVisible(); - if (!r || n.width < yv || n.height < Cv) return Xi; + if (!r || n.width < Ev || n.height < yv) return Xi; let s; s = e.position === "inside" ? n.bottom - i.height : n.bottom - i.height / 2, s -= e.verticalOffset; const a = t(n, i); @@ -21143,11 +21143,11 @@ Read more: ${ne}#error-${o}`; } function Gh(o) { const e = o.config.get("ui.poweredBy"), t = e && e.position || "border"; - return vv({ position: t, label: Ev, verticalOffset: t === "inside" ? 5 : 0, horizontalOffset: 5, side: o.locale.contentLanguageDirection === "ltr" ? "right" : "left" }, e); + return Cv({ position: t, label: xv, verticalOffset: t === "inside" ? 5 : 0, horizontalOffset: 5, side: o.locale.contentLanguageDirection === "ltr" ? "right" : "left" }, e); } - class Dv extends ve() { + class Bv extends ve() { constructor(e) { - super(), this.isReady = !1, this._editableElementsMap = /* @__PURE__ */ new Map(), this._focusableToolbarDefinitions = [], this.editor = e, this.componentFactory = new gv(e), this.focusTracker = new xt(), this.tooltipManager = new Qi(e), this.poweredBy = new xv(e), this.set("viewportOffset", this._readViewportOffsetFromConfig()), this.once("ready", () => { + super(), this.isReady = !1, this._editableElementsMap = /* @__PURE__ */ new Map(), this._focusableToolbarDefinitions = [], this.editor = e, this.componentFactory = new mv(e), this.focusTracker = new xt(), this.tooltipManager = new Qi(e), this.poweredBy = new Sv(e), this.set("viewportOffset", this._readViewportOffsetFromConfig()), this.once("ready", () => { this.isReady = !0; }), this.listenTo(e.editing.view.document, "layoutChanged", () => this.update()), this._initFocusTracking(); } @@ -21236,11 +21236,11 @@ Read more: ${ne}#error-${o}`; let n = 10; return kn(e.element) && n--, t.isContextual && n--, n; } - var Jh = S(9688), Bv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Jh.Z, Bv), Jh.Z.locals; - class Tv extends ue { + var Jh = S(9688), Tv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Jh.Z, Tv), Jh.Z.locals; + class Iv extends ue { constructor(e) { - super(e), this.body = new yw(e); + super(e), this.body = new Ew(e); } render() { super.render(), this.body.attachToDom(); @@ -21249,7 +21249,7 @@ Read more: ${ne}#error-${o}`; return this.body.detachFromDom(), super.destroy(); } } - class Iv extends Tv { + class Pv extends Iv { 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 }] }); } @@ -21258,7 +21258,7 @@ Read more: ${ne}#error-${o}`; return t.text = e("Rich Text Editor"), t.extendTemplate({ attributes: { class: "ck-voice-label" } }), t; } } - class Pv extends ue { + class Rv extends ue { constructor(e, t, n) { super(e), this.name = null, this.setTemplate({ tag: "div", attributes: { class: ["ck", "ck-content", "ck-editor__editable", "ck-rounded-corners"], lang: e.contentLanguage, dir: e.contentLanguageDirection } }), this.set("isFocused", !1), this._editableElement = n, this._hasExternalElement = !!this._editableElement, this._editingView = t; } @@ -21286,7 +21286,7 @@ Read more: ${ne}#error-${o}`; }(this) : t(this); } } - class Rv extends Pv { + class Ov extends Rv { constructor(e, t, n, i = {}) { super(e, t, n); const r = e.t; @@ -21301,8 +21301,8 @@ Read more: ${ne}#error-${o}`; }); } } - var Yh = S(8847), Ov = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Yh.Z, Ov), Yh.Z.locals; + var Yh = S(8847), zv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Yh.Z, zv), Yh.Z.locals; class Qh extends Bi { static get pluginName() { return "Notification"; @@ -21331,10 +21331,10 @@ Read more: ${ne}#error-${o}`; super(), t && Yd(this, t), e && this.set(e); } } - var Xh = S(4650), zv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Xh.Z, zv), Xh.Z.locals; - var eg = S(7676), Mv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(eg.Z, Mv), eg.Z.locals; + var Xh = S(4650), Mv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Xh.Z, Mv), Xh.Z.locals; + var eg = S(7676), Fv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(eg.Z, Fv), eg.Z.locals; const er = rs("px"); class tr extends K { constructor(e) { @@ -21396,7 +21396,7 @@ Read more: ${ne}#error-${o}`; e[t] || (t = e.length - 1), this.showStack(this._getStackId(e[t])); } _createRotatorView() { - const e = new Fv(this.editor.locale), t = this.editor.locale.t; + const e = new Nv(this.editor.locale), t = this.editor.locale.t; return this.view.content.add(e), e.bind("isNavigationVisible").to(this, "_numberOfStacks", this, "_singleViewMode", (n, i) => !i && n > 1), e.on("change:isNavigationVisible", () => this.updatePosition(), { priority: "low" }), e.bind("counter").to(this, "visibleView", this, "_numberOfStacks", (n, i) => { if (i < 2) return ""; const r = Array.from(this._idToStack.values()).indexOf(this._visibleStack) + 1; @@ -21408,7 +21408,7 @@ Read more: ${ne}#error-${o}`; }), e; } _createFakePanelsView() { - const e = new Nv(this.editor.locale, this.view); + const e = new Vv(this.editor.locale, this.view); return e.bind("numberOfPanels").to(this, "_numberOfStacks", this, "_singleViewMode", (t, n) => !n && 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: n = !0, singleViewMode: i = !1 }) { @@ -21419,7 +21419,7 @@ Read more: ${ne}#error-${o}`; return e && (e.limiter || (e = Object.assign({}, e, { limiter: this.positionLimiter })), e = Object.assign({}, e, { viewportOffsetConfig: this.editor.ui.viewportOffset })), e; } } - class Fv extends ue { + class Nv extends ue { constructor(e) { super(e); const t = e.t, n = this.bindTemplate; @@ -21442,7 +21442,7 @@ Read more: ${ne}#error-${o}`; return n.set({ label: e, icon: t, tooltip: !0 }), n; } } - class Nv extends ue { + class Vv extends ue { constructor(e, t) { super(e); const n = this.bindTemplate; @@ -21469,10 +21469,10 @@ Read more: ${ne}#error-${o}`; } } } - var tg = S(5868), Vv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(tg.Z, Vv), tg.Z.locals; + var tg = S(5868), Lv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(tg.Z, Lv), tg.Z.locals; const Yo = rs("px"); - class Lv extends ue { + class jv extends ue { constructor(e) { super(e); const t = this.bindTemplate; @@ -21491,9 +21491,9 @@ Read more: ${ne}#error-${o}`; this.limiterElement ? (t = this._limiterRect = this.limiterElement.getBoundingClientRect(), this.isSticky = this.isActive && t.top < this.viewportTopOffset && this._panelRect.height + this.limiterBottomOffset < t.height) : this.isSticky = !1, this.isSticky ? (this._isStickyToTheLimiter = t.bottom < e.height + this.limiterBottomOffset + this.viewportTopOffset, this._hasViewportTopOffset = !this._isStickyToTheLimiter && !!this.viewportTopOffset, this._marginLeft = this._isStickyToTheLimiter ? null : Yo(-ce.window.scrollX)) : (this._isStickyToTheLimiter = !1, this._hasViewportTopOffset = !1, this._marginLeft = null); } } - var ng = S(9695), jv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(ng.Z, jv), ng.Z.locals; - class $v extends Dv { + var ng = S(9695), $v = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(ng.Z, $v), ng.Z.locals; + class Hv extends Bv { constructor(e, t) { super(e), this.view = t, this._toolbarConfig = dd(e.config.get("toolbar")), this._elementReplacer = new Sl(); } @@ -21527,11 +21527,11 @@ Read more: ${ne}#error-${o}`; }({ view: t, element: n, text: r, isDirectHost: !1, keepOnFocus: !0 }); } } - var og = S(3143), Hv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(og.Z, Hv), og.Z.locals; - class qv extends Iv { + var og = S(3143), qv = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(og.Z, qv), og.Z.locals; + class Uv extends Pv { constructor(e, t, n = {}) { - super(e), this.stickyPanel = new Lv(e), this.toolbar = new ta(e, { shouldGroupWhenFull: n.shouldToolbarGroupWhenFull }), this.editable = new Rv(e, t); + super(e), this.stickyPanel = new jv(e), this.toolbar = new ta(e, { shouldGroupWhenFull: n.shouldToolbarGroupWhenFull }), this.editable = new Ov(e, t); } render() { super.render(), this.stickyPanel.content.add(this.toolbar), this.top.add(this.stickyPanel), this.main.add(this.editable); @@ -21582,7 +21582,7 @@ Read more: ${ne}#error-${o}`; let i = 0; for (; t.length > i; ) { const r = t[i++]; - if (!n.has(r) && Uv(r) && !e.has(r)) if (n.add(r), Symbol.iterator in r) try { + if (!n.has(r) && Wv(r) && !e.has(r)) if (n.add(r), Symbol.iterator in r) try { for (const s of r) t.push(s); } catch { } @@ -21590,7 +21590,7 @@ Read more: ${ne}#error-${o}`; } return n; } - function Uv(o) { + function Wv(o) { const e = Object.prototype.toString.call(o), t = typeof o; return !(t === "number" || t === "boolean" || t === "string" || t === "symbol" || t === "function" || e === "[object Date]" || e === "[object RegExp]" || e === "[object Module]" || o == null || o._watchdogExcluded || o instanceof EventTarget || o instanceof Event); } @@ -21669,7 +21669,7 @@ Read more: ${ne}#error-${o}`; } } const Qo = Symbol("MainQueueId"); - class Wv { + class Kv { constructor() { this._onEmptyCallbacks = [], this._queues = /* @__PURE__ */ new Map(), this._activeActions = 0; } @@ -21689,15 +21689,15 @@ Read more: ${ne}#error-${o}`; function ag(o) { return Array.isArray(o) ? o : [o]; } - class nr extends Ki(ea(U_)) { + class nr extends Ki(ea(W_)) { constructor(e, t = {}) { if (!or(e) && t.initialData !== void 0) throw new T("editor-create-initial-data", null); super(t), this.config.get("initialData") === void 0 && this.config.set("initialData", function(r) { return or(r) ? (s = r, s instanceof HTMLTextAreaElement ? s.value : s.innerHTML) : r; var s; }(e)), or(e) && (this.sourceElement = e), this.model.document.createRoot(); - const n = !this.config.get("toolbar.shouldNotGroupWhenFull"), i = new qv(this.locale, this.editing.view, { shouldToolbarGroupWhenFull: n }); - this.ui = new $v(this, i), function(r) { + const n = !this.config.get("toolbar.shouldNotGroupWhenFull"), i = new Uv(this.locale, this.editing.view, { shouldToolbarGroupWhenFull: n }); + this.ui = new Hv(this, i), function(r) { if (!mn(r.updateSourceElement)) throw new T("attachtoform-missing-elementapi-interface", r); const s = r.sourceElement; if (function(a) { @@ -21728,7 +21728,7 @@ Read more: ${ne}#error-${o}`; } nr.Context = pd, nr.EditorWatchdog = sg, nr.ContextWatchdog = class extends ig { constructor(o, e = {}) { - super(e), this._watchdogs = /* @__PURE__ */ new Map(), this._context = null, this._contextProps = /* @__PURE__ */ new Set(), this._actionQueues = new Wv(), this._watchdogConfig = e, this._creator = (t) => o.create(t), this._destructor = (t) => t.destroy(), this._actionQueues.onEmpty(() => { + super(e), this._watchdogs = /* @__PURE__ */ new Map(), this._context = null, this._contextProps = /* @__PURE__ */ new Set(), this._actionQueues = new Kv(), this._watchdogConfig = e, this._creator = (t) => o.create(t), this._destructor = (t) => t.destroy(), this._actionQueues.onEmpty(() => { this.state === "initializing" && (this.state = "ready", this._fire("stateChange")); }); } @@ -21803,7 +21803,7 @@ Read more: ${ne}#error-${o}`; return rg(this._context, o.context); } }; - class ba extends rn { + class ba extends sn { constructor(e) { super(e), this.domEventType = ["paste", "copy", "cut", "drop", "dragover", "dragstart", "dragend", "dragenter", "dragleave"]; const t = this.document; @@ -21925,7 +21925,7 @@ Read more: ${ne}#error-${o}`; this.isLocked && !e || (this._batch = null, this._size = 0); } } - class Kv extends le { + class Gv extends le { constructor(e, t) { super(e), this._buffer = new dg(e.model, t), this._isEnabledBasedOnSelection = !1; } @@ -21946,7 +21946,7 @@ Read more: ${ne}#error-${o}`; } } const ug = ["insertText", "insertReplacementText"]; - class Gv extends Ft { + class Zv extends Ft { constructor(e) { super(e), f.isAndroid && ug.push("insertCompositionText"); const t = e.document; @@ -21971,8 +21971,8 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor, t = e.model, n = e.editing.view, i = t.document.selection; - n.addObserver(Gv); - const r = new Kv(e, e.config.get("typing.undoStep") || 20); + n.addObserver(Zv); + const r = new Gv(e, e.config.get("typing.undoStep") || 20); e.commands.add("insertText", r), e.commands.add("input", r), this.listenTo(n.document, "insertText", (s, a) => { n.document.isComposing || a.preventDefault(); const { text: l, selection: c, resultRange: d } = a, u = Array.from(c.getRanges()).map((b) => e.editing.mapper.toModelRange(b)); @@ -22038,8 +22038,8 @@ Read more: ${ne}#error-${o}`; return i.parent == s && !!e.containsEntireContent(s) && !!n.schema.checkChild(r, "paragraph") && s.name != "paragraph"; } } - const pg = "word", ln = "selection", uo = "backward", Xo = "forward", fg = { deleteContent: { unit: ln, direction: uo }, deleteContentBackward: { unit: "codePoint", direction: uo }, deleteWordBackward: { unit: pg, direction: uo }, deleteHardLineBackward: { unit: ln, direction: uo }, deleteSoftLineBackward: { unit: ln, direction: uo }, deleteContentForward: { unit: "character", direction: Xo }, deleteWordForward: { unit: pg, direction: Xo }, deleteHardLineForward: { unit: ln, direction: Xo }, deleteSoftLineForward: { unit: ln, direction: Xo } }; - class Zv extends Ft { + const pg = "word", cn = "selection", uo = "backward", Xo = "forward", fg = { deleteContent: { unit: cn, direction: uo }, deleteContentBackward: { unit: "codePoint", direction: uo }, deleteWordBackward: { unit: pg, direction: uo }, deleteHardLineBackward: { unit: cn, direction: uo }, deleteSoftLineBackward: { unit: cn, direction: uo }, deleteContentForward: { unit: "character", direction: Xo }, deleteWordForward: { unit: pg, direction: Xo }, deleteHardLineForward: { unit: cn, direction: Xo }, deleteSoftLineForward: { unit: cn, direction: Xo } }; + class Jv extends Ft { constructor(e) { super(e); const t = e.document; @@ -22053,7 +22053,7 @@ Read more: ${ne}#error-${o}`; const { targetRanges: s, domEvent: a, inputType: l } = r, c = fg[l]; if (!c) return; const d = { direction: c.direction, unit: c.unit, sequence: n }; - d.unit == ln && (d.selectionToRemove = e.createSelection(s[0])), l === "deleteContentBackward" && (f.isAndroid && (d.sequence = 1), function(g) { + d.unit == cn && (d.selectionToRemove = e.createSelection(s[0])), l === "deleteContentBackward" && (f.isAndroid && (d.sequence = 1), function(g) { if (g.length != 1 || g[0].isCollapsed) return !1; const p = g[0].getWalker({ direction: "backward", singleCharacters: !0, ignoreElementEnd: !0 }); let b = 0; @@ -22066,7 +22066,7 @@ Read more: ${ne}#error-${o}`; if (b > 1) return !0; } return !1; - }(s) && (d.unit = ln, d.selectionToRemove = e.createSelection(s))); + }(s) && (d.unit = cn, d.selectionToRemove = e.createSelection(s))); const u = new oo(t, "delete", s[0]); t.fire(u, new ro(e, a, d)), u.stop.called && i.stop(); }), f.isBlink && function(i) { @@ -22083,7 +22083,7 @@ Read more: ${ne}#error-${o}`; }), s.on("keyup", (u, { keyCode: g, domEvent: p }) => { const b = s.selection, w = i.isEnabled && g == a && c(g) && !b.isCollapsed && !l; if (a = null, w) { - const E = b.getFirstRange(), I = new oo(s, "delete", E), z = { unit: ln, direction: d(g), selectionToRemove: b }; + const E = b.getFirstRange(), I = new oo(s, "delete", E), z = { unit: cn, direction: d(g), selectionToRemove: b }; s.fire(I, new ro(r, p, z)); } }), s.on("beforeinput", (u, { inputType: g }) => { @@ -22105,7 +22105,7 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor, t = e.editing.view, n = t.document, i = e.model.document; - t.addObserver(Zv), this._undoOnBackspace = !1; + t.addObserver(Jv), this._undoOnBackspace = !1; const r = new mg(e, "forward"); e.commands.add("deleteForward", r), e.commands.add("forwardDelete", r), e.commands.add("delete", new mg(e, "backward")), this.listenTo(n, "delete", (s, a) => { n.isComposing || a.preventDefault(); @@ -22125,7 +22125,7 @@ Read more: ${ne}#error-${o}`; this.editor.plugins.has("UndoEditing") && (this._undoOnBackspace = !0); } } - class Jv extends K { + class Yv extends K { static get requires() { return [hg, ho]; } @@ -22229,17 +22229,17 @@ Read more: ${ne}#error-${o}`; } return !1; } - var Ag = /[\\^$.*+?()[\]{}|]/g, Yv = RegExp(Ag.source); - const Qv = function(o) { - return (o = As(o)) && Yv.test(o) ? o.replace(Ag, "\\$&") : o; - }, _g = { copyright: { from: "(c)", to: "©" }, registeredTrademark: { from: "(r)", to: "®" }, trademark: { from: "(tm)", to: "™" }, oneHalf: { from: /(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i, to: [null, "½", null] }, oneThird: { from: /(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i, to: [null, "⅓", null] }, twoThirds: { from: /(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i, to: [null, "⅔", null] }, oneForth: { from: /(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i, to: [null, "¼", null] }, threeQuarters: { from: /(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i, to: [null, "¾", null] }, lessThanOrEqual: { from: "<=", to: "≤" }, greaterThanOrEqual: { from: ">=", to: "≥" }, notEqual: { from: "!=", to: "≠" }, arrowLeft: { from: "<-", to: "←" }, arrowRight: { from: "->", to: "→" }, horizontalEllipsis: { from: "...", to: "…" }, enDash: { from: /(^| )(--)( )$/, to: [null, "–", null] }, emDash: { from: /(^| )(---)( )$/, to: [null, "—", null] }, quotesPrimary: { from: go('"'), to: [null, "“", null, "”"] }, quotesSecondary: { from: go("'"), to: [null, "‘", null, "’"] }, quotesPrimaryEnGb: { from: go("'"), to: [null, "‘", null, "’"] }, quotesSecondaryEnGb: { from: go('"'), to: [null, "“", null, "”"] }, quotesPrimaryPl: { from: go('"'), to: [null, "„", null, "”"] }, quotesSecondaryPl: { from: go("'"), to: [null, "‚", null, "’"] } }, vg = { symbols: ["copyright", "registeredTrademark", "trademark"], mathematical: ["oneHalf", "oneThird", "twoThirds", "oneForth", "threeQuarters", "lessThanOrEqual", "greaterThanOrEqual", "notEqual", "arrowLeft", "arrowRight"], typography: ["horizontalEllipsis", "enDash", "emDash"], quotes: ["quotesPrimary", "quotesSecondary"] }, Xv = ["symbols", "mathematical", "typography", "quotes"]; - function eC(o) { - return typeof o == "string" ? new RegExp(`(${Qv(o)})$`) : o; - } + var Ag = /[\\^$.*+?()[\]{}|]/g, Qv = RegExp(Ag.source); + const Xv = function(o) { + return (o = As(o)) && Qv.test(o) ? o.replace(Ag, "\\$&") : o; + }, _g = { copyright: { from: "(c)", to: "©" }, registeredTrademark: { from: "(r)", to: "®" }, trademark: { from: "(tm)", to: "™" }, oneHalf: { from: /(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i, to: [null, "½", null] }, oneThird: { from: /(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i, to: [null, "⅓", null] }, twoThirds: { from: /(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i, to: [null, "⅔", null] }, oneForth: { from: /(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i, to: [null, "¼", null] }, threeQuarters: { from: /(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i, to: [null, "¾", null] }, lessThanOrEqual: { from: "<=", to: "≤" }, greaterThanOrEqual: { from: ">=", to: "≥" }, notEqual: { from: "!=", to: "≠" }, arrowLeft: { from: "<-", to: "←" }, arrowRight: { from: "->", to: "→" }, horizontalEllipsis: { from: "...", to: "…" }, enDash: { from: /(^| )(--)( )$/, to: [null, "–", null] }, emDash: { from: /(^| )(---)( )$/, to: [null, "—", null] }, quotesPrimary: { from: go('"'), to: [null, "“", null, "”"] }, quotesSecondary: { from: go("'"), to: [null, "‘", null, "’"] }, quotesPrimaryEnGb: { from: go("'"), to: [null, "‘", null, "’"] }, quotesSecondaryEnGb: { from: go('"'), to: [null, "“", null, "”"] }, quotesPrimaryPl: { from: go('"'), to: [null, "„", null, "”"] }, quotesSecondaryPl: { from: go("'"), to: [null, "‚", null, "’"] } }, vg = { symbols: ["copyright", "registeredTrademark", "trademark"], mathematical: ["oneHalf", "oneThird", "twoThirds", "oneForth", "threeQuarters", "lessThanOrEqual", "greaterThanOrEqual", "notEqual", "arrowLeft", "arrowRight"], typography: ["horizontalEllipsis", "enDash", "emDash"], quotes: ["quotesPrimary", "quotesSecondary"] }, eC = ["symbols", "mathematical", "typography", "quotes"]; function tC(o) { - return typeof o == "string" ? () => [o] : o instanceof Array ? () => o : o; + return typeof o == "string" ? new RegExp(`(${Xv(o)})$`) : o; } function nC(o) { + return typeof o == "string" ? () => [o] : o instanceof Array ? () => o : o; + } + function oC(o) { return (o.textNode ? o.textNode : o.nodeAfter).getAttributes(); } function go(o) { @@ -22256,7 +22256,7 @@ Read more: ${ne}#error-${o}`; function* yg(o, e) { for (const t of e) t && o.getAttributeProperties(t[0]).copyOnEnter && (yield t); } - class oC extends le { + class iC extends le { execute() { this.editor.model.change((e) => { this.enterBlock(e), this.fire("afterExecute", { writer: e }); @@ -22282,7 +22282,7 @@ Read more: ${ne}#error-${o}`; function Eg(o, e) { o.split(e), o.setSelection(e.parent.nextSibling, 0); } - const iC = { insertParagraph: { isSoft: !1 }, insertLineBreak: { isSoft: !0 } }; + const rC = { insertParagraph: { isSoft: !1 }, insertLineBreak: { isSoft: !0 } }; class xg extends Ft { constructor(e) { super(e); @@ -22294,7 +22294,7 @@ Read more: ${ne}#error-${o}`; if (!this.isEnabled) return; let s = r.inputType; f.isSafari && n && s == "insertParagraph" && (s = "insertLineBreak"); - const a = r.domEvent, l = iC[s]; + const a = r.domEvent, l = rC[s]; if (!l) return; const c = new oo(t, "enter", r.targetRanges[0]); t.fire(c, new ro(e, a, { isSoft: l.isSoft })), c.stop.called && i.stop(); @@ -22311,12 +22311,12 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor, t = e.editing.view, n = t.document; - t.addObserver(xg), e.commands.add("enter", new oC(e)), this.listenTo(n, "enter", (i, r) => { + t.addObserver(xg), e.commands.add("enter", new iC(e)), this.listenTo(n, "enter", (i, r) => { n.isComposing || r.preventDefault(), r.isSoft || (e.execute("enter"), t.scrollToTheSelection()); }, { priority: "low" }); } } - class rC extends le { + class sC extends le { execute() { const e = this.editor.model, t = e.document; e.change((n) => { @@ -22350,18 +22350,18 @@ Read more: ${ne}#error-${o}`; function Aa(o, e) { return !o.is("rootElement") && (e.isLimit(o) || Aa(o.parent, e)); } - class sC extends K { + class aC extends K { static get pluginName() { return "ShiftEnter"; } init() { const e = this.editor, t = e.model.schema, n = e.conversion, i = e.editing.view, r = i.document; - t.register("softBreak", { allowWhere: "$text", isInline: !0 }), n.for("upcast").elementToElement({ model: "softBreak", view: "br" }), n.for("downcast").elementToElement({ model: "softBreak", view: (s, { writer: a }) => a.createEmptyElement("br") }), i.addObserver(xg), e.commands.add("shiftEnter", new rC(e)), this.listenTo(r, "enter", (s, a) => { + t.register("softBreak", { allowWhere: "$text", isInline: !0 }), n.for("upcast").elementToElement({ model: "softBreak", view: "br" }), n.for("downcast").elementToElement({ model: "softBreak", view: (s, { writer: a }) => a.createEmptyElement("br") }), i.addObserver(xg), e.commands.add("shiftEnter", new sC(e)), this.listenTo(r, "enter", (s, a) => { r.isComposing || a.preventDefault(), a.isSoft && (e.execute("shiftEnter"), i.scrollToTheSelection()); }, { priority: "low" }); } } - class aC extends _e() { + class lC extends _e() { constructor() { super(...arguments), this._stack = []; } @@ -22382,7 +22382,7 @@ Read more: ${ne}#error-${o}`; if (_a(e, t[n])) return; n > -1 && t.splice(n, 1); let i = 0; - for (; t[i] && lC(t[i], e); ) i++; + for (; t[i] && cC(t[i], e); ) i++; t.splice(i, 0, e); } _removeDescriptor(e) { @@ -22393,61 +22393,61 @@ Read more: ${ne}#error-${o}`; function _a(o, e) { return o && e && o.priority == e.priority && sr(o.classes) == sr(e.classes); } - function lC(o, e) { + function cC(o, e) { return o.priority > e.priority || !(o.priority < e.priority) && sr(o.classes) > sr(e.classes); } function sr(o) { return Array.isArray(o) ? o.sort().join(",") : o; } - const cC = '', dC = "ck-widget", Dg = "ck-widget_selected"; + const dC = '', uC = "ck-widget", Dg = "ck-widget_selected"; function Ne(o) { return !!o.is("element") && !!o.getCustomProperty("widget"); } function va(o, e, t = {}) { if (!o.is("containerElement")) throw new T("widget-to-widget-wrong-element-type", null, { element: o }); - return e.setAttribute("contenteditable", "false", o), e.addClass(dC, o), e.setCustomProperty("widget", !0, o), o.getFillerOffset = mC, e.setCustomProperty("widgetLabel", [], o), t.label && function(n, i) { + return e.setAttribute("contenteditable", "false", o), e.addClass(uC, o), e.setCustomProperty("widget", !0, o), o.getFillerOffset = pC, e.setCustomProperty("widgetLabel", [], o), t.label && function(n, i) { n.getCustomProperty("widgetLabel").push(i); }(o, t.label), t.hasSelectionHandle && function(n, i) { const r = i.createUIElement("div", { class: "ck ck-widget__selection-handle" }, function(s) { const a = this.toDomElement(s), l = new zo(); - return l.set("content", cC), l.render(), a.appendChild(l.element), a; + return l.set("content", dC), l.render(), a.appendChild(l.element), a; }); i.insert(i.createPositionAt(n, 0), r), i.addClass(["ck-widget_with-selection-handle"], n); }(o, e), Bg(o, e), o; } - function uC(o, e, t) { + function hC(o, e, t) { if (e.classes && t.addClass($e(e.classes), o), e.attributes) for (const n in e.attributes) t.setAttribute(n, e.attributes[n], o); } - function hC(o, e, t) { + function gC(o, e, t) { if (e.classes && t.removeClass($e(e.classes), o), e.attributes) for (const n in e.attributes) t.removeAttribute(n, o); } - function Bg(o, e, t = uC, n = hC) { - const i = new aC(); + function Bg(o, e, t = hC, n = gC) { + const i = new lC(); i.on("change:top", (r, s) => { s.oldDescriptor && n(o, s.oldDescriptor, s.writer), s.newDescriptor && t(o, s.newDescriptor, s.writer); }), e.setCustomProperty("addHighlight", (r, s, a) => i.add(s, a), o), e.setCustomProperty("removeHighlight", (r, s, a) => i.remove(s, a), o); } - function gC(o, e, t = {}) { + function mC(o, e, t = {}) { return e.addClass(["ck-editor__editable", "ck-editor__nested-editable"], o), e.setAttribute("role", "textbox", o), t.label && e.setAttribute("aria-label", t.label, o), e.setAttribute("contenteditable", o.isReadOnly ? "false" : "true", o), o.on("change:isReadOnly", (n, i, r) => { e.setAttribute("contenteditable", r ? "false" : "true", o); }), o.on("change:isFocused", (n, i, r) => { r ? e.addClass("ck-editor__nested-editable_focused", o) : e.removeClass("ck-editor__nested-editable_focused", o); }), Bg(o, e), o; } - function mC() { + function pC() { return null; } const Jt = "widget-type-around"; function Tn(o, e, t) { return !!o && Ne(o) && !t.isInline(e); } - function cn(o) { + function dn(o) { return o.getAttribute(Jt); } - var Tg = S(4921), pC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Tg.Z, pC), Tg.Z.locals; - const Ig = ["before", "after"], fC = new DOMParser().parseFromString('', "image/svg+xml").firstChild, Pg = "ck-widget__type-around_disabled"; - class bC extends K { + var Tg = S(4921), fC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Tg.Z, fC), Tg.Z.locals; + const Ig = ["before", "after"], bC = new DOMParser().parseFromString('', "image/svg+xml").firstChild, Pg = "ck-widget__type-around_disabled"; + class kC extends K { constructor() { super(...arguments), this._currentFakeCaretModelElement = null; } @@ -22480,7 +22480,7 @@ Read more: ${ne}#error-${o}`; }, i); } _insertParagraphAccordingToFakeCaretPosition() { - const e = this.editor.model.document.selection, t = cn(e); + const e = this.editor.model.document.selection, t = dn(e); if (!t) return !1; const n = e.getSelectedElement(); return this._insertParagraph(n, t), !0; @@ -22494,7 +22494,7 @@ Read more: ${ne}#error-${o}`; const b = this.toDomElement(p); return function(w, E) { for (const I of Ig) { - const z = new Rt({ tag: "div", attributes: { class: ["ck", "ck-widget__type-around__button", `ck-widget__type-around__button_${I}`], title: E[I], "aria-hidden": "true" }, children: [w.ownerDocument.importNode(fC, !0)] }); + const z = new Rt({ tag: "div", attributes: { class: ["ck", "ck-widget__type-around__button", `ck-widget__type-around__button_${I}`], title: E[I], "aria-hidden": "true" }, children: [w.ownerDocument.importNode(bC, !0)] }); w.appendChild(z.render()); } }(b, d), function(w) { @@ -22532,7 +22532,7 @@ Read more: ${ne}#error-${o}`; if (!u) return; const g = c.mapper.toViewElement(u); if (!Tn(g, u, i)) return; - const p = cn(l.selection); + const p = dn(l.selection); p && (d.addClass(s(p), g), this._currentFakeCaretModelElement = u); }), this._listenToIfEnabled(e.ui.focusTracker, "change:isFocused", (a, l, c) => { c || e.model.change((d) => { @@ -22549,7 +22549,7 @@ Read more: ${ne}#error-${o}`; Tn(c, n.editing.mapper.toModelElement(c), s) ? d = this._handleArrowKeyPressOnSelectedWidget(l) : r.isCollapsed ? d = this._handleArrowKeyPressWhenSelectionNextToAWidget(l) : t.shiftKey || (d = this._handleArrowKeyPressWhenNonCollapsedSelection(l)), d && (t.preventDefault(), e.stop()); } _handleArrowKeyPressOnSelectedWidget(e) { - const t = this.editor.model, n = cn(t.document.selection); + const t = this.editor.model, n = dn(t.document.selection); return t.change((i) => n ? n !== (e ? "after" : "before") ? (i.removeSelectionAttribute(Jt), !0) : !1 : (i.setSelectionAttribute(Jt, e ? "after" : "before"), !0)); } _handleArrowKeyPressWhenSelectionNextToAWidget(e) { @@ -22601,7 +22601,7 @@ Read more: ${ne}#error-${o}`; const e = this.editor, t = e.editing.view, n = e.model, i = n.schema; this._listenToIfEnabled(t.document, "delete", (r, s) => { if (r.eventPhase != "atTarget") return; - const a = cn(n.document.selection); + const a = dn(n.document.selection); if (!a) return; const l = s.direction, c = n.document.selection.getSelectedElement(), d = l == "forward"; if (a === "before" === d) e.execute("delete", { selection: n.createSelection(c, "on") }); @@ -22633,7 +22633,7 @@ Read more: ${ne}#error-${o}`; const e = this.editor, t = this.editor.model, n = t.document.selection; this._listenToIfEnabled(e.model, "insertContent", (i, [r, s]) => { if (s && !s.is("documentSelection")) return; - const a = cn(n); + const a = dn(n); return a ? (i.stop(), t.change((l) => { const c = n.getSelectedElement(), d = t.createPositionAt(c, a), u = l.createSelection(d), g = t.insertContent(r, u); return l.setSelection(u), g; @@ -22645,18 +22645,18 @@ Read more: ${ne}#error-${o}`; this._listenToIfEnabled(e.model, "insertObject", (n, i) => { const [, r, s = {}] = i; if (r && !r.is("documentSelection")) return; - const a = cn(t); + const a = dn(t); a && (s.findOptimalPosition = a, i[3] = s); }, { priority: "high" }); } _enableDeleteContentIntegration() { const e = this.editor, t = this.editor.model.document.selection; this._listenToIfEnabled(e.model, "deleteContent", (n, [i]) => { - i && !i.is("documentSelection") || cn(t) && n.stop(); + i && !i.is("documentSelection") || dn(t) && n.stop(); }, { priority: "high" }); } } - function kC(o) { + function wC(o) { const e = o.model; return (t, n) => { const i = n.keyCode == ge.arrowup, r = n.keyCode == ge.arrowdown, s = n.shiftKey, a = e.document.selection; @@ -22720,8 +22720,8 @@ Read more: ${ne}#error-${o}`; for (const { nextPosition: i } of e.getWalker({ direction: t })) if (o.checkChild(i, "$text")) return i; return null; } - var zg = S(3488), wC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(zg.Z, wC), zg.Z.locals; + var zg = S(3488), AC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(zg.Z, AC), zg.Z.locals; class ti extends K { constructor() { super(...arguments), this._previouslySelected = /* @__PURE__ */ new Set(); @@ -22730,7 +22730,7 @@ Read more: ${ne}#error-${o}`; return "Widget"; } static get requires() { - return [bC, ho]; + return [kC, ho]; } init() { const e = this.editor, t = e.editing.view, n = t.document; @@ -22748,13 +22748,13 @@ Read more: ${ne}#error-${o}`; let c = null; for (const d of l.getRanges()) for (const u of d) { const g = u.item; - Ne(g) && !AC(g, c) && (a.addClass(Dg, g), this._previouslySelected.add(g), c = g); + Ne(g) && !_C(g, c) && (a.addClass(Dg, g), this._previouslySelected.add(g), c = g); } }, { priority: "low" }), t.addObserver(Xs), this.listenTo(n, "mousedown", (...i) => this._onMousedown(...i)), this.listenTo(n, "arrowKey", (...i) => { this._handleSelectionChangeOnArrowKeyPress(...i); }, { context: [Ne, "$text"] }), this.listenTo(n, "arrowKey", (...i) => { this._preventDefaultOnArrowKeyPress(...i); - }, { context: "$root" }), this.listenTo(n, "arrowKey", kC(this.editor.editing), { context: "$text" }), this.listenTo(n, "delete", (i, r) => { + }, { context: "$root" }), this.listenTo(n, "arrowKey", wC(this.editor.editing), { context: "$text" }), this.listenTo(n, "delete", (i, r) => { this._handleDelete(r.direction == "forward") && (r.preventDefault(), i.stop()); }, { context: "$root" }); } @@ -22837,7 +22837,7 @@ Read more: ${ne}#error-${o}`; this._previouslySelected.clear(); } } - function AC(o, e) { + function _C(o, e) { return !!e && Array.from(o.getAncestors()).includes(e); } class ar extends K { @@ -22923,11 +22923,11 @@ Read more: ${ne}#error-${o}`; const t = o.editing.view, n = ht.defaultPositions; return { target: t.domConverter.mapViewToDom(e), positions: [n.northArrowSouth, n.northArrowSouthWest, n.northArrowSouthEast, n.southArrowNorth, n.southArrowNorthWest, n.southArrowNorthEast, n.viewportStickyNorth] }; } - var Ng = S(8506), _C = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Ng.Z, _C), Ng.Z.locals; - var Vg = S(903), vC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Vg.Z, vC), Vg.Z.locals; - class CC extends K { + var Ng = S(8506), vC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Ng.Z, vC), Ng.Z.locals; + var Vg = S(903), CC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Vg.Z, CC), Vg.Z.locals; + class yC extends K { static get pluginName() { return "DragDrop"; } @@ -23098,7 +23098,7 @@ Read more: ${ne}#error-${o}`; const e = o.findAncestor((t) => Ne(t) || t.is("editableElement")); return Ne(e) ? e : null; } - class yC extends K { + class EC extends K { static get pluginName() { return "PastePlainText"; } @@ -23124,15 +23124,15 @@ Read more: ${ne}#error-${o}`; }); } } - class EC extends K { + class xC extends K { static get pluginName() { return "Clipboard"; } static get requires() { - return [Zt, CC, yC]; + return [Zt, yC, EC]; } } - class xC extends le { + class SC extends le { constructor(e) { super(e), this.affectsData = !1; } @@ -23150,19 +23150,19 @@ Read more: ${ne}#error-${o}`; function Hg(o, e) { return o.isLimit(e) && (o.checkChild(e, "$text") || o.checkChild(e, "paragraph")); } - const SC = Ei("Ctrl+A"); - class DC extends K { + const DC = Ei("Ctrl+A"); + class BC extends K { static get pluginName() { return "SelectAllEditing"; } init() { const e = this.editor, t = e.editing.view.document; - e.commands.add("selectAll", new xC(e)), this.listenTo(t, "keydown", (n, i) => { - eo(i) === SC && (e.execute("selectAll"), i.preventDefault()); + e.commands.add("selectAll", new SC(e)), this.listenTo(t, "keydown", (n, i) => { + eo(i) === DC && (e.execute("selectAll"), i.preventDefault()); }); } } - class BC extends K { + class TC extends K { static get pluginName() { return "SelectAllUI"; } @@ -23176,21 +23176,21 @@ Read more: ${ne}#error-${o}`; }); } } - class TC extends K { + class IC extends K { static get requires() { - return [DC, BC]; + return [BC, TC]; } static get pluginName() { return "SelectAll"; } } - var IC = Object.defineProperty, qg = Object.getOwnPropertySymbols, PC = Object.prototype.hasOwnProperty, RC = Object.prototype.propertyIsEnumerable, Ug = (o, e, t) => e in o ? IC(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; + var PC = Object.defineProperty, qg = Object.getOwnPropertySymbols, RC = Object.prototype.hasOwnProperty, OC = Object.prototype.propertyIsEnumerable, Ug = (o, e, t) => e in o ? PC(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; class Wg extends le { constructor(e) { super(e), this._stack = [], this._createdBatches = /* @__PURE__ */ new WeakSet(), this.refresh(), this._isEnabledBasedOnSelection = !1, this.listenTo(e.data, "set", (t, n) => { n[1] = ((r, s) => { - for (var a in s || (s = {})) PC.call(s, a) && Ug(r, a, s[a]); - if (qg) for (var a of qg(s)) RC.call(s, a) && Ug(r, a, s[a]); + for (var a in s || (s = {})) RC.call(s, a) && Ug(r, a, s[a]); + if (qg) for (var a of qg(s)) OC.call(s, a) && Ug(r, a, s[a]); return r; })({}, n[1]); const i = n[1]; @@ -23215,8 +23215,8 @@ Read more: ${ne}#error-${o}`; _restoreSelection(e, t, n) { const i = this.editor.model, r = i.document, s = [], a = e.map((c) => c.getTransformedByOperations(n)), l = a.flat(); for (const c of a) { - const d = c.filter((u) => u.root != r.graveyard).filter((u) => !zC(u, l)); - d.length && (OC(d), s.push(d[0])); + const d = c.filter((u) => u.root != r.graveyard).filter((u) => !MC(u, l)); + d.length && (zC(d), s.push(d[0])); } s.length && i.change((c) => { c.setSelection(s, { backward: t }); @@ -23228,7 +23228,7 @@ Read more: ${ne}#error-${o}`; const r = e.operations.slice().filter((s) => s.isDocumentOperation); r.reverse(); for (const s of r) { - const a = s.baseVersion + 1, l = Array.from(i.history.getOperations(a)), c = r_([s.getReversed()], l, { useRelations: !0, document: this.editor.model.document, padWithNoOps: !1, forceWeakRemove: !0 }).operationsA; + const a = s.baseVersion + 1, l = Array.from(i.history.getOperations(a)), c = s_([s.getReversed()], l, { useRelations: !0, document: this.editor.model.document, padWithNoOps: !1, forceWeakRemove: !0 }).operationsA; for (let d of c) { const u = d.affectedSelectable; u && !n.canEditAt(u) && (d = new Xe(d.baseVersion)), t.addOperation(d), n.applyOperation(d), i.history.setOperationAsUndone(s, d); @@ -23236,17 +23236,17 @@ Read more: ${ne}#error-${o}`; } } } - function OC(o) { + function zC(o) { o.sort((e, t) => e.start.isBefore(t.start) ? -1 : 1); for (let e = 1; e < o.length; e++) { const t = o[e - 1].getJoined(o[e], !0); t && (e--, o.splice(e, 2, t)); } } - function zC(o, e) { + function MC(o, e) { return e.some((t) => t !== o && t.containsRange(o, !0)); } - class MC extends Wg { + class FC extends Wg { execute(e = null) { const t = e ? this._stack.findIndex((r) => r.batch == e) : this._stack.length - 1, n = this._stack.splice(t, 1)[0], i = this.editor.model.createBatch({ isUndo: !0 }); this.editor.model.enqueueChange(i, () => { @@ -23256,7 +23256,7 @@ Read more: ${ne}#error-${o}`; }), this.refresh(); } } - class FC extends Wg { + class NC extends Wg { execute() { const e = this._stack.pop(), t = this.editor.model.createBatch({ isUndo: !0 }); this.editor.model.enqueueChange(t, () => { @@ -23265,7 +23265,7 @@ Read more: ${ne}#error-${o}`; }), this.refresh(); } } - class NC extends K { + class VC extends K { constructor() { super(...arguments), this._batchRegistry = /* @__PURE__ */ new WeakSet(); } @@ -23274,7 +23274,7 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor; - this._undoCommand = new MC(e), this._redoCommand = new FC(e), e.commands.add("undo", this._undoCommand), e.commands.add("redo", this._redoCommand), this.listenTo(e.model, "applyOperation", (t, n) => { + this._undoCommand = new FC(e), this._redoCommand = new NC(e), e.commands.add("undo", this._undoCommand), e.commands.add("redo", this._redoCommand), this.listenTo(e.model, "applyOperation", (t, n) => { const i = n[0]; if (!i.isDocumentOperation) return; const r = i.batch, s = this._redoCommand.createdBatches.has(r), a = this._undoCommand.createdBatches.has(r); @@ -23285,7 +23285,7 @@ Read more: ${ne}#error-${o}`; } } const Kg = '', Gg = ''; - class VC extends K { + class LC extends K { static get pluginName() { return "UndoUI"; } @@ -23303,15 +23303,15 @@ Read more: ${ne}#error-${o}`; }); } } - class LC extends K { + class jC extends K { static get requires() { - return [NC, VC]; + return [VC, LC]; } static get pluginName() { return "Undo"; } } - class jC extends ve() { + class $C extends ve() { constructor() { super(); const e = new window.FileReader(); @@ -23392,7 +23392,7 @@ Read more: ${ne}#error-${o}`; } class Zg extends ve() { constructor(e, t) { - super(), this.id = Q(), this._filePromiseWrapper = this._createFilePromiseWrapper(e), this._adapter = t(this), this._reader = new jC(), this.set("status", "idle"), this.set("uploaded", 0), this.set("uploadTotal", null), this.bind("uploadedPercent").to(this, "uploaded", this, "uploadTotal", (n, i) => i ? n / i * 100 : 0), this.set("uploadResponse", null); + super(), this.id = Q(), this._filePromiseWrapper = this._createFilePromiseWrapper(e), this._adapter = t(this), this._reader = new $C(), this.set("status", "idle"), this.set("uploaded", 0), this.set("uploadTotal", null), this.bind("uploadedPercent").to(this, "uploaded", this, "uploadTotal", (n, i) => i ? n / i * 100 : 0), this.set("uploadResponse", null); } get file() { return this._filePromiseWrapper ? this._filePromiseWrapper.promise.then((e) => this._filePromiseWrapper ? e : null) : Promise.resolve(null); @@ -23434,9 +23434,9 @@ Read more: ${ne}#error-${o}`; }), t; } } - class $C extends ue { + class HC extends ue { constructor(e) { - super(e), this.buttonView = new De(e), this._fileInputView = new HC(e), this._fileInputView.bind("acceptedType").to(this), this._fileInputView.bind("allowMultipleFiles").to(this), this._fileInputView.delegate("done").to(this), this.setTemplate({ tag: "span", attributes: { class: "ck-file-dialog-button" }, children: [this.buttonView, this._fileInputView] }), this.buttonView.on("execute", () => { + super(e), this.buttonView = new De(e), this._fileInputView = new qC(e), this._fileInputView.bind("acceptedType").to(this), this._fileInputView.bind("allowMultipleFiles").to(this), this._fileInputView.delegate("done").to(this), this.setTemplate({ tag: "span", attributes: { class: "ck-file-dialog-button" }, children: [this.buttonView, this._fileInputView] }), this.buttonView.on("execute", () => { this._fileInputView.open(); }); } @@ -23444,7 +23444,7 @@ Read more: ${ne}#error-${o}`; this.buttonView.focus(); } } - class HC extends ue { + class qC extends ue { constructor(e) { super(e), this.set("acceptedType", void 0), this.set("allowMultipleFiles", !1); const t = this.bindTemplate; @@ -23457,7 +23457,7 @@ Read more: ${ne}#error-${o}`; } } const Jg = "ckCsrfToken", Yg = "abcdefghijklmnopqrstuvwxyz0123456789"; - function qC() { + function UC() { let o = function(n) { n = n.toLowerCase(); const i = document.cookie.split(";"); @@ -23479,7 +23479,7 @@ Read more: ${ne}#error-${o}`; return i; }(40), e = Jg, t = o, document.cookie = encodeURIComponent(e) + "=" + encodeURIComponent(t) + ";path=/"), o; } - class UC { + class WC { constructor(e, t, n) { this.loader = e, this.url = t, this.t = n; } @@ -23507,7 +23507,7 @@ Read more: ${ne}#error-${o}`; } _sendRequest(e) { const t = new FormData(); - t.append("upload", e), t.append("ckCsrfToken", qC()), this.xhr.send(t); + t.append("upload", e), t.append("ckCsrfToken", UC()), this.xhr.send(t); } } class Ca extends le { @@ -23536,7 +23536,7 @@ Read more: ${ne}#error-${o}`; } } const po = "bold"; - class WC extends K { + class KC extends K { static get pluginName() { return "BoldEditing"; } @@ -23549,7 +23549,7 @@ Read more: ${ne}#error-${o}`; } } const ya = "bold"; - class KC extends K { + class GC extends K { static get pluginName() { return "BoldUI"; } @@ -23563,10 +23563,10 @@ Read more: ${ne}#error-${o}`; }); } } - var Qg = S(8603), GC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Qg.Z, GC), Qg.Z.locals; + var Qg = S(8603), ZC = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Qg.Z, ZC), Qg.Z.locals; const fo = "italic"; - class ZC extends K { + class JC extends K { static get pluginName() { return "ItalicEditing"; } @@ -23576,7 +23576,7 @@ Read more: ${ne}#error-${o}`; } } const Ea = "italic"; - class JC extends K { + class YC extends K { static get pluginName() { return "ItalicUI"; } @@ -23591,7 +23591,7 @@ Read more: ${ne}#error-${o}`; } } const ni = "underline"; - class YC extends K { + class QC extends K { static get pluginName() { return "UnderlineEditing"; } @@ -23601,7 +23601,7 @@ Read more: ${ne}#error-${o}`; } } const xa = "underline"; - class QC extends K { + class XC extends K { static get pluginName() { return "UnderlineUI"; } @@ -23615,7 +23615,7 @@ Read more: ${ne}#error-${o}`; }); } } - class XC extends le { + class e1 extends le { refresh() { this.value = this._getValue(), this.isEnabled = this._checkEnabled(); } @@ -23673,7 +23673,7 @@ Read more: ${ne}#error-${o}`; const t = o.checkChild(e.parent, "blockQuote"), n = o.checkChild(["$root", "blockQuote"], e); return t && n; } - class e1 extends K { + class t1 extends K { static get pluginName() { return "BlockQuoteEditing"; } @@ -23682,7 +23682,7 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor, t = e.model.schema; - e.commands.add("blockQuote", new XC(e)), t.register("blockQuote", { inheritAllFrom: "$container" }), e.conversion.elementToElement({ model: "blockQuote", view: "blockquote" }), e.model.document.registerPostFixer((s) => { + e.commands.add("blockQuote", new e1(e)), t.register("blockQuote", { inheritAllFrom: "$container" }), e.conversion.elementToElement({ model: "blockQuote", view: "blockquote" }), e.model.document.registerPostFixer((s) => { const a = e.model.document.differ.getChanges(); for (const l of a) if (l.type == "insert") { const c = l.position.nodeAfter; @@ -23709,9 +23709,9 @@ Read more: ${ne}#error-${o}`; }, { context: "blockquote" }); } } - var tm = S(3062), t1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(tm.Z, t1), tm.Z.locals; - class n1 extends K { + var tm = S(3062), n1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(tm.Z, n1), tm.Z.locals; + class o1 extends K { static get pluginName() { return "BlockQuoteUI"; } @@ -23725,7 +23725,7 @@ Read more: ${ne}#error-${o}`; }); } } - class o1 extends K { + class i1 extends K { static get pluginName() { return "CloudServicesUploadAdapter"; } @@ -23736,10 +23736,10 @@ Read more: ${ne}#error-${o}`; const e = this.editor, t = e.plugins.get("CloudServices"), n = t.token, i = t.uploadUrl; if (!n) return; const r = e.plugins.get("CloudServicesCore"); - this._uploadGateway = r.createUploadGateway(n, i), e.plugins.get(Yt).createUploadAdapter = (s) => new i1(this._uploadGateway, s); + this._uploadGateway = r.createUploadGateway(n, i), e.plugins.get(Yt).createUploadAdapter = (s) => new r1(this._uploadGateway, s); } } - class i1 { + class r1 { constructor(e, t) { this.uploadGateway = e, this.loader = t; } @@ -23752,7 +23752,7 @@ Read more: ${ne}#error-${o}`; this.fileUploader.abort(); } } - class r1 extends le { + class s1 extends le { constructor(e) { super(e), this._isEnabledBasedOnSelection = !1; } @@ -23771,7 +23771,7 @@ Read more: ${ne}#error-${o}`; function nm(o, e) { return e.checkChild(o.parent, "paragraph") && !e.isObject(o); } - class s1 extends le { + class a1 extends le { constructor(e) { super(e), this._isEnabledBasedOnSelection = !1; } @@ -23795,12 +23795,12 @@ Read more: ${ne}#error-${o}`; } init() { const o = this.editor, e = o.model; - o.commands.add("paragraph", new r1(o)), o.commands.add("insertParagraph", new s1(o)), e.schema.register("paragraph", { inheritAllFrom: "$block" }), o.conversion.elementToElement({ model: "paragraph", view: "p" }), o.conversion.for("upcast").elementToElement({ model: (t, { writer: n }) => om.paragraphLikeElements.has(t.name) ? t.isEmpty ? null : n.createElement("paragraph") : null, view: /.+/, converterPriority: "low" }); + o.commands.add("paragraph", new s1(o)), o.commands.add("insertParagraph", new a1(o)), e.schema.register("paragraph", { inheritAllFrom: "$block" }), o.conversion.elementToElement({ model: "paragraph", view: "p" }), o.conversion.for("upcast").elementToElement({ model: (t, { writer: n }) => om.paragraphLikeElements.has(t.name) ? t.isEmpty ? null : n.createElement("paragraph") : null, view: /.+/, converterPriority: "low" }); } }; let Sa = om; Sa.paragraphLikeElements = /* @__PURE__ */ new Set(["blockquote", "dd", "div", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "li", "p", "td", "th"]); - class a1 extends le { + class l1 extends le { constructor(e, t) { super(e), this.modelElements = t; } @@ -23820,7 +23820,7 @@ Read more: ${ne}#error-${o}`; return t.checkChild(o.parent, e) && !t.isObject(o); } const rm = "paragraph"; - class l1 extends K { + class c1 extends K { static get pluginName() { return "HeadingEditing"; } @@ -23833,7 +23833,7 @@ Read more: ${ne}#error-${o}`; init() { const e = this.editor, t = e.config.get("heading.options"), n = []; for (const i of t) i.model !== "paragraph" && (e.model.schema.register(i.model, { inheritAllFrom: "$block" }), e.conversion.elementToElement(i), n.push(i.model)); - this._addDefaultH1Conversion(e), e.commands.add("heading", new a1(e, n)); + this._addDefaultH1Conversion(e), e.commands.add("heading", new l1(e, n)); } afterInit() { const e = this.editor, t = e.commands.get("enter"), n = e.config.get("heading.options"); @@ -23846,9 +23846,9 @@ Read more: ${ne}#error-${o}`; e.conversion.for("upcast").elementToElement({ model: "heading1", view: "h1", converterPriority: se.get("low") + 1 }); } } - var sm = S(8733), c1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(sm.Z, c1), sm.Z.locals; - class d1 extends K { + var sm = S(8733), d1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(sm.Z, d1), sm.Z.locals; + class u1 extends K { static get pluginName() { return "HeadingUI"; } @@ -23892,9 +23892,9 @@ Read more: ${ne}#error-${o}`; const t = Ge(e.getSelectedBlocks()); return !t || o.isObject(t) || t.isEmpty && t.name != "listItem" ? "imageBlock" : "imageInline"; } - var u1 = Object.defineProperty, cm = Object.getOwnPropertySymbols, h1 = Object.prototype.hasOwnProperty, g1 = Object.prototype.propertyIsEnumerable, dm = (o, e, t) => e in o ? u1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, um = (o, e) => { - for (var t in e || (e = {})) h1.call(e, t) && dm(o, t, e[t]); - if (cm) for (var t of cm(e)) g1.call(e, t) && dm(o, t, e[t]); + var h1 = Object.defineProperty, cm = Object.getOwnPropertySymbols, g1 = Object.prototype.hasOwnProperty, m1 = Object.prototype.propertyIsEnumerable, dm = (o, e, t) => e in o ? h1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, um = (o, e) => { + for (var t in e || (e = {})) g1.call(e, t) && dm(o, t, e[t]); + if (cm) for (var t of cm(e)) m1.call(e, t) && dm(o, t, e[t]); return o; }; class Qt extends K { @@ -23943,7 +23943,7 @@ Read more: ${ne}#error-${o}`; const l = function(d, u) { const g = d.getSelectedElement(); if (g) { - const p = cn(d); + const p = dn(d); if (p) return u.createRange(u.createPositionAt(g, p)); } return ph(d, u); @@ -23982,7 +23982,7 @@ Read more: ${ne}#error-${o}`; const n = o.model.schema, i = o.config.get("image.insert.type"); return o.plugins.has("ImageBlockEditing") ? o.plugins.has("ImageInlineEditing") ? t || (i === "inline" ? "imageInline" : i === "block" ? "imageBlock" : e.is("selection") ? Da(n, e) : n.checkChild(e, "imageInline") ? "imageInline" : "imageBlock") : "imageBlock" : "imageInline"; } - class m1 extends le { + class p1 extends le { refresh() { const e = this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection); this.isEnabled = !!e, this.isEnabled && e.hasAttribute("alt") ? this.value = e.getAttribute("alt") : this.value = !1; @@ -23994,7 +23994,7 @@ Read more: ${ne}#error-${o}`; }); } } - class p1 extends K { + class f1 extends K { static get requires() { return [Qt]; } @@ -24002,14 +24002,14 @@ Read more: ${ne}#error-${o}`; return "ImageTextAlternativeEditing"; } init() { - this.editor.commands.add("imageTextAlternative", new m1(this.editor)); + this.editor.commands.add("imageTextAlternative", new p1(this.editor)); } } - var gm = S(1905), f1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(gm.Z, f1), gm.Z.locals; - var mm = S(6764), b1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(mm.Z, b1), mm.Z.locals; - class k1 extends ue { + var gm = S(1905), b1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(gm.Z, b1), gm.Z.locals; + var mm = S(6764), k1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(mm.Z, k1), mm.Z.locals; + class w1 extends ue { constructor(e) { super(e); const t = this.locale.t; @@ -24036,7 +24036,7 @@ Read more: ${ne}#error-${o}`; const e = o.editing.view, t = ht.defaultPositions, n = o.plugins.get("ImageUtils"); return { target: e.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(e.document.selection)), positions: [t.northArrowSouth, t.northArrowSouthWest, t.northArrowSouthEast, t.southArrowNorth, t.southArrowNorthWest, t.southArrowNorthEast, t.viewportStickyNorth] }; } - class w1 extends K { + class A1 extends K { static get requires() { return [tr]; } @@ -24060,7 +24060,7 @@ Read more: ${ne}#error-${o}`; } _createForm() { const e = this.editor, t = e.editing.view.document, n = e.plugins.get("ImageUtils"); - this._balloon = this.editor.plugins.get("ContextualBalloon"), this._form = new (x(k1))(e.locale), this._form.render(), this.listenTo(this._form, "submit", () => { + this._balloon = this.editor.plugins.get("ContextualBalloon"), this._form = new (x(w1))(e.locale), this._form.render(), this.listenTo(this._form, "submit", () => { e.execute("imageTextAlternative", { newValue: this._form.labeledInput.fieldView.element.value }), this._hideForm(!0); }), this.listenTo(this._form, "cancel", () => { this._hideForm(!0); @@ -24094,7 +24094,7 @@ Read more: ${ne}#error-${o}`; } class fm extends K { static get requires() { - return [p1, w1]; + return [f1, A1]; } static get pluginName() { return "ImageTextAlternative"; @@ -24126,7 +24126,7 @@ Read more: ${ne}#error-${o}`; i.on(`attribute:${t}:${e}`, n); }; } - class A1 extends Ft { + class _1 extends Ft { observe(e) { this.listenTo(e, "load", (t, n) => { const i = n.target; @@ -24140,12 +24140,12 @@ Read more: ${ne}#error-${o}`; this.isEnabled && (this.document.fire("layoutChanged"), this.document.fire("imageLoaded", e)); } } - var _1 = Object.defineProperty, km = Object.getOwnPropertySymbols, v1 = Object.prototype.hasOwnProperty, C1 = Object.prototype.propertyIsEnumerable, wm = (o, e, t) => e in o ? _1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, dr = (o, e) => { - for (var t in e || (e = {})) v1.call(e, t) && wm(o, t, e[t]); - if (km) for (var t of km(e)) C1.call(e, t) && wm(o, t, e[t]); + var v1 = Object.defineProperty, km = Object.getOwnPropertySymbols, C1 = Object.prototype.hasOwnProperty, y1 = Object.prototype.propertyIsEnumerable, wm = (o, e, t) => e in o ? v1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, dr = (o, e) => { + for (var t in e || (e = {})) C1.call(e, t) && wm(o, t, e[t]); + if (km) for (var t of km(e)) y1.call(e, t) && wm(o, t, e[t]); return o; }; - class y1 extends le { + class E1 extends le { constructor(e) { super(e); const t = e.config.get("image.insert.type"); @@ -24166,7 +24166,7 @@ Read more: ${ne}#error-${o}`; }); } } - class E1 extends le { + class x1 extends le { refresh() { const e = this.editor.plugins.get("ImageUtils"), t = this.editor.model.document.selection.getSelectedElement(); this.isEnabled = e.isImage(t), this.value = this.isEnabled ? t.getAttribute("src") : null; @@ -24187,11 +24187,11 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor, t = e.conversion; - e.editing.view.addObserver(A1), t.for("upcast").attributeToAttribute({ view: { name: "img", key: "alt" }, model: "alt" }).attributeToAttribute({ view: { name: "img", key: "srcset" }, model: { key: "srcset", value: (r) => { + e.editing.view.addObserver(_1), t.for("upcast").attributeToAttribute({ view: { name: "img", key: "alt" }, model: "alt" }).attributeToAttribute({ view: { name: "img", key: "srcset" }, model: { key: "srcset", value: (r) => { const s = { data: r.getAttribute("srcset") }; return r.hasAttribute("width") && (s.width = r.getAttribute("width")), s; } } }); - const n = new y1(e), i = new E1(e); + const n = new E1(e), i = new x1(e); e.commands.add("insertImage", n), e.commands.add("replaceImageSource", i), e.commands.add("imageInsert", n); } } @@ -24217,7 +24217,7 @@ Read more: ${ne}#error-${o}`; }) : null; } } - class x1 extends K { + class S1 extends K { static get requires() { return [Am, Qt, Zt]; } @@ -24259,17 +24259,17 @@ Read more: ${ne}#error-${o}`; }); } } - var vm = S(3508), S1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(vm.Z, S1), vm.Z.locals; - class D1 extends K { + var vm = S(3508), D1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(vm.Z, D1), vm.Z.locals; + class B1 extends K { static get requires() { - return [x1, ti, fm]; + return [S1, ti, fm]; } static get pluginName() { return "ImageBlock"; } } - class B1 extends K { + class T1 extends K { static get requires() { return [Am, Qt, Zt]; } @@ -24303,21 +24303,21 @@ Read more: ${ne}#error-${o}`; }); } } - class T1 extends K { + class I1 extends K { static get requires() { - return [B1, ti, fm]; + return [T1, ti, fm]; } static get pluginName() { return "ImageInline"; } } - var Cm = S(2640), I1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Cm.Z, I1), Cm.Z.locals; + var Cm = S(2640), P1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Cm.Z, P1), Cm.Z.locals; function ym(o) { const e = o.map((t) => t.replace("+", "\\+")); return new RegExp(`^image\\/(${e.join("|")})$`); } - function P1(o) { + function R1(o) { return new Promise((e, t) => { const n = o.getAttribute("src"); fetch(n).then((i) => i.blob()).then((i) => { @@ -24342,13 +24342,13 @@ Read more: ${ne}#error-${o}`; function Em(o, e) { return o.type ? o.type : e.match(/data:(image\/\w+);base64/) ? e.match(/data:(image\/\w+);base64/)[1].toLowerCase() : "image/jpeg"; } - class R1 extends K { + class O1 extends K { static get pluginName() { return "ImageUploadUI"; } init() { const e = this.editor, t = e.t, n = (i) => { - const r = new $C(i), s = e.commands.get("uploadImage"), a = e.config.get("image.upload.types"), l = ym(a); + const r = new HC(i), s = e.commands.get("uploadImage"), a = e.config.get("image.upload.types"), l = ym(a); return r.set({ acceptedType: a.map((c) => `image/${c}`).join(","), allowMultipleFiles: !0 }), r.buttonView.set({ label: t("Insert image"), icon: Pe.image, tooltip: !0 }), r.buttonView.bind("isEnabled").to(s), r.on("done", (c, d) => { const u = Array.from(d).filter((g) => l.test(g.type)); u.length && (e.execute("uploadImage", { file: u }), e.editing.view.focus()); @@ -24357,13 +24357,13 @@ Read more: ${ne}#error-${o}`; e.ui.componentFactory.add("uploadImage", n), e.ui.componentFactory.add("imageUpload", n); } } - var xm = S(3689), O1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(xm.Z, O1), xm.Z.locals; - var Sm = S(4036), z1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Sm.Z, z1), Sm.Z.locals; - var Dm = S(3773), M1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Dm.Z, M1), Dm.Z.locals; - class F1 extends K { + var xm = S(3689), z1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(xm.Z, z1), xm.Z.locals; + var Sm = S(4036), M1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Sm.Z, M1), Sm.Z.locals; + var Dm = S(3773), F1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Dm.Z, F1), Dm.Z.locals; + class N1 extends K { constructor(e) { super(e), this.uploadStatusChange = (t, n, i) => { const r = this.editor, s = n.item, a = s.getAttribute("uploadId"); @@ -24430,8 +24430,8 @@ Read more: ${ne}#error-${o}`; const n = Pm(o, t); n && e.remove(e.createRangeOn(n)); } - var N1 = Object.defineProperty, V1 = Object.defineProperties, L1 = Object.getOwnPropertyDescriptors, Om = Object.getOwnPropertySymbols, j1 = Object.prototype.hasOwnProperty, $1 = Object.prototype.propertyIsEnumerable, zm = (o, e, t) => e in o ? N1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; - class H1 extends le { + var V1 = Object.defineProperty, L1 = Object.defineProperties, j1 = Object.getOwnPropertyDescriptors, Om = Object.getOwnPropertySymbols, $1 = Object.prototype.hasOwnProperty, H1 = Object.prototype.propertyIsEnumerable, zm = (o, e, t) => e in o ? V1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t; + class q1 extends le { refresh() { const e = this.editor, t = e.plugins.get("ImageUtils"), n = e.model.document.selection.getSelectedElement(); this.isEnabled = t.isImageAllowed() || t.isImage(n); @@ -24450,13 +24450,13 @@ Read more: ${ne}#error-${o}`; const i = this.editor, r = i.plugins.get(Yt).createLoader(e), s = i.plugins.get("ImageUtils"); var a, l; r && s.insertImage((a = ((c, d) => { - for (var u in d || (d = {})) j1.call(d, u) && zm(c, u, d[u]); - if (Om) for (var u of Om(d)) $1.call(d, u) && zm(c, u, d[u]); + for (var u in d || (d = {})) $1.call(d, u) && zm(c, u, d[u]); + if (Om) for (var u of Om(d)) H1.call(d, u) && zm(c, u, d[u]); return c; - })({}, t), l = { uploadId: r.id }, V1(a, L1(l))), n); + })({}, t), l = { uploadId: r.id }, L1(a, j1(l))), n); } } - class q1 extends K { + class U1 extends K { constructor(e) { super(e), e.config.define("image", { upload: { types: ["jpeg", "png", "gif", "bmp", "webp", "tiff"] } }), this._uploadImageElements = /* @__PURE__ */ new Map(); } @@ -24467,7 +24467,7 @@ Read more: ${ne}#error-${o}`; return "ImageUploadEditing"; } init() { - const e = this.editor, t = e.model.document, n = e.conversion, i = e.plugins.get(Yt), r = e.plugins.get("ImageUtils"), s = e.plugins.get("ClipboardPipeline"), a = ym(e.config.get("image.upload.types")), l = new H1(e); + const e = this.editor, t = e.model.document, n = e.conversion, i = e.plugins.get(Yt), r = e.plugins.get("ImageUtils"), s = e.plugins.get("ClipboardPipeline"), a = ym(e.config.get("image.upload.types")), l = new q1(e); e.commands.add("uploadImage", l), e.commands.add("imageUpload", l), n.for("upcast").attributeToAttribute({ view: { name: "img", key: "uploadId" }, model: "uploadId" }), this.listenTo(e.editing.view.document, "clipboardInput", (c, d) => { if (u = d.dataTransfer, Array.from(u.types).includes("text/html") && u.getData("text/html") !== "") return; var u; @@ -24480,7 +24480,7 @@ Read more: ${ne}#error-${o}`; }), this.listenTo(s, "inputTransformation", (c, d) => { const u = Array.from(e.editing.view.createRangeIn(d.content)).map((p) => p.item).filter((p) => function(b, w) { return !(!b.isInlineImageView(w) || !w.getAttribute("src") || !w.getAttribute("src").match(/^data:image\/\w+;base64,/g) && !w.getAttribute("src").match(/^blob:/g)); - }(r, p) && !p.getAttribute("uploadProcessed")).map((p) => ({ promise: P1(p), imageElement: p })); + }(r, p) && !p.getAttribute("uploadProcessed")).map((p) => ({ promise: R1(p), imageElement: p })); if (!u.length) return; const g = new Wi(e.editing.view.document); for (const p of u) { @@ -24494,7 +24494,7 @@ Read more: ${ne}#error-${o}`; const c = t.differ.getChanges({ includeChangesInGraveyard: !0 }).reverse(), d = /* @__PURE__ */ new Set(); for (const u of c) if (u.type == "insert" && u.name != "$text") { const g = u.position.nodeAfter, p = u.position.root.rootName == "$graveyard"; - for (const b of U1(e, g)) { + for (const b of W1(e, g)) { const w = b.getAttribute("uploadId"); if (!w) continue; const E = i.loaders.get(w); @@ -24558,15 +24558,15 @@ Read more: ${ne}#error-${o}`; r != "" && n.setAttribute("srcset", { data: r, width: i }, t); } } - function U1(o, e) { + function W1(o, e) { const t = o.plugins.get("ImageUtils"); return Array.from(o.model.createRangeOn(e)).filter((n) => t.isImage(n.item)).map((n) => n.item); } - var Mm = S(1568), W1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Mm.Z, W1), Mm.Z.locals; - var Fm = S(3535), K1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Fm.Z, K1), Fm.Z.locals; - class G1 extends le { + var Mm = S(1568), K1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Mm.Z, K1), Mm.Z.locals; + var Fm = S(3535), G1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Fm.Z, G1), Fm.Z.locals; + class Z1 extends le { refresh() { const e = this.editor, t = e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection); this.isEnabled = !!t, t && t.hasAttribute("width") ? this.value = { width: t.getAttribute("width"), height: null } : this.value = null; @@ -24578,7 +24578,7 @@ Read more: ${ne}#error-${o}`; }); } } - class Z1 extends K { + class J1 extends K { static get requires() { return [Qt]; } @@ -24589,7 +24589,7 @@ Read more: ${ne}#error-${o}`; super(e), e.config.define("image", { resizeUnit: "%", resizeOptions: [{ name: "resizeImage:original", value: null, icon: "original" }, { name: "resizeImage:25", value: "25", icon: "small" }, { name: "resizeImage:50", value: "50", icon: "medium" }, { name: "resizeImage:75", value: "75", icon: "large" }] }); } init() { - const e = this.editor, t = new G1(e); + const e = this.editor, t = new Z1(e); this._registerSchema(), this._registerConverters("imageBlock"), this._registerConverters("imageInline"), e.commands.add("resizeImage", t), e.commands.add("imageResize", t); } _registerSchema() { @@ -24608,9 +24608,9 @@ Read more: ${ne}#error-${o}`; function Nm(o) { return (e) => o === null && e === o || e !== null && e.width === o; } - var Vm = S(6270), J1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Vm.Z, J1), Vm.Z.locals; - class Y1 extends le { + var Vm = S(6270), Y1 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Vm.Z, Y1), Vm.Z.locals; + class Q1 extends le { constructor(e, t) { super(e), this._defaultStyles = { imageBlock: !1, imageInline: !1 }, this._styles = new Map(t.map((n) => { if (n.isDefault) for (const i of n.modelElements) this._defaultStyles[i] = n.name; @@ -24633,12 +24633,12 @@ Read more: ${ne}#error-${o}`; return !this._styles.get(e).modelElements.includes(t.name); } } - var Q1 = Object.defineProperty, Lm = Object.getOwnPropertySymbols, X1 = Object.prototype.hasOwnProperty, ey = Object.prototype.propertyIsEnumerable, jm = (o, e, t) => e in o ? Q1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, $m = (o, e) => { - for (var t in e || (e = {})) X1.call(e, t) && jm(o, t, e[t]); - if (Lm) for (var t of Lm(e)) ey.call(e, t) && jm(o, t, e[t]); + var X1 = Object.defineProperty, Lm = Object.getOwnPropertySymbols, ey = Object.prototype.hasOwnProperty, ty = Object.prototype.propertyIsEnumerable, jm = (o, e, t) => e in o ? X1(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, $m = (o, e) => { + for (var t in e || (e = {})) ey.call(e, t) && jm(o, t, e[t]); + if (Lm) for (var t of Lm(e)) ty.call(e, t) && jm(o, t, e[t]); return o; }; - const { objectFullWidth: ty, objectInline: Hm, objectLeft: qm, objectRight: Ta, objectCenter: Ia, objectBlockLeft: Um, objectBlockRight: Wm } = Pe, ur = { get inline() { + const { objectFullWidth: ny, objectInline: Hm, objectLeft: qm, objectRight: Ta, objectCenter: Ia, objectBlockLeft: Um, objectBlockRight: Wm } = Pe, ur = { get inline() { return { name: "inline", title: "In line", icon: Hm, modelElements: ["imageInline"], isDefault: !0 }; }, get alignLeft() { return { name: "alignLeft", title: "Left aligned image", icon: qm, modelElements: ["imageBlock", "imageInline"], className: "image-style-align-left" }; @@ -24654,7 +24654,7 @@ Read more: ${ne}#error-${o}`; return { name: "block", title: "Centered image", icon: Ia, modelElements: ["imageBlock"], isDefault: !0 }; }, get side() { return { name: "side", title: "Side image", icon: Ta, modelElements: ["imageBlock"], className: "image-style-side" }; - } }, Km = { full: ty, left: Um, right: Wm, center: Ia, inlineLeft: qm, inlineRight: Ta, inline: Hm }, Gm = [{ name: "imageStyle:wrapText", title: "Wrap text", defaultItem: "imageStyle:alignLeft", items: ["imageStyle:alignLeft", "imageStyle:alignRight"] }, { name: "imageStyle:breakText", title: "Break text", defaultItem: "imageStyle:block", items: ["imageStyle:alignBlockLeft", "imageStyle:block", "imageStyle:alignBlockRight"] }]; + } }, Km = { full: ny, left: Um, right: Wm, center: Ia, inlineLeft: qm, inlineRight: Ta, inline: Hm }, Gm = [{ name: "imageStyle:wrapText", title: "Wrap text", defaultItem: "imageStyle:alignLeft", items: ["imageStyle:alignLeft", "imageStyle:alignRight"] }, { name: "imageStyle:breakText", title: "Break text", defaultItem: "imageStyle:block", items: ["imageStyle:alignBlockLeft", "imageStyle:block", "imageStyle:alignBlockRight"] }]; function Zm(o) { ee("image-style-configuration-definition-invalid", o); } @@ -24691,7 +24691,7 @@ Read more: ${ne}#error-${o}`; } init() { const { normalizeStyles: e, getDefaultStylesConfiguration: t } = Pa, n = this.editor, i = n.plugins.has("ImageBlockEditing"), r = n.plugins.has("ImageInlineEditing"); - n.config.define("image.styles", t(i, r)), this.normalizedStyles = e({ configuredStyles: n.config.get("image.styles"), isBlockPluginLoaded: i, isInlinePluginLoaded: r }), this._setupConversion(i, r), this._setupPostFixer(), n.commands.add("imageStyle", new Y1(n, this.normalizedStyles)); + n.config.define("image.styles", t(i, r)), this.normalizedStyles = e({ configuredStyles: n.config.get("image.styles"), isBlockPluginLoaded: i, isInlinePluginLoaded: r }), this._setupConversion(i, r), this._setupPostFixer(), n.commands.add("imageStyle", new Q1(n, this.normalizedStyles)); } _setupConversion(e, t) { const n = this.editor, i = n.model.schema, r = (s = this.normalizedStyles, (l, c, d) => { @@ -24726,9 +24726,9 @@ Read more: ${ne}#error-${o}`; }); } } - var Qm = S(5083), ny = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Qm.Z, ny), Qm.Z.locals; - class oy extends K { + var Qm = S(5083), oy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Qm.Z, oy), Qm.Z.locals; + class iy extends K { static get requires() { return [Ym]; } @@ -24789,7 +24789,7 @@ Read more: ${ne}#error-${o}`; function tp(o, e) { return (o ? o + ": " : "") + e; } - class iy extends K { + class ry extends K { static get pluginName() { return "IndentEditing"; } @@ -24799,7 +24799,7 @@ Read more: ${ne}#error-${o}`; } } const np = '', op = ''; - class ry extends K { + class sy extends K { static get pluginName() { return "IndentUI"; } @@ -24866,8 +24866,8 @@ Read more: ${ne}#error-${o}`; return this.classes[t + n]; } } - const sy = ["paragraph", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6"]; - class ay { + const ay = ["paragraph", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6"]; + class ly { constructor() { this._definitions = /* @__PURE__ */ new Set(); } @@ -24911,28 +24911,28 @@ Read more: ${ne}#error-${o}`; }; } } - const ly = function(o, e, t) { + const cy = function(o, e, t) { var n = o.length; return t = t === void 0 ? n : t, !e && t >= n ? o : Cd(o, e, t); }; - var cy = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"); + var dy = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"); const sp = function(o) { - return cy.test(o); - }, dy = function(o) { + return dy.test(o); + }, uy = function(o) { return o.split(""); }; - var ap = "\\ud800-\\udfff", uy = "[" + ap + "]", Ra = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", Oa = "\\ud83c[\\udffb-\\udfff]", lp = "[^" + ap + "]", cp = "(?:\\ud83c[\\udde6-\\uddff]){2}", dp = "[\\ud800-\\udbff][\\udc00-\\udfff]", up = "(?:" + Ra + "|" + Oa + ")?", hp = "[\\ufe0e\\ufe0f]?", hy = hp + up + ("(?:\\u200d(?:" + [lp, cp, dp].join("|") + ")" + hp + up + ")*"), gy = "(?:" + [lp + Ra + "?", Ra, cp, dp, uy].join("|") + ")", my = RegExp(Oa + "(?=" + Oa + ")|" + gy + hy, "g"); - const py = function(o) { - return o.match(my) || []; - }, fy = function(o) { - return sp(o) ? py(o) : dy(o); - }, by = /* @__PURE__ */ function(o) { + var ap = "\\ud800-\\udfff", hy = "[" + ap + "]", Ra = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", Oa = "\\ud83c[\\udffb-\\udfff]", lp = "[^" + ap + "]", cp = "(?:\\ud83c[\\udde6-\\uddff]){2}", dp = "[\\ud800-\\udbff][\\udc00-\\udfff]", up = "(?:" + Ra + "|" + Oa + ")?", hp = "[\\ufe0e\\ufe0f]?", gy = hp + up + ("(?:\\u200d(?:" + [lp, cp, dp].join("|") + ")" + hp + up + ")*"), my = "(?:" + [lp + Ra + "?", Ra, cp, dp, hy].join("|") + ")", py = RegExp(Oa + "(?=" + Oa + ")|" + my + gy, "g"); + const fy = function(o) { + return o.match(py) || []; + }, by = function(o) { + return sp(o) ? fy(o) : uy(o); + }, ky = /* @__PURE__ */ function(o) { return function(e) { e = As(e); - var t = sp(e) ? fy(e) : void 0, n = t ? t[0] : e.charAt(0), i = t ? ly(t, 1).join("") : e.slice(1); + var t = sp(e) ? by(e) : void 0, n = t ? t[0] : e.charAt(0), i = t ? cy(t, 1).join("") : e.slice(1); return n[o]() + i; }; - }("toUpperCase"), ky = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g, wy = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i, Ay = /^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i, _y = /^((\w+:(\/{2,})?)|(\W))/i, za = "Ctrl+K"; + }("toUpperCase"), wy = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g, Ay = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i, _y = /^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i, vy = /^((\w+:(\/{2,})?)|(\W))/i, za = "Ctrl+K"; function gp(o, { writer: e }) { const t = e.createAttributeElement("a", { href: o }, { priority: 5 }); return e.setCustomProperty("link", !0, t), t; @@ -24940,27 +24940,27 @@ Read more: ${ne}#error-${o}`; function mp(o) { const e = String(o); return function(t) { - return !!t.replace(ky, "").match(wy); + return !!t.replace(wy, "").match(Ay); }(e) ? e : "#"; } function Ma(o, e) { return !!o && e.checkAttribute(o.name, "linkHref"); } function Fa(o, e) { - const t = (n = o, Ay.test(n) ? "mailto:" : e); + const t = (n = o, _y.test(n) ? "mailto:" : e); var n; const i = !!t && !pp(o); return o && i ? t + o : o; } function pp(o) { - return _y.test(o); + return vy.test(o); } function fp(o) { window.open(o, "_blank", "noopener"); } - class vy extends le { + class Cy extends le { constructor() { - super(...arguments), this.manualDecorators = new vt(), this.automaticDecorators = new ay(); + super(...arguments), this.manualDecorators = new vt(), this.automaticDecorators = new ly(); } restoreManualDecoratorStates() { for (const e of this.manualDecorators) e.value = this._getDecoratorStateFromModel(e.id); @@ -25040,7 +25040,7 @@ Read more: ${ne}#error-${o}`; return t.is("$text") || t.is("$textProxy") ? t.data : null; } } - class Cy extends le { + class yy extends le { refresh() { const e = this.editor.model, t = e.document.selection, n = t.getSelectedElement(); Ma(n, e.schema) ? this.isEnabled = e.schema.checkAttribute(n, "linkHref") : this.isEnabled = e.schema.checkAttributeInSelection(t, "linkHref"); @@ -25053,7 +25053,7 @@ Read more: ${ne}#error-${o}`; }); } } - class yy extends ve() { + class Ey extends ve() { constructor({ id: e, label: t, attributes: n, classes: i, styles: r, defaultValue: s }) { super(), this.id = e, this.set("value", void 0), this.defaultValue = s, this.label = t, this.attributes = n, this.classes = i, this.styles = r; } @@ -25061,15 +25061,15 @@ Read more: ${ne}#error-${o}`; return { attributes: this.attributes, classes: this.classes, styles: this.styles }; } } - var kp = S(9773), Ey = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(kp.Z, Ey), kp.Z.locals; - var xy = Object.defineProperty, wp = Object.getOwnPropertySymbols, Sy = Object.prototype.hasOwnProperty, Dy = Object.prototype.propertyIsEnumerable, Ap = (o, e, t) => e in o ? xy(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, By = (o, e) => { - for (var t in e || (e = {})) Sy.call(e, t) && Ap(o, t, e[t]); - if (wp) for (var t of wp(e)) Dy.call(e, t) && Ap(o, t, e[t]); + var kp = S(9773), xy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(kp.Z, xy), kp.Z.locals; + var Sy = Object.defineProperty, wp = Object.getOwnPropertySymbols, Dy = Object.prototype.hasOwnProperty, By = Object.prototype.propertyIsEnumerable, Ap = (o, e, t) => e in o ? Sy(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, Ty = (o, e) => { + for (var t in e || (e = {})) Dy.call(e, t) && Ap(o, t, e[t]); + if (wp) for (var t of wp(e)) By.call(e, t) && Ap(o, t, e[t]); return o; }; - const _p = "automatic", Ty = /^(https?:)?\/\//; - class Iy extends K { + const _p = "automatic", Iy = /^(https?:)?\/\//; + class Py extends K { static get pluginName() { return "LinkEditing"; } @@ -25081,14 +25081,14 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor; - e.model.schema.extend("$text", { allowAttributes: "linkHref" }), e.conversion.for("dataDowncast").attributeToElement({ model: "linkHref", view: gp }), e.conversion.for("editingDowncast").attributeToElement({ model: "linkHref", view: (n, i) => gp(mp(n), i) }), e.conversion.for("upcast").elementToAttribute({ view: { name: "a", attributes: { href: !0 } }, model: { key: "linkHref", value: (n) => n.getAttribute("href") } }), e.commands.add("link", new vy(e)), e.commands.add("unlink", new Cy(e)); + e.model.schema.extend("$text", { allowAttributes: "linkHref" }), e.conversion.for("dataDowncast").attributeToElement({ model: "linkHref", view: gp }), e.conversion.for("editingDowncast").attributeToElement({ model: "linkHref", view: (n, i) => gp(mp(n), i) }), e.conversion.for("upcast").elementToAttribute({ view: { name: "a", attributes: { href: !0 } }, model: { key: "linkHref", value: (n) => n.getAttribute("href") } }), e.commands.add("link", new Cy(e)), e.commands.add("unlink", new yy(e)); const t = function(n, i) { const r = { "Open in a new tab": n("Open in a new tab"), Downloadable: n("Downloadable") }; return i.forEach((s) => ("label" in s && r[s.label] && (s.label = r[s.label]), s)), i; }(e.t, function(n) { const i = []; if (n) for (const [r, s] of Object.entries(n)) { - const a = Object.assign({}, s, { id: `link${by(r)}` }); + const a = Object.assign({}, s, { id: `link${ky(r)}` }); i.push(a); } return i; @@ -25115,14 +25115,14 @@ Read more: ${ne}#error-${o}`; } _enableAutomaticDecorators(e) { const t = this.editor, n = t.commands.get("link").automaticDecorators; - t.config.get("link.addTargetToExternalLinks") && n.add({ id: "linkIsExternal", mode: _p, callback: (i) => !!i && Ty.test(i), attributes: { target: "_blank", rel: "noopener noreferrer" } }), n.add(e), n.length && t.conversion.for("downcast").add(n.getDispatcher()); + t.config.get("link.addTargetToExternalLinks") && n.add({ id: "linkIsExternal", mode: _p, callback: (i) => !!i && Iy.test(i), attributes: { target: "_blank", rel: "noopener noreferrer" } }), n.add(e), n.length && t.conversion.for("downcast").add(n.getDispatcher()); } _enableManualDecorators(e) { if (!e.length) return; const t = this.editor, n = t.commands.get("link").manualDecorators; e.forEach((i) => { t.model.schema.extend("$text", { allowAttributes: i.id }); - const r = new yy(i); + const r = new Ey(i); n.add(r), t.conversion.for("downcast").attributeToElement({ model: r.id, view: (s, { writer: a, schema: l }, { item: c }) => { if ((c.is("selection") || l.isInline(c)) && s) { const d = a.createAttributeElement("a", r.attributes, { priority: 5 }); @@ -25130,7 +25130,7 @@ Read more: ${ne}#error-${o}`; for (const u in r.styles) a.setStyle(u, r.styles[u], d); return a.setCustomProperty("link", !0, d), d; } - } }), t.conversion.for("upcast").elementToAttribute({ view: By({ name: "a" }, r._createPattern()), model: { key: r.id } }); + } }), t.conversion.for("upcast").elementToAttribute({ view: Ty({ name: "a" }, r._createPattern()), model: { key: r.id } }); }); } _enableLinkOpen() { @@ -25231,9 +25231,9 @@ Read more: ${ne}#error-${o}`; function Va(o) { return o.getDefinition("$text").allowAttributes.filter((e) => e.startsWith("link")); } - var Cp = S(7754), Py = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Cp.Z, Py), Cp.Z.locals; - class Ry extends ue { + var Cp = S(7754), Ry = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Cp.Z, Ry), Cp.Z.locals; + class Oy extends ue { constructor(e, t) { super(e), this.focusTracker = new xt(), this.keystrokes = new Ht(), this._focusables = new wn(); const n = e.t; @@ -25282,9 +25282,9 @@ Read more: ${ne}#error-${o}`; return t.add(this.saveButtonView), t.add(this.cancelButtonView), t; } } - var yp = S(2347), Oy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(yp.Z, Oy), yp.Z.locals; - class zy extends ue { + var yp = S(2347), zy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(yp.Z, zy), yp.Z.locals; + class My extends ue { constructor(e) { super(e), this.focusTracker = new xt(), this.keystrokes = new Ht(), this._focusables = new wn(); const t = e.t; @@ -25311,7 +25311,7 @@ Read more: ${ne}#error-${o}`; } } const Lt = "link-ui"; - class My extends K { + class Fy extends K { constructor() { super(...arguments), this.actionsView = null, this.formView = null; } @@ -25323,7 +25323,7 @@ Read more: ${ne}#error-${o}`; } init() { const e = this.editor; - e.editing.view.addObserver(L_), this._balloon = e.plugins.get(tr), this._createToolbarLinkButton(), this._enableBalloonActivators(), e.conversion.for("editingDowncast").markerToHighlight({ model: Lt, view: { classes: ["ck-fake-link-selection"] } }), e.conversion.for("editingDowncast").markerToElement({ model: Lt, view: { name: "span", classes: ["ck-fake-link-selection", "ck-fake-link-selection_collapsed"] } }); + e.editing.view.addObserver(j_), this._balloon = e.plugins.get(tr), this._createToolbarLinkButton(), this._enableBalloonActivators(), e.conversion.for("editingDowncast").markerToHighlight({ model: Lt, view: { classes: ["ck-fake-link-selection"] } }), e.conversion.for("editingDowncast").markerToElement({ model: Lt, view: { name: "span", classes: ["ck-fake-link-selection", "ck-fake-link-selection_collapsed"] } }); } destroy() { super.destroy(), this.formView && this.formView.destroy(), this.actionsView && this.actionsView.destroy(); @@ -25332,7 +25332,7 @@ Read more: ${ne}#error-${o}`; this.actionsView = this._createActionsView(), this.formView = this._createFormView(), this._enableUserBalloonInteractions(); } _createActionsView() { - const e = this.editor, t = new zy(e.locale), n = e.commands.get("link"), i = e.commands.get("unlink"); + const e = this.editor, t = new My(e.locale), n = e.commands.get("link"), i = e.commands.get("unlink"); return t.bind("href").to(n, "value"), t.editButtonView.bind("isEnabled").to(n), t.unlinkButtonView.bind("isEnabled").to(i), this.listenTo(t, "edit", () => { this._addFormView(); }), this.listenTo(t, "unlink", () => { @@ -25344,7 +25344,7 @@ Read more: ${ne}#error-${o}`; }), t; } _createFormView() { - const e = this.editor, t = e.commands.get("link"), n = e.config.get("link.defaultProtocol"), i = new (x(Ry))(e.locale, t); + const e = this.editor, t = e.commands.get("link"), n = e.config.get("link.defaultProtocol"), i = new (x(Oy))(e.locale, t); return i.urlInputView.fieldView.bind("value").to(t, "value"), i.urlInputView.bind("isEnabled").to(t, "isEnabled"), i.saveButtonView.bind("isEnabled").to(t), this.listenTo(i, "submit", () => { const { value: r } = i.urlInputView.fieldView.element, s = Fa(r, n); e.execute("link", s, i.getDecoratorSwitchesState()), this._closeFormView(); @@ -25471,8 +25471,8 @@ Read more: ${ne}#error-${o}`; var t; }) || null; } - const Fy = new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$", "i"); - class Ny extends K { + const Ny = new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$", "i"); + class Vy extends K { static get requires() { return [ho]; } @@ -25545,19 +25545,19 @@ Read more: ${ne}#error-${o}`; } } function Ep(o) { - const e = Fy.exec(o); + const e = Ny.exec(o); return e ? e[2] : null; } - var xp = S(111), Vy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(xp.Z, Vy), xp.Z.locals; - var Sp = S(5730), Ly = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Sp.Z, Ly), Sp.Z.locals; - var Dp = S(4564), jy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Dp.Z, jy), Dp.Z.locals; - function $y(o, e) { + var xp = S(111), Ly = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(xp.Z, Ly), xp.Z.locals; + var Sp = S(5730), jy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Sp.Z, jy), Sp.Z.locals; + var Dp = S(4564), $y = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Dp.Z, $y), Dp.Z.locals; + function Hy(o, e) { const t = e.mapper, n = e.writer, i = o.getAttribute("listType") == "numbered" ? "ol" : "ul", r = function(a) { const l = a.createContainerElement("li"); - return l.getFillerOffset = Uy, l; + return l.getFillerOffset = Wy, l; }(n), s = n.createContainerElement(i, null); return n.insert(n.createPositionAt(s, 0), r), t.bindElements(o, r), r; } @@ -25631,12 +25631,12 @@ Read more: ${ne}#error-${o}`; } return t; } - const Hy = ["disc", "circle", "square"], qy = ["decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin"]; - function Uy() { + const qy = ["disc", "circle", "square"], Uy = ["decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin"]; + function Wy() { const o = !this.isEmpty && (this.getChild(0).name == "ul" || this.getChild(0).name == "ol"); return this.isEmpty || o ? 0 : Bd.call(this); } - class Wy extends K { + class Ky extends K { static get pluginName() { return "ListUI"; } @@ -25645,14 +25645,14 @@ Read more: ${ne}#error-${o}`; Pp(this.editor, "numberedList", e("Numbered List"), ''), Pp(this.editor, "bulletedList", e("Bulleted List"), ''); } } - const Ky = [{ listStyle: "disc", typeAttribute: "disc", listType: "bulleted" }, { listStyle: "circle", typeAttribute: "circle", listType: "bulleted" }, { listStyle: "square", typeAttribute: "square", listType: "bulleted" }, { listStyle: "decimal", typeAttribute: "1", listType: "numbered" }, { listStyle: "decimal-leading-zero", typeAttribute: null, listType: "numbered" }, { listStyle: "lower-roman", typeAttribute: "i", listType: "numbered" }, { listStyle: "upper-roman", typeAttribute: "I", listType: "numbered" }, { listStyle: "lower-alpha", typeAttribute: "a", listType: "numbered" }, { listStyle: "upper-alpha", typeAttribute: "A", listType: "numbered" }, { listStyle: "lower-latin", typeAttribute: "a", listType: "numbered" }, { listStyle: "upper-latin", typeAttribute: "A", listType: "numbered" }]; - for (const { listStyle: o, typeAttribute: e, listType: t } of Ky) ; - var Rp = S(4721), Gy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Rp.Z, Gy), Rp.Z.locals; - var Op = S(6082), Zy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Op.Z, Zy), Op.Z.locals; - var zp = S(2417), Jy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(zp.Z, Jy), zp.Z.locals; + const Gy = [{ listStyle: "disc", typeAttribute: "disc", listType: "bulleted" }, { listStyle: "circle", typeAttribute: "circle", listType: "bulleted" }, { listStyle: "square", typeAttribute: "square", listType: "bulleted" }, { listStyle: "decimal", typeAttribute: "1", listType: "numbered" }, { listStyle: "decimal-leading-zero", typeAttribute: null, listType: "numbered" }, { listStyle: "lower-roman", typeAttribute: "i", listType: "numbered" }, { listStyle: "upper-roman", typeAttribute: "I", listType: "numbered" }, { listStyle: "lower-alpha", typeAttribute: "a", listType: "numbered" }, { listStyle: "upper-alpha", typeAttribute: "A", listType: "numbered" }, { listStyle: "lower-latin", typeAttribute: "a", listType: "numbered" }, { listStyle: "upper-latin", typeAttribute: "A", listType: "numbered" }]; + for (const { listStyle: o, typeAttribute: e, listType: t } of Gy) ; + var Rp = S(4721), Zy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Rp.Z, Zy), Rp.Z.locals; + var Op = S(6082), Jy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Op.Z, Jy), Op.Z.locals; + var zp = S(2417), Yy = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(zp.Z, Yy), zp.Z.locals; class Mp extends le { constructor(e, t) { super(e), this._indentBy = t == "forward" ? 1 : -1; @@ -25740,13 +25740,13 @@ Read more: ${ne}#error-${o}`; function Vp(o, e) { return e.checkChild(o.parent, "listItem") && !e.isObject(o); } - class Yy extends K { + class Qy extends K { static get pluginName() { return "ListUtils"; } getListTypeFromListStyleType(e) { return function(t) { - return Hy.includes(t) ? "bulleted" : qy.includes(t) ? "numbered" : null; + return qy.includes(t) ? "bulleted" : Uy.includes(t) ? "numbered" : null; }(e); } getSelectedListItems(e) { @@ -25768,16 +25768,16 @@ Read more: ${ne}#error-${o}`; if (!i.test(t.item, "insert") || !i.test(t.item, "attribute:listType") || !i.test(t.item, "attribute:listIndent")) return; i.consume(t.item, "insert"), i.consume(t.item, "attribute:listType"), i.consume(t.item, "attribute:listIndent"); const r = t.item; - Bp(r, $y(r, n), n, o); + Bp(r, Hy(r, n), n, o); }; } - const Qy = (o, e, t) => { + const Xy = (o, e, t) => { if (!t.consumable.test(e.item, o.name)) return; const n = t.mapper.toViewElement(e.item), i = t.writer; i.breakContainer(i.createPositionBefore(n)), i.breakContainer(i.createPositionAfter(n)); const r = n.parent, s = e.attributeNewValue == "numbered" ? "ol" : "ul"; i.rename(s, r); - }, Xy = (o, e, t) => { + }, e2 = (o, e, t) => { t.consumable.consume(e.item, o.name); const n = t.mapper.toViewElement(e.item).parent, i = t.writer; yt(i, n, n.nextSibling), yt(i, n.previousSibling, n); @@ -25804,10 +25804,10 @@ Read more: ${ne}#error-${o}`; yt(i, n.nodeBefore, n.nodeAfter); } } - }, e2 = (o, e, t) => { + }, t2 = (o, e, t) => { const n = t.mapper.toViewPosition(e.position), i = n.nodeBefore, r = n.nodeAfter; yt(t.writer, i, r); - }, t2 = (o, e, t) => { + }, n2 = (o, e, t) => { if (t.consumable.consume(e.viewItem, { name: !0 })) { const n = t.writer, i = n.createElement("listItem"), r = function(l) { let c = 0, d = l.parent; @@ -25830,7 +25830,7 @@ Read more: ${ne}#error-${o}`; for (const b of c) if (b.name == "ul" || b.name == "ol") p = d.convertItem(b, p).modelCursor; else { const w = d.convertItem(b, u.createPositionAt(l, "end")), E = w.modelRange.start.nodeAfter; - E && E.is("element") && !g.checkChild(l, E.name) && (l = w.modelCursor.parent.is("element", "listItem") ? w.modelCursor.parent : i2(w.modelCursor), p = u.createPositionAfter(l)); + E && E.is("element") && !g.checkChild(l, E.name) && (l = w.modelCursor.parent.is("element", "listItem") ? w.modelCursor.parent : r2(w.modelCursor), p = u.createPositionAfter(l)); } return p; }(i, e.viewItem.getChildren(), t); @@ -25842,7 +25842,7 @@ Read more: ${ne}#error-${o}`; for (const i of n) !(i.is("element", "li") || bo(i)) && i._remove(); } - }, n2 = (o, e, t) => { + }, o2 = (o, e, t) => { if (t.consumable.test(e.viewItem, { name: !0 })) { if (e.viewItem.childCount === 0) return; const n = [...e.viewItem.getChildren()]; @@ -25869,7 +25869,7 @@ Read more: ${ne}#error-${o}`; } }; } - const o2 = function(o, [e, t]) { + const i2 = function(o, [e, t]) { const n = this; let i, r = e.is("documentFragment") ? e.getChild(0) : e; if (i = t ? n.createSelection(t) : n.document.selection, r && r.is("element", "listItem")) { @@ -25881,7 +25881,7 @@ Read more: ${ne}#error-${o}`; } } }; - function i2(o) { + function r2(o) { const e = new Nt({ startPosition: o }); let t; do @@ -25906,12 +25906,12 @@ Read more: ${ne}#error-${o}`; function bo(o) { return o.is("element", "ol") || o.is("element", "ul"); } - class r2 extends K { + class s2 extends K { static get pluginName() { return "ListEditing"; } static get requires() { - return [ei, ho, Yy]; + return [ei, ho, Qy]; } init() { const e = this.editor; @@ -25984,7 +25984,7 @@ Read more: ${ne}#error-${o}`; a.modelPosition = i.createPositionBefore(u).getShiftedBy(g), s.stop(); } })), t.mapper.on("modelToViewPosition", Hp(n.view)), e.conversion.for("editingDowncast").add((s) => { - s.on("insert", jp, { priority: "high" }), s.on("insert:listItem", Lp(e.model)), s.on("attribute:listType:listItem", Qy, { priority: "high" }), s.on("attribute:listType:listItem", Xy, { priority: "low" }), s.on("attribute:listIndent:listItem", /* @__PURE__ */ function(a) { + s.on("insert", jp, { priority: "high" }), s.on("insert:listItem", Lp(e.model)), s.on("attribute:listType:listItem", Xy, { priority: "high" }), s.on("attribute:listType:listItem", e2, { priority: "low" }), s.on("attribute:listIndent:listItem", /* @__PURE__ */ function(a) { return (l, c, d) => { if (!d.consumable.consume(c.item, "attribute:listIndent")) return; const u = d.mapper.toViewElement(c.item), g = d.writer; @@ -26002,12 +26002,12 @@ Read more: ${ne}#error-${o}`; for (const I of g.createRangeIn(E).getItems()) d.mapper.unbindViewElement(I); l.stop(); }; - }(e.model)), s.on("remove", e2, { priority: "low" }); + }(e.model)), s.on("remove", t2, { priority: "low" }); }), e.conversion.for("dataDowncast").add((s) => { s.on("insert", jp, { priority: "high" }), s.on("insert:listItem", Lp(e.model)); }), e.conversion.for("upcast").add((s) => { - s.on("element:ul", $p, { priority: "high" }), s.on("element:ol", $p, { priority: "high" }), s.on("element:li", n2, { priority: "high" }), s.on("element:li", t2); - }), e.model.on("insertContent", o2, { priority: "high" }), e.commands.add("numberedList", new Fp(e, "numbered")), e.commands.add("bulletedList", new Fp(e, "bulleted")), e.commands.add("indentList", new Mp(e, "forward")), e.commands.add("outdentList", new Mp(e, "backward")); + s.on("element:ul", $p, { priority: "high" }), s.on("element:ol", $p, { priority: "high" }), s.on("element:li", o2, { priority: "high" }), s.on("element:li", n2); + }), e.model.on("insertContent", i2, { priority: "high" }), e.commands.add("numberedList", new Fp(e, "numbered")), e.commands.add("bulletedList", new Fp(e, "bulleted")), e.commands.add("indentList", new Mp(e, "forward")), e.commands.add("outdentList", new Mp(e, "backward")); const r = n.view.document; this.listenTo(r, "enter", (s, a) => { const l = this.editor.model.document, c = l.selection.getLastPosition().parent; @@ -26036,8 +26036,8 @@ Read more: ${ne}#error-${o}`; return e; } Ei("Ctrl+Enter"); - var Up = S(1199), s2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Up.Z, s2), Up.Z.locals; + var Up = S(1199), a2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Up.Z, a2), Up.Z.locals; function qe(o, e, t, n, i = 1) { e != null && i != null && e > i ? n.setAttribute(o, e, t) : n.removeAttribute(o, t); } @@ -26049,7 +26049,7 @@ Read more: ${ne}#error-${o}`; const t = e.parent.parent, n = parseInt(t.getAttribute("headingColumns") || "0"), { column: i } = o.getCellLocation(e); return !!n && i < n; } - function a2() { + function l2() { return (o) => { o.on("element:table", (e, t, n) => { const i = t.viewItem; @@ -26065,7 +26065,7 @@ Read more: ${ne}#error-${o}`; for (const z of I) if (w && E === w || E.name === "tbody" && Array.from(z.getChildren()).length && Array.from(z.getChildren()).every((H) => H.is("element", "th"))) g++, p.push(z); else { b.push(z); - const H = l2(z); + const H = c2(z); (!u || H < u) && (u = H); } } @@ -26098,7 +26098,7 @@ Read more: ${ne}#error-${o}`; }, { priority: "low" }); }; } - function l2(o) { + function c2(o) { let e = 0, t = 0; const n = Array.from(o.getChildren()).filter((i) => i.name === "th" || i.name === "td"); for (; t < n.length && n[t].name === "th"; ) { @@ -26143,7 +26143,7 @@ Read more: ${ne}#error-${o}`; return this._endColumn !== void 0 && this._column > this._endColumn; } _formatOutValue(e, t = this._row, n = this._column) { - return { done: !1, value: new c2(this, e, t, n) }; + return { done: !1, value: new d2(this, e, t, n) }; } _shouldSkipSlot() { const e = this._skipRows.has(this._row), t = this._row < this._startRow, n = this._column < this._startColumn, i = this._endColumn !== void 0 && this._column > this._endColumn; @@ -26161,7 +26161,7 @@ Read more: ${ne}#error-${o}`; this._spannedCells.has(e) || this._spannedCells.set(e, /* @__PURE__ */ new Map()), this._spannedCells.get(e).set(t, n); } } - class c2 { + class d2 { constructor(e, t, n, i) { this.cell = t, this.row = e._row, this.column = e._column, this.cellAnchorRow = n, this.cellAnchorColumn = i, this._cellIndex = e._cellIndex, this._rowIndex = e._rowIndex, this._table = e._table; } @@ -26197,7 +26197,7 @@ Read more: ${ne}#error-${o}`; let c = null; for (const d of s) if (d.cell == e) { const u = d.row < a || d.column < l ? "th" : "td"; - c = o.asWidget ? gC(t.createEditableElement(u), t) : t.createContainerElement(u); + c = o.asWidget ? mC(t.createEditableElement(u), t) : t.createContainerElement(u); break; } return c; @@ -26216,7 +26216,7 @@ Read more: ${ne}#error-${o}`; function Jp(o) { return o.parent.childCount == 1 && !!o.getAttributeKeys().next().done; } - class d2 extends le { + class u2 extends le { refresh() { const e = this.editor.model, t = e.document.selection, n = e.schema; this.isEnabled = function(i, r) { @@ -26412,7 +26412,7 @@ Read more: ${ne}#error-${o}`; const e = o.getChild(0); return o.childCount == 1 && e.is("element", "paragraph") && e.isEmpty; } - class u2 extends le { + class h2 extends le { refresh() { const e = this.editor.plugins.get("TableUtils"), t = e.getSelectionAffectedTableCells(this.editor.model.document.selection), n = t[0]; if (n) { @@ -26438,7 +26438,7 @@ Read more: ${ne}#error-${o}`; }); } } - class h2 extends le { + class g2 extends le { refresh() { const e = this.editor.plugins.get("TableUtils"), t = e.getSelectionAffectedTableCells(this.editor.model.document.selection), n = t[0]; if (n) { @@ -26459,7 +26459,7 @@ Read more: ${ne}#error-${o}`; }); } } - class g2 extends le { + class m2 extends le { refresh() { const e = this.editor.plugins.get("TableUtils"), t = this.editor.model, n = e.getSelectionAffectedTableCells(t.document.selection), i = n.length > 0; this.isEnabled = i, this.value = i && n.every((r) => this._isInHeading(r, r.parent.parent)); @@ -26480,7 +26480,7 @@ Read more: ${ne}#error-${o}`; return !!n && e.parent.index < n; } } - class m2 extends le { + class p2 extends le { refresh() { const e = this.editor.model, t = this.editor.plugins.get("TableUtils"), n = t.getSelectionAffectedTableCells(e.document.selection), i = n.length > 0; this.isEnabled = i, this.value = i && n.every((r) => Ha(t, r)); @@ -26699,7 +26699,7 @@ Read more: ${ne}#error-${o}`; }(t, n) == i; } sortRanges(e) { - return Array.from(e).sort(p2); + return Array.from(e).sort(f2); } _getFirstLastIndexesObject(e) { const t = e.sort((n, i) => n - i); @@ -26729,11 +26729,11 @@ Read more: ${ne}#error-${o}`; const t = Math.floor(o / e); return { newCellsSpan: t, updatedSpan: o - t * e + t }; } - function p2(o, e) { + function f2(o, e) { const t = o.start, n = e.start; return t.isBefore(n) ? -1 : 1; } - class f2 extends le { + class b2 extends le { refresh() { const e = this.editor.plugins.get(ot), t = e.getSelectedTableCells(this.editor.model.document.selection); this.isEnabled = e.isSelectionRectangular(t); @@ -26751,12 +26751,12 @@ Read more: ${ne}#error-${o}`; return { mergeWidth: w, mergeHeight: E }; }(r, i, t); qe("colspan", s, r, n), qe("rowspan", a, r, n); - for (const l of i) b2(l, r, n); + for (const l of i) k2(l, r, n); Wa(r.findAncestor("table"), t), n.setSelection(r, "in"); }); } } - function b2(o, e, t) { + function k2(o, e, t) { uf(o) || (uf(e) && t.remove(t.createRangeIn(e)), t.move(t.createRangeIn(o), t.createPositionAt(e, "end"))), t.remove(o); } function uf(o) { @@ -26767,7 +26767,7 @@ Read more: ${ne}#error-${o}`; const i = parseInt(o.getAttribute(n) || "1"); return Math.max(t, e + i); } - class k2 extends le { + class w2 extends le { constructor(e) { super(e), this.affectsData = !1; } @@ -26783,7 +26783,7 @@ Read more: ${ne}#error-${o}`; }); } } - class w2 extends le { + class A2 extends le { constructor(e) { super(e), this.affectsData = !1; } @@ -26799,19 +26799,19 @@ Read more: ${ne}#error-${o}`; }); } } - function A2(o) { + function _2(o) { o.document.registerPostFixer((e) => function(t, n) { const i = n.document.differ.getChanges(); let r = !1; const s = /* @__PURE__ */ new Set(); for (const a of i) { let l = null; - a.type == "insert" && a.name == "table" && (l = a.position.nodeAfter), a.type != "insert" && a.type != "remove" || a.name != "tableRow" && a.name != "tableCell" || (l = a.position.findAncestor("table")), C2(a) && (l = a.range.start.findAncestor("table")), l && !s.has(l) && (r = _2(l, t) || r, r = v2(l, t) || r, s.add(l)); + a.type == "insert" && a.name == "table" && (l = a.position.nodeAfter), a.type != "insert" && a.type != "remove" || a.name != "tableRow" && a.name != "tableCell" || (l = a.position.findAncestor("table")), y2(a) && (l = a.range.start.findAncestor("table")), l && !s.has(l) && (r = v2(l, t) || r, r = C2(l, t) || r, s.add(l)); } return r; }(e, o)); } - function _2(o, e) { + function v2(o, e) { let t = !1; const n = function(i) { const r = parseInt(i.getAttribute("headingRows") || "0"), s = Array.from(i.getChildren()).reduce((l, c) => c.is("element", "tableRow") ? l + 1 : l, 0), a = []; @@ -26831,7 +26831,7 @@ Read more: ${ne}#error-${o}`; } return t; } - function v2(o, e) { + function C2(o, e) { let t = !1; const n = function(a) { const l = new Array(a.childCount).fill(0); @@ -26856,20 +26856,20 @@ Read more: ${ne}#error-${o}`; } return t; } - function C2(o) { + function y2(o) { if (o.type !== "attribute") return !1; const e = o.attributeKey; return e === "headingRows" || e === "colspan" || e === "rowspan"; } - function y2(o) { + function E2(o) { o.document.registerPostFixer((e) => function(t, n) { const i = n.document.differ.getChanges(); let r = !1; - for (const s of i) s.type == "insert" && s.name == "table" && (r = E2(s.position.nodeAfter, t) || r), s.type == "insert" && s.name == "tableRow" && (r = gf(s.position.nodeAfter, t) || r), s.type == "insert" && s.name == "tableCell" && (r = Ga(s.position.nodeAfter, t) || r), s.type != "remove" && s.type != "insert" || !x2(s) || (r = Ga(s.position.parent, t) || r); + for (const s of i) s.type == "insert" && s.name == "table" && (r = x2(s.position.nodeAfter, t) || r), s.type == "insert" && s.name == "tableRow" && (r = gf(s.position.nodeAfter, t) || r), s.type == "insert" && s.name == "tableCell" && (r = Ga(s.position.nodeAfter, t) || r), s.type != "remove" && s.type != "insert" || !S2(s) || (r = Ga(s.position.parent, t) || r); return r; }(e, o)); } - function E2(o, e) { + function x2(o, e) { let t = !1; for (const n of o.getChildren()) n.is("element", "tableRow") && (t = gf(n, e) || t); return t; @@ -26885,17 +26885,17 @@ Read more: ${ne}#error-${o}`; for (const n of t) e.wrap(e.createRangeOn(n), "paragraph"); return !!t.length; } - function x2(o) { + function S2(o) { return !!o.position.parent.is("element", "tableCell") && (o.type == "insert" && o.name == "$text" || o.type == "remove"); } - function S2(o, e) { + function D2(o, e) { if (!o.is("element", "paragraph")) return !1; const t = e.toViewElement(o); return !!t && Jp(o) !== t.is("element", "span"); } - var mf = S(3881), D2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(mf.Z, D2), mf.Z.locals; - class B2 extends K { + var mf = S(3881), B2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(mf.Z, B2), mf.Z.locals; + class T2 extends K { constructor(e) { super(e), this._additionalSlots = []; } @@ -26918,11 +26918,11 @@ Read more: ${ne}#error-${o}`; const u = Ge(c.convertItem(d, l.modelCursor).modelRange.getItems()); u ? (c.convertChildren(l.viewItem, c.writer.createPositionAt(u, "end")), c.updateConversionResult(u, l)) : c.consumable.revert(l.viewItem, { name: !0, classes: "table" }); }); - }), i.for("upcast").add(a2()), i.for("editingDowncast").elementToStructure({ model: { name: "table", attributes: ["headingRows"] }, view: Kp(r, { asWidget: !0, additionalSlots: this._additionalSlots }) }), i.for("dataDowncast").elementToStructure({ model: { name: "table", attributes: ["headingRows"] }, view: Kp(r, { additionalSlots: this._additionalSlots }) }), i.for("upcast").elementToElement({ model: "tableRow", view: "tr" }), i.for("upcast").add((s) => { + }), i.for("upcast").add(l2()), i.for("editingDowncast").elementToStructure({ model: { name: "table", attributes: ["headingRows"] }, view: Kp(r, { asWidget: !0, additionalSlots: this._additionalSlots }) }), i.for("dataDowncast").elementToStructure({ model: { name: "table", attributes: ["headingRows"] }, view: Kp(r, { additionalSlots: this._additionalSlots }) }), i.for("upcast").elementToElement({ model: "tableRow", view: "tr" }), i.for("upcast").add((s) => { s.on("element:tr", (a, l) => { l.viewItem.isEmpty && l.modelCursor.index == 0 && a.stop(); }, { priority: "high" }); - }), i.for("downcast").elementToElement({ model: "tableRow", view: (s, { writer: a }) => s.isEmpty ? a.createEmptyElement("tr") : a.createContainerElement("tr") }), i.for("upcast").elementToElement({ model: "tableCell", view: "td" }), i.for("upcast").elementToElement({ model: "tableCell", view: "th" }), i.for("upcast").add(Wp("td")), i.for("upcast").add(Wp("th")), i.for("editingDowncast").elementToElement({ model: "tableCell", view: Gp({ asWidget: !0 }) }), i.for("dataDowncast").elementToElement({ model: "tableCell", view: Gp() }), i.for("editingDowncast").elementToElement({ model: "paragraph", view: Zp({ asWidget: !0 }), converterPriority: "high" }), i.for("dataDowncast").elementToElement({ model: "paragraph", view: Zp(), converterPriority: "high" }), i.for("downcast").attributeToAttribute({ model: "colspan", view: "colspan" }), i.for("upcast").attributeToAttribute({ model: { key: "colspan", value: pf("colspan") }, view: "colspan" }), i.for("downcast").attributeToAttribute({ model: "rowspan", view: "rowspan" }), i.for("upcast").attributeToAttribute({ model: { key: "rowspan", value: pf("rowspan") }, view: "rowspan" }), e.config.define("table.defaultHeadings.rows", 0), e.config.define("table.defaultHeadings.columns", 0), e.commands.add("insertTable", new d2(e)), e.commands.add("insertTableRowAbove", new Yp(e, { order: "above" })), e.commands.add("insertTableRowBelow", new Yp(e, { order: "below" })), e.commands.add("insertTableColumnLeft", new Qp(e, { order: "left" })), e.commands.add("insertTableColumnRight", new Qp(e, { order: "right" })), e.commands.add("removeTableRow", new u2(e)), e.commands.add("removeTableColumn", new h2(e)), e.commands.add("splitTableCellVertically", new Xp(e, { direction: "vertically" })), e.commands.add("splitTableCellHorizontally", new Xp(e, { direction: "horizontally" })), e.commands.add("mergeTableCells", new f2(e)), e.commands.add("mergeTableCellRight", new gr(e, { direction: "right" })), e.commands.add("mergeTableCellLeft", new gr(e, { direction: "left" })), e.commands.add("mergeTableCellDown", new gr(e, { direction: "down" })), e.commands.add("mergeTableCellUp", new gr(e, { direction: "up" })), e.commands.add("setTableColumnHeader", new m2(e)), e.commands.add("setTableRowHeader", new g2(e)), e.commands.add("selectTableRow", new k2(e)), e.commands.add("selectTableColumn", new w2(e)), A2(t), y2(t), this.listenTo(t.document, "change:data", () => { + }), i.for("downcast").elementToElement({ model: "tableRow", view: (s, { writer: a }) => s.isEmpty ? a.createEmptyElement("tr") : a.createContainerElement("tr") }), i.for("upcast").elementToElement({ model: "tableCell", view: "td" }), i.for("upcast").elementToElement({ model: "tableCell", view: "th" }), i.for("upcast").add(Wp("td")), i.for("upcast").add(Wp("th")), i.for("editingDowncast").elementToElement({ model: "tableCell", view: Gp({ asWidget: !0 }) }), i.for("dataDowncast").elementToElement({ model: "tableCell", view: Gp() }), i.for("editingDowncast").elementToElement({ model: "paragraph", view: Zp({ asWidget: !0 }), converterPriority: "high" }), i.for("dataDowncast").elementToElement({ model: "paragraph", view: Zp(), converterPriority: "high" }), i.for("downcast").attributeToAttribute({ model: "colspan", view: "colspan" }), i.for("upcast").attributeToAttribute({ model: { key: "colspan", value: pf("colspan") }, view: "colspan" }), i.for("downcast").attributeToAttribute({ model: "rowspan", view: "rowspan" }), i.for("upcast").attributeToAttribute({ model: { key: "rowspan", value: pf("rowspan") }, view: "rowspan" }), e.config.define("table.defaultHeadings.rows", 0), e.config.define("table.defaultHeadings.columns", 0), e.commands.add("insertTable", new u2(e)), e.commands.add("insertTableRowAbove", new Yp(e, { order: "above" })), e.commands.add("insertTableRowBelow", new Yp(e, { order: "below" })), e.commands.add("insertTableColumnLeft", new Qp(e, { order: "left" })), e.commands.add("insertTableColumnRight", new Qp(e, { order: "right" })), e.commands.add("removeTableRow", new h2(e)), e.commands.add("removeTableColumn", new g2(e)), e.commands.add("splitTableCellVertically", new Xp(e, { direction: "vertically" })), e.commands.add("splitTableCellHorizontally", new Xp(e, { direction: "horizontally" })), e.commands.add("mergeTableCells", new b2(e)), e.commands.add("mergeTableCellRight", new gr(e, { direction: "right" })), e.commands.add("mergeTableCellLeft", new gr(e, { direction: "left" })), e.commands.add("mergeTableCellDown", new gr(e, { direction: "down" })), e.commands.add("mergeTableCellUp", new gr(e, { direction: "up" })), e.commands.add("setTableColumnHeader", new p2(e)), e.commands.add("setTableRowHeader", new m2(e)), e.commands.add("selectTableRow", new w2(e)), e.commands.add("selectTableColumn", new A2(e)), _2(t), E2(t), this.listenTo(t.document, "change:data", () => { (function(s, a) { const l = s.document.differ; for (const c of l.getChanges()) { @@ -26946,7 +26946,7 @@ Read more: ${ne}#error-${o}`; u.is("element", "tableCell") && c.add(u); } for (const d of c.values()) { - const u = Array.from(d.getChildren()).filter((g) => S2(g, a.mapper)); + const u = Array.from(d.getChildren()).filter((g) => D2(g, a.mapper)); for (const g of u) a.reconvertItem(g); } }(t, e.editing); @@ -26962,9 +26962,9 @@ Read more: ${ne}#error-${o}`; return Number.isNaN(t) || t <= 0 ? null : t; }; } - var ff = S(1613), T2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(ff.Z, T2), ff.Z.locals; - class I2 extends ue { + var ff = S(1613), I2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(ff.Z, I2), ff.Z.locals; + class P2 extends ue { constructor(e) { super(e); const t = this.bindTemplate; @@ -27033,7 +27033,7 @@ Read more: ${ne}#error-${o}`; return this.createCollection(e); } } - class P2 extends K { + class R2 extends K { static get pluginName() { return "TableUI"; } @@ -27043,7 +27043,7 @@ Read more: ${ne}#error-${o}`; const r = e.commands.get("insertTable"), s = Gt(i); let a; return s.bind("isEnabled").to(r), s.buttonView.set({ icon: '', label: t("Insert table"), tooltip: !0 }), s.on("change:isOpen", () => { - a || (a = new I2(i), s.panelView.children.add(a), a.delegate("execute").to(s), s.on("execute", () => { + a || (a = new P2(i), s.panelView.children.add(a), a.delegate("execute").to(s), s.on("execute", () => { e.execute("insertTable", { rows: a.rows, columns: a.columns }), e.editing.view.focus(); })); }), s; @@ -27074,19 +27074,19 @@ Read more: ${ne}#error-${o}`; } _fillDropdownWithListOptions(e, t) { const n = this.editor, i = [], r = new vt(); - for (const s of t) R2(s, n, i, r); + for (const s of t) O2(s, n, i, r); return oa(e, r), i; } } - function R2(o, e, t, n) { + function O2(o, e, t, n) { if (o.type === "button" || o.type === "switchbutton") { const i = o.model = new pa(o.model), { commandName: r, bindIsOn: s } = o.model, a = e.commands.get(r); t.push(a), i.set({ commandName: r }), i.bind("isEnabled").to(a), s && i.bind("isOn").to(a, "value"), i.set({ withText: !0 }); } n.add(o); } - var bf = S(6945), O2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(bf.Z, O2), bf.Z.locals; + var bf = S(6945), z2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(bf.Z, z2), bf.Z.locals; class Pn extends K { static get pluginName() { return "TableSelection"; @@ -27184,7 +27184,7 @@ Read more: ${ne}#error-${o}`; return g && d.reverse(), p && d.forEach((b) => b.reverse()), { cells: d.flat(), backward: g || p }; } } - class z2 extends K { + class M2 extends K { static get pluginName() { return "TableClipboard"; } @@ -27211,12 +27211,12 @@ Read more: ${ne}#error-${o}`; a.length ? (e.stop(), i.change((l) => { const c = { width: r.getColumns(s), height: r.getRows(s) }, d = function(E, I, z, H) { const X = E[0].findAncestor("table"), de = H.getColumnIndexes(E), Oe = H.getRowIndexes(E), ke = { firstColumn: de.first, lastColumn: de.last, firstRow: Oe.first, lastRow: Oe.last }, Xt = E.length === 1; - return Xt && (ke.lastRow += I.height - 1, ke.lastColumn += I.width - 1, function(At, wr, Mn, un) { - const vo = un.getColumns(At), Co = un.getRows(At); - Mn > vo && un.insertColumns(At, { at: vo, columns: Mn - vo }), wr > Co && un.insertRows(At, { at: Co, rows: wr - Co }); + return Xt && (ke.lastRow += I.height - 1, ke.lastColumn += I.width - 1, function(At, wr, Mn, hn) { + const vo = hn.getColumns(At), Co = hn.getRows(At); + Mn > vo && hn.insertColumns(At, { at: vo, columns: Mn - vo }), wr > Co && hn.insertRows(At, { at: Co, rows: wr - Co }); }(X, ke.lastRow + 1, ke.lastColumn + 1, H)), Xt || !H.isSelectionRectangular(E) ? function(At, wr, Mn) { - const { firstRow: un, lastRow: vo, firstColumn: Co, lastColumn: Qf } = wr, Xf = { first: un, last: vo }, eb = { first: Co, last: Qf }; - Ja(At, Co, Xf, Mn), Ja(At, Qf + 1, Xf, Mn), Za(At, un, eb, Mn), Za(At, vo + 1, eb, Mn, un); + const { firstRow: hn, lastRow: vo, firstColumn: Co, lastColumn: Qf } = wr, Xf = { first: hn, last: vo }, eb = { first: Co, last: Qf }; + Ja(At, Co, Xf, Mn), Ja(At, Qf + 1, Xf, Mn), Za(At, hn, eb, Mn), Za(At, vo + 1, eb, Mn, hn); }(X, ke, z) : (ke.lastRow = af(X, ke), ke.lastColumn = lf(X, ke)), ke; }(a, c, l, r), u = d.lastRow - d.firstRow + 1, g = d.lastColumn - d.firstColumn + 1, p = { startRow: 0, startColumn: 0, endRow: Math.min(u, c.height) - 1, endColumn: Math.min(g, c.width) - 1 }; s = ef(s, p, l); @@ -27281,7 +27281,7 @@ Read more: ${ne}#error-${o}`; const n = o + e - 1, { first: i, last: r } = t; return o >= i && o <= r || o < i && n >= i; } - class M2 extends K { + class F2 extends K { static get pluginName() { return "TableKeyboard"; } @@ -27381,7 +27381,7 @@ Read more: ${ne}#error-${o}`; } } } - class F2 extends rn { + class N2 extends sn { constructor() { super(...arguments), this.domEventType = ["mousemove", "mouseleave"]; } @@ -27389,7 +27389,7 @@ Read more: ${ne}#error-${o}`; this.fire(e.type, e); } } - class N2 extends K { + class V2 extends K { static get pluginName() { return "TableMouse"; } @@ -27397,7 +27397,7 @@ Read more: ${ne}#error-${o}`; return [Pn, ot]; } init() { - this.editor.editing.view.addObserver(F2), this._enableShiftClickSelection(), this._enableMouseDragSelection(); + this.editor.editing.view.addObserver(N2), this._enableShiftClickSelection(), this._enableMouseDragSelection(); } _enableShiftClickSelection() { const e = this.editor, t = e.plugins.get(ot); @@ -27440,13 +27440,13 @@ Read more: ${ne}#error-${o}`; function wf(o, e) { return o.parent.parent == e.parent.parent; } - var Af = S(6306), V2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Af.Z, V2), Af.Z.locals; - function L2(o) { + var Af = S(6306), L2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Af.Z, L2), Af.Z.locals; + function j2(o) { const e = o.getSelectedElement(); return e && _f(e) ? e : null; } - function j2(o) { + function $2(o) { const e = o.getFirstPosition(); if (!e) return null; let t = e.parent; @@ -27459,30 +27459,30 @@ Read more: ${ne}#error-${o}`; function _f(o) { return !!o.getCustomProperty("table") && Ne(o); } - var vf = S(7368), $2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(vf.Z, $2), vf.Z.locals; - var Cf = S(9247), H2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Cf.Z, H2), Cf.Z.locals; - var yf = S(4070), q2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(yf.Z, q2), yf.Z.locals; - var Ef = S(6237), U2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Ef.Z, U2), Ef.Z.locals; - var xf = S(5087), W2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(xf.Z, W2), xf.Z.locals; + var vf = S(7368), H2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(vf.Z, H2), vf.Z.locals; + var Cf = S(9247), q2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Cf.Z, q2), Cf.Z.locals; + var yf = S(4070), U2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(yf.Z, U2), yf.Z.locals; + var Ef = S(6237), W2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Ef.Z, W2), Ef.Z.locals; + var xf = S(5087), K2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(xf.Z, K2), xf.Z.locals; const Rn = ht.defaultPositions; Rn.northArrowSouth, Rn.northArrowSouthWest, Rn.northArrowSouthEast, Rn.southArrowNorth, Rn.southArrowNorthWest, Rn.southArrowNorthEast, Rn.viewportStickyNorth; - var Sf = S(7341), K2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Sf.Z, K2), Sf.Z.locals; - var Df = S(2128), G2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Df.Z, G2), Df.Z.locals; - var Bf = S(4101), Z2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Bf.Z, Z2), Bf.Z.locals; - var J2 = Object.defineProperty, Tf = Object.getOwnPropertySymbols, Y2 = Object.prototype.hasOwnProperty, Q2 = Object.prototype.propertyIsEnumerable, If = (o, e, t) => e in o ? J2(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, Pf = (o, e) => { - for (var t in e || (e = {})) Y2.call(e, t) && If(o, t, e[t]); - if (Tf) for (var t of Tf(e)) Q2.call(e, t) && If(o, t, e[t]); + var Sf = S(7341), G2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Sf.Z, G2), Sf.Z.locals; + var Df = S(2128), Z2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Df.Z, Z2), Df.Z.locals; + var Bf = S(4101), J2 = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Bf.Z, J2), Bf.Z.locals; + var Y2 = Object.defineProperty, Tf = Object.getOwnPropertySymbols, Q2 = Object.prototype.hasOwnProperty, X2 = Object.prototype.propertyIsEnumerable, If = (o, e, t) => e in o ? Y2(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, Pf = (o, e) => { + for (var t in e || (e = {})) Q2.call(e, t) && If(o, t, e[t]); + if (Tf) for (var t of Tf(e)) X2.call(e, t) && If(o, t, e[t]); return o; }; - const X2 = { autoRefresh: !0 }, Rf = 36e5; + const eE = { autoRefresh: !0 }, Rf = 36e5; class Ya extends ve() { constructor(e, t = {}) { if (super(), !e) throw new T("token-missing-token-url", this); @@ -27495,7 +27495,7 @@ Read more: ${ne}#error-${o}`; }), s.addEventListener("error", () => r(new Error("Network Error"))), s.addEventListener("abort", () => r(new Error("Abort"))), s.send(); }); var n; - }, this._options = Pf(Pf({}, X2), t); + }, this._options = Pf(Pf({}, eE), t); } init() { return new Promise((e, t) => { @@ -27531,7 +27531,7 @@ Read more: ${ne}#error-${o}`; } } const Qa = /^data:(\S*?);base64,/; - class eE extends _e() { + class tE extends _e() { constructor(e, t, n) { if (super(), !e) throw new T("fileuploader-missing-file", null); if (!t) throw new T("fileuploader-missing-token", null); @@ -27589,17 +27589,17 @@ Read more: ${ne}#error-${o}`; }); } } - class tE { + class nE { constructor(e, t) { if (!e) throw new T("uploadgateway-missing-token", null); if (!t) throw new T("uploadgateway-missing-api-address", null); this._token = e, this._apiAddress = t; } upload(e) { - return new eE(e, this._token, this._apiAddress); + return new tE(e, this._token, this._apiAddress); } } - class nE extends Bi { + class oE extends Bi { static get pluginName() { return "CloudServicesCore"; } @@ -27607,7 +27607,7 @@ Read more: ${ne}#error-${o}`; return new Ya(e, t); } createUploadGateway(e, t) { - return new tE(e, t); + return new nE(e, t); } } var Of = (o, e, t) => new Promise((n, i) => { @@ -27650,7 +27650,7 @@ Read more: ${ne}#error-${o}`; }), e; } const el = "alignment"; - class oE extends le { + class iE extends le { refresh() { const e = this.editor.locale, t = Ge(this.editor.model.document.selection.getSelectedBlocks()); this.isEnabled = !!t && this._canBeAligned(t), this.isEnabled && t.hasAttribute("alignment") ? this.value = t.getAttribute("alignment") : this.value = e.contentLanguageDirection === "rtl" ? "right" : "left"; @@ -27670,7 +27670,7 @@ Read more: ${ne}#error-${o}`; return this.editor.model.schema.checkAttribute(e, el); } } - class iE extends K { + class rE extends K { static get pluginName() { return "AlignmentEditing"; } @@ -27700,11 +27700,11 @@ Read more: ${ne}#error-${o}`; return c; }(i); for (const l of a) e.conversion.for("upcast").attributeToAttribute(l); - e.commands.add("alignment", new oE(e)); + e.commands.add("alignment", new iE(e)); } } const mr = /* @__PURE__ */ new Map([["left", Pe.alignLeft], ["right", Pe.alignRight], ["center", Pe.alignCenter], ["justify", Pe.alignJustify]]); - class rE extends K { + class sE extends K { get localizedOptionTitles() { const e = this.editor.t; return { left: e("Align left"), right: e("Align right"), center: e("Align center"), justify: e("Justify") }; @@ -27733,7 +27733,7 @@ Read more: ${ne}#error-${o}`; }); } } - function sE(o) { + function aE(o) { const e = [{ name: "address", isVoid: !1 }, { name: "article", isVoid: !1 }, { name: "aside", isVoid: !1 }, { name: "blockquote", isVoid: !1 }, { name: "br", isVoid: !0 }, { name: "details", isVoid: !1 }, { name: "dialog", isVoid: !1 }, { name: "dd", isVoid: !1 }, { name: "div", isVoid: !1 }, { name: "dl", isVoid: !1 }, { name: "dt", isVoid: !1 }, { name: "fieldset", isVoid: !1 }, { name: "figcaption", isVoid: !1 }, { name: "figure", isVoid: !1 }, { name: "footer", isVoid: !1 }, { name: "form", isVoid: !1 }, { name: "h1", isVoid: !1 }, { name: "h2", isVoid: !1 }, { name: "h3", isVoid: !1 }, { name: "h4", isVoid: !1 }, { name: "h5", isVoid: !1 }, { name: "h6", isVoid: !1 }, { name: "header", isVoid: !1 }, { name: "hgroup", isVoid: !1 }, { name: "hr", isVoid: !0 }, { name: "input", isVoid: !0 }, { name: "li", isVoid: !1 }, { name: "main", isVoid: !1 }, { name: "nav", isVoid: !1 }, { name: "ol", isVoid: !1 }, { name: "p", isVoid: !1 }, { name: "section", isVoid: !1 }, { name: "table", isVoid: !1 }, { name: "tbody", isVoid: !1 }, { name: "td", isVoid: !1 }, { name: "textarea", isVoid: !1 }, { name: "th", isVoid: !1 }, { name: "thead", isVoid: !1 }, { name: "tr", isVoid: !1 }, { name: "ul", isVoid: !1 }], t = e.map((r) => r.name).join("|"), n = o.replace(new RegExp(``, "g"), ` $& `).split(` @@ -27749,16 +27749,16 @@ $& function tl(o, e, t = " ") { return `${t.repeat(Math.max(0, e))}${o}`; } - var Nf = S(2896), aE = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Nf.Z, aE), Nf.Z.locals; + var Nf = S(2896), lE = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Nf.Z, lE), Nf.Z.locals; const Vf = "SourceEditingMode"; - function lE(o) { + function cE(o) { return function(e) { return e.startsWith("<"); - }(o) ? sE(o) : o; + }(o) ? aE(o) : o; } const nl = "removeFormat"; - class cE extends K { + class dE extends K { static get pluginName() { return "RemoveFormatUI"; } @@ -27772,7 +27772,7 @@ $& }); } } - class dE extends le { + class uE extends le { refresh() { const e = this.editor.model; this.isEnabled = !!Ge(this._getFormattingItems(e.document.selection, e.schema)); @@ -27800,18 +27800,18 @@ $& } } } - class uE extends K { + class hE extends K { static get pluginName() { return "RemoveFormatEditing"; } init() { const e = this.editor; - e.commands.add("removeFormat", new dE(e)); + e.commands.add("removeFormat", new uE(e)); } } - var hE = Object.defineProperty, Lf = Object.getOwnPropertySymbols, gE = Object.prototype.hasOwnProperty, mE = Object.prototype.propertyIsEnumerable, jf = (o, e, t) => e in o ? hE(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, $f = (o, e) => { - for (var t in e || (e = {})) gE.call(e, t) && jf(o, t, e[t]); - if (Lf) for (var t of Lf(e)) mE.call(e, t) && jf(o, t, e[t]); + var gE = Object.defineProperty, Lf = Object.getOwnPropertySymbols, mE = Object.prototype.hasOwnProperty, pE = Object.prototype.propertyIsEnumerable, jf = (o, e, t) => e in o ? gE(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, $f = (o, e) => { + for (var t in e || (e = {})) mE.call(e, t) && jf(o, t, e[t]); + if (Lf) for (var t of Lf(e)) pE.call(e, t) && jf(o, t, e[t]); return o; }; function On(o, e, t, n) { @@ -27819,14 +27819,14 @@ $& if (r.attributes) for (const [a] of Object.entries(r.attributes)) i.removeAttribute(a, s); if (r.styles) for (const a of Object.keys(r.styles)) i.removeStyle(a, s); r.classes && i.removeClass(r.classes, s); - }(o, e, n), t && dn(o, t, n); + }(o, e, n), t && un(o, t, n); } - function dn(o, e, t) { + function un(o, e, t) { if (e.attributes) for (const [n, i] of Object.entries(e.attributes)) o.setAttribute(n, i, t); e.styles && o.setStyle(e.styles, t), e.classes && o.addClass(e.classes, t); } - function pE(o, e) { - const t = an(o); + function fE(o, e) { + const t = ln(o); let n = "attributes"; for (n in e) t[n] = n == "classes" ? Array.from(/* @__PURE__ */ new Set([...o[n] || [], ...e[n]])) : $f($f({}, o[n]), e[n]); return t; @@ -27851,11 +27851,11 @@ $& function ol({ model: o }) { return (e, t) => t.writer.createElement(o, { htmlContent: e.getCustomProperty("$rawContent") }); } - function fE(o, { view: e, isInline: t }) { + function bE(o, { view: e, isInline: t }) { const n = o.t; return (i, { writer: r }) => { const s = n("HTML object"), a = pr(e, i, r), l = i.getAttribute("htmlAttributes"); - return r.addClass("html-object-embed__content", a), l && dn(r, l, a), va(r.createContainerElement(t ? "span" : "div", { class: "html-object-embed", "data-html-object-embed-label": s }, a), r, { label: s }); + return r.addClass("html-object-embed__content", a), l && un(r, l, a), va(r.createContainerElement(t ? "span" : "div", { class: "html-object-embed", "data-html-object-embed-label": s }, a), r, { label: s }); }; } function pr(o, e, t) { @@ -27863,11 +27863,11 @@ $& i.setContentOf(n, e.getAttribute("htmlContent")); }); } - function bE({ priority: o, view: e }) { + function kE({ priority: o, view: e }) { return (t, n) => { if (!t) return; const { writer: i } = n, r = i.createAttributeElement(e, null, { priority: o }); - return dn(i, t, r), r; + return un(i, t, r), r; }; } function oi({ view: o }, e) { @@ -27888,14 +27888,14 @@ $& }); }; } - const kE = [{ model: "codeBlock", view: "pre" }, { model: "paragraph", view: "p" }, { model: "blockQuote", view: "blockquote" }, { model: "listItem", view: "li" }, { model: "pageBreak", view: "div" }, { model: "rawHtml", view: "div" }, { model: "table", view: "table" }, { model: "tableRow", view: "tr" }, { model: "tableCell", view: "td" }, { model: "tableCell", view: "th" }, { model: "tableColumnGroup", view: "colgroup" }, { model: "tableColumn", view: "col" }, { model: "caption", view: "caption" }, { model: "caption", view: "figcaption" }, { model: "imageBlock", view: "img" }, { model: "imageInline", view: "img" }, { model: "htmlP", view: "p", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlBlockquote", view: "blockquote", modelSchema: { inheritAllFrom: "$container" } }, { model: "htmlTable", view: "table", modelSchema: { allowWhere: "$block", isBlock: !0 } }, { model: "htmlTbody", view: "tbody", modelSchema: { allowIn: "htmlTable", isBlock: !1 } }, { model: "htmlThead", view: "thead", modelSchema: { allowIn: "htmlTable", isBlock: !1 } }, { model: "htmlTfoot", view: "tfoot", modelSchema: { allowIn: "htmlTable", isBlock: !1 } }, { model: "htmlCaption", view: "caption", modelSchema: { allowIn: "htmlTable", allowChildren: "$text", isBlock: !1 } }, { model: "htmlColgroup", view: "colgroup", modelSchema: { allowIn: "htmlTable", allowChildren: "col", isBlock: !1 } }, { model: "htmlCol", view: "col", modelSchema: { allowIn: "htmlColgroup", isBlock: !1 } }, { model: "htmlTr", view: "tr", modelSchema: { allowIn: ["htmlTable", "htmlThead", "htmlTbody"], isLimit: !0 } }, { model: "htmlTd", view: "td", modelSchema: { allowIn: "htmlTr", allowContentOf: "$container", isLimit: !0, isBlock: !1 } }, { model: "htmlTh", view: "th", modelSchema: { allowIn: "htmlTr", allowContentOf: "$container", isLimit: !0, isBlock: !1 } }, { model: "htmlFigure", view: "figure", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlFigcaption", view: "figcaption", modelSchema: { allowIn: "htmlFigure", allowChildren: "$text", isBlock: !1 } }, { model: "htmlAddress", view: "address", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlAside", view: "aside", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlMain", view: "main", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlDetails", view: "details", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlSummary", view: "summary", modelSchema: { allowChildren: "$text", allowIn: "htmlDetails", isBlock: !1 } }, { model: "htmlDiv", view: "div", paragraphLikeModel: "htmlDivParagraph", modelSchema: { inheritAllFrom: "$container" } }, { model: "htmlFieldset", view: "fieldset", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlLegend", view: "legend", modelSchema: { allowIn: "htmlFieldset", allowChildren: "$text" } }, { model: "htmlHeader", view: "header", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlFooter", view: "footer", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlForm", view: "form", modelSchema: { inheritAllFrom: "$container", isBlock: !0 } }, { model: "htmlHgroup", view: "hgroup", modelSchema: { allowChildren: ["htmlH1", "htmlH2", "htmlH3", "htmlH4", "htmlH5", "htmlH6"], isBlock: !1 } }, { model: "htmlH1", view: "h1", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH2", view: "h2", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH3", view: "h3", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH4", view: "h4", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH5", view: "h5", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH6", view: "h6", modelSchema: { inheritAllFrom: "$block" } }, { model: "$htmlList", modelSchema: { allowWhere: "$container", allowChildren: ["$htmlList", "htmlLi"], isBlock: !1 } }, { model: "htmlDir", view: "dir", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlMenu", view: "menu", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlUl", view: "ul", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlOl", view: "ol", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlLi", view: "li", modelSchema: { allowIn: "$htmlList", allowChildren: "$text", isBlock: !1 } }, { model: "htmlPre", view: "pre", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlArticle", view: "article", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlSection", view: "section", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlNav", view: "nav", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlDivDl", view: "div", modelSchema: { allowChildren: ["htmlDt", "htmlDd"], allowIn: "htmlDl" } }, { model: "htmlDl", view: "dl", modelSchema: { allowWhere: "$container", allowChildren: ["htmlDt", "htmlDd", "htmlDivDl"], isBlock: !1 } }, { model: "htmlDt", view: "dt", modelSchema: { allowChildren: "$block", isBlock: !1 } }, { model: "htmlDd", view: "dd", modelSchema: { allowChildren: "$block", isBlock: !1 } }, { model: "htmlCenter", view: "center", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }], wE = [{ model: "htmlLiAttributes", view: "li", appliesToBlock: !0 }, { model: "htmlListAttributes", view: "ol", appliesToBlock: !0 }, { model: "htmlListAttributes", view: "ul", appliesToBlock: !0 }, { model: "htmlFigureAttributes", view: "figure", appliesToBlock: "table" }, { model: "htmlTheadAttributes", view: "thead", appliesToBlock: "table" }, { model: "htmlTbodyAttributes", view: "tbody", appliesToBlock: "table" }, { model: "htmlFigureAttributes", view: "figure", appliesToBlock: "imageBlock" }, { model: "htmlAcronym", view: "acronym", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlTt", view: "tt", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlFont", view: "font", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlTime", view: "time", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlVar", view: "var", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlBig", view: "big", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSmall", view: "small", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSamp", view: "samp", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlQ", view: "q", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlOutput", view: "output", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlKbd", view: "kbd", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlBdi", view: "bdi", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlBdo", view: "bdo", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlAbbr", view: "abbr", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlA", view: "a", priority: 5, coupledAttribute: "linkHref", attributeProperties: { copyOnEnter: !0 } }, { model: "htmlStrong", view: "strong", coupledAttribute: "bold", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlB", view: "b", coupledAttribute: "bold", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlI", view: "i", coupledAttribute: "italic", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlEm", view: "em", coupledAttribute: "italic", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlS", view: "s", coupledAttribute: "strikethrough", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlDel", view: "del", coupledAttribute: "strikethrough", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlIns", view: "ins", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlU", view: "u", coupledAttribute: "underline", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSub", view: "sub", coupledAttribute: "subscript", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSup", view: "sup", coupledAttribute: "superscript", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlCode", view: "code", coupledAttribute: "code", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlMark", view: "mark", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSpan", view: "span", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlCite", view: "cite", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlLabel", view: "label", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlDfn", view: "dfn", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlObject", view: "object", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlIframe", view: "iframe", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlInput", view: "input", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlButton", view: "button", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlTextarea", view: "textarea", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlSelect", view: "select", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlVideo", view: "video", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlEmbed", view: "embed", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlOembed", view: "oembed", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlAudio", view: "audio", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlImg", view: "img", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlCanvas", view: "canvas", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlMeter", view: "meter", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlProgress", view: "progress", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlScript", view: "script", modelSchema: { allowWhere: ["$text", "$block"], isInline: !0 } }, { model: "htmlStyle", view: "style", modelSchema: { allowWhere: ["$text", "$block"], isInline: !0 } }, { model: "htmlCustomElement", view: "$customElement", modelSchema: { allowWhere: ["$text", "$block"], isInline: !0 } }], AE = Es(function(o, e, t, n) { + const wE = [{ model: "codeBlock", view: "pre" }, { model: "paragraph", view: "p" }, { model: "blockQuote", view: "blockquote" }, { model: "listItem", view: "li" }, { model: "pageBreak", view: "div" }, { model: "rawHtml", view: "div" }, { model: "table", view: "table" }, { model: "tableRow", view: "tr" }, { model: "tableCell", view: "td" }, { model: "tableCell", view: "th" }, { model: "tableColumnGroup", view: "colgroup" }, { model: "tableColumn", view: "col" }, { model: "caption", view: "caption" }, { model: "caption", view: "figcaption" }, { model: "imageBlock", view: "img" }, { model: "imageInline", view: "img" }, { model: "htmlP", view: "p", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlBlockquote", view: "blockquote", modelSchema: { inheritAllFrom: "$container" } }, { model: "htmlTable", view: "table", modelSchema: { allowWhere: "$block", isBlock: !0 } }, { model: "htmlTbody", view: "tbody", modelSchema: { allowIn: "htmlTable", isBlock: !1 } }, { model: "htmlThead", view: "thead", modelSchema: { allowIn: "htmlTable", isBlock: !1 } }, { model: "htmlTfoot", view: "tfoot", modelSchema: { allowIn: "htmlTable", isBlock: !1 } }, { model: "htmlCaption", view: "caption", modelSchema: { allowIn: "htmlTable", allowChildren: "$text", isBlock: !1 } }, { model: "htmlColgroup", view: "colgroup", modelSchema: { allowIn: "htmlTable", allowChildren: "col", isBlock: !1 } }, { model: "htmlCol", view: "col", modelSchema: { allowIn: "htmlColgroup", isBlock: !1 } }, { model: "htmlTr", view: "tr", modelSchema: { allowIn: ["htmlTable", "htmlThead", "htmlTbody"], isLimit: !0 } }, { model: "htmlTd", view: "td", modelSchema: { allowIn: "htmlTr", allowContentOf: "$container", isLimit: !0, isBlock: !1 } }, { model: "htmlTh", view: "th", modelSchema: { allowIn: "htmlTr", allowContentOf: "$container", isLimit: !0, isBlock: !1 } }, { model: "htmlFigure", view: "figure", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlFigcaption", view: "figcaption", modelSchema: { allowIn: "htmlFigure", allowChildren: "$text", isBlock: !1 } }, { model: "htmlAddress", view: "address", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlAside", view: "aside", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlMain", view: "main", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlDetails", view: "details", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlSummary", view: "summary", modelSchema: { allowChildren: "$text", allowIn: "htmlDetails", isBlock: !1 } }, { model: "htmlDiv", view: "div", paragraphLikeModel: "htmlDivParagraph", modelSchema: { inheritAllFrom: "$container" } }, { model: "htmlFieldset", view: "fieldset", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlLegend", view: "legend", modelSchema: { allowIn: "htmlFieldset", allowChildren: "$text" } }, { model: "htmlHeader", view: "header", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlFooter", view: "footer", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlForm", view: "form", modelSchema: { inheritAllFrom: "$container", isBlock: !0 } }, { model: "htmlHgroup", view: "hgroup", modelSchema: { allowChildren: ["htmlH1", "htmlH2", "htmlH3", "htmlH4", "htmlH5", "htmlH6"], isBlock: !1 } }, { model: "htmlH1", view: "h1", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH2", view: "h2", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH3", view: "h3", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH4", view: "h4", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH5", view: "h5", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlH6", view: "h6", modelSchema: { inheritAllFrom: "$block" } }, { model: "$htmlList", modelSchema: { allowWhere: "$container", allowChildren: ["$htmlList", "htmlLi"], isBlock: !1 } }, { model: "htmlDir", view: "dir", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlMenu", view: "menu", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlUl", view: "ul", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlOl", view: "ol", modelSchema: { inheritAllFrom: "$htmlList" } }, { model: "htmlLi", view: "li", modelSchema: { allowIn: "$htmlList", allowChildren: "$text", isBlock: !1 } }, { model: "htmlPre", view: "pre", modelSchema: { inheritAllFrom: "$block" } }, { model: "htmlArticle", view: "article", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlSection", view: "section", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlNav", view: "nav", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }, { model: "htmlDivDl", view: "div", modelSchema: { allowChildren: ["htmlDt", "htmlDd"], allowIn: "htmlDl" } }, { model: "htmlDl", view: "dl", modelSchema: { allowWhere: "$container", allowChildren: ["htmlDt", "htmlDd", "htmlDivDl"], isBlock: !1 } }, { model: "htmlDt", view: "dt", modelSchema: { allowChildren: "$block", isBlock: !1 } }, { model: "htmlDd", view: "dd", modelSchema: { allowChildren: "$block", isBlock: !1 } }, { model: "htmlCenter", view: "center", modelSchema: { inheritAllFrom: "$container", isBlock: !1 } }], AE = [{ model: "htmlLiAttributes", view: "li", appliesToBlock: !0 }, { model: "htmlListAttributes", view: "ol", appliesToBlock: !0 }, { model: "htmlListAttributes", view: "ul", appliesToBlock: !0 }, { model: "htmlFigureAttributes", view: "figure", appliesToBlock: "table" }, { model: "htmlTheadAttributes", view: "thead", appliesToBlock: "table" }, { model: "htmlTbodyAttributes", view: "tbody", appliesToBlock: "table" }, { model: "htmlFigureAttributes", view: "figure", appliesToBlock: "imageBlock" }, { model: "htmlAcronym", view: "acronym", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlTt", view: "tt", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlFont", view: "font", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlTime", view: "time", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlVar", view: "var", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlBig", view: "big", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSmall", view: "small", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSamp", view: "samp", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlQ", view: "q", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlOutput", view: "output", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlKbd", view: "kbd", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlBdi", view: "bdi", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlBdo", view: "bdo", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlAbbr", view: "abbr", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlA", view: "a", priority: 5, coupledAttribute: "linkHref", attributeProperties: { copyOnEnter: !0 } }, { model: "htmlStrong", view: "strong", coupledAttribute: "bold", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlB", view: "b", coupledAttribute: "bold", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlI", view: "i", coupledAttribute: "italic", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlEm", view: "em", coupledAttribute: "italic", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlS", view: "s", coupledAttribute: "strikethrough", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlDel", view: "del", coupledAttribute: "strikethrough", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlIns", view: "ins", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlU", view: "u", coupledAttribute: "underline", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSub", view: "sub", coupledAttribute: "subscript", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSup", view: "sup", coupledAttribute: "superscript", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlCode", view: "code", coupledAttribute: "code", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlMark", view: "mark", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlSpan", view: "span", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlCite", view: "cite", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlLabel", view: "label", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlDfn", view: "dfn", attributeProperties: { copyOnEnter: !0, isFormatting: !0 } }, { model: "htmlObject", view: "object", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlIframe", view: "iframe", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlInput", view: "input", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlButton", view: "button", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlTextarea", view: "textarea", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlSelect", view: "select", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlVideo", view: "video", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlEmbed", view: "embed", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlOembed", view: "oembed", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlAudio", view: "audio", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlImg", view: "img", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlCanvas", view: "canvas", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlMeter", view: "meter", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlProgress", view: "progress", isObject: !0, modelSchema: { inheritAllFrom: "$inlineObject" } }, { model: "htmlScript", view: "script", modelSchema: { allowWhere: ["$text", "$block"], isInline: !0 } }, { model: "htmlStyle", view: "style", modelSchema: { allowWhere: ["$text", "$block"], isInline: !0 } }, { model: "htmlCustomElement", view: "$customElement", modelSchema: { allowWhere: ["$text", "$block"], isInline: !0 } }], _E = Es(function(o, e, t, n) { yd(o, e, t, n); }); - var _E = Object.defineProperty, vE = Object.defineProperties, CE = Object.getOwnPropertyDescriptors, Hf = Object.getOwnPropertySymbols, yE = Object.prototype.hasOwnProperty, EE = Object.prototype.propertyIsEnumerable, qf = (o, e, t) => e in o ? _E(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, fr = (o, e) => { - for (var t in e || (e = {})) yE.call(e, t) && qf(o, t, e[t]); - if (Hf) for (var t of Hf(e)) EE.call(e, t) && qf(o, t, e[t]); + var vE = Object.defineProperty, CE = Object.defineProperties, yE = Object.getOwnPropertyDescriptors, Hf = Object.getOwnPropertySymbols, EE = Object.prototype.hasOwnProperty, xE = Object.prototype.propertyIsEnumerable, qf = (o, e, t) => e in o ? vE(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, fr = (o, e) => { + for (var t in e || (e = {})) EE.call(e, t) && qf(o, t, e[t]); + if (Hf) for (var t of Hf(e)) xE.call(e, t) && qf(o, t, e[t]); return o; - }, br = (o, e) => vE(o, CE(e)); + }, br = (o, e) => CE(o, yE(e)); class wo extends K { constructor() { super(...arguments), this._definitions = []; @@ -27904,8 +27904,8 @@ $& return "DataSchema"; } init() { - for (const e of kE) this.registerBlockElement(e); - for (const e of wE) this.registerInlineElement(e); + for (const e of wE) this.registerBlockElement(e); + for (const e of AE) this.registerInlineElement(e); } registerBlockElement(e) { this._definitions.push(br(fr({}, e), { isBlock: !0 })); @@ -27944,31 +27944,31 @@ $& } _extendDefinition(e) { const t = Array.from(this._definitions.entries()).filter(([, n]) => n.model == e.model); - if (t.length != 0) for (const [n, i] of t) this._definitions[n] = AE({}, i, e, (r, s) => Array.isArray(r) ? r.concat(s) : void 0); + if (t.length != 0) for (const [n, i] of t) this._definitions[n] = _E({}, i, e, (r, s) => Array.isArray(r) ? r.concat(s) : void 0); else this._definitions.push(e); } } - const xE = function(o, e, t, n) { + const SE = function(o, e, t, n) { for (var i = o.length, r = t + -1; ++r < i; ) if (e(o[r], r, o)) return r; return -1; - }, SE = function(o) { + }, DE = function(o) { return o != o; - }, DE = function(o, e, t) { + }, BE = function(o, e, t) { for (var n = t - 1, i = o.length; ++n < i; ) if (o[n] === e) return n; return -1; - }, BE = function(o, e, t) { - return e == e ? DE(o, e, t) : xE(o, SE, t); + }, TE = function(o, e, t) { + return e == e ? BE(o, e, t) : SE(o, DE, t); }; var Uf = Array.prototype.splice; - const TE = function(o, e, t, n) { - var i = BE, r = -1, s = e.length, a = o; + const IE = function(o, e, t, n) { + var i = TE, r = -1, s = e.length, a = o; for (o === e && (e = Gr(e)), t; ++r < s; ) for (var l = 0, c = e[r], d = c; (l = i(a, d, l)) > -1; ) a !== o && Uf.call(a, l, 1), Uf.call(o, l, 1); return o; - }, IE = xd(function(o, e) { - return o && o.length && e && e.length ? TE(o, e) : o; + }, PE = xd(function(o, e) { + return o && o.length && e && e.length ? IE(o, e) : o; }); - var Wf = S(5049), PE = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Wf.Z, PE), Wf.Z.locals; + var Wf = S(5049), RE = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Wf.Z, RE), Wf.Z.locals; class Je extends K { constructor(e) { super(e), this._dataSchema = e.plugins.get("DataSchema"), this._allowedAttributes = new no(), this._disallowedAttributes = new no(), this._allowedElements = /* @__PURE__ */ new Set(), this._disallowedElements = /* @__PURE__ */ new Set(), this._dataInitialized = !1, this._coupledAttributes = null, this._registerElementsAfterInit(), this._registerElementHandlers(), this._registerModelPostFixer(); @@ -28060,7 +28060,7 @@ $& } _registerObjectElement(e) { const t = this.editor, n = t.model.schema, i = t.conversion, { view: r, model: s } = e; - n.register(s, e.modelSchema), r && (n.extend(e.model, { allowAttributes: ["htmlAttributes", "htmlContent"] }), t.data.registerRawContentMatcher({ name: r }), i.for("upcast").elementToElement({ view: r, model: ol(e), converterPriority: se.get("low") + 1 }), i.for("upcast").add(oi(e, this)), i.for("editingDowncast").elementToStructure({ model: { name: s, attributes: ["htmlAttributes"] }, view: fE(t, e) }), i.for("dataDowncast").elementToElement({ model: s, view: (a, { writer: l }) => pr(r, a, l) }), i.for("dataDowncast").add(ii(e))); + n.register(s, e.modelSchema), r && (n.extend(e.model, { allowAttributes: ["htmlAttributes", "htmlContent"] }), t.data.registerRawContentMatcher({ name: r }), i.for("upcast").elementToElement({ view: r, model: ol(e), converterPriority: se.get("low") + 1 }), i.for("upcast").add(oi(e, this)), i.for("editingDowncast").elementToStructure({ model: { name: s, attributes: ["htmlAttributes"] }, view: bE(t, e) }), i.for("dataDowncast").elementToElement({ model: s, view: (a, { writer: l }) => pr(r, a, l) }), i.for("dataDowncast").add(ii(e))); } _registerBlockElement(e) { const t = this.editor, n = t.model.schema, i = t.conversion, { view: r, model: s } = e; @@ -28079,19 +28079,19 @@ $& if (p || g.consumable.test(u.viewItem, { name: !0 })) { p = p || {}, g.consumable.consume(u.viewItem, { name: !0 }), u.modelRange || (u = Object.assign(u, g.convertChildren(u.viewItem, u.modelCursor))); for (const b of u.modelRange.getItems()) if (g.schema.checkAttribute(b, a)) { - const w = pE(p, b.getAttribute(a) || {}); + const w = fE(p, b.getAttribute(a) || {}); g.writer.setAttribute(a, w, b); } } }, { priority: "low" }); }; - }(e, this)), i.for("downcast").attributeToElement({ model: r, view: bE(e) })); + }(e, this)), i.for("downcast").attributeToElement({ model: r, view: kE(e) })); } } function Kf(o, e, t) { const n = function(l, { consumable: c }, d) { const u = d.matchAll(l) || [], g = []; - for (const p of u) RE(c, l, p), delete p.match.name, c.consume(l, p.match), g.push(p); + for (const p of u) OE(c, l, p), delete p.match.name, c.consume(l, p.match), g.push(p); return g; }(o, e, t), { attributes: i, styles: r, classes: s } = function(l) { const c = { attributes: /* @__PURE__ */ new Set(), classes: /* @__PURE__ */ new Set(), styles: /* @__PURE__ */ new Set() }; @@ -28102,10 +28102,10 @@ $& if (i.size) for (const l of i) xc(l) || i.delete(l); return i.size && (a.attributes = Gf(i, (l) => o.getAttribute(l))), r.size && (a.styles = Gf(r, (l) => o.getStyle(l))), s.size && (a.classes = Array.from(s)), Object.keys(a).length ? a : null; } - function RE(o, e, t) { + function OE(o, e, t) { for (const n of ["attributes", "classes", "styles"]) { const i = t.match[n]; - if (i) for (const r of Array.from(i)) o.test(e, { [n]: [r] }) || IE(i, r); + if (i) for (const r of Array.from(i)) o.test(e, { [n]: [r] }) || PE(i, r); } } function Gf(o, e) { @@ -28122,7 +28122,7 @@ $& const { name: e, attributes: t, classes: n, styles: i } = o, r = []; return t && r.push(...il({ name: e, attributes: t }, "attributes")), n && r.push(...il({ name: e, classes: n }, "classes")), i && r.push(...il({ name: e, styles: i }, "styles")), r; } - class OE extends K { + class zE extends K { static get requires() { return [Je]; } @@ -28160,7 +28160,7 @@ $& }); } } - class zE extends K { + class ME extends K { static get requires() { return [Je]; } @@ -28185,7 +28185,7 @@ $& t.model.schema.extend(e.model, { allowAttributes: "htmlAttributes" }), n.for("upcast").add(oi(e, i)), n.for("downcast").add(ii(e)); } } - class ME extends K { + class FE extends K { static get requires() { return [wo, ei]; } @@ -28215,7 +28215,7 @@ $& const n = o.createRangeOn(e); for (const { item: i } of n.getWalker()) if (i.is("element", t)) return i; } - class FE extends K { + class NE extends K { static get requires() { return [Je]; } @@ -28269,7 +28269,7 @@ $& }, { priority: "low" }), d === "a" && a.on("attribute:linkHref:imageBlock", (g, p, b) => { if (!b.consumable.consume(p.item, "attribute:htmlLinkAttributes:imageBlock")) return; const w = b.mapper.toViewElement(p.item), E = kr(b.writer, w, "a"); - dn(b.writer, p.item.getAttribute("htmlLinkAttributes"), E); + un(b.writer, p.item.getAttribute("htmlLinkAttributes"), E); }, { priority: "low" }); } l("htmlAttributes"), c("img", "htmlAttributes"), c("figure", "htmlFigureAttributes"), c("a", "htmlLinkAttributes"); @@ -28277,7 +28277,7 @@ $& }); } } - class NE extends K { + class VE extends K { static get requires() { return [Je]; } @@ -28326,7 +28326,7 @@ $& }); } } - class VE extends K { + class LE extends K { static get requires() { return [Je]; } @@ -28341,7 +28341,7 @@ $& }); } } - class LE extends K { + class jE extends K { static get requires() { return [Je]; } @@ -28401,7 +28401,7 @@ $& }); } } - class jE extends K { + class $E extends K { static get requires() { return [Je]; } @@ -28416,7 +28416,7 @@ $& }); } } - class $E extends K { + class HE extends K { static get requires() { return [Je]; } @@ -28428,9 +28428,9 @@ $& if (!e.plugins.has("DocumentListEditing")) return; const t = e.model.schema, n = e.conversion, i = e.plugins.get(Je), r = e.plugins.get("DocumentListEditing"); r.registerDowncastStrategy({ scope: "item", attributeName: "htmlLiAttributes", setAttributeOnDowncast(s, a, l) { - dn(s, a, l); + un(s, a, l); } }), r.registerDowncastStrategy({ scope: "list", attributeName: "htmlListAttributes", setAttributeOnDowncast(s, a, l) { - dn(s, a, l); + un(s, a, l); } }), i.on("register", (s, a) => { ["ul", "ol", "li"].includes(a.view) && (s.stop(), t.checkAttribute("$block", "htmlListAttributes") || (t.extend("$block", { allowAttributes: ["htmlListAttributes", "htmlLiAttributes"] }), t.extend("$blockObject", { allowAttributes: ["htmlListAttributes", "htmlLiAttributes"] }), t.extend("$container", { allowAttributes: ["htmlListAttributes", "htmlLiAttributes"] }), n.for("upcast").add((l) => { l.on("element:ul", rl("htmlListAttributes", i), { priority: "low" }), l.on("element:ol", rl("htmlListAttributes", i), { priority: "low" }), l.on("element:li", rl("htmlLiAttributes", i), { priority: "low" }); @@ -28473,7 +28473,7 @@ $& for (const a of n.modelRange.getItems({ shallow: !0 })) a.hasAttribute("listItemId") && (a.hasAttribute(o) || i.writer.setAttribute(o, s || {}, a)); }; } - class HE extends K { + class qE extends K { static get requires() { return [Je, wo]; } @@ -28503,14 +28503,14 @@ $& return g; }, converterPriority: "low" }), a.for("editingDowncast").elementToElement({ model: { name: i.model, attributes: ["htmlElementName", "htmlAttributes", "htmlContent"] }, view: (d, { writer: u }) => { const g = d.getAttribute("htmlElementName"), p = u.createRawElement(g); - return d.hasAttribute("htmlAttributes") && dn(u, d.getAttribute("htmlAttributes"), p), p; + return d.hasAttribute("htmlAttributes") && un(u, d.getAttribute("htmlAttributes"), p), p; } }), a.for("dataDowncast").elementToElement({ model: { name: i.model, attributes: ["htmlElementName", "htmlAttributes", "htmlContent"] }, view: (d, { writer: u }) => { const g = d.getAttribute("htmlElementName"), p = d.getAttribute("htmlContent"), b = u.createRawElement(g, null, (w, E) => { E.setContentOf(w, p); const I = w.firstChild; for (I.remove(); I.firstChild; ) w.appendChild(I.firstChild); }); - return d.hasAttribute("htmlAttributes") && dn(u, d.getAttribute("htmlAttributes"), b), b; + return d.hasAttribute("htmlAttributes") && un(u, d.getAttribute("htmlAttributes"), b), b; } }); }); } @@ -28547,7 +28547,7 @@ $& } return t.toString(); } - class qE { + class UE { constructor(e, t) { this.loader = e, this.api_url = t; } @@ -28593,13 +28593,13 @@ $& this.xhr && this.xhr.abort(); } } - var Yf = S(2245), UE = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; - J()(Yf.Z, UE), Yf.Z.locals; + var Yf = S(2245), WE = { injectType: "singletonStyleTag", attributes: { "data-cke": !0 }, insert: "head", singleton: !0 }; + J()(Yf.Z, WE), Yf.Z.locals; class sl extends nr { } sl.builtinPlugins = [class extends K { static get requires() { - return [EC, ei, TC, sC, Jv, LC]; + return [xC, ei, IC, aC, Yv, jC]; } static get pluginName() { return "Essentials"; @@ -28613,7 +28613,7 @@ $& } init() { const o = this.editor.config.get("ckfinder.uploadUrl"); - o && (this.editor.plugins.get(Yt).createUploadAdapter = (e) => new UC(e, o, this.editor.t)); + o && (this.editor.plugins.get(Yt).createUploadAdapter = (e) => new WC(e, o, this.editor.t)); } }, class extends Bi { constructor() { @@ -28623,7 +28623,7 @@ $& return "CloudServices"; } static get requires() { - return [nE]; + return [oE]; } init() { return Of(this, null, function* () { @@ -28652,21 +28652,21 @@ $& } }, class extends K { static get requires() { - return [WC, KC]; + return [KC, GC]; } static get pluginName() { return "Bold"; } }, class extends K { static get requires() { - return [ZC, JC]; + return [JC, YC]; } static get pluginName() { return "Italic"; } }, class extends K { static get requires() { - return [e1, n1]; + return [t1, o1]; } static get pluginName() { return "BlockQuote"; @@ -28676,7 +28676,7 @@ $& return "EasyImage"; } static get requires() { - return [o1, "ImageUpload"]; + return [i1, "ImageUpload"]; } init() { const o = this.editor; @@ -28684,21 +28684,21 @@ $& } }, class extends K { static get requires() { - return [l1, d1]; + return [c1, u1]; } static get pluginName() { return "Heading"; } }, class extends K { static get requires() { - return [D1, T1]; + return [B1, I1]; } static get pluginName() { return "Image"; } }, class extends K { static get requires() { - return [Ym, oy]; + return [Ym, iy]; } static get pluginName() { return "ImageStyle"; @@ -28720,14 +28720,14 @@ $& return "ImageUpload"; } static get requires() { - return [q1, R1, F1]; + return [U1, O1, N1]; } }, class extends K { constructor(o) { super(o), this._resizeUnit = o.config.get("image.resizeUnit"); } static get requires() { - return [Z1]; + return [J1]; } static get pluginName() { return "ImageResizeButtons"; @@ -28773,7 +28773,7 @@ $& return "Indent"; } static get requires() { - return [iy, ry]; + return [ry, sy]; } }, class extends K { constructor(o) { @@ -28784,11 +28784,11 @@ $& } init() { const o = this.editor, e = o.config.get("indentBlock"); - e.classes && e.classes.length ? (this._setupConversionUsingClasses(e.classes), o.commands.add("indentBlock", new hr(o, new rp({ direction: "forward", classes: e.classes }))), o.commands.add("outdentBlock", new hr(o, new rp({ direction: "backward", classes: e.classes })))) : (o.data.addStyleProcessorRules(H_), this._setupConversionUsingOffset(), o.commands.add("indentBlock", new hr(o, new ip({ direction: "forward", offset: e.offset, unit: e.unit }))), o.commands.add("outdentBlock", new hr(o, new ip({ direction: "backward", offset: e.offset, unit: e.unit })))); + e.classes && e.classes.length ? (this._setupConversionUsingClasses(e.classes), o.commands.add("indentBlock", new hr(o, new rp({ direction: "forward", classes: e.classes }))), o.commands.add("outdentBlock", new hr(o, new rp({ direction: "backward", classes: e.classes })))) : (o.data.addStyleProcessorRules(q_), this._setupConversionUsingOffset(), o.commands.add("indentBlock", new hr(o, new ip({ direction: "forward", offset: e.offset, unit: e.unit }))), o.commands.add("outdentBlock", new hr(o, new ip({ direction: "backward", offset: e.offset, unit: e.unit })))); } afterInit() { const o = this.editor, e = o.model.schema, t = o.commands.get("indent"), n = o.commands.get("outdent"), i = o.config.get("heading.options"); - (i && i.map((r) => r.model) || sy).forEach((r) => { + (i && i.map((r) => r.model) || ay).forEach((r) => { e.isRegistered(r) && e.extend(r, { allowAttributes: "blockIndent" }); }), e.setAttributeProperties("blockIndent", { isFormatting: !0 }), t.registerChildCommand(o.commands.get("indentBlock")), n.registerChildCommand(o.commands.get("outdentBlock")); } @@ -28803,21 +28803,21 @@ $& } }, class extends K { static get requires() { - return [Iy, My, Ny]; + return [Py, Fy, Vy]; } static get pluginName() { return "Link"; } }, class extends K { static get requires() { - return [r2, Wy]; + return [s2, Ky]; } static get pluginName() { return "List"; } }, Sa, class extends K { static get requires() { - return [B2, P2, Pn, N2, M2, z2, ti]; + return [T2, R2, Pn, V2, F2, M2, ti]; } static get pluginName() { return "Table"; @@ -28831,7 +28831,7 @@ $& } afterInit() { const o = this.editor, e = o.t, t = o.plugins.get(ar), n = o.config.get("table.contentToolbar"), i = o.config.get("table.tableToolbar"); - n && t.register("tableContent", { ariaLabel: e("Table toolbar"), items: n, getRelatedElement: j2 }), i && t.register("table", { ariaLabel: e("Table toolbar"), items: i, getRelatedElement: L2 }); + n && t.register("tableContent", { ariaLabel: e("Table toolbar"), items: n, getRelatedElement: $2 }), i && t.register("table", { ariaLabel: e("Table toolbar"), items: i, getRelatedElement: j2 }); } }, class extends K { static get requires() { @@ -28841,7 +28841,7 @@ $& return "TextTransformation"; } constructor(o) { - super(o), o.config.define("typing", { transformations: { include: Xv } }); + super(o), o.config.define("typing", { transformations: { include: eC } }); } init() { const o = this.editor.model.document.selection; @@ -28857,7 +28857,7 @@ $& for (const u of c) if (typeof u == "string" && vg[u]) for (const g of vg[u]) d.add(g); else d.add(u); return Array.from(d); - }(r.include.concat(s).filter(l)).filter(l).map((c) => typeof c == "string" && _g[c] ? _g[c] : c).filter((c) => typeof c == "object").map((c) => ({ from: eC(c.from), to: tC(c.to) })); + }(r.include.concat(s).filter(l)).filter(l).map((c) => typeof c == "string" && _g[c] ? _g[c] : c).filter((c) => typeof c == "object").map((c) => ({ from: tC(c.from), to: nC(c.to) })); }(o.config.get("typing.transformations")), i = new kg(o.model, (r) => { for (const s of n) if (s.from.test(r)) return { normalizedTransformation: s }; @@ -28873,7 +28873,7 @@ $& g += w.length; continue; } - const I = u.start.getShiftedBy(g), z = e.createRange(I, I.getShiftedBy(w.length)), H = nC(I); + const I = u.start.getShiftedBy(g), z = e.createRange(I, I.getShiftedBy(w.length)), H = oC(I); e.insertContent(p.createText(E, H), z), g += E.length; } e.enqueueChange(() => { @@ -28884,14 +28884,14 @@ $& } }, class extends K { static get requires() { - return [YC, QC]; + return [QC, XC]; } static get pluginName() { return "Underline"; } }, class extends K { static get requires() { - return [iE, rE]; + return [rE, sE]; } static get pluginName() { return "Alignment"; @@ -28937,7 +28937,7 @@ $& n.setSelection(null), n.removeSelectionAttribute(t.document.selection.getAttributeKeys()); }); for (const [n, i] of e.domRoots) { - const r = lE(o.data.get({ rootName: n })), s = Mr(i.ownerDocument, "textarea", { rows: "1", "aria-label": "Source code editing area" }), a = Mr(i.ownerDocument, "div", { class: "ck-source-editing-area", "data-value": r }, [s]); + const r = cE(o.data.get({ rootName: n })), s = Mr(i.ownerDocument, "textarea", { rows: "1", "aria-label": "Source code editing area" }), a = Mr(i.ownerDocument, "div", { class: "ck-source-editing-area", "data-value": r }, [s]); s.value = r, s.setSelectionRange(0, 0), s.addEventListener("input", () => { a.dataset.value = s.value, o.ui.update(); }), e.change((l) => { @@ -28974,7 +28974,7 @@ $& } }, class extends K { static get requires() { - return [uE, cE]; + return [hE, dE]; } static get pluginName() { return "RemoveFormat"; @@ -28984,7 +28984,7 @@ $& return "GeneralHtmlSupport"; } static get requires() { - return [Je, OE, zE, ME, FE, NE, VE, LE, jE, $E, HE]; + return [Je, zE, ME, FE, NE, VE, LE, jE, $E, HE, qE]; } init() { const o = this.editor, e = o.plugins.get(Je); @@ -29043,7 +29043,7 @@ $& }); } }], sl.defaultConfig = { extraPlugins: [function(o) { - o.plugins.get("FileRepository").createUploadAdapter = (e) => new qE(e, o.config.get("viur_api_url")); + o.plugins.get("FileRepository").createUploadAdapter = (e) => new UE(e, o.config.get("viur_api_url")); }, function(o) { o.conversion.attributeToElement({ model: "bold", view: "b", upcastAlso: [(e) => { const t = e.getStyle("font-weight"); @@ -29226,12 +29226,12 @@ const wb = /* @__PURE__ */ we(SD, [["render", TD], ["__scopeId", "data-v-7bc3102 removeMultipleEntries: F }; } -}), yb = (h) => (st("data-v-63e75dee"), h = h(), at(), h), PD = { class: "actionbar" }, RD = ["title"], OD = /* @__PURE__ */ yb(() => /* @__PURE__ */ M("sl-icon", { +}), Eb = (h) => (st("data-v-63e75dee"), h = h(), at(), h), PD = { class: "actionbar" }, RD = ["title"], OD = /* @__PURE__ */ Eb(() => /* @__PURE__ */ M("sl-icon", { slot: "prefix", name: "x-lg" }, null, -1)), zD = [ OD -], MD = ["title"], FD = /* @__PURE__ */ yb(() => /* @__PURE__ */ M("sl-icon", { +], MD = ["title"], FD = /* @__PURE__ */ Eb(() => /* @__PURE__ */ M("sl-icon", { slot: "prefix", name: "plus-lg" }, null, -1)); @@ -29299,12 +29299,12 @@ const jD = Ve({ getList: x }; } -}), Eb = (h) => (st("data-v-eeea51c6"), h = h(), at(), h), $D = { class: "actionbar" }, HD = ["title"], qD = /* @__PURE__ */ Eb(() => /* @__PURE__ */ M("sl-icon", { +}), xb = (h) => (st("data-v-eeea51c6"), h = h(), at(), h), $D = { class: "actionbar" }, HD = ["title"], qD = /* @__PURE__ */ xb(() => /* @__PURE__ */ M("sl-icon", { slot: "prefix", name: "x-lg" }, null, -1)), UD = [ qD -], WD = ["source"], KD = ["title"], GD = /* @__PURE__ */ Eb(() => /* @__PURE__ */ M("sl-icon", { +], WD = ["source"], KD = ["title"], GD = /* @__PURE__ */ xb(() => /* @__PURE__ */ M("sl-icon", { slot: "prefix", name: "plus-lg" }, null, -1)); @@ -29494,8 +29494,8 @@ function cB(h, y, _, O, S, F) { } const dB = /* @__PURE__ */ we(YD, [["render", cB], ["__scopeId", "data-v-9bac9f8a"]]), fl = gl("boneStore", () => { const h = he({ - additionalBones: hn({}), - defaultBones: hn({ + additionalBones: en({}), + defaultBones: en({ rawBone: hl, keyBone: ib, stringBone: rb, @@ -29513,11 +29513,11 @@ const dB = /* @__PURE__ */ we(YD, [["render", cB], ["__scopeId", "data-v-9bac9f8 textBone: kb, spatialBone: wb }), - actionbars: hn({ + actionbars: en({ "relational.tree.leaf.file.file": dB, "relational.": JD }), - multibones: hn(["select", "select."]) + multibones: en(["select", "select."]) }); function y(k, x) { h.additionalBones[k] = x; @@ -29710,12 +29710,12 @@ const bl = (h) => (st("data-v-25f20336"), h = h(), at(), h), gB = /* @__PURE__ * boneState: _ }; } -}), xb = (h) => (st("data-v-141aaf9b"), h = h(), at(), h), AB = ["draggable"], _B = ["disabled"], vB = /* @__PURE__ */ xb(() => /* @__PURE__ */ M("sl-icon", { +}), Sb = (h) => (st("data-v-141aaf9b"), h = h(), at(), h), AB = ["draggable"], _B = ["disabled"], vB = /* @__PURE__ */ Sb(() => /* @__PURE__ */ M("sl-icon", { slot: "prefix", name: "grip-vertical" }, null, -1)), CB = [ vB -], yB = { class: "value" }, EB = ["disabled", "title"], xB = /* @__PURE__ */ xb(() => /* @__PURE__ */ M("sl-icon", { +], yB = { class: "value" }, EB = ["disabled", "title"], xB = /* @__PURE__ */ Sb(() => /* @__PURE__ */ M("sl-icon", { slot: "prefix", name: "x-lg" }, null, -1)), SB = [ @@ -30423,7 +30423,7 @@ const cl = /* @__PURE__ */ we(MB, [["render", tT], ["__scopeId", "data-v-dee63f3 rootNode: {}, tabs: { cart: { - component: hn(vb), + component: en(vb), props: { sidebar: !0, mode: "basket", @@ -30437,16 +30437,16 @@ const cl = /* @__PURE__ */ we(MB, [["render", tT], ["__scopeId", "data-v-dee63f3 atShow: null, atHide: null }, - // confirm: { - // component: shallowRef(ConfirmView), - // props: {}, - // displayName: "Bestellung prüfen", - // icon: { name: "order-check", library: "hsk" }, - // position: 5, - // disabled: false, - // atShow: null, - // atHide: null, - // }, + confirm: { + component: en(Cb), + props: {}, + displayName: "Bestellung prüfen", + icon: { name: "order-check", library: "hsk" }, + position: 5, + disabled: !1, + atShow: null, + atHide: null + }, // order: { // component: shallowRef(CategoryView), // props: { @@ -30463,7 +30463,7 @@ const cl = /* @__PURE__ */ we(MB, [["render", tT], ["__scopeId", "data-v-dee63f3 // atHide: null, // }, orderComplete: { - component: hn(j5), + component: en(j5), props: {}, displayName: "Bestellung Abgeschlossen", icon: { name: "order-confirmed", library: "hsk" }, @@ -30473,7 +30473,7 @@ const cl = /* @__PURE__ */ we(MB, [["render", tT], ["__scopeId", "data-v-dee63f3 atHide: null }, userInfo: { - component: hn(kB), + component: en(kB), props: {}, displayName: "Daten Eingeben", icon: { name: "user", library: "hsk" }, @@ -30483,7 +30483,7 @@ const cl = /* @__PURE__ */ we(MB, [["render", tT], ["__scopeId", "data-v-dee63f3 atHide: null }, userInfoMulti: { - component: hn(mT), + component: en(mT), props: {}, displayName: "Daten Eingeben (Multi)", icon: { name: "user", library: "hsk" }, @@ -30506,12 +30506,12 @@ const cl = /* @__PURE__ */ we(MB, [["render", tT], ["__scopeId", "data-v-dee63f3 } }, CT = { install(h) { - h.component("CartView", vb), h.component("ExampleUsage", pT), h.component("ConfirmView", w5); + h.component("CartView", vb), h.component("ExampleUsage", pT), h.component("ConfirmView", Cb); } }; export { vb as CartView, - w5 as ConfirmView, + Cb as ConfirmView, pT as ExampleUsage, CT as default, ai as useCartStore diff --git a/source/dist/viur-shop-components.umd.js b/source/dist/viur-shop-components.umd.js index a175f60..c89125f 100644 --- a/source/dist/viur-shop-components.umd.js +++ b/source/dist/viur-shop-components.umd.js @@ -1,4 +1,4 @@ -(function(Ve,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@viur/vue-utils"),require("pinia"),require("@viur/viur-shop-client"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@viur/vue-utils","pinia","@viur/viur-shop-client","vue-router"],h):(Ve=typeof globalThis<"u"?globalThis:Ve||self,h(Ve.ViurShopComponents={},Ve.Vue,Ve.ViurVueUtils,Ve.Pinia,Ve.ViurShopClient))})(this,function(Ve,h,Ft,or,Yf){"use strict";var oB=Object.defineProperty;var iB=(Ve,h,Ft)=>h in Ve?oB(Ve,h,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Ve[h]=Ft;var Jf=(Ve,h,Ft)=>iB(Ve,typeof h!="symbol"?h+"":h,Ft);const de=(m,x)=>{const C=m.__vccOpts||m;for(const[N,D]of x)C[N]=D;return C},ir={props:{size:{type:String,default:"2"},active:{type:Boolean,default:!0},logo:{default:"logo-cube.svg",type:String},color:{default:"var(--sl-color-primary-500)",type:String}},setup(m,x){const C=h.reactive({trackWidth:h.computed(()=>`${m.size/30}rem`),outerSize:h.computed(()=>`calc(${m.size}rem + ${C.trackWidth})`),spinnerSize:h.computed(()=>`${m.size}rem`),logoSize:h.computed(()=>`calc(${m.size}rem - ${C.trackWidth} * 10)`),shadow:h.computed(()=>`0px 0px ${m.size/6}rem 0 color-mix(in hsl, var(--sl-color-neutral-1000), 80% transparent)`)});return{state:C}}},$a=()=>{h.useCssVars(m=>({"93747d92":m.state.outerSize,"284424e5":m.state.shadow,"6485ca5e":m.state.logoSize,"5d833915":m.state.spinnerSize,d5b3feca:m.color,"2050b700":m.state.trackWidth}))},Ha=ir.setup;ir.setup=Ha?(m,x)=>($a(),Ha(m,x)):$a;const Qf=m=>(h.pushScopeId("data-v-46c45785"),m=m(),h.popScopeId(),m),Xf={key:0,class:"loading"},ek=Qf(()=>h.createElementVNode("sl-spinner",{class:"loader"},null,-1)),tk={class:"logo"},nk=["src"];function ok(m,x,C,N,D,M){return h.openBlock(),h.createBlock(h.Transition,null,{default:h.withCtx(()=>[C.active?(h.openBlock(),h.createElementBlock("div",Xf,[ek,h.createElementVNode("div",tk,[h.createElementVNode("sl-icon",{src:C.logo},null,8,nk)])])):h.createCommentVNode("",!0)]),_:1})}const ik=de(ir,[["render",ok],["__scopeId","data-v-46c45785"]]),vn=or.defineStore("cartstore",()=>{const m=new Yf.ViURShopClient({host_url:window.location.origin==="http://localhost:8081"?"http://localhost:8080":window.location.origin}),x=h.reactive({basketRootNode:{},whishlistRootNodes:[],children:{},structure:{address:{},cart:{}}});async function C(){await D()}async function N(B){return await m.cart_list({cart_key:B})}async function D(){(await m.cart_list()).forEach(v=>{v.is_root_node&&(v.cart_type==="basket"?x.basketRootNode=v:x.whishlistRootNodes.push(v))})}async function M(B,v){let k=await m.article_add({article_key:B,parent_cart_key:v});console.log("addToCart",k)}async function w(B,v){let k=await m.article_view({article_key:B,parent_cart_key:v});console.log("getArticleView",k)}async function S(B,v){let k=await m.article_remove({article_key:B,parent_cart_key:v});console.log("remove Resp",k)}async function p(B,v,k){let _=await m.article_update({article_key:B,parent_cart_key:v,quantity:k,quantity_mode:"replace"});console.log("update Resp",_)}async function y(){let B=await m.address_structure();x.structure.address=B.addSkel,console.log("adress add",x.structure.address)}return{state:x,addToCart:M,getArticleView:w,removeItem:S,updateItem:p,init:C,getAdressStructure:y,getChildren:N}}),rk={__name:"CartNode",props:{node:{type:Object,required:!0}},setup(m){return h.reactive({}),(x,C)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createTextVNode(" cartnode "),h.createElementVNode("pre",null,h.toDisplayString(m.node.name),1)],64))}},io=m=>(h.pushScopeId("data-v-0e24135f"),m=m(),h.popScopeId(),m),sk={horizontal:"",class:"viur-shop-cart-card"},ak=["src"],lk={class:"viur-shop-cart-card-header",slot:"header"},ck={class:"viur-shop-cart-card-headline headline"},dk={class:"viur-shop-cart-card-body-row"},hk={class:"viur-shop-cart-card-body-info"},uk=io(()=>h.createElementVNode("div",{class:"viur-shop-cart-card-descr"},[h.createTextVNode(" Version: 900x900x2000 "),h.createElementVNode("br"),h.createTextVNode(" Farbe: Chromoptik "),h.createElementVNode("br"),h.createTextVNode(" Glasart: Klar hell mit Edelglasbeschichtung"),h.createElementVNode("br"),h.createTextVNode(" Anschlag: Beidseitig variabel"),h.createElementVNode("br"),h.createTextVNode(" Griff: Stangengriff Exklusiv (56) ")],-1)),mk={class:"viur-shop-cart-card-body-footer"},gk=io(()=>h.createElementVNode("sl-button",{size:"small",outline:"",class:"viur-shop-cart-card-add-to-favourites-btn",variant:"primary",title:"Add to favourites"},[h.createElementVNode("sl-icon",{name:"heart",slot:"prefix"})],-1)),pk=[io(()=>h.createElementVNode("sl-icon",{name:"trash",slot:"prefix"},null,-1))],fk={class:"viur-shop-cart-card-body-amount"},kk={class:"viur-shop-cart-card-price-wrap",slot:"footer"},bk=io(()=>h.createElementVNode("div",{class:"viur-shop-cart-card-price-label"},"Preis",-1)),wk={class:"viur-shop-cart-card-price"},Ak=io(()=>h.createElementVNode("div",{class:"viur-shop-cart-card-small-print"},"Brutto / Stk.",-1)),_k=de({__name:"CartLeaf",props:{leaf:{type:Object,required:!0},node:{type:Object,required:!0}},emits:["updateItem","removeItem"],setup(m,{emit:x}){const C=m,N=x,D=h.reactive({leaf:{}});function M(p){return p!==void 0?Ft.Request.downloadUrlFor(p):"https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"}function w(p,y,B,v){N("updateItem",{item:p,articleKey:y,node:B,quantity:v})}function S(p,y,B){N("removeItem",{item:p,articleKey:y,node:B})}return h.onBeforeMount(()=>{D.leaf=C.leaf}),(p,y)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createTextVNode(" cartleafe "),h.createElementVNode("sl-card",sk,[h.createElementVNode("img",{class:"viur-shop-cart-card-img",slot:"image",src:M(D.leaf.shop_image?D.leaf.shop_image:void 0)},null,8,ak),h.createElementVNode("div",lk,[h.createElementVNode("h4",ck,h.toDisplayString(D.leaf.shop_name)+" | "+h.toDisplayString(m.leaf.shop_art_no_or_gtin),1)]),h.createElementVNode("div",dk,[h.createElementVNode("div",hk,[uk,h.createElementVNode("div",mk,[gk,h.createElementVNode("sl-button",{size:"small",outline:"",class:"viur-shop-cart-card-delete-btn",variant:"primary",title:"Remove from cart",onClick:y[0]||(y[0]=B=>S(D.leaf,D.leaf.article.dest.key,m.node))},pk)])]),h.createElementVNode("div",fk,[h.withDirectives(h.createElementVNode("sl-input",{class:"amount-input",type:"number",label:"Anzahl",placeholder:"Number",min:"0","onUpdate:modelValue":y[1]||(y[1]=B=>D.leaf.quantity=B),onInput:y[2]||(y[2]=B=>w(D.leaf,D.leaf.article.dest.key,m.node,D.leaf.quantity))},null,544),[[h.vModelText,D.leaf.quantity]])]),h.createElementVNode("div",kk,[bk,h.createElementVNode("div",wk,h.toDisplayString(D.leaf.price.retail)+" € ",1),Ak])])])],64))}},[["__scopeId","data-v-0e24135f"]]),gt=m=>(h.pushScopeId("data-v-7aae4815"),m=m(),h.popScopeId(),m),Ck={key:0},vk=gt(()=>h.createElementVNode("p",null,"Möchten Sie den Artikel wirklich aus dem Warenkorb entfernen?",-1)),yk={class:"footer-wrap",slot:"footer"},Ek={key:0},xk=gt(()=>h.createElementVNode("h2",{class:"viur-shop-cart-sidebar-headline headline"},"Zusammenfassung",-1)),Sk=gt(()=>h.createElementVNode("br",null,null,-1)),Dk=gt(()=>h.createElementVNode("sl-input",{label:"Rabattcode eingeben"},null,-1)),Bk=gt(()=>h.createElementVNode("br",null,null,-1)),Tk={class:"viur-shop-cart-sidebar-info-line"},Ik=gt(()=>h.createElementVNode("span",null,"Zwischensumme",-1)),Pk=gt(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Rabatt"),h.createTextVNode(" 0 € ")],-1)),Rk=gt(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Versandkosten"),h.createTextVNode(" 0 € ")],-1)),Ok={class:"viur-shop-cart-sidebar-info-line total"},Nk=gt(()=>h.createElementVNode("span",null,"Gesamt:",-1)),zk=gt(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-btn-wrap"},[h.createElementVNode("sl-button",{variant:"info",size:"small"}," Jetzt Bestellen "),h.createElementVNode("sl-button",{size:"small",variant:"primary"},[h.createElementVNode("sl-icon",{name:"paypal",slot:"prefix"}),h.createTextVNode(" Paypal ")])],-1)),rr=de({__name:"CartView",props:{mode:{type:String,default:"basket"},cartKey:{type:String,required:!0},sidebar:{type:Boolean,default:!0}},setup(m){const x=m,C=vn(),N=h.ref(null),D=h.reactive({cartIsInit:h.computed(()=>!!C.state.basketRootNode),itemsIsInit:h.computed(()=>!0),images:{},currentItem:{},currentNode:{},nodes:[],leaves:{}});h.computed(()=>x.mode==="basket"?C.state.basket:x.cartKey);async function M(){await C.updateItem(D.currentItem.article.dest.key,D.currentNode.key,0),await y(),N.value.hide()}async function w(v){console.log("updateItem :",v),v.quantity===0?(N.value.show(),D.currentItem=v.item,D.currentNode=v.node):(await C.updateItem(v.articleKey,v.node.key,v.quantity),await C.init())}function S(v){console.log("removeItem :",v),N.value.show(),D.currentItem=v.item,D.currentNode=v.node}async function p(){D.leaves[D.currentNode.key].forEach(v=>{v.key===D.currentItem.key&&(v.quantity=1)}),D.currentItem={},D.currentNode={}}async function y(){D.nodes=[],D.leaves={},await C.init(),await B()}async function B(v=x.cartKey){console.log("debug getChildren parentKey from comp: ",v);const k=await C.getChildren(v);console.log("getChildren children: ",k),k.forEach(async _=>{_.skel_type==="node"?(D.nodes.push(_),await B(_.key)):(Object.keys(D.leaves).includes(v)||(D.leaves[v]=[]),D.leaves[v].push(_))})}return h.onBeforeMount(async()=>{await C.init(),await B(),x.mode==="basket"&&D.nodes.push(C.state.basketRootNode),console.log("state.nodes test",D.nodes),console.log("state.leaves",D.leaves)}),(v,k)=>m.cartKey.length?(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[h.createElementVNode("sl-dialog",{ref_key:"confirm",ref:N,onSlHide:p},[vk,h.createElementVNode("div",yk,[h.createElementVNode("sl-button",{variant:"danger",onClick:k[0]||(k[0]=_=>N.value.hide()),size:"medium"}," Abbrechen "),h.createElementVNode("sl-button",{variant:"success",onClick:M,size:"medium"}," Aus Warenkorb entfernen ")])],544),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(D.nodes,_=>(h.openBlock(),h.createElementBlock("div",null,[Object.keys(D.leaves).includes(_.key)?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createVNode(rk,{node:_},null,8,["node"]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(D.leaves[_.key],R=>(h.openBlock(),h.createBlock(_k,{key:R.key,leaf:R,node:_,onRemoveItem:S,onUpdateItem:w},null,8,["leaf","node"]))),128))],64)):h.createCommentVNode("",!0)]))),256)),m.sidebar?(h.openBlock(),h.createElementBlock("div",Ek,[xk,Sk,Dk,Bk,h.createElementVNode("div",Tk,[Ik,h.createTextVNode(" --> "+h.toDisplayString(m.mode==="basket"?h.unref(C).state.basketRootNode.total:h.unref(C).state.whishlistRootNodes[m.cartKey].total)+" € ",1)]),Pk,Rk,h.createElementVNode("div",Ok,[Nk,h.createTextVNode(" "+h.toDisplayString(m.mode==="basket"?h.unref(C).state.basketRootNode.total:h.unref(C).state.whishlistRootNodes[m.cartKey].total)+" € ",1)]),zk])):h.createCommentVNode("",!0)],64)):(h.openBlock(),h.createElementBlock("sl-spinner",Ck))}},[["__scopeId","data-v-7aae4815"]]),Ke=m=>(h.pushScopeId("data-v-75e70e9a"),m=m(),h.popScopeId(),m),Mk={key:1,class:"list"},Fk=Ke(()=>h.createElementVNode("h2",{class:"viur-shop-cart-headline headline"},"Bestellung prüfen",-1)),Vk=Ke(()=>h.createElementVNode("br",null,null,-1)),Lk=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-address-wrap"},[h.createElementVNode("div",{class:"viur-shop-cart-address"},[h.createElementVNode("div",{class:"viur-shop-cart-address-headline"},[h.createTextVNode(" Versandadresse "),h.createElementVNode("sl-button",{outline:"",size:"small"},[h.createElementVNode("sl-icon",{name:"pencil",slot:"prefix"})])]),h.createTextVNode(" Roland Brose"),h.createElementVNode("br"),h.createTextVNode(" Speicherstraße 33"),h.createElementVNode("br"),h.createTextVNode(" 44147 Dortmund, DE"),h.createElementVNode("br"),h.createElementVNode("br"),h.createTextVNode(" rb@mausbrand.de"),h.createElementVNode("br"),h.createTextVNode(" 0231 21 34 68 90 ")]),h.createElementVNode("div",{class:"viur-shop-cart-address"},[h.createElementVNode("div",{class:"viur-shop-cart-address-headline"},[h.createTextVNode(" Rechnungsadresse "),h.createElementVNode("sl-button",{outline:"",size:"small"},[h.createElementVNode("sl-icon",{name:"pencil",slot:"prefix"})])]),h.createTextVNode(" Roland Brose"),h.createElementVNode("br"),h.createTextVNode(" Speicherstraße 33"),h.createElementVNode("br"),h.createTextVNode(" 44147 Dortmund, DE"),h.createElementVNode("br"),h.createElementVNode("br"),h.createTextVNode(" rb@mausbrand.de"),h.createElementVNode("br"),h.createTextVNode(" 0231 21 34 68 90 ")])],-1)),jk=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-payment"},[h.createElementVNode("div",{class:"viur-shop-cart-payment-method"},[h.createElementVNode("span",null,"Zahlungsmethode:"),h.createTextVNode(" Paypal ")]),h.createElementVNode("sl-button",{outline:"",size:"small"},[h.createElementVNode("sl-icon",{name:"pencil",slot:"prefix"})])],-1)),$k=Ke(()=>h.createElementVNode("h2",{class:"viur-shop-cart-headline headline"},"Warenkorb",-1)),Hk=Ke(()=>h.createElementVNode("br",null,null,-1)),qk={horizontal:"",class:"viur-shop-cart-mini-card"},Uk=["src"],Wk={class:"viur-shop-cart-mini-cart-header",slot:"header"},Kk={class:"viur-shop-cart-mini-headline headline"},Gk={class:"viur-shop-cart-mini-card-body-row"},Zk={class:"viur-shop-cart-mini-card-body-info"},Jk={class:"viur-shop-cart-mini-card-info-wrap"},Yk=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-mini-card-info"},[h.createElementVNode("span",null,"Anzahl: "),h.createTextVNode(" 1 ")],-1)),Qk={class:"viur-shop-cart-mini-card-info"},Xk=Ke(()=>h.createElementVNode("span",null,"Preis: ",-1)),eb=Ke(()=>h.createElementVNode("h2",{class:"viur-shop-cart-sidebar-headline headline"},"Jetzt Bestellen",-1)),tb=Ke(()=>h.createElementVNode("br",null,null,-1)),nb={class:"viur-shop-cart-sidebar-info-line"},ob=Ke(()=>h.createElementVNode("span",null,"Zwischensumme",-1)),ib=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Rabatt"),h.createTextVNode(" 0 € ")],-1)),rb=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Versandkosten"),h.createTextVNode(" 0 € ")],-1)),sb={class:"viur-shop-cart-sidebar-info-line total"},ab=Ke(()=>h.createElementVNode("span",null,"Gesamt:",-1)),lb={class:"viur-shop-cart-sidebar-btn-wrap"},cb=["variant","disabled"],qa=de({__name:"ConfirmView",setup(m){const x=vn(),C=h.reactive({cartIsInit:h.computed(()=>!!x.state.basket.length),itemsIsInit:h.computed(()=>!!x.state.carts[x.state.basket].items),images:{},showOrderButton:!1});function N(M){return Ft.Request.get(`/json/dk_variante/view/${M}`).then(async w=>{let S=await w.json();S=S.values;let p=S.dk_artikel.dest.image?Ft.Request.downloadUrlFor(S.dk_artikel.dest.image):"https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";C.images[M]=p}),C.images[M]}function D(M){M.target.checked&&(C.showOrderButton=!0),M.target.checked||(C.showOrderButton=!1)}return h.onBeforeMount(async()=>{await x.init()}),(M,w)=>C.cartIsInit?(h.openBlock(),h.createElementBlock("div",Mk,[Fk,Vk,Lk,jk,$k,Hk,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(h.unref(x).state.carts[h.unref(x).state.basket].items,S=>(h.openBlock(),h.createElementBlock("sl-card",qk,[h.createElementVNode("img",{class:"viur-shop-cart-mini-card-img",slot:"image",src:N(S.article.dest.key)},null,8,Uk),h.createElementVNode("div",Wk,[h.createElementVNode("h4",Kk,h.toDisplayString(S.article.dest.shop_name)+" | 425018",1)]),h.createElementVNode("div",Gk,[h.createElementVNode("div",Zk,[h.createElementVNode("div",Jk,[Yk,h.createElementVNode("div",Qk,[Xk,h.createTextVNode(" "+h.toDisplayString(S.article.dest.shop_price_recommended)+" € ",1)])])])])]))),256)),(h.openBlock(),h.createBlock(h.Teleport,{to:"#order_sidebar"},[eb,tb,h.createElementVNode("div",nb,[ob,h.createTextVNode(" "+h.toDisplayString(h.unref(x).state.carts[h.unref(x).state.basket].info.total)+" € ",1)]),ib,rb,h.createElementVNode("div",sb,[ab,h.createTextVNode(" "+h.toDisplayString(h.unref(x).state.carts[h.unref(x).state.basket].info.total)+" € ",1)]),h.createElementVNode("sl-checkbox",{onSlChange:D}," Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen ",32),h.createElementVNode("div",lb,[h.createElementVNode("sl-button",{variant:C.showOrderButton?"info":"disabled",size:"small",disabled:!C.showOrderButton}," Zahlungspflichtig bestellen ",8,cb)])]))])):(h.openBlock(),h.createBlock(ik,{key:0}))}},[["__scopeId","data-v-75e70e9a"]]),db=m=>(h.pushScopeId("data-v-61488015"),m=m(),h.popScopeId(),m),hb={class:"bind viur-shop-wrap"},ub=["panel","disabled"],mb={class:"viur-shop-order-step"},gb=["name","library"],pb={class:"viur-shop-order-status-text"},fb={key:0,name:"chevron-right",class:"viur-shop-order-tab-check"},kb=["name"],bb=["onClick"],wb=["onClick"],Ab=db(()=>h.createElementVNode("div",{class:"viur-shop-sidebar",id:"order_sidebar"},null,-1)),_b=de({__name:"OrderView",props:{tabs:{type:Object,required:!0}},emits:["tabChange"],setup(m,{emit:x}){const C=m,N=x,D=h.reactive({tabNames:h.computed(()=>w(C.tabs)),isFirstTab:B=>B===0}),M=h.ref(null);function w(B){let v=[],k=[];for(const _ in B)B[_].position?v.push([_,B[_].position]):v.push([_,0]);return v.sort((_,R)=>_[1]-R[1]),v.forEach(_=>{k.push(_[0])}),k}function S(B){N("tabChange",B)}function p(B){M.value.show(B)}function y(B){M.value.show(B)}return(B,v)=>(h.openBlock(),h.createElementBlock("div",hb,[h.createElementVNode("sl-tab-group",{class:"viur-shop-order-tab",noScrollControls:"",onSlTabShow:S,ref_key:"tabGroup",ref:M},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(D.tabNames,(k,_)=>(h.openBlock(),h.createElementBlock("sl-tab",{slot:"nav",panel:k,key:k,disabled:m.tabs[k].disabled},[h.createElementVNode("div",mb,[h.createElementVNode("sl-icon",{name:m.tabs[k].icon.name,library:m.tabs[k].icon.library},null,8,gb),h.createElementVNode("div",pb,h.toDisplayString(_+1)+". "+h.toDisplayString(m.tabs[k].displayName),1)]),_(h.openBlock(),h.createElementBlock("sl-tab-panel",{name:k,key:k},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.tabs[k].component),h.mergeProps({ref_for:!0},m.tabs[k].props?m.tabs[k].props:""),null,16)),_!==D.tabNames.length-1?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["viur-shop-form-footer",{"flex-end":D.isFirstTab(_)}])},[h.withDirectives(h.createElementVNode("sl-button",{type:"submit",onClick:R=>p(D.tabNames[_-1])}," Zurück ",8,bb),[[h.vShow,_!==0]]),h.createElementVNode("sl-button",{type:"submit",variant:"primary",onClick:R=>y(D.tabNames[_+1])}," Weiter ",8,wb)],2)):h.createCommentVNode("",!0)],8,kb))),128))],544),Ab]))}},[["__scopeId","data-v-61488015"]]),Cb={},jo=m=>(h.pushScopeId("data-v-36ccc280"),m=m(),h.popScopeId(),m),vb={class:"bind"},yb=[jo(()=>h.createElementVNode("h1",{class:"headline"},"Vielen Dank für Ihre Bestellung",-1)),jo(()=>h.createElementVNode("br",null,null,-1)),jo(()=>h.createElementVNode("p",{class:"paragraph"},[h.createElementVNode("strong",null,"Ihre Bestellnummer:"),h.createTextVNode(" 123345670 ")],-1)),jo(()=>h.createElementVNode("p",{class:"paragraph"},[h.createTextVNode(" Wir haben Ihre Bestellung erhalten und werden diese schenllstmöglich bearbeiten."),h.createElementVNode("br"),h.createTextVNode(" Sie erhalten in wenigen Minuten eine Bestätigung per E-Mail. "),h.createElementVNode("div",{class:"btn-wrap"},[h.createElementVNode("sl-button",{size:"medium"}," Zur Startseite "),h.createElementVNode("sl-button",{variant:"primary",size:"medium"}," Weiter Einkaufen ")])],-1))];function Eb(m,x){return h.openBlock(),h.createElementBlock("div",vb,yb)}const xb=de(Cb,[["render",Eb],["__scopeId","data-v-36ccc280"]]),Sb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({});function D(M){x.emit("change",m.name,M.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Db=["disabled","value"],Bb=["disabled","value"];function Tb(m,x,C,N,D,M){var w,S;return m.boneState.bonestructure.type==="raw.json"?(h.openBlock(),h.createElementBlock("sl-textarea",{key:0,disabled:(w=m.boneState)==null?void 0:w.readonly,value:JSON.stringify(m.value),onInput:x[0]||(x[0]=(...p)=>m.changeEvent&&m.changeEvent(...p))},null,40,Db)):(h.openBlock(),h.createElementBlock("sl-textarea",{key:1,disabled:(S=m.boneState)==null?void 0:S.readonly,value:m.value,onInput:x[1]||(x[1]=(...p)=>m.changeEvent&&m.changeEvent(...p))},null,40,Bb))}const sr=de(Sb,[["render",Tb],["__scopeId","data-v-0ebe5f0b"]]),Ib=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.reactive({});function N(D){x.emit("change",m.name,D.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:C,changeEvent:N}}}),Pb=["value"];function Rb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{disabled:"",value:m.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Pb)}const Ua=de(Ib,[["render",Rb],["__scopeId","data-v-b45a1311"]]);function Ob(m){return h.getCurrentScope()?(h.onScopeDispose(m),!0):!1}function Nb(m){return typeof m=="function"?m():h.unref(m)}const zb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function $o(m,x,C={}){const{immediate:N=!0}=C,D=h.ref(!1);let M=null;function w(){M&&(clearTimeout(M),M=null)}function S(){D.value=!1,w()}function p(...y){w(),D.value=!0,M=setTimeout(()=>{D.value=!1,M=null,m(...y)},Nb(x))}return N&&(D.value=!0,zb&&p()),Ob(S),{isPending:h.readonly(D),start:p,stop:S}}class Mb{static objectEmpty(x){return Object.keys(x).length===0&&x.constructor===Object}static getDescr(x,C){try{return x.values.filter(N=>N[0]===C)[0][1]}catch{return"-"}}static unescape(x){return x||(x=""),String(x).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/(/g,"(").replace(/)/g,")").replace(/=/g,"=").replace(/'/g,"'").replace(/(/g,"(").replace(/)/g,")").replace(/=/g,"=")}static formatString(x,C){function N(w){let S=[],p=[],y=/\$\((.*?)\)/g;for(;p;){if(p=y.exec(w),!p){p=!1;continue}S.push(p[1])}return S}let D=N(x),M=[];Array.isArray(C)||(C=[C]);for(let w of C){let S=x;for(let p of D){let y=p.split("."),B=w;for(let v of y)B&&B!=="-"&&v in B&&B[v]?B=B[v]:B="-";B=this.unescape(B),S=S.replace("$("+p+")",B)}M.push(S)}return M.join(", ")}}const Fb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>m.value)}),D=h.ref(null);function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index)}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:w}=$o(()=>{D.value.focus()},600);w()}}),h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,Utils:Mb,boneState:C,changeEvent:M,stringBone:D}}}),Vb=["disabled","value","required"];function Lb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{ref:"stringBone",disabled:m.boneState.readonly,value:m.Utils.unescape(m.value),required:m.boneState.bonestructure.required,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onKeyup:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Vb)}const Wa=de(Fb,[["render",Lb],["__scopeId","data-v-1ccbacc0"]]),jb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({}),D=h.ref(null);function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index)}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:w}=$o(()=>{D.value.focus()},600);w()}}),h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:M,emailBone:D}}}),$b=["disabled","value"];function Hb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{ref:"emailBone",disabled:m.boneState.readonly,type:"email",value:m.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,$b)}const Ka=de(jb,[["render",Hb],["__scopeId","data-v-4328e024"]]),qb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>{var w;let M=m.value;return C.bonestructure.time?M=(w=m.value)==null?void 0:w.split("+")[0]:m.value&&(M=new Date(m.value).toISOString().substr(0,10)),M}),typeString:h.computed(()=>{let M="datetime-local";return C.bonestructure.time||(M="date"),M})});function D(M){x.emit("change",m.name,M.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Ub=["disabled","type","value"];function Wb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{disabled:m.boneState.readonly,type:m.state.typeString,value:m.state.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Ub)}const Ga=de(qb,[["render",Wb],["__scopeId","data-v-f1b8af8c"]]),Kb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:null,index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>{let w=m.value;return Array.isArray(m.value)?(C.bonestructure.values instanceof Array?w=w.filter(S=>C.bonestructure.values.map(p=>p[0].toString()).includes(S)):w=w.filter(S=>Object.keys(C.bonestructure.values).map(p=>p.toString()).includes(S)),w.map(S=>S.toString())):m.value?m.value.toString():""})});function D(){if(Array.isArray(C.bonestructure.values))return C.bonestructure.values;{let w=[];for(const[S,p]of Object.entries(C.bonestructure.values))w.push([S,p]);return w}}function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index),W}return h.onMounted(()=>{x.emit("change",m.name,N.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:M,convertObjToList:D}}}),Gb=["disabled","value","multiple"],Zb=["value"];function Jb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-select",{disabled:m.boneState.readonly,value:m.state.value,hoist:"",multiple:m.boneState.bonestructure.multiple,"max-options-visible":"0",clearable:"",onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.convertObjToList(),w=>(h.openBlock(),h.createElementBlock("sl-option",{key:w[0],value:w[0]},h.toDisplayString(w[1]),9,Zb))),128))],40,Gb)}const Za=de(Kb,[["render",Jb],["__scopeId","data-v-5a38b97f"]]),Yb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>![!1,null,void 0,""].includes(m.value))});function D(M){x.emit("change",m.name,M.target.checked,m.lang,m.index)}return h.onMounted(()=>{let M=m.value;M||(M=!1),x.emit("change",m.name,M,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Qb=["disabled","checked"];function Xb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-switch",{disabled:m.boneState.readonly,checked:m.state.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Qb)}const Ja=de(Yb,[["render",Xb],["__scopeId","data-v-363598c8"]]),ew=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value1:"",value2:null,equal:!1,passwordInfo:[],requiredPasswordInfo:[]}),D=h.ref(null);function M(S){N.value1===N.value2?N.equal=!0:N.equal=!1,w(N.value1),N.requiredPasswordInfo.length===0&&N.passwordInfo.length-N.requiredPasswordInfo.length<=C.bonestructure.test_threshold?x.emit("change",m.name,N.value1,m.lang,m.index,!0):x.emit("change",m.name,N.value1,m.lang,m.index,!1)}h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)});function w(S){N.passwordInfo=[],N.requiredPasswordInfo=[];for(const p of C.bonestructure.tests)new RegExp(p[0]).test(S)||(p[2]?N.requiredPasswordInfo.push(p[1]):N.passwordInfo.push(p[1]));N.equal||N.requiredPasswordInfo.push("Die eingegebenen Passwörter stimmen nicht überein."),N.value1||N.requiredPasswordInfo.push("Das eingegebene Passwort ist leer.")}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:S}=$o(()=>{D.value.focus()},600);S()}}),h.watch(()=>m.value,(S,p)=>{N.value1=S}),{state:N,boneState:C,changeEvent:M,passwordBone:D}}}),tw=["disabled"],nw=["name"],ow=["name"],iw={class:"errors"};function rw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.withDirectives(h.createElementVNode("sl-input",{ref:"passwordBone","onUpdate:modelValue":x[0]||(x[0]=w=>m.state.value1=w),disabled:m.boneState.readonly,class:h.normalizeClass({"has-check":!m.boneState.readonly}),type:"password",clearable:"","password-toggle":"true",onSlChange:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onSlClear:x[2]||(x[2]=w=>m.state.value1=""),onKeyup:x[3]||(x[3]=(...w)=>m.changeEvent&&m.changeEvent(...w))},[h.createElementVNode("sl-icon",{slot:"suffix",name:m.state.equal&&m.state.value1.length?"check":"x"},null,8,nw)],42,tw),[[h.vModelText,m.state.value1]]),m.boneState.readonly?h.createCommentVNode("",!0):h.withDirectives((h.openBlock(),h.createElementBlock("sl-input",{key:0,"onUpdate:modelValue":x[4]||(x[4]=w=>m.state.value2=w),class:"password-check",type:"password",clearable:"","password-toggle":"true",onSlChange:x[5]||(x[5]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onSlClear:x[6]||(x[6]=w=>m.state.value2=""),onKeyup:x[7]||(x[7]=(...w)=>m.changeEvent&&m.changeEvent(...w))},[h.createElementVNode("sl-icon",{slot:"suffix",name:m.state.equal&&m.state.value1.length?"check":"x"},null,8,ow)],544)),[[h.vModelText,m.state.value2]]),h.createElementVNode("ul",iw,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.passwordInfo,(w,S)=>(h.openBlock(),h.createElementBlock("li",{key:S},h.toDisplayString(w),1))),128)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.requiredPasswordInfo,(w,S)=>(h.openBlock(),h.createElementBlock("li",{key:S,class:"requiredInfo"},h.toDisplayString(w),1))),128))])],64)}const Ya=de(ew,[["render",rw],["__scopeId","data-v-0ccf18c0"]]),sw=h.defineComponent({props:{name:String,value:null,index:Number,lang:String,readonly:Boolean,params:Object},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>m.value),structure:h.computed(()=>w(C.bonestructure.using)),globalRegistration:!1,formGroups:h.computed(()=>{var y,B;let S={default:{name:"Allgemein",bones:[],groupVisible:!1,groupOpen:!0}};for(const[v,k]of Object.entries(N.structure)){let _="default",R=N.structure[v],T=(y=N.value)==null?void 0:y[v];(B=k==null?void 0:k.params)!=null&&B.category&&(_=k.params.category.toLowerCase()),Object.keys(S).includes(_)?S[_].bones.push({boneName:v,boneStructure:R,boneValue:T}):S[_]={name:k.params.category,bones:[{boneName:v,boneStructure:R,boneValue:T}]},R.visible===!0&&(S[_].groupVisible=!0)}let p={};return Object.keys(S).sort().forEach(function(v){p[v]=S[v]}),p})});function D(S){x.emit("change",S)}h.onMounted(()=>{h.getCurrentInstance().appContext.components.Bone?N.globalRegistration=!0:N.globalRegistration=!1,x.emit("change",m.name,m.value,m.lang,m.index)});function M(S){console.log(S)}function w(S){if(Array.isArray(S)){let p={};for(const y in S)p[S[y][0]]=S[y][1];return p}else return S}return{state:N,boneState:C,getBoneWidget:Yt,structureToDict:w,changeEvent:D,updateValue:M}}}),aw={key:0,open:"",variant:"danger"},lw={key:1,class:"form"},cw=["summary","open"];function dw(m,x,C,N,D,M){const w=h.resolveComponent("bone");return m.state.globalRegistration?(h.openBlock(),h.createElementBlock("div",lw,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.formGroups,(S,p)=>h.withDirectives((h.openBlock(),h.createElementBlock("sl-details",{key:p,summary:S.name,open:S.groupOpen},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(S.bones,y=>h.withDirectives((h.openBlock(),h.createBlock(w,{key:y.name,is:m.getBoneWidget(m.state.structure[y.boneName].type),name:y.boneName,structure:m.state.structure,skel:m.state.value,errors:m.boneState.errors,readonly:m.boneState.bonestructure.readonly?!0:void 0,onChangeInternal:m.changeEvent},null,8,["is","name","structure","skel","errors","readonly","onChangeInternal"])),[[h.vShow,m.state.structure[y.boneName].visible]])),128))],8,cw)),[[h.vShow,S.groupVisible]])),128))])):(h.openBlock(),h.createElementBlock("sl-alert",aw," In Order to use this Bone register the bone component globally in your main file "))}const Qa=de(sw,[["render",dw],["__scopeId","data-v-e6fcfbca"]]),hw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:null,index:Number,lang:String},components:{Wrapper_nested:Qa},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:{},index:h.computed(()=>m.index),lang:h.computed(()=>m.lang)});function D(M){var S;(S=N.value)!=null&&S[M.name]||(N.value?N.value[M.name]=null:N.value={[M.name]:null});let w=N.value[M.name];M.lang?(w===null&&(w={}),Object.keys(w).includes(M.lang)&&M.index!==null?w[M.lang][M.index]=M.value:w[M.lang]=M.value):M.index!==null?(w===null&&(w=[]),w[M.index]=M.value):w=M.value,N.value[M.name]=w,x.emit("change",m.name,N.value,m.lang,m.index,!0)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}});function uw(m,x,C,N,D,M){const w=h.resolveComponent("Wrapper_nested");return h.openBlock(),h.createBlock(w,{value:m.value,name:m.name,index:m.state.index,disabled:m.boneState.bonestructure.readonly,onChange:m.changeEvent},null,8,["value","name","index","disabled","onChange"])}const Xa=de(hw,[["render",uw],["__scopeId","data-v-84a761ce"]]),mw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({});function D(M){x.emit("change",m.name,M.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),gw=["disabled","value"];function pw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-color-picker",{disabled:m.boneState.readonly,value:m.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,gw)}const el=de(mw,[["render",pw],["__scopeId","data-v-534b9149"]]),fw=h.defineComponent({inheritAttrs:!1,emits:{change:null},props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},setup(m,x){const C=h.inject("boneState"),N=h.reactive({minAmount:h.computed(()=>C.bonestructure.minAmount),maxAmount:h.computed(()=>C.bonestructure.maxAmount),precision:h.computed(()=>{if(C.bonestructure.precision>1)return parseFloat(`0.${"0".repeat(C.bonestructure.precision-1)}1`)})}),D=h.ref(null);function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index)}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:w}=$o(()=>{D.value.focus()},600);w()}}),h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:M,numericBone:D}}}),kw=["disabled","value","min","max","step"],bw={class:"info"},ww={key:0},Aw={key:1},_w={key:2};function Cw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("sl-input",{ref:"numericBone",type:"number",disabled:m.boneState.readonly,value:m.value,min:m.state.minAmount,max:m.state.maxAmount,step:m.state.precision,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onKeyup:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,kw),h.createElementVNode("ul",bw,[m.state.minAmount!==-9223372036854776e3&&m.state.minAmount?(h.openBlock(),h.createElementBlock("li",ww,h.toDisplayString(m.$t("bones.numeric.min",{val:m.state.minAmount})),1)):h.createCommentVNode("",!0),m.state.maxAmount!==9223372036854776e3&&m.state.maxAmount?(h.openBlock(),h.createElementBlock("li",Aw,h.toDisplayString(m.$t("bones.numeric.max",{val:m.state.maxAmount})),1)):h.createCommentVNode("",!0),m.state.precision?(h.openBlock(),h.createElementBlock("li",_w,h.toDisplayString(m.$t("bones.numeric.precision",{val:m.boneState.bonestructure.precision})),1)):h.createCommentVNode("",!0)])],64)}const tl=de(fw,[["render",Cw],["__scopeId","data-v-03d5b399"]]);var Le={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};class Ho extends Error{constructor(x,C,N,D){super(N||C),arguments.length>=4&&D&&Object.assign(this,D),this.statusText=C,this.statusCode=x,this.response=D}}let ar=null;function Jt(){return ar||(ar=or.defineStore("requestStore",()=>{const m=h.reactive({sKeys:new Set});function x(){m.sKeys=new Set}return{state:m,$reset:x}})),ar()}class we{static resetState(){Jt().$reset(),Jt().$dispose()}static buildUrl(x){return x&&!(x.startsWith("http://")||x.startsWith("https://")||x.startsWith("//"))&&(x=window.location.origin+x),x}static post(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,abortController:M=null,headers:w=null,mode:S=null}={}){function p(){if(C instanceof FormData)return C;const B=new FormData;for(const v in C)if(Array.isArray(C[v]))for(let k of C[v])B.append(v,k);else B.append(v,C[v]);return B}let y=ro.post(we.buildUrl(x),p(),null,w,M,S);return y.then(function(B){N&&N(B.data)}).catch(function(B){D&&D(B)}),y}static async getBatchSkeys(x=30,C=Le.VITE_DEFAULT_RENDERER||"json"){await we.get(`/${C}/skey`,{dataObj:{amount:x}}).then(async N=>{let D=await N.json();Array.isArray(D)||(D=[D]),Jt().state.sKeys=new Set(D)})}static async securePost(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,abortController:M=null,renderer:w=Le.VITE_DEFAULT_RENDERER||"json",headers:S=null,mode:p=null,amount:y=30}={}){let B=null;Jt().state.sKeys.size===0&&await we.getBatchSkeys(y);const v=[...Jt().state.sKeys][0];return C instanceof FormData?(C.append("skey",v),Jt().state.sKeys.delete(v)):(C||(C={}),C.skey=v,Jt().state.sKeys.delete(v)),B=we.post(x,{dataObj:C,callback:N,abortController:M,headers:S,mode:p}),B}static get(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,cached:M=!1,clearCache:w=!1,abortController:S=null,headers:p=null,mode:y=null,cacheTime:B=1e3*60*60*24*1}={}){let v=ro.get(we.buildUrl(x),C,w,p,S,y);return v.then(function(k){N&&N(k.data)}).catch(function(k){D&&D(k)}),v}static list(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,group:M=null,abortController:w=null,renderer:S=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let p=`/${S}/${x}/list`;return M&&(p+=`/${M}`),we.get(p,{dataObj:C,callback:N,failedCallback:D,abortController:w})}static getStructure(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,group:M=null,abortController:w=null,renderer:S=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){x=x.replace(/\//g,".");let p=`/${S}/getStructure/${x}`;return M&&(p+=`/${M}`),we.get(p,{dataObj:C,callback:N,failedCallback:D,abortController:w})}static view(x,C,{dataObj:N=null,callback:D=null,failedCallback:M=null,group:w=null,abortController:S=null,renderer:p=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let y=`/${p}/${x}/view/${C}`;return w&&(y=`/${p}/${x}/view/${w}/${C}`),we.get(y,{dataObj:N,callback:D,failedCallback:M,abortController:S})}static add(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,group:M=null,abortController:w=null,renderer:S=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let p=`/${S}/${x}/add`;return M&&(p=`/${S}/${x}/add/${M}`),we.securePost(p,{dataObj:C,callback:N,failedCallback:D,abortController:w})}static edit(x,C,{dataObj:N=null,callback:D=null,failedCallback:M=null,group:w=null,abortController:S=null,renderer:p=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let y=`/${p}/${x}/edit/${C}`;return w&&(y=`/${p}/${x}/edit/${w}/${C}`),we.securePost(y,{dataObj:N,callback:D,failedCallback:M,abortController:S})}static delete(x,C,{dataObj:N=null,callback:D=null,failedCallback:M=null,group:w=null,abortController:S=null,renderer:p=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let y=`/${p}/${x}/delete/${C}`;return w&&(y=`/${p}/${x}/delete/${w}/${C}`),we.securePost(y,{dataObj:N,callback:D,failedCallback:M,abortController:S,amount:1})}static downloadUrlFor(x,C=!1){return x&&"dest"in x?C&&"thumbnail"in x.dest?we.buildUrl(x.dest.thumbnail):"downloadUrl"in x.dest?we.buildUrl(x.dest.downloadUrl):we.buildUrl(null):we.buildUrl(x)}static uploadFile(x,C=void 0){const N={fileName:x.name,mimeType:x.type||"application/octet-stream",size:x.size.toString(),node:C};return new Promise((D,M)=>{we.securePost("/vi/file/getUploadURL",{dataObj:N}).then(async w=>{let S=await w.json();fetch(S.values.uploadUrl,{body:x,method:"POST",mode:"no-cors"}).then(async p=>{const y={key:S.values.uploadKey,skelType:"leaf"};we.securePost("/vi/file/add",{dataObj:y}).then(async B=>{let v=await B.json();v.action==="addSuccess"?D(v.values):M(v)}).catch(B=>{M(B)})}).catch(p=>{M(p)})}).catch(w=>{M(w)})})}}class ro{constructor(){Jf(this,"withCredentials",!0)}static buildOptions(x,C=null,N=null,D=null,M=null){let w={method:x};return w.credentials="include",w.headers={Accept:"application/json, text/plain, */*"},N&&(w.headers={...w.headers,...N}),C&&(w.body=C),D&&(w.signal=D.signal),M&&(w.mode=M),w}static get(x,C=null,N=null,D=null,M=null,w=null){function S(p,y){let B=new URL(p);if(y&&Object.keys(y).length>0){const v=new URLSearchParams;for(const[k,_]of Object.entries(y))if(Array.isArray(_))for(const R of _)v.append(k,R);else v.append(k,_);B.search=v.toString()}return B.toString()}return fetch(S(x,C),ro.buildOptions("GET",null,D,M,w)).then(async p=>{if(p.ok)return p;{const y=`${p.status} ${p.statusText}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(p.status,p.statusText,y,p))}}).catch(p=>{if(p instanceof TypeError){const B=`503 ${p.message}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(503,p.message,B,p))}if(p instanceof DOMException&&p.name=="AbortError"){const B=`${p.code} ${p.name}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(p.code,p.name,B,{url:x}))}const y=`${p.statusCode} ${p.statusText}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(p.statusCode,p.statusText,y,p.response))})}static post(x,C=null,N=null,D=null,M=null,w=null){return fetch(x,ro.buildOptions("POST",C,D,M,w))}}var vw={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const yw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{Wrapper_nested:Qa},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.inject("formatString"),D=h.reactive({format:h.computed(()=>C==null?void 0:C.bonestructure.format),skellistdata:null,selection:null});function M(p){let y="";return C.bonestructure.type==="relational.tree.leaf.file"?y="skelType=leaf&":C.bonestructure.type==="relational.tree.node.file"&&(y="skelType=node&"),we.get(`/${vw.VITE_DEFAULT_RENDERER||"vi"}/${C.bonestructure.module}/list?${y}limit=99`).then(async B=>{var k;const v=await B.json();D.skellistdata={};for(let _ of v.skellist)D.skellistdata[_.key]=_;return(k=v.skellist)==null?void 0:k.map(_=>({text:N(C.bonestructure.format,{dest:_}),value:_.key,data:_}))})}function w(p){D.selection={dest:D.skellistdata[p.detail.item.value]},x.emit("change",m.name,D.selection,m.lang,m.index)}function S(p){var B;D.selection||(D.selection={}),(B=D.selection.rel)!=null&&B[p.name]||(D.selection.rel?D.selection.rel[p.name]=null:D.selection.rel={[p.name]:null});let y=D.selection.rel[p.name];p.lang?(y===null&&(y={}),Object.keys(y).includes(p.lang)&&p.index!==null?y[p.lang][p.index]=p.value:y[p.lang]=p.value):p.index!==null?(y===null&&(y=[]),y[p.index]=p.value):y=p.value,Object.keys(D.selection).includes("rel")&&D.selection.rel?D.selection.rel[p.name]=y:D.selection.rel={[p.name]:y},Object.keys(D.selection).includes("dest")&&x.emit("change",m.name,D.selection,m.lang,m.index)}return h.onMounted(()=>{D.selection=m.value,x.emit("change",m.name,m.value,m.lang,m.index)}),{state:D,boneState:C,formatString:N,changeEvent:w,changeEventNested:S,getList:M}}}),Ew=m=>(h.pushScopeId("data-v-61dd72e0"),m=m(),h.popScopeId(),m),xw={class:"record"},Sw={class:"single-entry"},Dw=["value"],Bw=["disabled","source"],Tw=["title"],Iw=[Ew(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))];function Pw(m,x,C,N,D,M){var S,p;const w=h.resolveComponent("Wrapper_nested");return h.openBlock(),h.createElementBlock("div",xw,[h.createElementVNode("div",Sw,[m.state.selection?(h.openBlock(),h.createElementBlock("sl-input",{key:0,disabled:!0,value:m.value?m.formatString(m.state.format,m.state.selection):""},null,8,Dw)):(h.openBlock(),h.createElementBlock("sl-combobox",{key:1,disabled:m.boneState.readonly,source:m.getList,hoist:"",onSlItemSelect:x[0]||(x[0]=(...y)=>m.changeEvent&&m.changeEvent(...y))},null,40,Bw)),!m.boneState.multiple&&!m.boneState.isEmpty?(h.openBlock(),h.createElementBlock("sl-button",{key:2,variant:"danger",outline:"",title:m.$t("bone.del"),class:"delete-btn square-btn",onClick:x[1]||(x[1]=()=>{m.$emit("change",m.name,"",m.lang,m.index),m.state.selection=null})},Iw,8,Tw)):h.createCommentVNode("",!0)]),(S=m.boneState)!=null&&S.bonestructure.using?(h.openBlock(),h.createBlock(w,{key:0,value:(p=m.value)==null?void 0:p.rel,name:m.name,index:m.index,disabled:m.boneState.bonestructure.readonly,onChange:m.changeEventNested},null,8,["value","name","index","disabled","onChange"])):h.createCommentVNode("",!0)])}const nl=de(yw,[["render",Pw],["__scopeId","data-v-61dd72e0"]]),Rw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({});function D(M,w){x.emit("change",m.name,M,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Ow={class:"box"};function Nw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",Ow,h.toDisplayString(m.value),1)}const zw=de(Rw,[["render",Nw],["__scopeId","data-v-343aca69"]]);var ol={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Mw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.ref(),D=h.reactive({loading:!1,droparea:!1,previewopen:!1});h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)});function M(){console.log(we.downloadUrlFor(m.value)),window.open(we.downloadUrlFor(m.value))}function w(){return we.downloadUrlFor(m.value,!1)}function S(B){const v={fileName:B.name,mimeType:B.type||"application/octet-stream",size:B.size.toString()};return new Promise((k,_)=>{we.securePost(`/${ol.VITE_DEFAULT_RENDERER||"vi"}/file/getUploadURL`,{dataObj:v}).then(async R=>{let T=await R.json();fetch(T.values.uploadUrl,{body:B,method:"POST",mode:"no-cors"}).then(async O=>{const F={key:T.values.uploadKey,node:void 0,skelType:"leaf"};we.securePost(`/${ol.VITE_DEFAULT_RENDERER||"vi"}/file/add`,{dataObj:F}).then(async L=>{let $=await L.json();$.action==="addSuccess"?k($.values):_($)}).catch(L=>{_(L)})}).catch(O=>{_(O)})}).catch(R=>{_(R)})})}async function p(B){D.loading=!0;for(let v of B.target.files){let k=await S(v);N.value.value=null,x.emit("change",m.name,{dest:k,rel:null},m.lang,m.index)}D.loading=!1}async function y(B){D.loading=!0,D.droparea=!1;for(let v of B.dataTransfer.files){let k=await S(v);N.value.value=null,x.emit("change",m.name,{dest:k,rel:null},m.lang,m.index);break}D.loading=!1}return{state:D,boneState:C,downloadFile:M,createBackgroundImage:w,handleUpload:p,uploadinput:N,handleDrop:y}}}),qo=m=>(h.pushScopeId("data-v-91086308"),m=m(),h.popScopeId(),m),Fw={key:0,class:"loader"},Vw=[qo(()=>h.createElementVNode("sl-spinner",{slot:"suffix"},null,-1))],Lw={key:1,class:"droparea"},jw=["title"],$w=[qo(()=>h.createElementVNode("sl-icon",{name:"upload"},null,-1))],Hw=["multiple"],qw=["title"],Uw=[qo(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"download"},null,-1))],Ww={class:"box"},Kw=["src"],Gw=["label","open"],Zw=["src"],Jw={key:1,class:"preview"},Yw={key:0,name:"file-earmark"},Qw={key:2},Xw=["title"],eA=[qo(()=>h.createElementVNode("sl-icon",{name:"x-lg"},null,-1))];function tA(m,x,C,N,D,M){var w,S,p,y,B,v,k,_,R,T;return h.openBlock(),h.createElementBlock("div",{class:"file-wrapper",onDragover:x[5]||(x[5]=h.withModifiers(O=>m.state.droparea=!0,["prevent"])),onDragleave:x[6]||(x[6]=O=>m.state.droparea=!1),onDrop:x[7]||(x[7]=h.withModifiers((...O)=>m.handleDrop&&m.handleDrop(...O),["prevent"]))},[m.state.loading?(h.openBlock(),h.createElementBlock("div",Fw,Vw)):h.createCommentVNode("",!0),m.state.droparea?(h.openBlock(),h.createElementBlock("div",Lw," Dateien hier hinziehen ")):h.createCommentVNode("",!0),!m.boneState.readonly&&(!m.value||m.state.loading)?(h.openBlock(),h.createElementBlock("sl-button",{key:2,title:m.$t("bone.upload"),outline:"",class:"upload-btn",onClick:x[0]||(x[0]=O=>m.uploadinput.click())},$w,8,jw)):h.createCommentVNode("",!0),h.createElementVNode("input",{ref:"uploadinput",hidden:"",type:"file",multiple:m.boneState.multiple,onChange:x[1]||(x[1]=(...O)=>m.handleUpload&&m.handleUpload(...O))},null,40,Hw),m.value?(h.openBlock(),h.createElementBlock("sl-button",{key:3,title:m.$t("bone.download"),onClick:x[2]||(x[2]=(...O)=>m.downloadFile&&m.downloadFile(...O))},Uw,8,qw)):h.createCommentVNode("",!0),h.createElementVNode("div",Ww,[(S=(w=m.value)==null?void 0:w.dest)!=null&&S.mimetype.includes("image")?(h.openBlock(),h.createElementBlock("div",{key:0,class:"preview has-preview",onClick:x[3]||(x[3]=O=>m.state.previewopen=!m.state.previewopen)},[h.createElementVNode("img",{class:"preview-img",src:m.createBackgroundImage(),alt:""},null,8,Kw),h.createElementVNode("sl-dialog",{label:decodeURIComponent((y=(p=m.value)==null?void 0:p.dest)==null?void 0:y.name),class:"preview-overlay",open:m.state.previewopen},[h.createElementVNode("img",{src:m.createBackgroundImage(),alt:""},null,8,Zw)],8,Gw)])):(h.openBlock(),h.createElementBlock("div",Jw,[(v=(B=m.value)==null?void 0:B.dest)!=null&&v.name?(h.openBlock(),h.createElementBlock("sl-icon",Yw)):h.createCommentVNode("",!0)])),(_=(k=m.value)==null?void 0:k.dest)!=null&&_.name?(h.openBlock(),h.createElementBlock("div",Qw,h.toDisplayString(decodeURIComponent((T=(R=m.value)==null?void 0:R.dest)==null?void 0:T.name)),1)):h.createCommentVNode("",!0)]),m.boneState.multiple?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("sl-button",{key:4,variant:"danger",outline:"",title:m.$t("bone.del"),class:"delete-btn",onClick:x[4]||(x[4]=O=>m.$emit("change",m.name,"",m.lang,m.index))},eA,8,Xw))],32)}const il=de(Mw,[["render",tA],["__scopeId","data-v-91086308"]]);var Uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nA(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var Wo={exports:{}};Wo.exports,function(m,x){(function(C){const N=C.de=C.de||{};N.dictionary=Object.assign(N.dictionary||{},{"%0 of %1":"%0 von %1","Align cell text to the bottom":"Zellentext unten ausrichten","Align cell text to the center":"Zellentext zentriert ausrichten","Align cell text to the left":"Zellentext linksbündig ausrichten","Align cell text to the middle":"Zellentext mittig ausrichten","Align cell text to the right":"Zellentext rechtsbündig ausrichten","Align cell text to the top":"Zellentext oben ausrichten","Align center":"Zentriert","Align left":"Linksbündig","Align right":"Rechtsbündig","Align table to the left":"Tabelle links ausrichten","Align table to the right":"Tabelle rechts ausrichten",Alignment:"Ausrichtung",Aquamarine:"Aquamarinblau",Background:"Hintergrund",Black:"Schwarz","Block quote":"Blockzitat",Blue:"Blau",Bold:"Fett",Border:"Rahmen","Break text":"Bild teilt Text","Bulleted List":"Aufzählungsliste","Bulleted list styles toolbar":"Darstellung der ungeordneten Liste",Cancel:"Abbrechen","Cannot upload file:":"Die Datei kann nicht hochgeladen werden:","Caption for image: %0":"Bildunterschrift: %0","Caption for the image":"Bildunterschrift","Cell properties":"Zelleneigenschaften","Center table":"Tabelle zentrieren","Centered image":"Zentriertes Bild","Change image text alternative":"Alternativtext ändern","Choose heading":"Überschrift auswählen",Circle:"Leerer Kreis",Code:"Code",Color:"Farbe","Color picker":"Farbwähler",Column:"Spalte",Dashed:"Gestrichelt",Decimal:"Dezimalzahlen","Decimal with leading zero":"Dezimalzahlen mit vorangestellten Nullen","Decrease indent":"Einzug verkleinern","Delete column":"Spalte löschen","Delete row":"Zeile löschen","Dim grey":"Dunkelgrau",Dimensions:"Größe",Disc:"Gefüllter Kreis",Dotted:"Gepunktet",Double:"Doppelt",Downloadable:"Herunterladbar","Dropdown toolbar":"Dropdown-Liste Werkzeugleiste","Edit block":"Absatz bearbeiten","Edit link":"Link bearbeiten","Editor block content toolbar":"Editor Blockinhalt-Toolbar","Editor contextual toolbar":"Editor kontextuelle Toolbar","Editor editing area: %0":"Bearbeitungsbereich des Editors: %0","Editor toolbar":"Editor Werkzeugleiste","Enter image caption":"Bildunterschrift eingeben","Enter table caption":"Tabellenüberschrift eingeben","Full size image":"Bild in voller Größe",Green:"Grün",Grey:"Grau",Groove:"Eingeritzt","Header column":"Kopfspalte","Header row":"Kopfzeile",Heading:"Überschrift","Heading 1":"Überschrift 1","Heading 2":"Überschrift 2","Heading 3":"Überschrift 3","Heading 4":"Überschrift 4","Heading 5":"Überschrift 5","Heading 6":"Überschrift 6",Height:"Höhe",HEX:"","Horizontal text alignment toolbar":"Werkzeugleiste für die horizontale Zellentext-Ausrichtung","HTML object":"HTML-Objekt","Image resize list":"Bildgrößen-Liste","Image toolbar":"Bild Werkzeugleiste","image widget":"Bild-Steuerelement","In line":"Text in Zeile","Increase indent":"Einzug vergrößern",Insert:"Einfügen","Insert column left":"Spalte links einfügen","Insert column right":"Spalte rechts einfügen","Insert image":"Bild einfügen","Insert image via URL":"Bild von URL einfügen","Insert paragraph after block":"Absatz nach Block einfügen","Insert paragraph before block":"Absatz vor Block einfügen","Insert row above":"Zeile oben einfügen","Insert row below":"Zeile unten einfügen","Insert table":"Tabelle einfügen",Inset:"Eingelassen",Italic:"Kursiv",Justify:"Blocksatz","Justify cell text":"Zellentext als Blocksatz ausrichten","Left aligned image":"Linksbündiges Bild","Light blue":"Hellblau","Light green":"Hellgrün","Light grey":"Hellgrau",Link:"Link","Link image":"Bild verlinken","Link URL":"Link Adresse","List properties":"Listeneigenschaften","Lower-latin":"Kleingeschriebene lateinische Buchstaben","Lower–roman":"Kleingeschriebene römische Zahlen","Merge cell down":"Zelle unten verbinden","Merge cell left":"Zelle links verbinden","Merge cell right":"Zelle rechts verbinden","Merge cell up":"Zelle verbinden","Merge cells":"Zellen verbinden",Next:"Nächste",None:"Kein Rahmen","Numbered List":"Nummerierte Liste","Numbered list styles toolbar":"Darstellung der geordneten Liste","Open in a new tab":"In neuem Tab öffnen","Open link in new tab":"Link im neuen Tab öffnen",Orange:"Orange",Original:"Original",Outset:"Geprägt",Padding:"Innenabstand",Paragraph:"Absatz","Press Enter to type after or press Shift + Enter to type before the widget":"Drücken Sie die Eingabetaste, um nach dem Widget zu tippen oder Shift + Eingabetaste, um vor dem Widget zu tippen.",Previous:"vorherige",Purple:"Violett",Red:"Rot",Redo:"Wiederherstellen","Remove color":"Farbe entfernen","Remove Format":"Formatierung entfernen","Resize image":"Bildgröße ändern","Resize image to %0":"Bildgröße ändern in %0","Resize image to the original size":"Bild in Originalgröße ändern","Restore default":"Standard wiederherstellen","Reversed order":"Umgekehrte Reihenfolge","Rich Text Editor":"Rich Text Editor",Ridge:"Hervorgehoben","Right aligned image":"Rechtsbündiges Bild",Row:"Zeile",Save:"Speichern","Select all":"Alles auswählen","Select column":"Spalte auswählen","Select row":"Zeile auswählen","Show more items":"Mehr anzeigen","Side image":"Seitenbild",Solid:"Durchgezogen","Split cell horizontally":"Zelle horizontal teilen","Split cell vertically":"Zelle vertikal teilen",Square:"Quadrat","Start at":"Beginnen mit","Start index must be greater than 0.":"Der Startwert muss größer als 0 sein.",Strikethrough:"Durchgestrichen",Style:"Rahmenart",Subscript:"Tiefgestellt",Superscript:"Hochgestellt","Table alignment toolbar":"Werkzeugleiste für die Tabellen-Ausrichtung","Table cell text alignment":"Ausrichtung des Zellentextes","Table properties":"Tabelleneigenschaften","Table toolbar":"Tabelle Werkzeugleiste","Text alignment":"Textausrichtung","Text alignment toolbar":"Text-Ausrichtung Toolbar","Text alternative":"Alternativtext",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"Die Farbe ist ungültig. Probieren Sie „#FF0000“ oder „rgb(255,0,0)“ oder „red“.",'The value is invalid. Try "10px" or "2em" or simply "2".':"Der Wert ist ungültig. Probieren Sie „10px“ oder „2em“ oder „2“.","This link has no URL":"Dieser Link hat keine Adresse","To-do List":"Aufgabenliste","Toggle caption off":"Tabellenüberschrift deaktivieren","Toggle caption on":"Tabellenüberschrift aktivieren","Toggle the circle list style":"Leeren Kreis einstellen","Toggle the decimal list style":"Dezimalzahlen einstellen","Toggle the decimal with leading zero list style":"Dezimalzahlen mit vorangestellten Nullen einstellen","Toggle the disc list style":"Gefüllten Kreis einstellen","Toggle the lower–latin list style":"Kleingeschriebene lateinische Buchstaben einstellen","Toggle the lower–roman list style":"Kleingeschriebene römische Zahlen einstellen","Toggle the square list style":"Quadrat einstellen","Toggle the upper–latin list style":"Großgeschriebene lateinische Buchstaben einstellen","Toggle the upper–roman list style":"Großgeschriebene römische Zahlen einstellen",Turquoise:"Türkis","Type or paste your content here.":"Hier Inhalt einfügen.","Type your title":"Titel eingeben",Underline:"Unterstrichen",Undo:"Rückgängig",Unlink:"Link entfernen",Update:"Aktualisieren","Update image URL":"Bild-URL aktualisieren","Upload failed":"Hochladen fehlgeschlagen","Upload in progress":"Upload läuft","Upper-latin":"Großgeschriebene lateinische Buchstaben","Upper-roman":"Großgeschriebene römische Zahlen","Vertical text alignment toolbar":"Werkzeugleiste für die vertikale Zellentext-Ausrichtung",White:"Weiß","Widget toolbar":"Widget Werkzeugleiste",Width:"Breite","Wrap text":"Text umfließt Bild",Yellow:"Gelb"}),N.getPluralForm=function(D){return D!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(C,N){m.exports=N()}(self,()=>(()=>{var C={4959:(w,S,p)=>{const y=p(1103),B={};for(const k of Object.keys(y))B[y[k]]=k;const v={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};w.exports=v;for(const k of Object.keys(v)){if(!("channels"in v[k]))throw new Error("missing channels property: "+k);if(!("labels"in v[k]))throw new Error("missing channel labels property: "+k);if(v[k].labels.length!==v[k].channels)throw new Error("channel and label counts mismatch: "+k);const{channels:_,labels:R}=v[k];delete v[k].channels,delete v[k].labels,Object.defineProperty(v[k],"channels",{value:_}),Object.defineProperty(v[k],"labels",{value:R})}v.rgb.hsl=function(k){const _=k[0]/255,R=k[1]/255,T=k[2]/255,O=Math.min(_,R,T),F=Math.max(_,R,T),L=F-O;let $,K;F===O?$=0:_===F?$=(R-T)/L:R===F?$=2+(T-_)/L:T===F&&($=4+(_-R)/L),$=Math.min(60*$,360),$<0&&($+=360);const J=(O+F)/2;return K=F===O?0:J<=.5?L/(F+O):L/(2-F-O),[$,100*K,100*J]},v.rgb.hsv=function(k){let _,R,T,O,F;const L=k[0]/255,$=k[1]/255,K=k[2]/255,J=Math.max(L,$,K),te=J-Math.min(L,$,K),Z=function(ee){return(J-ee)/6/te+.5};return te===0?(O=0,F=0):(F=te/J,_=Z(L),R=Z($),T=Z(K),L===J?O=T-R:$===J?O=.3333333333333333+_-T:K===J&&(O=.6666666666666666+R-_),O<0?O+=1:O>1&&(O-=1)),[360*O,100*F,100*J]},v.rgb.hwb=function(k){const _=k[0],R=k[1];let T=k[2];const O=v.rgb.hsl(k)[0],F=1/255*Math.min(_,Math.min(R,T));return T=1-.00392156862745098*Math.max(_,Math.max(R,T)),[O,100*F,100*T]},v.rgb.cmyk=function(k){const _=k[0]/255,R=k[1]/255,T=k[2]/255,O=Math.min(1-_,1-R,1-T);return[100*((1-_-O)/(1-O)||0),100*((1-R-O)/(1-O)||0),100*((1-T-O)/(1-O)||0),100*O]},v.rgb.keyword=function(k){const _=B[k];if(_)return _;let R,T=1/0;for(const L of Object.keys(y)){const $=y[L],K=(F=$,((O=k)[0]-F[0])**2+(O[1]-F[1])**2+(O[2]-F[2])**2);K.04045?((_+.055)/1.055)**2.4:_/12.92,R=R>.04045?((R+.055)/1.055)**2.4:R/12.92,T=T>.04045?((T+.055)/1.055)**2.4:T/12.92,[100*(.4124*_+.3576*R+.1805*T),100*(.2126*_+.7152*R+.0722*T),100*(.0193*_+.1192*R+.9505*T)]},v.rgb.lab=function(k){const _=v.rgb.xyz(k);let R=_[0],T=_[1],O=_[2];return R/=95.047,T/=100,O/=108.883,R=R>.008856?R**.3333333333333333:7.787*R+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,O=O>.008856?O**.3333333333333333:7.787*O+.13793103448275862,[116*T-16,500*(R-T),200*(T-O)]},v.hsl.rgb=function(k){const _=k[0]/360,R=k[1]/100,T=k[2]/100;let O,F,L;if(R===0)return L=255*T,[L,L,L];O=T<.5?T*(1+R):T+R-T*R;const $=2*T-O,K=[0,0,0];for(let J=0;J<3;J++)F=_+.3333333333333333*-(J-1),F<0&&F++,F>1&&F--,L=6*F<1?$+6*(O-$)*F:2*F<1?O:3*F<2?$+(O-$)*(.6666666666666666-F)*6:$,K[J]=255*L;return K},v.hsl.hsv=function(k){const _=k[0];let R=k[1]/100,T=k[2]/100,O=R;const F=Math.max(T,.01);return T*=2,R*=T<=1?T:2-T,O*=F<=1?F:2-F,[_,100*(T===0?2*O/(F+O):2*R/(T+R)),100*((T+R)/2)]},v.hsv.rgb=function(k){const _=k[0]/60,R=k[1]/100;let T=k[2]/100;const O=Math.floor(_)%6,F=_-Math.floor(_),L=255*T*(1-R),$=255*T*(1-R*F),K=255*T*(1-R*(1-F));switch(T*=255,O){case 0:return[T,K,L];case 1:return[$,T,L];case 2:return[L,T,K];case 3:return[L,$,T];case 4:return[K,L,T];case 5:return[T,L,$]}},v.hsv.hsl=function(k){const _=k[0],R=k[1]/100,T=k[2]/100,O=Math.max(T,.01);let F,L;L=(2-R)*T;const $=(2-R)*O;return F=R*O,F/=$<=1?$:2-$,F=F||0,L/=2,[_,100*F,100*L]},v.hwb.rgb=function(k){const _=k[0]/360;let R=k[1]/100,T=k[2]/100;const O=R+T;let F;O>1&&(R/=O,T/=O);const L=Math.floor(6*_),$=1-T;F=6*_-L,1&L&&(F=1-F);const K=R+F*($-R);let J,te,Z;switch(L){default:case 6:case 0:J=$,te=K,Z=R;break;case 1:J=K,te=$,Z=R;break;case 2:J=R,te=$,Z=K;break;case 3:J=R,te=K,Z=$;break;case 4:J=K,te=R,Z=$;break;case 5:J=$,te=R,Z=K}return[255*J,255*te,255*Z]},v.cmyk.rgb=function(k){const _=k[0]/100,R=k[1]/100,T=k[2]/100,O=k[3]/100;return[255*(1-Math.min(1,_*(1-O)+O)),255*(1-Math.min(1,R*(1-O)+O)),255*(1-Math.min(1,T*(1-O)+O))]},v.xyz.rgb=function(k){const _=k[0]/100,R=k[1]/100,T=k[2]/100;let O,F,L;return O=3.2406*_+-1.5372*R+-.4986*T,F=-.9689*_+1.8758*R+.0415*T,L=.0557*_+-.204*R+1.057*T,O=O>.0031308?1.055*O**.4166666666666667-.055:12.92*O,F=F>.0031308?1.055*F**.4166666666666667-.055:12.92*F,L=L>.0031308?1.055*L**.4166666666666667-.055:12.92*L,O=Math.min(Math.max(0,O),1),F=Math.min(Math.max(0,F),1),L=Math.min(Math.max(0,L),1),[255*O,255*F,255*L]},v.xyz.lab=function(k){let _=k[0],R=k[1],T=k[2];return _/=95.047,R/=100,T/=108.883,_=_>.008856?_**.3333333333333333:7.787*_+.13793103448275862,R=R>.008856?R**.3333333333333333:7.787*R+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,[116*R-16,500*(_-R),200*(R-T)]},v.lab.xyz=function(k){let _,R,T;R=(k[0]+16)/116,_=k[1]/500+R,T=R-k[2]/200;const O=R**3,F=_**3,L=T**3;return R=O>.008856?O:(R-.13793103448275862)/7.787,_=F>.008856?F:(_-.13793103448275862)/7.787,T=L>.008856?L:(T-.13793103448275862)/7.787,_*=95.047,R*=100,T*=108.883,[_,R,T]},v.lab.lch=function(k){const _=k[0],R=k[1],T=k[2];let O;return O=360*Math.atan2(T,R)/2/Math.PI,O<0&&(O+=360),[_,Math.sqrt(R*R+T*T),O]},v.lch.lab=function(k){const _=k[0],R=k[1],T=k[2]/360*2*Math.PI;return[_,R*Math.cos(T),R*Math.sin(T)]},v.rgb.ansi16=function(k,_=null){const[R,T,O]=k;let F=_===null?v.rgb.hsv(k)[2]:_;if(F=Math.round(F/50),F===0)return 30;let L=30+(Math.round(O/255)<<2|Math.round(T/255)<<1|Math.round(R/255));return F===2&&(L+=60),L},v.hsv.ansi16=function(k){return v.rgb.ansi16(v.hsv.rgb(k),k[2])},v.rgb.ansi256=function(k){const _=k[0],R=k[1],T=k[2];return _===R&&R===T?_<8?16:_>248?231:Math.round((_-8)/247*24)+232:16+36*Math.round(_/255*5)+6*Math.round(R/255*5)+Math.round(T/255*5)},v.ansi16.rgb=function(k){let _=k%10;if(_===0||_===7)return k>50&&(_+=3.5),_=_/10.5*255,[_,_,_];const R=.5*(1+~~(k>50));return[(1&_)*R*255,(_>>1&1)*R*255,(_>>2&1)*R*255]},v.ansi256.rgb=function(k){if(k>=232){const R=10*(k-232)+8;return[R,R,R]}let _;return k-=16,[Math.floor(k/36)/5*255,Math.floor((_=k%36)/6)/5*255,_%6/5*255]},v.rgb.hex=function(k){const _=(((255&Math.round(k[0]))<<16)+((255&Math.round(k[1]))<<8)+(255&Math.round(k[2]))).toString(16).toUpperCase();return"000000".substring(_.length)+_},v.hex.rgb=function(k){const _=k.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!_)return[0,0,0];let R=_[0];_[0].length===3&&(R=R.split("").map(O=>O+O).join(""));const T=parseInt(R,16);return[T>>16&255,T>>8&255,255&T]},v.rgb.hcg=function(k){const _=k[0]/255,R=k[1]/255,T=k[2]/255,O=Math.max(Math.max(_,R),T),F=Math.min(Math.min(_,R),T),L=O-F;let $,K;return $=L<1?F/(1-L):0,K=L<=0?0:O===_?(R-T)/L%6:O===R?2+(T-_)/L:4+(_-R)/L,K/=6,K%=1,[360*K,100*L,100*$]},v.hsl.hcg=function(k){const _=k[1]/100,R=k[2]/100,T=R<.5?2*_*R:2*_*(1-R);let O=0;return T<1&&(O=(R-.5*T)/(1-T)),[k[0],100*T,100*O]},v.hsv.hcg=function(k){const _=k[1]/100,R=k[2]/100,T=_*R;let O=0;return T<1&&(O=(R-T)/(1-T)),[k[0],100*T,100*O]},v.hcg.rgb=function(k){const _=k[0]/360,R=k[1]/100,T=k[2]/100;if(R===0)return[255*T,255*T,255*T];const O=[0,0,0],F=_%1*6,L=F%1,$=1-L;let K=0;switch(Math.floor(F)){case 0:O[0]=1,O[1]=L,O[2]=0;break;case 1:O[0]=$,O[1]=1,O[2]=0;break;case 2:O[0]=0,O[1]=1,O[2]=L;break;case 3:O[0]=0,O[1]=$,O[2]=1;break;case 4:O[0]=L,O[1]=0,O[2]=1;break;default:O[0]=1,O[1]=0,O[2]=$}return K=(1-R)*T,[255*(R*O[0]+K),255*(R*O[1]+K),255*(R*O[2]+K)]},v.hcg.hsv=function(k){const _=k[1]/100,R=_+k[2]/100*(1-_);let T=0;return R>0&&(T=_/R),[k[0],100*T,100*R]},v.hcg.hsl=function(k){const _=k[1]/100,R=k[2]/100*(1-_)+.5*_;let T=0;return R>0&&R<.5?T=_/(2*R):R>=.5&&R<1&&(T=_/(2*(1-R))),[k[0],100*T,100*R]},v.hcg.hwb=function(k){const _=k[1]/100,R=_+k[2]/100*(1-_);return[k[0],100*(R-_),100*(1-R)]},v.hwb.hcg=function(k){const _=k[1]/100,R=1-k[2]/100,T=R-_;let O=0;return T<1&&(O=(R-T)/(1-T)),[k[0],100*T,100*O]},v.apple.rgb=function(k){return[k[0]/65535*255,k[1]/65535*255,k[2]/65535*255]},v.rgb.apple=function(k){return[k[0]/255*65535,k[1]/255*65535,k[2]/255*65535]},v.gray.rgb=function(k){return[k[0]/100*255,k[0]/100*255,k[0]/100*255]},v.gray.hsl=function(k){return[0,0,k[0]]},v.gray.hsv=v.gray.hsl,v.gray.hwb=function(k){return[0,100,k[0]]},v.gray.cmyk=function(k){return[0,0,0,k[0]]},v.gray.lab=function(k){return[k[0],0,0]},v.gray.hex=function(k){const _=255&Math.round(k[0]/100*255),R=((_<<16)+(_<<8)+_).toString(16).toUpperCase();return"000000".substring(R.length)+R},v.rgb.gray=function(k){return[(k[0]+k[1]+k[2])/3/255*100]}},841:(w,S,p)=>{const y=p(4959),B=p(9325),v={};Object.keys(y).forEach(k=>{v[k]={},Object.defineProperty(v[k],"channels",{value:y[k].channels}),Object.defineProperty(v[k],"labels",{value:y[k].labels});const _=B(k);Object.keys(_).forEach(R=>{const T=_[R];v[k][R]=function(O){const F=function(...L){const $=L[0];if($==null)return $;$.length>1&&(L=$);const K=O(L);if(typeof K=="object")for(let J=K.length,te=0;te1&&(L=$),O(L))};return"conversion"in O&&(F.conversion=O.conversion),F}(T)})}),w.exports=v},9325:(w,S,p)=>{const y=p(4959);function B(_){const R=function(){const O={},F=Object.keys(y);for(let L=F.length,$=0;${w.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8603:(w,S,p)=>{p.d(S,{Z:()=>_});var y=p(1799),B=p.n(y),v=p(2609),k=p.n(v)()(B());k.push([w.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}","",{version:3,sources:["webpack://./../ckeditor5-basic-styles/theme/code.css"],names:[],mappings:"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD",sourcesContent:[`/* +(function(Ve,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@viur/vue-utils"),require("pinia"),require("@viur/viur-shop-client"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@viur/vue-utils","pinia","@viur/viur-shop-client","vue-router"],h):(Ve=typeof globalThis<"u"?globalThis:Ve||self,h(Ve.ViurShopComponents={},Ve.Vue,Ve.ViurVueUtils,Ve.Pinia,Ve.ViurShopClient))})(this,function(Ve,h,Ft,or,Yf){"use strict";var oB=Object.defineProperty;var iB=(Ve,h,Ft)=>h in Ve?oB(Ve,h,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Ve[h]=Ft;var Jf=(Ve,h,Ft)=>iB(Ve,typeof h!="symbol"?h+"":h,Ft);const de=(m,x)=>{const C=m.__vccOpts||m;for(const[N,D]of x)C[N]=D;return C},ir={props:{size:{type:String,default:"2"},active:{type:Boolean,default:!0},logo:{default:"logo-cube.svg",type:String},color:{default:"var(--sl-color-primary-500)",type:String}},setup(m,x){const C=h.reactive({trackWidth:h.computed(()=>`${m.size/30}rem`),outerSize:h.computed(()=>`calc(${m.size}rem + ${C.trackWidth})`),spinnerSize:h.computed(()=>`${m.size}rem`),logoSize:h.computed(()=>`calc(${m.size}rem - ${C.trackWidth} * 10)`),shadow:h.computed(()=>`0px 0px ${m.size/6}rem 0 color-mix(in hsl, var(--sl-color-neutral-1000), 80% transparent)`)});return{state:C}}},Ha=()=>{h.useCssVars(m=>({"93747d92":m.state.outerSize,"284424e5":m.state.shadow,"6485ca5e":m.state.logoSize,"5d833915":m.state.spinnerSize,d5b3feca:m.color,"2050b700":m.state.trackWidth}))},qa=ir.setup;ir.setup=qa?(m,x)=>(Ha(),qa(m,x)):Ha;const Qf=m=>(h.pushScopeId("data-v-46c45785"),m=m(),h.popScopeId(),m),Xf={key:0,class:"loading"},ek=Qf(()=>h.createElementVNode("sl-spinner",{class:"loader"},null,-1)),tk={class:"logo"},nk=["src"];function ok(m,x,C,N,D,M){return h.openBlock(),h.createBlock(h.Transition,null,{default:h.withCtx(()=>[C.active?(h.openBlock(),h.createElementBlock("div",Xf,[ek,h.createElementVNode("div",tk,[h.createElementVNode("sl-icon",{src:C.logo},null,8,nk)])])):h.createCommentVNode("",!0)]),_:1})}const ik=de(ir,[["render",ok],["__scopeId","data-v-46c45785"]]),vn=or.defineStore("cartstore",()=>{const m=new Yf.ViURShopClient({host_url:window.location.origin==="http://localhost:8081"?"http://localhost:8080":window.location.origin}),x=h.reactive({basketRootNode:{},whishlistRootNodes:[],children:{},structure:{address:{},cart:{}}});async function C(){await D()}async function N(B){return await m.cart_list({cart_key:B})}async function D(){(await m.cart_list()).forEach(v=>{v.is_root_node&&(v.cart_type==="basket"?x.basketRootNode=v:x.whishlistRootNodes.push(v))})}async function M(B,v){let k=await m.article_add({article_key:B,parent_cart_key:v});console.log("addToCart",k)}async function w(B,v){let k=await m.article_view({article_key:B,parent_cart_key:v});console.log("getArticleView",k)}async function S(B,v){let k=await m.article_remove({article_key:B,parent_cart_key:v});console.log("remove Resp",k)}async function p(B,v,k){let _=await m.article_update({article_key:B,parent_cart_key:v,quantity:k,quantity_mode:"replace"});console.log("update Resp",_)}async function y(){let B=await m.address_structure();x.structure.address=B.addSkel,console.log("adress add",x.structure.address)}return{state:x,addToCart:M,getArticleView:w,removeItem:S,updateItem:p,init:C,getAdressStructure:y,getChildren:N}}),rk={__name:"CartNode",props:{node:{type:Object,required:!0}},setup(m){return h.reactive({}),(x,C)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createTextVNode(" cartnode "),h.createElementVNode("pre",null,h.toDisplayString(m.node.name),1)],64))}},io=m=>(h.pushScopeId("data-v-0e24135f"),m=m(),h.popScopeId(),m),sk={horizontal:"",class:"viur-shop-cart-card"},ak=["src"],lk={class:"viur-shop-cart-card-header",slot:"header"},ck={class:"viur-shop-cart-card-headline headline"},dk={class:"viur-shop-cart-card-body-row"},hk={class:"viur-shop-cart-card-body-info"},uk=io(()=>h.createElementVNode("div",{class:"viur-shop-cart-card-descr"},[h.createTextVNode(" Version: 900x900x2000 "),h.createElementVNode("br"),h.createTextVNode(" Farbe: Chromoptik "),h.createElementVNode("br"),h.createTextVNode(" Glasart: Klar hell mit Edelglasbeschichtung"),h.createElementVNode("br"),h.createTextVNode(" Anschlag: Beidseitig variabel"),h.createElementVNode("br"),h.createTextVNode(" Griff: Stangengriff Exklusiv (56) ")],-1)),mk={class:"viur-shop-cart-card-body-footer"},gk=io(()=>h.createElementVNode("sl-button",{size:"small",outline:"",class:"viur-shop-cart-card-add-to-favourites-btn",variant:"primary",title:"Add to favourites"},[h.createElementVNode("sl-icon",{name:"heart",slot:"prefix"})],-1)),pk=[io(()=>h.createElementVNode("sl-icon",{name:"trash",slot:"prefix"},null,-1))],fk={class:"viur-shop-cart-card-body-amount"},kk={class:"viur-shop-cart-card-price-wrap",slot:"footer"},bk=io(()=>h.createElementVNode("div",{class:"viur-shop-cart-card-price-label"},"Preis",-1)),wk={class:"viur-shop-cart-card-price"},Ak=io(()=>h.createElementVNode("div",{class:"viur-shop-cart-card-small-print"},"Brutto / Stk.",-1)),_k=de({__name:"CartLeaf",props:{leaf:{type:Object,required:!0},node:{type:Object,required:!0}},emits:["updateItem","removeItem"],setup(m,{emit:x}){const C=m,N=x,D=h.reactive({leaf:{}});function M(p){return p!==void 0?Ft.Request.downloadUrlFor(p):"https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"}function w(p,y,B,v){N("updateItem",{item:p,articleKey:y,node:B,quantity:v})}function S(p,y,B){N("removeItem",{item:p,articleKey:y,node:B})}return h.onBeforeMount(()=>{D.leaf=C.leaf}),(p,y)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createTextVNode(" cartleafe "),h.createElementVNode("sl-card",sk,[h.createElementVNode("img",{class:"viur-shop-cart-card-img",slot:"image",src:M(D.leaf.shop_image?D.leaf.shop_image:void 0)},null,8,ak),h.createElementVNode("div",lk,[h.createElementVNode("h4",ck,h.toDisplayString(D.leaf.shop_name)+" | "+h.toDisplayString(m.leaf.shop_art_no_or_gtin),1)]),h.createElementVNode("div",dk,[h.createElementVNode("div",hk,[uk,h.createElementVNode("div",mk,[gk,h.createElementVNode("sl-button",{size:"small",outline:"",class:"viur-shop-cart-card-delete-btn",variant:"primary",title:"Remove from cart",onClick:y[0]||(y[0]=B=>S(D.leaf,D.leaf.article.dest.key,m.node))},pk)])]),h.createElementVNode("div",fk,[h.withDirectives(h.createElementVNode("sl-input",{class:"amount-input",type:"number",label:"Anzahl",placeholder:"Number",min:"0","onUpdate:modelValue":y[1]||(y[1]=B=>D.leaf.quantity=B),onInput:y[2]||(y[2]=B=>w(D.leaf,D.leaf.article.dest.key,m.node,D.leaf.quantity))},null,544),[[h.vModelText,D.leaf.quantity]])]),h.createElementVNode("div",kk,[bk,h.createElementVNode("div",wk,h.toDisplayString(D.leaf.price.retail)+" € ",1),Ak])])])],64))}},[["__scopeId","data-v-0e24135f"]]),gt=m=>(h.pushScopeId("data-v-7aae4815"),m=m(),h.popScopeId(),m),Ck={key:0},vk=gt(()=>h.createElementVNode("p",null,"Möchten Sie den Artikel wirklich aus dem Warenkorb entfernen?",-1)),yk={class:"footer-wrap",slot:"footer"},Ek={key:0},xk=gt(()=>h.createElementVNode("h2",{class:"viur-shop-cart-sidebar-headline headline"},"Zusammenfassung",-1)),Sk=gt(()=>h.createElementVNode("br",null,null,-1)),Dk=gt(()=>h.createElementVNode("sl-input",{label:"Rabattcode eingeben"},null,-1)),Bk=gt(()=>h.createElementVNode("br",null,null,-1)),Tk={class:"viur-shop-cart-sidebar-info-line"},Ik=gt(()=>h.createElementVNode("span",null,"Zwischensumme",-1)),Pk=gt(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Rabatt"),h.createTextVNode(" 0 € ")],-1)),Rk=gt(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Versandkosten"),h.createTextVNode(" 0 € ")],-1)),Ok={class:"viur-shop-cart-sidebar-info-line total"},Nk=gt(()=>h.createElementVNode("span",null,"Gesamt:",-1)),zk=gt(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-btn-wrap"},[h.createElementVNode("sl-button",{variant:"info",size:"small"}," Jetzt Bestellen "),h.createElementVNode("sl-button",{size:"small",variant:"primary"},[h.createElementVNode("sl-icon",{name:"paypal",slot:"prefix"}),h.createTextVNode(" Paypal ")])],-1)),rr=de({__name:"CartView",props:{mode:{type:String,default:"basket"},cartKey:{type:String,required:!0},sidebar:{type:Boolean,default:!0}},setup(m){const x=m,C=vn(),N=h.ref(null),D=h.reactive({cartIsInit:h.computed(()=>!!C.state.basketRootNode),itemsIsInit:h.computed(()=>!0),images:{},currentItem:{},currentNode:{},nodes:[],leaves:{}});h.computed(()=>x.mode==="basket"?C.state.basket:x.cartKey);async function M(){await C.updateItem(D.currentItem.article.dest.key,D.currentNode.key,0),await y(),N.value.hide()}async function w(v){console.log("updateItem :",v),v.quantity===0?(N.value.show(),D.currentItem=v.item,D.currentNode=v.node):(await C.updateItem(v.articleKey,v.node.key,v.quantity),await C.init())}function S(v){console.log("removeItem :",v),N.value.show(),D.currentItem=v.item,D.currentNode=v.node}async function p(){D.leaves[D.currentNode.key].forEach(v=>{v.key===D.currentItem.key&&(v.quantity=1)}),D.currentItem={},D.currentNode={}}async function y(){D.nodes=[],D.leaves={},await C.init(),await B()}async function B(v=x.cartKey){console.log("debug getChildren parentKey from comp: ",v);const k=await C.getChildren(v);console.log("getChildren children: ",k),k.forEach(async _=>{_.skel_type==="node"?(D.nodes.push(_),await B(_.key)):(Object.keys(D.leaves).includes(v)||(D.leaves[v]=[]),D.leaves[v].push(_))})}return h.onBeforeMount(async()=>{await C.init(),await B(),x.mode==="basket"&&D.nodes.push(C.state.basketRootNode),console.log("state.nodes test",D.nodes),console.log("state.leaves",D.leaves)}),(v,k)=>m.cartKey.length?(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[h.createElementVNode("sl-dialog",{ref_key:"confirm",ref:N,onSlHide:p},[vk,h.createElementVNode("div",yk,[h.createElementVNode("sl-button",{variant:"danger",onClick:k[0]||(k[0]=_=>N.value.hide()),size:"medium"}," Abbrechen "),h.createElementVNode("sl-button",{variant:"success",onClick:M,size:"medium"}," Aus Warenkorb entfernen ")])],544),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(D.nodes,_=>(h.openBlock(),h.createElementBlock("div",null,[Object.keys(D.leaves).includes(_.key)?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createVNode(rk,{node:_},null,8,["node"]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(D.leaves[_.key],R=>(h.openBlock(),h.createBlock(_k,{key:R.key,leaf:R,node:_,onRemoveItem:S,onUpdateItem:w},null,8,["leaf","node"]))),128))],64)):h.createCommentVNode("",!0)]))),256)),m.sidebar?(h.openBlock(),h.createElementBlock("div",Ek,[xk,Sk,Dk,Bk,h.createElementVNode("div",Tk,[Ik,h.createTextVNode(" --> "+h.toDisplayString(m.mode==="basket"?h.unref(C).state.basketRootNode.total:h.unref(C).state.whishlistRootNodes[m.cartKey].total)+" € ",1)]),Pk,Rk,h.createElementVNode("div",Ok,[Nk,h.createTextVNode(" "+h.toDisplayString(m.mode==="basket"?h.unref(C).state.basketRootNode.total:h.unref(C).state.whishlistRootNodes[m.cartKey].total)+" € ",1)]),zk])):h.createCommentVNode("",!0)],64)):(h.openBlock(),h.createElementBlock("sl-spinner",Ck))}},[["__scopeId","data-v-7aae4815"]]),Ke=m=>(h.pushScopeId("data-v-75e70e9a"),m=m(),h.popScopeId(),m),Mk={key:1,class:"list"},Fk=Ke(()=>h.createElementVNode("h2",{class:"viur-shop-cart-headline headline"},"Bestellung prüfen",-1)),Vk=Ke(()=>h.createElementVNode("br",null,null,-1)),Lk=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-address-wrap"},[h.createElementVNode("div",{class:"viur-shop-cart-address"},[h.createElementVNode("div",{class:"viur-shop-cart-address-headline"},[h.createTextVNode(" Versandadresse "),h.createElementVNode("sl-button",{outline:"",size:"small"},[h.createElementVNode("sl-icon",{name:"pencil",slot:"prefix"})])]),h.createTextVNode(" Roland Brose"),h.createElementVNode("br"),h.createTextVNode(" Speicherstraße 33"),h.createElementVNode("br"),h.createTextVNode(" 44147 Dortmund, DE"),h.createElementVNode("br"),h.createElementVNode("br"),h.createTextVNode(" rb@mausbrand.de"),h.createElementVNode("br"),h.createTextVNode(" 0231 21 34 68 90 ")]),h.createElementVNode("div",{class:"viur-shop-cart-address"},[h.createElementVNode("div",{class:"viur-shop-cart-address-headline"},[h.createTextVNode(" Rechnungsadresse "),h.createElementVNode("sl-button",{outline:"",size:"small"},[h.createElementVNode("sl-icon",{name:"pencil",slot:"prefix"})])]),h.createTextVNode(" Roland Brose"),h.createElementVNode("br"),h.createTextVNode(" Speicherstraße 33"),h.createElementVNode("br"),h.createTextVNode(" 44147 Dortmund, DE"),h.createElementVNode("br"),h.createElementVNode("br"),h.createTextVNode(" rb@mausbrand.de"),h.createElementVNode("br"),h.createTextVNode(" 0231 21 34 68 90 ")])],-1)),jk=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-payment"},[h.createElementVNode("div",{class:"viur-shop-cart-payment-method"},[h.createElementVNode("span",null,"Zahlungsmethode:"),h.createTextVNode(" Paypal ")]),h.createElementVNode("sl-button",{outline:"",size:"small"},[h.createElementVNode("sl-icon",{name:"pencil",slot:"prefix"})])],-1)),$k=Ke(()=>h.createElementVNode("h2",{class:"viur-shop-cart-headline headline"},"Warenkorb",-1)),Hk=Ke(()=>h.createElementVNode("br",null,null,-1)),qk={horizontal:"",class:"viur-shop-cart-mini-card"},Uk=["src"],Wk={class:"viur-shop-cart-mini-cart-header",slot:"header"},Kk={class:"viur-shop-cart-mini-headline headline"},Gk={class:"viur-shop-cart-mini-card-body-row"},Zk={class:"viur-shop-cart-mini-card-body-info"},Jk={class:"viur-shop-cart-mini-card-info-wrap"},Yk=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-mini-card-info"},[h.createElementVNode("span",null,"Anzahl: "),h.createTextVNode(" 1 ")],-1)),Qk={class:"viur-shop-cart-mini-card-info"},Xk=Ke(()=>h.createElementVNode("span",null,"Preis: ",-1)),eb=Ke(()=>h.createElementVNode("h2",{class:"viur-shop-cart-sidebar-headline headline"},"Jetzt Bestellen",-1)),tb=Ke(()=>h.createElementVNode("br",null,null,-1)),nb={class:"viur-shop-cart-sidebar-info-line"},ob=Ke(()=>h.createElementVNode("span",null,"Zwischensumme",-1)),ib=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Rabatt"),h.createTextVNode(" 0 € ")],-1)),rb=Ke(()=>h.createElementVNode("div",{class:"viur-shop-cart-sidebar-info-line"},[h.createElementVNode("span",null,"Versandkosten"),h.createTextVNode(" 0 € ")],-1)),sb={class:"viur-shop-cart-sidebar-info-line total"},ab=Ke(()=>h.createElementVNode("span",null,"Gesamt:",-1)),lb={class:"viur-shop-cart-sidebar-btn-wrap"},cb=["variant","disabled"],sr=de({__name:"ConfirmView",setup(m){const x=vn(),C=h.reactive({cartIsInit:h.computed(()=>!!x.state.basket.length),itemsIsInit:h.computed(()=>!!x.state.carts[x.state.basket].items),images:{},showOrderButton:!1});function N(M){return Ft.Request.get(`/json/dk_variante/view/${M}`).then(async w=>{let S=await w.json();S=S.values;let p=S.dk_artikel.dest.image?Ft.Request.downloadUrlFor(S.dk_artikel.dest.image):"https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";C.images[M]=p}),C.images[M]}function D(M){M.target.checked&&(C.showOrderButton=!0),M.target.checked||(C.showOrderButton=!1)}return h.onBeforeMount(async()=>{await x.init()}),(M,w)=>C.cartIsInit?(h.openBlock(),h.createElementBlock("div",Mk,[Fk,Vk,Lk,jk,$k,Hk,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(h.unref(x).state.carts[h.unref(x).state.basket].items,S=>(h.openBlock(),h.createElementBlock("sl-card",qk,[h.createElementVNode("img",{class:"viur-shop-cart-mini-card-img",slot:"image",src:N(S.article.dest.key)},null,8,Uk),h.createElementVNode("div",Wk,[h.createElementVNode("h4",Kk,h.toDisplayString(S.article.dest.shop_name)+" | 425018",1)]),h.createElementVNode("div",Gk,[h.createElementVNode("div",Zk,[h.createElementVNode("div",Jk,[Yk,h.createElementVNode("div",Qk,[Xk,h.createTextVNode(" "+h.toDisplayString(S.article.dest.shop_price_recommended)+" € ",1)])])])])]))),256)),(h.openBlock(),h.createBlock(h.Teleport,{to:"#order_sidebar"},[eb,tb,h.createElementVNode("div",nb,[ob,h.createTextVNode(" "+h.toDisplayString(h.unref(x).state.carts[h.unref(x).state.basket].info.total)+" € ",1)]),ib,rb,h.createElementVNode("div",sb,[ab,h.createTextVNode(" "+h.toDisplayString(h.unref(x).state.carts[h.unref(x).state.basket].info.total)+" € ",1)]),h.createElementVNode("sl-checkbox",{onSlChange:D}," Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen ",32),h.createElementVNode("div",lb,[h.createElementVNode("sl-button",{variant:C.showOrderButton?"info":"disabled",size:"small",disabled:!C.showOrderButton}," Zahlungspflichtig bestellen ",8,cb)])]))])):(h.openBlock(),h.createBlock(ik,{key:0}))}},[["__scopeId","data-v-75e70e9a"]]),db=m=>(h.pushScopeId("data-v-61488015"),m=m(),h.popScopeId(),m),hb={class:"bind viur-shop-wrap"},ub=["panel","disabled"],mb={class:"viur-shop-order-step"},gb=["name","library"],pb={class:"viur-shop-order-status-text"},fb={key:0,name:"chevron-right",class:"viur-shop-order-tab-check"},kb=["name"],bb=["onClick"],wb=["onClick"],Ab=db(()=>h.createElementVNode("div",{class:"viur-shop-sidebar",id:"order_sidebar"},null,-1)),_b=de({__name:"OrderView",props:{tabs:{type:Object,required:!0}},emits:["tabChange"],setup(m,{emit:x}){const C=m,N=x,D=h.reactive({tabNames:h.computed(()=>w(C.tabs)),isFirstTab:B=>B===0}),M=h.ref(null);function w(B){let v=[],k=[];for(const _ in B)B[_].position?v.push([_,B[_].position]):v.push([_,0]);return v.sort((_,R)=>_[1]-R[1]),v.forEach(_=>{k.push(_[0])}),k}function S(B){N("tabChange",B)}function p(B){M.value.show(B)}function y(B){M.value.show(B)}return(B,v)=>(h.openBlock(),h.createElementBlock("div",hb,[h.createElementVNode("sl-tab-group",{class:"viur-shop-order-tab",noScrollControls:"",onSlTabShow:S,ref_key:"tabGroup",ref:M},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(D.tabNames,(k,_)=>(h.openBlock(),h.createElementBlock("sl-tab",{slot:"nav",panel:k,key:k,disabled:m.tabs[k].disabled},[h.createElementVNode("div",mb,[h.createElementVNode("sl-icon",{name:m.tabs[k].icon.name,library:m.tabs[k].icon.library},null,8,gb),h.createElementVNode("div",pb,h.toDisplayString(_+1)+". "+h.toDisplayString(m.tabs[k].displayName),1)]),_(h.openBlock(),h.createElementBlock("sl-tab-panel",{name:k,key:k},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.tabs[k].component),h.mergeProps({ref_for:!0},m.tabs[k].props?m.tabs[k].props:""),null,16)),_!==D.tabNames.length-1?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["viur-shop-form-footer",{"flex-end":D.isFirstTab(_)}])},[h.withDirectives(h.createElementVNode("sl-button",{type:"submit",onClick:R=>p(D.tabNames[_-1])}," Zurück ",8,bb),[[h.vShow,_!==0]]),h.createElementVNode("sl-button",{type:"submit",variant:"primary",onClick:R=>y(D.tabNames[_+1])}," Weiter ",8,wb)],2)):h.createCommentVNode("",!0)],8,kb))),128))],544),Ab]))}},[["__scopeId","data-v-61488015"]]),Cb={},jo=m=>(h.pushScopeId("data-v-36ccc280"),m=m(),h.popScopeId(),m),vb={class:"bind"},yb=[jo(()=>h.createElementVNode("h1",{class:"headline"},"Vielen Dank für Ihre Bestellung",-1)),jo(()=>h.createElementVNode("br",null,null,-1)),jo(()=>h.createElementVNode("p",{class:"paragraph"},[h.createElementVNode("strong",null,"Ihre Bestellnummer:"),h.createTextVNode(" 123345670 ")],-1)),jo(()=>h.createElementVNode("p",{class:"paragraph"},[h.createTextVNode(" Wir haben Ihre Bestellung erhalten und werden diese schenllstmöglich bearbeiten."),h.createElementVNode("br"),h.createTextVNode(" Sie erhalten in wenigen Minuten eine Bestätigung per E-Mail. "),h.createElementVNode("div",{class:"btn-wrap"},[h.createElementVNode("sl-button",{size:"medium"}," Zur Startseite "),h.createElementVNode("sl-button",{variant:"primary",size:"medium"}," Weiter Einkaufen ")])],-1))];function Eb(m,x){return h.openBlock(),h.createElementBlock("div",vb,yb)}const xb=de(Cb,[["render",Eb],["__scopeId","data-v-36ccc280"]]),Sb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({});function D(M){x.emit("change",m.name,M.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Db=["disabled","value"],Bb=["disabled","value"];function Tb(m,x,C,N,D,M){var w,S;return m.boneState.bonestructure.type==="raw.json"?(h.openBlock(),h.createElementBlock("sl-textarea",{key:0,disabled:(w=m.boneState)==null?void 0:w.readonly,value:JSON.stringify(m.value),onInput:x[0]||(x[0]=(...p)=>m.changeEvent&&m.changeEvent(...p))},null,40,Db)):(h.openBlock(),h.createElementBlock("sl-textarea",{key:1,disabled:(S=m.boneState)==null?void 0:S.readonly,value:m.value,onInput:x[1]||(x[1]=(...p)=>m.changeEvent&&m.changeEvent(...p))},null,40,Bb))}const ar=de(Sb,[["render",Tb],["__scopeId","data-v-0ebe5f0b"]]),Ib=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.reactive({});function N(D){x.emit("change",m.name,D.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:C,changeEvent:N}}}),Pb=["value"];function Rb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{disabled:"",value:m.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Pb)}const Ua=de(Ib,[["render",Rb],["__scopeId","data-v-b45a1311"]]);function Ob(m){return h.getCurrentScope()?(h.onScopeDispose(m),!0):!1}function Nb(m){return typeof m=="function"?m():h.unref(m)}const zb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function $o(m,x,C={}){const{immediate:N=!0}=C,D=h.ref(!1);let M=null;function w(){M&&(clearTimeout(M),M=null)}function S(){D.value=!1,w()}function p(...y){w(),D.value=!0,M=setTimeout(()=>{D.value=!1,M=null,m(...y)},Nb(x))}return N&&(D.value=!0,zb&&p()),Ob(S),{isPending:h.readonly(D),start:p,stop:S}}class Mb{static objectEmpty(x){return Object.keys(x).length===0&&x.constructor===Object}static getDescr(x,C){try{return x.values.filter(N=>N[0]===C)[0][1]}catch{return"-"}}static unescape(x){return x||(x=""),String(x).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/(/g,"(").replace(/)/g,")").replace(/=/g,"=").replace(/'/g,"'").replace(/(/g,"(").replace(/)/g,")").replace(/=/g,"=")}static formatString(x,C){function N(w){let S=[],p=[],y=/\$\((.*?)\)/g;for(;p;){if(p=y.exec(w),!p){p=!1;continue}S.push(p[1])}return S}let D=N(x),M=[];Array.isArray(C)||(C=[C]);for(let w of C){let S=x;for(let p of D){let y=p.split("."),B=w;for(let v of y)B&&B!=="-"&&v in B&&B[v]?B=B[v]:B="-";B=this.unescape(B),S=S.replace("$("+p+")",B)}M.push(S)}return M.join(", ")}}const Fb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>m.value)}),D=h.ref(null);function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index)}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:w}=$o(()=>{D.value.focus()},600);w()}}),h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,Utils:Mb,boneState:C,changeEvent:M,stringBone:D}}}),Vb=["disabled","value","required"];function Lb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{ref:"stringBone",disabled:m.boneState.readonly,value:m.Utils.unescape(m.value),required:m.boneState.bonestructure.required,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onKeyup:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Vb)}const Wa=de(Fb,[["render",Lb],["__scopeId","data-v-1ccbacc0"]]),jb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({}),D=h.ref(null);function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index)}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:w}=$o(()=>{D.value.focus()},600);w()}}),h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:M,emailBone:D}}}),$b=["disabled","value"];function Hb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{ref:"emailBone",disabled:m.boneState.readonly,type:"email",value:m.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,$b)}const Ka=de(jb,[["render",Hb],["__scopeId","data-v-4328e024"]]),qb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>{var w;let M=m.value;return C.bonestructure.time?M=(w=m.value)==null?void 0:w.split("+")[0]:m.value&&(M=new Date(m.value).toISOString().substr(0,10)),M}),typeString:h.computed(()=>{let M="datetime-local";return C.bonestructure.time||(M="date"),M})});function D(M){x.emit("change",m.name,M.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Ub=["disabled","type","value"];function Wb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-input",{disabled:m.boneState.readonly,type:m.state.typeString,value:m.state.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Ub)}const Ga=de(qb,[["render",Wb],["__scopeId","data-v-f1b8af8c"]]),Kb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:null,index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>{let w=m.value;return Array.isArray(m.value)?(C.bonestructure.values instanceof Array?w=w.filter(S=>C.bonestructure.values.map(p=>p[0].toString()).includes(S)):w=w.filter(S=>Object.keys(C.bonestructure.values).map(p=>p.toString()).includes(S)),w.map(S=>S.toString())):m.value?m.value.toString():""})});function D(){if(Array.isArray(C.bonestructure.values))return C.bonestructure.values;{let w=[];for(const[S,p]of Object.entries(C.bonestructure.values))w.push([S,p]);return w}}function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index),W}return h.onMounted(()=>{x.emit("change",m.name,N.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:M,convertObjToList:D}}}),Gb=["disabled","value","multiple"],Zb=["value"];function Jb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-select",{disabled:m.boneState.readonly,value:m.state.value,hoist:"",multiple:m.boneState.bonestructure.multiple,"max-options-visible":"0",clearable:"",onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.convertObjToList(),w=>(h.openBlock(),h.createElementBlock("sl-option",{key:w[0],value:w[0]},h.toDisplayString(w[1]),9,Zb))),128))],40,Gb)}const Za=de(Kb,[["render",Jb],["__scopeId","data-v-5a38b97f"]]),Yb=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>![!1,null,void 0,""].includes(m.value))});function D(M){x.emit("change",m.name,M.target.checked,m.lang,m.index)}return h.onMounted(()=>{let M=m.value;M||(M=!1),x.emit("change",m.name,M,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Qb=["disabled","checked"];function Xb(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-switch",{disabled:m.boneState.readonly,checked:m.state.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,Qb)}const Ja=de(Yb,[["render",Xb],["__scopeId","data-v-363598c8"]]),ew=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value1:"",value2:null,equal:!1,passwordInfo:[],requiredPasswordInfo:[]}),D=h.ref(null);function M(S){N.value1===N.value2?N.equal=!0:N.equal=!1,w(N.value1),N.requiredPasswordInfo.length===0&&N.passwordInfo.length-N.requiredPasswordInfo.length<=C.bonestructure.test_threshold?x.emit("change",m.name,N.value1,m.lang,m.index,!0):x.emit("change",m.name,N.value1,m.lang,m.index,!1)}h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)});function w(S){N.passwordInfo=[],N.requiredPasswordInfo=[];for(const p of C.bonestructure.tests)new RegExp(p[0]).test(S)||(p[2]?N.requiredPasswordInfo.push(p[1]):N.passwordInfo.push(p[1]));N.equal||N.requiredPasswordInfo.push("Die eingegebenen Passwörter stimmen nicht überein."),N.value1||N.requiredPasswordInfo.push("Das eingegebene Passwort ist leer.")}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:S}=$o(()=>{D.value.focus()},600);S()}}),h.watch(()=>m.value,(S,p)=>{N.value1=S}),{state:N,boneState:C,changeEvent:M,passwordBone:D}}}),tw=["disabled"],nw=["name"],ow=["name"],iw={class:"errors"};function rw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.withDirectives(h.createElementVNode("sl-input",{ref:"passwordBone","onUpdate:modelValue":x[0]||(x[0]=w=>m.state.value1=w),disabled:m.boneState.readonly,class:h.normalizeClass({"has-check":!m.boneState.readonly}),type:"password",clearable:"","password-toggle":"true",onSlChange:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onSlClear:x[2]||(x[2]=w=>m.state.value1=""),onKeyup:x[3]||(x[3]=(...w)=>m.changeEvent&&m.changeEvent(...w))},[h.createElementVNode("sl-icon",{slot:"suffix",name:m.state.equal&&m.state.value1.length?"check":"x"},null,8,nw)],42,tw),[[h.vModelText,m.state.value1]]),m.boneState.readonly?h.createCommentVNode("",!0):h.withDirectives((h.openBlock(),h.createElementBlock("sl-input",{key:0,"onUpdate:modelValue":x[4]||(x[4]=w=>m.state.value2=w),class:"password-check",type:"password",clearable:"","password-toggle":"true",onSlChange:x[5]||(x[5]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onSlClear:x[6]||(x[6]=w=>m.state.value2=""),onKeyup:x[7]||(x[7]=(...w)=>m.changeEvent&&m.changeEvent(...w))},[h.createElementVNode("sl-icon",{slot:"suffix",name:m.state.equal&&m.state.value1.length?"check":"x"},null,8,ow)],544)),[[h.vModelText,m.state.value2]]),h.createElementVNode("ul",iw,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.passwordInfo,(w,S)=>(h.openBlock(),h.createElementBlock("li",{key:S},h.toDisplayString(w),1))),128)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.requiredPasswordInfo,(w,S)=>(h.openBlock(),h.createElementBlock("li",{key:S,class:"requiredInfo"},h.toDisplayString(w),1))),128))])],64)}const Ya=de(ew,[["render",rw],["__scopeId","data-v-0ccf18c0"]]),sw=h.defineComponent({props:{name:String,value:null,index:Number,lang:String,readonly:Boolean,params:Object},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:h.computed(()=>m.value),structure:h.computed(()=>w(C.bonestructure.using)),globalRegistration:!1,formGroups:h.computed(()=>{var y,B;let S={default:{name:"Allgemein",bones:[],groupVisible:!1,groupOpen:!0}};for(const[v,k]of Object.entries(N.structure)){let _="default",R=N.structure[v],T=(y=N.value)==null?void 0:y[v];(B=k==null?void 0:k.params)!=null&&B.category&&(_=k.params.category.toLowerCase()),Object.keys(S).includes(_)?S[_].bones.push({boneName:v,boneStructure:R,boneValue:T}):S[_]={name:k.params.category,bones:[{boneName:v,boneStructure:R,boneValue:T}]},R.visible===!0&&(S[_].groupVisible=!0)}let p={};return Object.keys(S).sort().forEach(function(v){p[v]=S[v]}),p})});function D(S){x.emit("change",S)}h.onMounted(()=>{h.getCurrentInstance().appContext.components.Bone?N.globalRegistration=!0:N.globalRegistration=!1,x.emit("change",m.name,m.value,m.lang,m.index)});function M(S){console.log(S)}function w(S){if(Array.isArray(S)){let p={};for(const y in S)p[S[y][0]]=S[y][1];return p}else return S}return{state:N,boneState:C,getBoneWidget:Yt,structureToDict:w,changeEvent:D,updateValue:M}}}),aw={key:0,open:"",variant:"danger"},lw={key:1,class:"form"},cw=["summary","open"];function dw(m,x,C,N,D,M){const w=h.resolveComponent("bone");return m.state.globalRegistration?(h.openBlock(),h.createElementBlock("div",lw,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.formGroups,(S,p)=>h.withDirectives((h.openBlock(),h.createElementBlock("sl-details",{key:p,summary:S.name,open:S.groupOpen},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(S.bones,y=>h.withDirectives((h.openBlock(),h.createBlock(w,{key:y.name,is:m.getBoneWidget(m.state.structure[y.boneName].type),name:y.boneName,structure:m.state.structure,skel:m.state.value,errors:m.boneState.errors,readonly:m.boneState.bonestructure.readonly?!0:void 0,onChangeInternal:m.changeEvent},null,8,["is","name","structure","skel","errors","readonly","onChangeInternal"])),[[h.vShow,m.state.structure[y.boneName].visible]])),128))],8,cw)),[[h.vShow,S.groupVisible]])),128))])):(h.openBlock(),h.createElementBlock("sl-alert",aw," In Order to use this Bone register the bone component globally in your main file "))}const Qa=de(sw,[["render",dw],["__scopeId","data-v-e6fcfbca"]]),hw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:null,index:Number,lang:String},components:{Wrapper_nested:Qa},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:{},index:h.computed(()=>m.index),lang:h.computed(()=>m.lang)});function D(M){var S;(S=N.value)!=null&&S[M.name]||(N.value?N.value[M.name]=null:N.value={[M.name]:null});let w=N.value[M.name];M.lang?(w===null&&(w={}),Object.keys(w).includes(M.lang)&&M.index!==null?w[M.lang][M.index]=M.value:w[M.lang]=M.value):M.index!==null?(w===null&&(w=[]),w[M.index]=M.value):w=M.value,N.value[M.name]=w,x.emit("change",m.name,N.value,m.lang,m.index,!0)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}});function uw(m,x,C,N,D,M){const w=h.resolveComponent("Wrapper_nested");return h.openBlock(),h.createBlock(w,{value:m.value,name:m.name,index:m.state.index,disabled:m.boneState.bonestructure.readonly,onChange:m.changeEvent},null,8,["value","name","index","disabled","onChange"])}const Xa=de(hw,[["render",uw],["__scopeId","data-v-84a761ce"]]),mw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({});function D(M){x.emit("change",m.name,M.target.value,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),gw=["disabled","value"];function pw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("sl-color-picker",{disabled:m.boneState.readonly,value:m.value,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,gw)}const el=de(mw,[["render",pw],["__scopeId","data-v-534b9149"]]),fw=h.defineComponent({inheritAttrs:!1,emits:{change:null},props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,autofocus:Boolean},components:{},setup(m,x){const C=h.inject("boneState"),N=h.reactive({minAmount:h.computed(()=>C.bonestructure.minAmount),maxAmount:h.computed(()=>C.bonestructure.maxAmount),precision:h.computed(()=>{if(C.bonestructure.precision>1)return parseFloat(`0.${"0".repeat(C.bonestructure.precision-1)}1`)})}),D=h.ref(null);function M(w){x.emit("change",m.name,w.target.value,m.lang,m.index)}return h.watchEffect(()=>{if(m.autofocus&&D.value&&D.value!==null&&D!==null){const{start:w}=$o(()=>{D.value.focus()},600);w()}}),h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:M,numericBone:D}}}),kw=["disabled","value","min","max","step"],bw={class:"info"},ww={key:0},Aw={key:1},_w={key:2};function Cw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("sl-input",{ref:"numericBone",type:"number",disabled:m.boneState.readonly,value:m.value,min:m.state.minAmount,max:m.state.maxAmount,step:m.state.precision,onSlChange:x[0]||(x[0]=(...w)=>m.changeEvent&&m.changeEvent(...w)),onKeyup:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w))},null,40,kw),h.createElementVNode("ul",bw,[m.state.minAmount!==-9223372036854776e3&&m.state.minAmount?(h.openBlock(),h.createElementBlock("li",ww,h.toDisplayString(m.$t("bones.numeric.min",{val:m.state.minAmount})),1)):h.createCommentVNode("",!0),m.state.maxAmount!==9223372036854776e3&&m.state.maxAmount?(h.openBlock(),h.createElementBlock("li",Aw,h.toDisplayString(m.$t("bones.numeric.max",{val:m.state.maxAmount})),1)):h.createCommentVNode("",!0),m.state.precision?(h.openBlock(),h.createElementBlock("li",_w,h.toDisplayString(m.$t("bones.numeric.precision",{val:m.boneState.bonestructure.precision})),1)):h.createCommentVNode("",!0)])],64)}const tl=de(fw,[["render",Cw],["__scopeId","data-v-03d5b399"]]);var Le={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};class Ho extends Error{constructor(x,C,N,D){super(N||C),arguments.length>=4&&D&&Object.assign(this,D),this.statusText=C,this.statusCode=x,this.response=D}}let lr=null;function Jt(){return lr||(lr=or.defineStore("requestStore",()=>{const m=h.reactive({sKeys:new Set});function x(){m.sKeys=new Set}return{state:m,$reset:x}})),lr()}class we{static resetState(){Jt().$reset(),Jt().$dispose()}static buildUrl(x){return x&&!(x.startsWith("http://")||x.startsWith("https://")||x.startsWith("//"))&&(x=window.location.origin+x),x}static post(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,abortController:M=null,headers:w=null,mode:S=null}={}){function p(){if(C instanceof FormData)return C;const B=new FormData;for(const v in C)if(Array.isArray(C[v]))for(let k of C[v])B.append(v,k);else B.append(v,C[v]);return B}let y=ro.post(we.buildUrl(x),p(),null,w,M,S);return y.then(function(B){N&&N(B.data)}).catch(function(B){D&&D(B)}),y}static async getBatchSkeys(x=30,C=Le.VITE_DEFAULT_RENDERER||"json"){await we.get(`/${C}/skey`,{dataObj:{amount:x}}).then(async N=>{let D=await N.json();Array.isArray(D)||(D=[D]),Jt().state.sKeys=new Set(D)})}static async securePost(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,abortController:M=null,renderer:w=Le.VITE_DEFAULT_RENDERER||"json",headers:S=null,mode:p=null,amount:y=30}={}){let B=null;Jt().state.sKeys.size===0&&await we.getBatchSkeys(y);const v=[...Jt().state.sKeys][0];return C instanceof FormData?(C.append("skey",v),Jt().state.sKeys.delete(v)):(C||(C={}),C.skey=v,Jt().state.sKeys.delete(v)),B=we.post(x,{dataObj:C,callback:N,abortController:M,headers:S,mode:p}),B}static get(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,cached:M=!1,clearCache:w=!1,abortController:S=null,headers:p=null,mode:y=null,cacheTime:B=1e3*60*60*24*1}={}){let v=ro.get(we.buildUrl(x),C,w,p,S,y);return v.then(function(k){N&&N(k.data)}).catch(function(k){D&&D(k)}),v}static list(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,group:M=null,abortController:w=null,renderer:S=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let p=`/${S}/${x}/list`;return M&&(p+=`/${M}`),we.get(p,{dataObj:C,callback:N,failedCallback:D,abortController:w})}static getStructure(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,group:M=null,abortController:w=null,renderer:S=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){x=x.replace(/\//g,".");let p=`/${S}/getStructure/${x}`;return M&&(p+=`/${M}`),we.get(p,{dataObj:C,callback:N,failedCallback:D,abortController:w})}static view(x,C,{dataObj:N=null,callback:D=null,failedCallback:M=null,group:w=null,abortController:S=null,renderer:p=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let y=`/${p}/${x}/view/${C}`;return w&&(y=`/${p}/${x}/view/${w}/${C}`),we.get(y,{dataObj:N,callback:D,failedCallback:M,abortController:S})}static add(x,{dataObj:C=null,callback:N=null,failedCallback:D=null,group:M=null,abortController:w=null,renderer:S=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let p=`/${S}/${x}/add`;return M&&(p=`/${S}/${x}/add/${M}`),we.securePost(p,{dataObj:C,callback:N,failedCallback:D,abortController:w})}static edit(x,C,{dataObj:N=null,callback:D=null,failedCallback:M=null,group:w=null,abortController:S=null,renderer:p=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let y=`/${p}/${x}/edit/${C}`;return w&&(y=`/${p}/${x}/edit/${w}/${C}`),we.securePost(y,{dataObj:N,callback:D,failedCallback:M,abortController:S})}static delete(x,C,{dataObj:N=null,callback:D=null,failedCallback:M=null,group:w=null,abortController:S=null,renderer:p=(Le==null?void 0:Le.VITE_DEFAULT_RENDERER)||"json"}={}){let y=`/${p}/${x}/delete/${C}`;return w&&(y=`/${p}/${x}/delete/${w}/${C}`),we.securePost(y,{dataObj:N,callback:D,failedCallback:M,abortController:S,amount:1})}static downloadUrlFor(x,C=!1){return x&&"dest"in x?C&&"thumbnail"in x.dest?we.buildUrl(x.dest.thumbnail):"downloadUrl"in x.dest?we.buildUrl(x.dest.downloadUrl):we.buildUrl(null):we.buildUrl(x)}static uploadFile(x,C=void 0){const N={fileName:x.name,mimeType:x.type||"application/octet-stream",size:x.size.toString(),node:C};return new Promise((D,M)=>{we.securePost("/vi/file/getUploadURL",{dataObj:N}).then(async w=>{let S=await w.json();fetch(S.values.uploadUrl,{body:x,method:"POST",mode:"no-cors"}).then(async p=>{const y={key:S.values.uploadKey,skelType:"leaf"};we.securePost("/vi/file/add",{dataObj:y}).then(async B=>{let v=await B.json();v.action==="addSuccess"?D(v.values):M(v)}).catch(B=>{M(B)})}).catch(p=>{M(p)})}).catch(w=>{M(w)})})}}class ro{constructor(){Jf(this,"withCredentials",!0)}static buildOptions(x,C=null,N=null,D=null,M=null){let w={method:x};return w.credentials="include",w.headers={Accept:"application/json, text/plain, */*"},N&&(w.headers={...w.headers,...N}),C&&(w.body=C),D&&(w.signal=D.signal),M&&(w.mode=M),w}static get(x,C=null,N=null,D=null,M=null,w=null){function S(p,y){let B=new URL(p);if(y&&Object.keys(y).length>0){const v=new URLSearchParams;for(const[k,_]of Object.entries(y))if(Array.isArray(_))for(const R of _)v.append(k,R);else v.append(k,_);B.search=v.toString()}return B.toString()}return fetch(S(x,C),ro.buildOptions("GET",null,D,M,w)).then(async p=>{if(p.ok)return p;{const y=`${p.status} ${p.statusText}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(p.status,p.statusText,y,p))}}).catch(p=>{if(p instanceof TypeError){const B=`503 ${p.message}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(503,p.message,B,p))}if(p instanceof DOMException&&p.name=="AbortError"){const B=`${p.code} ${p.name}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(p.code,p.name,B,{url:x}))}const y=`${p.statusCode} ${p.statusText}: ${p.headers?p.headers.get("x-error-descr"):""}`;return Promise.reject(new Ho(p.statusCode,p.statusText,y,p.response))})}static post(x,C=null,N=null,D=null,M=null,w=null){return fetch(x,ro.buildOptions("POST",C,D,M,w))}}var vw={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const yw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{Wrapper_nested:Qa},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.inject("formatString"),D=h.reactive({format:h.computed(()=>C==null?void 0:C.bonestructure.format),skellistdata:null,selection:null});function M(p){let y="";return C.bonestructure.type==="relational.tree.leaf.file"?y="skelType=leaf&":C.bonestructure.type==="relational.tree.node.file"&&(y="skelType=node&"),we.get(`/${vw.VITE_DEFAULT_RENDERER||"vi"}/${C.bonestructure.module}/list?${y}limit=99`).then(async B=>{var k;const v=await B.json();D.skellistdata={};for(let _ of v.skellist)D.skellistdata[_.key]=_;return(k=v.skellist)==null?void 0:k.map(_=>({text:N(C.bonestructure.format,{dest:_}),value:_.key,data:_}))})}function w(p){D.selection={dest:D.skellistdata[p.detail.item.value]},x.emit("change",m.name,D.selection,m.lang,m.index)}function S(p){var B;D.selection||(D.selection={}),(B=D.selection.rel)!=null&&B[p.name]||(D.selection.rel?D.selection.rel[p.name]=null:D.selection.rel={[p.name]:null});let y=D.selection.rel[p.name];p.lang?(y===null&&(y={}),Object.keys(y).includes(p.lang)&&p.index!==null?y[p.lang][p.index]=p.value:y[p.lang]=p.value):p.index!==null?(y===null&&(y=[]),y[p.index]=p.value):y=p.value,Object.keys(D.selection).includes("rel")&&D.selection.rel?D.selection.rel[p.name]=y:D.selection.rel={[p.name]:y},Object.keys(D.selection).includes("dest")&&x.emit("change",m.name,D.selection,m.lang,m.index)}return h.onMounted(()=>{D.selection=m.value,x.emit("change",m.name,m.value,m.lang,m.index)}),{state:D,boneState:C,formatString:N,changeEvent:w,changeEventNested:S,getList:M}}}),Ew=m=>(h.pushScopeId("data-v-61dd72e0"),m=m(),h.popScopeId(),m),xw={class:"record"},Sw={class:"single-entry"},Dw=["value"],Bw=["disabled","source"],Tw=["title"],Iw=[Ew(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))];function Pw(m,x,C,N,D,M){var S,p;const w=h.resolveComponent("Wrapper_nested");return h.openBlock(),h.createElementBlock("div",xw,[h.createElementVNode("div",Sw,[m.state.selection?(h.openBlock(),h.createElementBlock("sl-input",{key:0,disabled:!0,value:m.value?m.formatString(m.state.format,m.state.selection):""},null,8,Dw)):(h.openBlock(),h.createElementBlock("sl-combobox",{key:1,disabled:m.boneState.readonly,source:m.getList,hoist:"",onSlItemSelect:x[0]||(x[0]=(...y)=>m.changeEvent&&m.changeEvent(...y))},null,40,Bw)),!m.boneState.multiple&&!m.boneState.isEmpty?(h.openBlock(),h.createElementBlock("sl-button",{key:2,variant:"danger",outline:"",title:m.$t("bone.del"),class:"delete-btn square-btn",onClick:x[1]||(x[1]=()=>{m.$emit("change",m.name,"",m.lang,m.index),m.state.selection=null})},Iw,8,Tw)):h.createCommentVNode("",!0)]),(S=m.boneState)!=null&&S.bonestructure.using?(h.openBlock(),h.createBlock(w,{key:0,value:(p=m.value)==null?void 0:p.rel,name:m.name,index:m.index,disabled:m.boneState.bonestructure.readonly,onChange:m.changeEventNested},null,8,["value","name","index","disabled","onChange"])):h.createCommentVNode("",!0)])}const nl=de(yw,[["render",Pw],["__scopeId","data-v-61dd72e0"]]),Rw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({});function D(M,w){x.emit("change",m.name,M,m.lang,m.index)}return h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),Ow={class:"box"};function Nw(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",Ow,h.toDisplayString(m.value),1)}const zw=de(Rw,[["render",Nw],["__scopeId","data-v-343aca69"]]);var ol={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Mw=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.ref(),D=h.reactive({loading:!1,droparea:!1,previewopen:!1});h.onMounted(()=>{x.emit("change",m.name,m.value,m.lang,m.index)});function M(){console.log(we.downloadUrlFor(m.value)),window.open(we.downloadUrlFor(m.value))}function w(){return we.downloadUrlFor(m.value,!1)}function S(B){const v={fileName:B.name,mimeType:B.type||"application/octet-stream",size:B.size.toString()};return new Promise((k,_)=>{we.securePost(`/${ol.VITE_DEFAULT_RENDERER||"vi"}/file/getUploadURL`,{dataObj:v}).then(async R=>{let T=await R.json();fetch(T.values.uploadUrl,{body:B,method:"POST",mode:"no-cors"}).then(async O=>{const F={key:T.values.uploadKey,node:void 0,skelType:"leaf"};we.securePost(`/${ol.VITE_DEFAULT_RENDERER||"vi"}/file/add`,{dataObj:F}).then(async L=>{let $=await L.json();$.action==="addSuccess"?k($.values):_($)}).catch(L=>{_(L)})}).catch(O=>{_(O)})}).catch(R=>{_(R)})})}async function p(B){D.loading=!0;for(let v of B.target.files){let k=await S(v);N.value.value=null,x.emit("change",m.name,{dest:k,rel:null},m.lang,m.index)}D.loading=!1}async function y(B){D.loading=!0,D.droparea=!1;for(let v of B.dataTransfer.files){let k=await S(v);N.value.value=null,x.emit("change",m.name,{dest:k,rel:null},m.lang,m.index);break}D.loading=!1}return{state:D,boneState:C,downloadFile:M,createBackgroundImage:w,handleUpload:p,uploadinput:N,handleDrop:y}}}),qo=m=>(h.pushScopeId("data-v-91086308"),m=m(),h.popScopeId(),m),Fw={key:0,class:"loader"},Vw=[qo(()=>h.createElementVNode("sl-spinner",{slot:"suffix"},null,-1))],Lw={key:1,class:"droparea"},jw=["title"],$w=[qo(()=>h.createElementVNode("sl-icon",{name:"upload"},null,-1))],Hw=["multiple"],qw=["title"],Uw=[qo(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"download"},null,-1))],Ww={class:"box"},Kw=["src"],Gw=["label","open"],Zw=["src"],Jw={key:1,class:"preview"},Yw={key:0,name:"file-earmark"},Qw={key:2},Xw=["title"],eA=[qo(()=>h.createElementVNode("sl-icon",{name:"x-lg"},null,-1))];function tA(m,x,C,N,D,M){var w,S,p,y,B,v,k,_,R,T;return h.openBlock(),h.createElementBlock("div",{class:"file-wrapper",onDragover:x[5]||(x[5]=h.withModifiers(O=>m.state.droparea=!0,["prevent"])),onDragleave:x[6]||(x[6]=O=>m.state.droparea=!1),onDrop:x[7]||(x[7]=h.withModifiers((...O)=>m.handleDrop&&m.handleDrop(...O),["prevent"]))},[m.state.loading?(h.openBlock(),h.createElementBlock("div",Fw,Vw)):h.createCommentVNode("",!0),m.state.droparea?(h.openBlock(),h.createElementBlock("div",Lw," Dateien hier hinziehen ")):h.createCommentVNode("",!0),!m.boneState.readonly&&(!m.value||m.state.loading)?(h.openBlock(),h.createElementBlock("sl-button",{key:2,title:m.$t("bone.upload"),outline:"",class:"upload-btn",onClick:x[0]||(x[0]=O=>m.uploadinput.click())},$w,8,jw)):h.createCommentVNode("",!0),h.createElementVNode("input",{ref:"uploadinput",hidden:"",type:"file",multiple:m.boneState.multiple,onChange:x[1]||(x[1]=(...O)=>m.handleUpload&&m.handleUpload(...O))},null,40,Hw),m.value?(h.openBlock(),h.createElementBlock("sl-button",{key:3,title:m.$t("bone.download"),onClick:x[2]||(x[2]=(...O)=>m.downloadFile&&m.downloadFile(...O))},Uw,8,qw)):h.createCommentVNode("",!0),h.createElementVNode("div",Ww,[(S=(w=m.value)==null?void 0:w.dest)!=null&&S.mimetype.includes("image")?(h.openBlock(),h.createElementBlock("div",{key:0,class:"preview has-preview",onClick:x[3]||(x[3]=O=>m.state.previewopen=!m.state.previewopen)},[h.createElementVNode("img",{class:"preview-img",src:m.createBackgroundImage(),alt:""},null,8,Kw),h.createElementVNode("sl-dialog",{label:decodeURIComponent((y=(p=m.value)==null?void 0:p.dest)==null?void 0:y.name),class:"preview-overlay",open:m.state.previewopen},[h.createElementVNode("img",{src:m.createBackgroundImage(),alt:""},null,8,Zw)],8,Gw)])):(h.openBlock(),h.createElementBlock("div",Jw,[(v=(B=m.value)==null?void 0:B.dest)!=null&&v.name?(h.openBlock(),h.createElementBlock("sl-icon",Yw)):h.createCommentVNode("",!0)])),(_=(k=m.value)==null?void 0:k.dest)!=null&&_.name?(h.openBlock(),h.createElementBlock("div",Qw,h.toDisplayString(decodeURIComponent((T=(R=m.value)==null?void 0:R.dest)==null?void 0:T.name)),1)):h.createCommentVNode("",!0)]),m.boneState.multiple?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("sl-button",{key:4,variant:"danger",outline:"",title:m.$t("bone.del"),class:"delete-btn",onClick:x[4]||(x[4]=O=>m.$emit("change",m.name,"",m.lang,m.index))},eA,8,Xw))],32)}const il=de(Mw,[["render",tA],["__scopeId","data-v-91086308"]]);var Uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nA(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var Wo={exports:{}};Wo.exports,function(m,x){(function(C){const N=C.de=C.de||{};N.dictionary=Object.assign(N.dictionary||{},{"%0 of %1":"%0 von %1","Align cell text to the bottom":"Zellentext unten ausrichten","Align cell text to the center":"Zellentext zentriert ausrichten","Align cell text to the left":"Zellentext linksbündig ausrichten","Align cell text to the middle":"Zellentext mittig ausrichten","Align cell text to the right":"Zellentext rechtsbündig ausrichten","Align cell text to the top":"Zellentext oben ausrichten","Align center":"Zentriert","Align left":"Linksbündig","Align right":"Rechtsbündig","Align table to the left":"Tabelle links ausrichten","Align table to the right":"Tabelle rechts ausrichten",Alignment:"Ausrichtung",Aquamarine:"Aquamarinblau",Background:"Hintergrund",Black:"Schwarz","Block quote":"Blockzitat",Blue:"Blau",Bold:"Fett",Border:"Rahmen","Break text":"Bild teilt Text","Bulleted List":"Aufzählungsliste","Bulleted list styles toolbar":"Darstellung der ungeordneten Liste",Cancel:"Abbrechen","Cannot upload file:":"Die Datei kann nicht hochgeladen werden:","Caption for image: %0":"Bildunterschrift: %0","Caption for the image":"Bildunterschrift","Cell properties":"Zelleneigenschaften","Center table":"Tabelle zentrieren","Centered image":"Zentriertes Bild","Change image text alternative":"Alternativtext ändern","Choose heading":"Überschrift auswählen",Circle:"Leerer Kreis",Code:"Code",Color:"Farbe","Color picker":"Farbwähler",Column:"Spalte",Dashed:"Gestrichelt",Decimal:"Dezimalzahlen","Decimal with leading zero":"Dezimalzahlen mit vorangestellten Nullen","Decrease indent":"Einzug verkleinern","Delete column":"Spalte löschen","Delete row":"Zeile löschen","Dim grey":"Dunkelgrau",Dimensions:"Größe",Disc:"Gefüllter Kreis",Dotted:"Gepunktet",Double:"Doppelt",Downloadable:"Herunterladbar","Dropdown toolbar":"Dropdown-Liste Werkzeugleiste","Edit block":"Absatz bearbeiten","Edit link":"Link bearbeiten","Editor block content toolbar":"Editor Blockinhalt-Toolbar","Editor contextual toolbar":"Editor kontextuelle Toolbar","Editor editing area: %0":"Bearbeitungsbereich des Editors: %0","Editor toolbar":"Editor Werkzeugleiste","Enter image caption":"Bildunterschrift eingeben","Enter table caption":"Tabellenüberschrift eingeben","Full size image":"Bild in voller Größe",Green:"Grün",Grey:"Grau",Groove:"Eingeritzt","Header column":"Kopfspalte","Header row":"Kopfzeile",Heading:"Überschrift","Heading 1":"Überschrift 1","Heading 2":"Überschrift 2","Heading 3":"Überschrift 3","Heading 4":"Überschrift 4","Heading 5":"Überschrift 5","Heading 6":"Überschrift 6",Height:"Höhe",HEX:"","Horizontal text alignment toolbar":"Werkzeugleiste für die horizontale Zellentext-Ausrichtung","HTML object":"HTML-Objekt","Image resize list":"Bildgrößen-Liste","Image toolbar":"Bild Werkzeugleiste","image widget":"Bild-Steuerelement","In line":"Text in Zeile","Increase indent":"Einzug vergrößern",Insert:"Einfügen","Insert column left":"Spalte links einfügen","Insert column right":"Spalte rechts einfügen","Insert image":"Bild einfügen","Insert image via URL":"Bild von URL einfügen","Insert paragraph after block":"Absatz nach Block einfügen","Insert paragraph before block":"Absatz vor Block einfügen","Insert row above":"Zeile oben einfügen","Insert row below":"Zeile unten einfügen","Insert table":"Tabelle einfügen",Inset:"Eingelassen",Italic:"Kursiv",Justify:"Blocksatz","Justify cell text":"Zellentext als Blocksatz ausrichten","Left aligned image":"Linksbündiges Bild","Light blue":"Hellblau","Light green":"Hellgrün","Light grey":"Hellgrau",Link:"Link","Link image":"Bild verlinken","Link URL":"Link Adresse","List properties":"Listeneigenschaften","Lower-latin":"Kleingeschriebene lateinische Buchstaben","Lower–roman":"Kleingeschriebene römische Zahlen","Merge cell down":"Zelle unten verbinden","Merge cell left":"Zelle links verbinden","Merge cell right":"Zelle rechts verbinden","Merge cell up":"Zelle verbinden","Merge cells":"Zellen verbinden",Next:"Nächste",None:"Kein Rahmen","Numbered List":"Nummerierte Liste","Numbered list styles toolbar":"Darstellung der geordneten Liste","Open in a new tab":"In neuem Tab öffnen","Open link in new tab":"Link im neuen Tab öffnen",Orange:"Orange",Original:"Original",Outset:"Geprägt",Padding:"Innenabstand",Paragraph:"Absatz","Press Enter to type after or press Shift + Enter to type before the widget":"Drücken Sie die Eingabetaste, um nach dem Widget zu tippen oder Shift + Eingabetaste, um vor dem Widget zu tippen.",Previous:"vorherige",Purple:"Violett",Red:"Rot",Redo:"Wiederherstellen","Remove color":"Farbe entfernen","Remove Format":"Formatierung entfernen","Resize image":"Bildgröße ändern","Resize image to %0":"Bildgröße ändern in %0","Resize image to the original size":"Bild in Originalgröße ändern","Restore default":"Standard wiederherstellen","Reversed order":"Umgekehrte Reihenfolge","Rich Text Editor":"Rich Text Editor",Ridge:"Hervorgehoben","Right aligned image":"Rechtsbündiges Bild",Row:"Zeile",Save:"Speichern","Select all":"Alles auswählen","Select column":"Spalte auswählen","Select row":"Zeile auswählen","Show more items":"Mehr anzeigen","Side image":"Seitenbild",Solid:"Durchgezogen","Split cell horizontally":"Zelle horizontal teilen","Split cell vertically":"Zelle vertikal teilen",Square:"Quadrat","Start at":"Beginnen mit","Start index must be greater than 0.":"Der Startwert muss größer als 0 sein.",Strikethrough:"Durchgestrichen",Style:"Rahmenart",Subscript:"Tiefgestellt",Superscript:"Hochgestellt","Table alignment toolbar":"Werkzeugleiste für die Tabellen-Ausrichtung","Table cell text alignment":"Ausrichtung des Zellentextes","Table properties":"Tabelleneigenschaften","Table toolbar":"Tabelle Werkzeugleiste","Text alignment":"Textausrichtung","Text alignment toolbar":"Text-Ausrichtung Toolbar","Text alternative":"Alternativtext",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"Die Farbe ist ungültig. Probieren Sie „#FF0000“ oder „rgb(255,0,0)“ oder „red“.",'The value is invalid. Try "10px" or "2em" or simply "2".':"Der Wert ist ungültig. Probieren Sie „10px“ oder „2em“ oder „2“.","This link has no URL":"Dieser Link hat keine Adresse","To-do List":"Aufgabenliste","Toggle caption off":"Tabellenüberschrift deaktivieren","Toggle caption on":"Tabellenüberschrift aktivieren","Toggle the circle list style":"Leeren Kreis einstellen","Toggle the decimal list style":"Dezimalzahlen einstellen","Toggle the decimal with leading zero list style":"Dezimalzahlen mit vorangestellten Nullen einstellen","Toggle the disc list style":"Gefüllten Kreis einstellen","Toggle the lower–latin list style":"Kleingeschriebene lateinische Buchstaben einstellen","Toggle the lower–roman list style":"Kleingeschriebene römische Zahlen einstellen","Toggle the square list style":"Quadrat einstellen","Toggle the upper–latin list style":"Großgeschriebene lateinische Buchstaben einstellen","Toggle the upper–roman list style":"Großgeschriebene römische Zahlen einstellen",Turquoise:"Türkis","Type or paste your content here.":"Hier Inhalt einfügen.","Type your title":"Titel eingeben",Underline:"Unterstrichen",Undo:"Rückgängig",Unlink:"Link entfernen",Update:"Aktualisieren","Update image URL":"Bild-URL aktualisieren","Upload failed":"Hochladen fehlgeschlagen","Upload in progress":"Upload läuft","Upper-latin":"Großgeschriebene lateinische Buchstaben","Upper-roman":"Großgeschriebene römische Zahlen","Vertical text alignment toolbar":"Werkzeugleiste für die vertikale Zellentext-Ausrichtung",White:"Weiß","Widget toolbar":"Widget Werkzeugleiste",Width:"Breite","Wrap text":"Text umfließt Bild",Yellow:"Gelb"}),N.getPluralForm=function(D){return D!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(C,N){m.exports=N()}(self,()=>(()=>{var C={4959:(w,S,p)=>{const y=p(1103),B={};for(const k of Object.keys(y))B[y[k]]=k;const v={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};w.exports=v;for(const k of Object.keys(v)){if(!("channels"in v[k]))throw new Error("missing channels property: "+k);if(!("labels"in v[k]))throw new Error("missing channel labels property: "+k);if(v[k].labels.length!==v[k].channels)throw new Error("channel and label counts mismatch: "+k);const{channels:_,labels:R}=v[k];delete v[k].channels,delete v[k].labels,Object.defineProperty(v[k],"channels",{value:_}),Object.defineProperty(v[k],"labels",{value:R})}v.rgb.hsl=function(k){const _=k[0]/255,R=k[1]/255,T=k[2]/255,O=Math.min(_,R,T),F=Math.max(_,R,T),L=F-O;let $,K;F===O?$=0:_===F?$=(R-T)/L:R===F?$=2+(T-_)/L:T===F&&($=4+(_-R)/L),$=Math.min(60*$,360),$<0&&($+=360);const J=(O+F)/2;return K=F===O?0:J<=.5?L/(F+O):L/(2-F-O),[$,100*K,100*J]},v.rgb.hsv=function(k){let _,R,T,O,F;const L=k[0]/255,$=k[1]/255,K=k[2]/255,J=Math.max(L,$,K),te=J-Math.min(L,$,K),Z=function(ee){return(J-ee)/6/te+.5};return te===0?(O=0,F=0):(F=te/J,_=Z(L),R=Z($),T=Z(K),L===J?O=T-R:$===J?O=.3333333333333333+_-T:K===J&&(O=.6666666666666666+R-_),O<0?O+=1:O>1&&(O-=1)),[360*O,100*F,100*J]},v.rgb.hwb=function(k){const _=k[0],R=k[1];let T=k[2];const O=v.rgb.hsl(k)[0],F=1/255*Math.min(_,Math.min(R,T));return T=1-.00392156862745098*Math.max(_,Math.max(R,T)),[O,100*F,100*T]},v.rgb.cmyk=function(k){const _=k[0]/255,R=k[1]/255,T=k[2]/255,O=Math.min(1-_,1-R,1-T);return[100*((1-_-O)/(1-O)||0),100*((1-R-O)/(1-O)||0),100*((1-T-O)/(1-O)||0),100*O]},v.rgb.keyword=function(k){const _=B[k];if(_)return _;let R,T=1/0;for(const L of Object.keys(y)){const $=y[L],K=(F=$,((O=k)[0]-F[0])**2+(O[1]-F[1])**2+(O[2]-F[2])**2);K.04045?((_+.055)/1.055)**2.4:_/12.92,R=R>.04045?((R+.055)/1.055)**2.4:R/12.92,T=T>.04045?((T+.055)/1.055)**2.4:T/12.92,[100*(.4124*_+.3576*R+.1805*T),100*(.2126*_+.7152*R+.0722*T),100*(.0193*_+.1192*R+.9505*T)]},v.rgb.lab=function(k){const _=v.rgb.xyz(k);let R=_[0],T=_[1],O=_[2];return R/=95.047,T/=100,O/=108.883,R=R>.008856?R**.3333333333333333:7.787*R+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,O=O>.008856?O**.3333333333333333:7.787*O+.13793103448275862,[116*T-16,500*(R-T),200*(T-O)]},v.hsl.rgb=function(k){const _=k[0]/360,R=k[1]/100,T=k[2]/100;let O,F,L;if(R===0)return L=255*T,[L,L,L];O=T<.5?T*(1+R):T+R-T*R;const $=2*T-O,K=[0,0,0];for(let J=0;J<3;J++)F=_+.3333333333333333*-(J-1),F<0&&F++,F>1&&F--,L=6*F<1?$+6*(O-$)*F:2*F<1?O:3*F<2?$+(O-$)*(.6666666666666666-F)*6:$,K[J]=255*L;return K},v.hsl.hsv=function(k){const _=k[0];let R=k[1]/100,T=k[2]/100,O=R;const F=Math.max(T,.01);return T*=2,R*=T<=1?T:2-T,O*=F<=1?F:2-F,[_,100*(T===0?2*O/(F+O):2*R/(T+R)),100*((T+R)/2)]},v.hsv.rgb=function(k){const _=k[0]/60,R=k[1]/100;let T=k[2]/100;const O=Math.floor(_)%6,F=_-Math.floor(_),L=255*T*(1-R),$=255*T*(1-R*F),K=255*T*(1-R*(1-F));switch(T*=255,O){case 0:return[T,K,L];case 1:return[$,T,L];case 2:return[L,T,K];case 3:return[L,$,T];case 4:return[K,L,T];case 5:return[T,L,$]}},v.hsv.hsl=function(k){const _=k[0],R=k[1]/100,T=k[2]/100,O=Math.max(T,.01);let F,L;L=(2-R)*T;const $=(2-R)*O;return F=R*O,F/=$<=1?$:2-$,F=F||0,L/=2,[_,100*F,100*L]},v.hwb.rgb=function(k){const _=k[0]/360;let R=k[1]/100,T=k[2]/100;const O=R+T;let F;O>1&&(R/=O,T/=O);const L=Math.floor(6*_),$=1-T;F=6*_-L,1&L&&(F=1-F);const K=R+F*($-R);let J,te,Z;switch(L){default:case 6:case 0:J=$,te=K,Z=R;break;case 1:J=K,te=$,Z=R;break;case 2:J=R,te=$,Z=K;break;case 3:J=R,te=K,Z=$;break;case 4:J=K,te=R,Z=$;break;case 5:J=$,te=R,Z=K}return[255*J,255*te,255*Z]},v.cmyk.rgb=function(k){const _=k[0]/100,R=k[1]/100,T=k[2]/100,O=k[3]/100;return[255*(1-Math.min(1,_*(1-O)+O)),255*(1-Math.min(1,R*(1-O)+O)),255*(1-Math.min(1,T*(1-O)+O))]},v.xyz.rgb=function(k){const _=k[0]/100,R=k[1]/100,T=k[2]/100;let O,F,L;return O=3.2406*_+-1.5372*R+-.4986*T,F=-.9689*_+1.8758*R+.0415*T,L=.0557*_+-.204*R+1.057*T,O=O>.0031308?1.055*O**.4166666666666667-.055:12.92*O,F=F>.0031308?1.055*F**.4166666666666667-.055:12.92*F,L=L>.0031308?1.055*L**.4166666666666667-.055:12.92*L,O=Math.min(Math.max(0,O),1),F=Math.min(Math.max(0,F),1),L=Math.min(Math.max(0,L),1),[255*O,255*F,255*L]},v.xyz.lab=function(k){let _=k[0],R=k[1],T=k[2];return _/=95.047,R/=100,T/=108.883,_=_>.008856?_**.3333333333333333:7.787*_+.13793103448275862,R=R>.008856?R**.3333333333333333:7.787*R+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,[116*R-16,500*(_-R),200*(R-T)]},v.lab.xyz=function(k){let _,R,T;R=(k[0]+16)/116,_=k[1]/500+R,T=R-k[2]/200;const O=R**3,F=_**3,L=T**3;return R=O>.008856?O:(R-.13793103448275862)/7.787,_=F>.008856?F:(_-.13793103448275862)/7.787,T=L>.008856?L:(T-.13793103448275862)/7.787,_*=95.047,R*=100,T*=108.883,[_,R,T]},v.lab.lch=function(k){const _=k[0],R=k[1],T=k[2];let O;return O=360*Math.atan2(T,R)/2/Math.PI,O<0&&(O+=360),[_,Math.sqrt(R*R+T*T),O]},v.lch.lab=function(k){const _=k[0],R=k[1],T=k[2]/360*2*Math.PI;return[_,R*Math.cos(T),R*Math.sin(T)]},v.rgb.ansi16=function(k,_=null){const[R,T,O]=k;let F=_===null?v.rgb.hsv(k)[2]:_;if(F=Math.round(F/50),F===0)return 30;let L=30+(Math.round(O/255)<<2|Math.round(T/255)<<1|Math.round(R/255));return F===2&&(L+=60),L},v.hsv.ansi16=function(k){return v.rgb.ansi16(v.hsv.rgb(k),k[2])},v.rgb.ansi256=function(k){const _=k[0],R=k[1],T=k[2];return _===R&&R===T?_<8?16:_>248?231:Math.round((_-8)/247*24)+232:16+36*Math.round(_/255*5)+6*Math.round(R/255*5)+Math.round(T/255*5)},v.ansi16.rgb=function(k){let _=k%10;if(_===0||_===7)return k>50&&(_+=3.5),_=_/10.5*255,[_,_,_];const R=.5*(1+~~(k>50));return[(1&_)*R*255,(_>>1&1)*R*255,(_>>2&1)*R*255]},v.ansi256.rgb=function(k){if(k>=232){const R=10*(k-232)+8;return[R,R,R]}let _;return k-=16,[Math.floor(k/36)/5*255,Math.floor((_=k%36)/6)/5*255,_%6/5*255]},v.rgb.hex=function(k){const _=(((255&Math.round(k[0]))<<16)+((255&Math.round(k[1]))<<8)+(255&Math.round(k[2]))).toString(16).toUpperCase();return"000000".substring(_.length)+_},v.hex.rgb=function(k){const _=k.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!_)return[0,0,0];let R=_[0];_[0].length===3&&(R=R.split("").map(O=>O+O).join(""));const T=parseInt(R,16);return[T>>16&255,T>>8&255,255&T]},v.rgb.hcg=function(k){const _=k[0]/255,R=k[1]/255,T=k[2]/255,O=Math.max(Math.max(_,R),T),F=Math.min(Math.min(_,R),T),L=O-F;let $,K;return $=L<1?F/(1-L):0,K=L<=0?0:O===_?(R-T)/L%6:O===R?2+(T-_)/L:4+(_-R)/L,K/=6,K%=1,[360*K,100*L,100*$]},v.hsl.hcg=function(k){const _=k[1]/100,R=k[2]/100,T=R<.5?2*_*R:2*_*(1-R);let O=0;return T<1&&(O=(R-.5*T)/(1-T)),[k[0],100*T,100*O]},v.hsv.hcg=function(k){const _=k[1]/100,R=k[2]/100,T=_*R;let O=0;return T<1&&(O=(R-T)/(1-T)),[k[0],100*T,100*O]},v.hcg.rgb=function(k){const _=k[0]/360,R=k[1]/100,T=k[2]/100;if(R===0)return[255*T,255*T,255*T];const O=[0,0,0],F=_%1*6,L=F%1,$=1-L;let K=0;switch(Math.floor(F)){case 0:O[0]=1,O[1]=L,O[2]=0;break;case 1:O[0]=$,O[1]=1,O[2]=0;break;case 2:O[0]=0,O[1]=1,O[2]=L;break;case 3:O[0]=0,O[1]=$,O[2]=1;break;case 4:O[0]=L,O[1]=0,O[2]=1;break;default:O[0]=1,O[1]=0,O[2]=$}return K=(1-R)*T,[255*(R*O[0]+K),255*(R*O[1]+K),255*(R*O[2]+K)]},v.hcg.hsv=function(k){const _=k[1]/100,R=_+k[2]/100*(1-_);let T=0;return R>0&&(T=_/R),[k[0],100*T,100*R]},v.hcg.hsl=function(k){const _=k[1]/100,R=k[2]/100*(1-_)+.5*_;let T=0;return R>0&&R<.5?T=_/(2*R):R>=.5&&R<1&&(T=_/(2*(1-R))),[k[0],100*T,100*R]},v.hcg.hwb=function(k){const _=k[1]/100,R=_+k[2]/100*(1-_);return[k[0],100*(R-_),100*(1-R)]},v.hwb.hcg=function(k){const _=k[1]/100,R=1-k[2]/100,T=R-_;let O=0;return T<1&&(O=(R-T)/(1-T)),[k[0],100*T,100*O]},v.apple.rgb=function(k){return[k[0]/65535*255,k[1]/65535*255,k[2]/65535*255]},v.rgb.apple=function(k){return[k[0]/255*65535,k[1]/255*65535,k[2]/255*65535]},v.gray.rgb=function(k){return[k[0]/100*255,k[0]/100*255,k[0]/100*255]},v.gray.hsl=function(k){return[0,0,k[0]]},v.gray.hsv=v.gray.hsl,v.gray.hwb=function(k){return[0,100,k[0]]},v.gray.cmyk=function(k){return[0,0,0,k[0]]},v.gray.lab=function(k){return[k[0],0,0]},v.gray.hex=function(k){const _=255&Math.round(k[0]/100*255),R=((_<<16)+(_<<8)+_).toString(16).toUpperCase();return"000000".substring(R.length)+R},v.rgb.gray=function(k){return[(k[0]+k[1]+k[2])/3/255*100]}},841:(w,S,p)=>{const y=p(4959),B=p(9325),v={};Object.keys(y).forEach(k=>{v[k]={},Object.defineProperty(v[k],"channels",{value:y[k].channels}),Object.defineProperty(v[k],"labels",{value:y[k].labels});const _=B(k);Object.keys(_).forEach(R=>{const T=_[R];v[k][R]=function(O){const F=function(...L){const $=L[0];if($==null)return $;$.length>1&&(L=$);const K=O(L);if(typeof K=="object")for(let J=K.length,te=0;te1&&(L=$),O(L))};return"conversion"in O&&(F.conversion=O.conversion),F}(T)})}),w.exports=v},9325:(w,S,p)=>{const y=p(4959);function B(_){const R=function(){const O={},F=Object.keys(y);for(let L=F.length,$=0;${w.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8603:(w,S,p)=>{p.d(S,{Z:()=>_});var y=p(1799),B=p.n(y),v=p(2609),k=p.n(v)()(B());k.push([w.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}","",{version:3,sources:["webpack://./../ckeditor5-basic-styles/theme/code.css"],names:[],mappings:"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD",sourcesContent:[`/* * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ @@ -6514,17 +6514,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)}return[v].join(` `)}},6062:(w,S,p)=>{var y,B=function(){return y===void 0&&(y=!!(window&&document&&document.all&&!window.atob)),y},v=function(){var Z={};return function(ee){if(Z[ee]===void 0){var I=document.querySelector(ee);if(window.HTMLIFrameElement&&I instanceof window.HTMLIFrameElement)try{I=I.contentDocument.head}catch{I=null}Z[ee]=I}return Z[ee]}}(),k=[];function _(Z){for(var ee=-1,I=0;I{var S=w&&w.__esModule?()=>w.default:()=>w;return D.d(S,{a:S}),S},D.d=(w,S)=>{for(var p in S)D.o(S,p)&&!D.o(w,p)&&Object.defineProperty(w,p,{enumerable:!0,get:S[p]})},D.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),D.o=(w,S)=>Object.prototype.hasOwnProperty.call(w,S),D.nc=void 0;var M={};return(()=>{function w({emitter:o,activator:e,callback:t,contextElements:n}){o.listenTo(document,"mousedown",(i,r)=>{if(!e())return;const s=typeof r.composedPath=="function"?r.composedPath():[],a=typeof n=="function"?n():n;for(const l of a)if(l.contains(r.target)||s.includes(l))return;t()})}function S(o){return class extends o{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function p({view:o}){o.listenTo(o.element,"submit",(e,t)=>{t.preventDefault(),o.fire("submit")},{useCapture:!0})}D.d(M,{default:()=>ja});const y=function(){try{return navigator.userAgent.toLowerCase()}catch{return""}}(),B={isMac:_(y),isWindows:(v=y,v.indexOf("windows")>-1),isGecko:function(o){return!!o.match(/gecko\/\d+/)}(y),isSafari:function(o){return o.indexOf(" applewebkit/")>-1&&o.indexOf("chrome")===-1}(y),isiOS:function(o){return!!o.match(/iphone|ipad/i)||_(o)&&navigator.maxTouchPoints>0}(y),isAndroid:function(o){return o.indexOf("android")>-1}(y),isBlink:function(o){return o.indexOf("chrome/")>-1&&o.indexOf("edge/")<0}(y),features:{isRegExpUnicodePropertySupported:function(){let o=!1;try{o="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return o}()}};var v;const k=B;function _(o){return o.indexOf("macintosh")>-1}function R(o,e,t,n){t=t||function(l,c){return l===c};const i=Array.isArray(o)?o:Array.prototype.slice.call(o),r=Array.isArray(e)?e:Array.prototype.slice.call(e),s=function(l,c,d){const u=T(l,c,d);if(u===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const g=O(l,u),f=O(c,u),b=T(g,f,d),A=l.length-b,E=c.length-b;return{firstIndex:u,lastIndexOld:A,lastIndexNew:E}}(i,r,t);return n?function(l,c){const{firstIndex:d,lastIndexOld:u,lastIndexNew:g}=l;if(d===-1)return Array(c).fill("equal");let f=[];return d>0&&(f=f.concat(Array(d).fill("equal"))),g-d>0&&(f=f.concat(Array(g-d).fill("insert"))),u-d>0&&(f=f.concat(Array(u-d).fill("delete"))),g0&&d.push({index:u,type:"insert",values:l.slice(u,f)}),g-u>0&&d.push({index:u+(f-u),type:"delete",howMany:g-u}),d}(r,s)}function T(o,e,t){for(let n=0;n200||i>200||n+i>300)return F.fastDiff(o,e,t,!0);let r,s;if(iP?-1:1;d[A+z]&&(d[A]=d[A+z].slice(0)),d[A]||(d[A]=[]),d[A].push(E>P?r:s);let j=Math.max(E,P),Y=j-A;for(;Yc;f--)u[f]=g(f);u[c]=g(c),b++}while(u[c]!==l);return d[c].slice(1)}F.fastDiff=R;const L=function(){return function o(){o.called=!0}};class ${constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=L(),this.off=L()}}const K=new Array(256).fill("").map((o,e)=>("0"+e.toString(16)).slice(-2));function J(){const o=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+K[o>>0&255]+K[o>>8&255]+K[o>>16&255]+K[o>>24&255]+K[e>>0&255]+K[e>>8&255]+K[e>>16&255]+K[e>>24&255]+K[t>>0&255]+K[t>>8&255]+K[t>>16&255]+K[t>>24&255]+K[n>>0&255]+K[n>>8&255]+K[n>>16&255]+K[n>>24&255]}const te={get(o="normal"){return typeof o!="number"?this[o]||this.normal:o},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function Z(o,e){const t=te.get(e.priority);for(let n=0;n{if(typeof u=="object"&&u!==null){if(s.has(u))return`[object ${u.constructor.name}]`;s.add(u)}return u},l=r?` ${JSON.stringify(r,a)}`:"",c=_e(i);return i+l+c}(e,n)),this.name="CKEditorError",this.context=t,this.data=n}is(e){return e==="CKEditorError"}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const n=new I(e.message,t);throw n.stack=e.stack,n}}function Q(o,e){console.warn(...Se(o,e))}function _e(o){return` -Read more: ${ee}#error-${o}`}function Se(o,e){const t=_e(o);return e?[o,e,t]:[o,t]}const Te="38.0.1",Vt=new Date(2023,4,23),pt=typeof window=="object"?window:D.g;if(pt.CKEDITOR_VERSION)throw new I("ckeditor-duplicated-modules",null);pt.CKEDITOR_VERSION=Te;const ft=Symbol("listeningTo"),yn=Symbol("emitterId"),xt=Symbol("delegations"),ml=me(Object);function me(o){return o?class extends o{on(e,t,n){this.listenTo(this,e,t,n)}once(e,t,n){let i=!1;this.listenTo(this,e,(r,...s)=>{i||(i=!0,r.off(),t.call(this,r,...s))},n)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,n,i={}){let r,s;this[ft]||(this[ft]={});const a=this[ft];ur(e)||gl(e);const l=ur(e);(r=a[l])||(r=a[l]={emitter:e,callbacks:{}}),(s=r.callbacks[t])||(s=r.callbacks[t]=[]),s.push(n),function(c,d,u,g,f){d._addEventListener?d._addEventListener(u,g,f):c._addEventListener.call(d,u,g,f)}(this,e,t,n,i)}stopListening(e,t,n){const i=this[ft];let r=e&&ur(e);const s=i&&r?i[r]:void 0,a=s&&t?s.callbacks[t]:void 0;if(!(!i||e&&!s||t&&!a))if(n)gr(this,e,t,n),a.indexOf(n)!==-1&&(a.length===1?delete s.callbacks[t]:gr(this,e,t,n));else if(a){for(;n=a.pop();)gr(this,e,t,n);delete s.callbacks[t]}else if(s){for(t in s.callbacks)this.stopListening(e,t);delete i[r]}else{for(r in i)this.stopListening(i[r].emitter);delete this[ft]}}fire(e,...t){try{const n=e instanceof $?e:new $(this,e),i=n.name;let r=fl(this,i);if(n.path.push(this),r){const a=[n,...t];r=Array.from(r);for(let l=0;l{this[xt]||(this[xt]=new Map),e.forEach(i=>{const r=this[xt].get(i);r?r.set(t,n):this[xt].set(i,new Map([[t,n]]))})}}}stopDelegating(e,t){if(this[xt])if(e)if(t){const n=this[xt].get(e);n&&n.delete(t)}else this[xt].delete(e);else this[xt].clear()}_addEventListener(e,t,n){(function(s,a){const l=pl(s);if(l[a])return;let c=a,d=null;const u=[];for(;c!==""&&!l[c];)l[c]={callbacks:[],childEvents:[]},u.push(l[c]),d&&l[c].childEvents.push(d),d=c,c=c.substr(0,c.lastIndexOf(":"));if(c!==""){for(const g of u)g.callbacks=l[c].callbacks.slice();l[c].childEvents.push(d)}})(this,e);const i=mr(this,e),r={callback:t,priority:te.get(n.priority)};for(const s of i)Z(s,r)}_removeEventListener(e,t){const n=mr(this,e);for(const i of n)for(let r=0;r-1?fl(o,e.substr(0,e.lastIndexOf(":"))):null}function kl(o,e,t){for(let[n,i]of o){i?typeof i=="function"&&(i=i(e.name)):i=e.name;const r=new $(e.source,i);r.path=[...e.path],n.fire(r,...t)}}function gr(o,e,t,n){e._removeEventListener?e._removeEventListener(t,n):o._removeEventListener.call(e,t,n)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{me[o]=ml.prototype[o]});const xe=function(o){var e=typeof o;return o!=null&&(e=="object"||e=="function")},Ko=Symbol("observableProperties"),Go=Symbol("boundObservables"),Zo=Symbol("boundProperties"),En=Symbol("decoratedMethods"),bl=Symbol("decoratedOriginal"),wl=ge(me());function ge(o){return o?class extends o{set(e,t){if(xe(e))return void Object.keys(e).forEach(i=>{this.set(i,e[i])},this);pr(this);const n=this[Ko];if(e in this&&!n.has(e))throw new I("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(i){const r=n.get(e);let s=this.fire(`set:${e}`,e,i,r);s===void 0&&(s=i),r===s&&n.has(e)||(n.set(e,s),this.fire(`change:${e}`,e,s,r))}}),this[e]=t}bind(...e){if(!e.length||!Al(e))throw new I("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new I("observable-bind-duplicate-properties",this);pr(this);const t=this[Zo];e.forEach(i=>{if(t.has(i))throw new I("observable-bind-rebind",this)});const n=new Map;return e.forEach(i=>{const r={property:i,to:[]};t.set(i,r),n.set(i,r)}),{to:F0,toMany:V0,_observable:this,_bindProperties:e,_to:[],_bindings:n}}unbind(...e){if(!this[Ko])return;const t=this[Zo],n=this[Go];if(e.length){if(!Al(e))throw new I("observable-unbind-wrong-properties",this);e.forEach(i=>{const r=t.get(i);r&&(r.to.forEach(([s,a])=>{const l=n.get(s),c=l[a];c.delete(r),c.size||delete l[a],Object.keys(l).length||(n.delete(s),this.stopListening(s,"change"))}),t.delete(i))})}else n.forEach((i,r)=>{this.stopListening(r,"change")}),n.clear(),t.clear()}decorate(e){pr(this);const t=this[e];if(!t)throw new I("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(n,i)=>{n.return=t.apply(this,i)}),this[e]=function(...n){return this.fire(e,n)},this[e][bl]=t,this[En]||(this[En]=[]),this[En].push(e)}stopListening(e,t,n){if(!e&&this[En]){for(const i of this[En])this[i]=this[i][bl];delete this[En]}super.stopListening(e,t,n)}}:wl}function pr(o){o[Ko]||(Object.defineProperty(o,Ko,{value:new Map}),Object.defineProperty(o,Go,{value:new Map}),Object.defineProperty(o,Zo,{value:new Map}))}function F0(...o){const e=function(...r){if(!r.length)throw new I("observable-bind-to-parse-error",null);const s={to:[]};let a;return typeof r[r.length-1]=="function"&&(s.callback=r.pop()),r.forEach(l=>{if(typeof l=="string")a.properties.push(l);else{if(typeof l!="object")throw new I("observable-bind-to-parse-error",null);a={observable:l,properties:[]},s.to.push(a)}}),s}(...o),t=Array.from(this._bindings.keys()),n=t.length;if(!e.callback&&e.to.length>1)throw new I("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new I("observable-bind-to-extra-callback",this);var i;e.to.forEach(r=>{if(r.properties.length&&r.properties.length!==n)throw new I("observable-bind-to-properties-length",this);r.properties.length||(r.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(t[0]).callback=e.callback),i=this._observable,this._to.forEach(r=>{const s=i[Go];let a;s.get(r.observable)||i.listenTo(r.observable,"change",(l,c)=>{a=s.get(r.observable)[c],a&&a.forEach(d=>{_l(i,d.property)})})}),function(r){let s;r._bindings.forEach((a,l)=>{r._to.forEach(c=>{s=c.properties[a.callback?0:r._bindProperties.indexOf(l)],a.to.push([c.observable,s]),function(d,u,g,f){const b=d[Go],A=b.get(g),E=A||{};E[f]||(E[f]=new Set),E[f].add(u),A||b.set(g,E)}(r._observable,a,c.observable,s)})})}(this),this._bindProperties.forEach(r=>{_l(this._observable,r)})}function V0(o,e,t){if(this._bindings.size>1)throw new I("observable-bind-to-many-not-one-binding",this);this.to(...function(n,i){const r=n.map(s=>[s,i]);return Array.prototype.concat.apply([],r)}(o,e),t)}function Al(o){return o.every(e=>typeof e=="string")}function _l(o,e){const t=o[Zo].get(e);let n;t.callback?n=t.callback.apply(o,t.to.map(i=>i[0][i[1]])):(n=t.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(o,e)?o[e]=n:o.set(e,n)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{ge[o]=wl.prototype[o]});class Cl{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}function fr(o){let e=0;for(const t of o)e++;return e}function Ue(o,e){const t=Math.min(o.length,e.length);for(let n=0;n-1},t_=function(o,e){var t=this.__data__,n=Jo(t,o);return n<0?(++this.size,t.push([o,e])):t[n][1]=e,this};function xn(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e-1&&o%1==0&&o-1&&o%1==0&&o<=9007199254740991};var ye={};ye["[object Float32Array]"]=ye["[object Float64Array]"]=ye["[object Int8Array]"]=ye["[object Int16Array]"]=ye["[object Int32Array]"]=ye["[object Uint8Array]"]=ye["[object Uint8ClampedArray]"]=ye["[object Uint16Array]"]=ye["[object Uint32Array]"]=!0,ye["[object Arguments]"]=ye["[object Array]"]=ye["[object ArrayBuffer]"]=ye["[object Boolean]"]=ye["[object DataView]"]=ye["[object Date]"]=ye["[object Error]"]=ye["[object Function]"]=ye["[object Map]"]=ye["[object Number]"]=ye["[object Object]"]=ye["[object RegExp]"]=ye["[object Set]"]=ye["[object String]"]=ye["[object WeakMap]"]=!1;const M_=function(o){return st(o)&&zl(o.length)&&!!ye[Lt(o)]},yr=function(o){return function(e){return o(e)}};var Ml=x&&!x.nodeType&&x,go=Ml&&!0&&m&&!m.nodeType&&m,Er=go&&go.exports===Ml&&vl.process;const In=function(){try{var o=go&&go.require&&go.require("util").types;return o||Er&&Er.binding&&Er.binding("util")}catch{}}();var Fl=In&&In.isTypedArray;const xr=Fl?yr(Fl):M_;var F_=Object.prototype.hasOwnProperty;const Vl=function(o,e){var t=We(o),n=!t&&Cr(o),i=!t&&!n&&mo(o),r=!t&&!n&&!i&&xr(o),s=t||n||i||r,a=s?P_(o.length,String):[],l=a.length;for(var c in o)!e&&!F_.call(o,c)||s&&(c=="length"||i&&(c=="offset"||c=="parent")||r&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||vr(c,l))||a.push(c);return a};var V_=Object.prototype;const Sr=function(o){var e=o&&o.constructor;return o===(typeof e=="function"&&e.prototype||V_)},L_=Sl(Object.keys,Object);var j_=Object.prototype.hasOwnProperty;const $_=function(o){if(!Sr(o))return L_(o);var e=[];for(var t in Object(o))j_.call(o,t)&&t!="constructor"&&e.push(t);return e},ti=function(o){return o!=null&&zl(o.length)&&!Xt(o)},Dr=function(o){return ti(o)?Vl(o):$_(o)},H_=function(o,e){return o&&Tn(e,Dr(e),o)},q_=function(o){var e=[];if(o!=null)for(var t in Object(o))e.push(t);return e};var U_=Object.prototype.hasOwnProperty;const W_=function(o){if(!xe(o))return q_(o);var e=Sr(o),t=[];for(var n in o)(n!="constructor"||!e&&U_.call(o,n))&&t.push(n);return t},Pn=function(o){return ti(o)?Vl(o,!0):W_(o)},K_=function(o,e){return o&&Tn(e,Pn(e),o)};var Ll=x&&!x.nodeType&&x,jl=Ll&&!0&&m&&!m.nodeType&&m,$l=jl&&jl.exports===Ll?dt.Buffer:void 0,Hl=$l?$l.allocUnsafe:void 0;const ql=function(o,e){if(e)return o.slice();var t=o.length,n=Hl?Hl(t):new o.constructor(t);return o.copy(n),n},Br=function(o,e){var t=-1,n=o.length;for(e||(e=Array(n));++t{this._setToTarget(e,i,t[i],n)})}}function uc(o){return Fr(o,fC)}function fC(o){return Rn(o)?o:void 0}function jt(o){if(o){if(o.defaultView)return o instanceof o.defaultView.Document;if(o.ownerDocument&&o.ownerDocument.defaultView)return o instanceof o.ownerDocument.defaultView.Node}return!1}function oi(o){const e=Object.prototype.toString.apply(o);return e=="[object Window]"||e=="[object global]"}const mc=$t(me());function $t(o){return o?class extends o{listenTo(e,t,n,i={}){if(jt(e)||oi(e)){const r={capture:!!i.useCapture,passive:!!i.usePassive},s=this._getProxyEmitter(e,r)||new kC(e,r);this.listenTo(s,t,n,i)}else super.listenTo(e,t,n,i)}stopListening(e,t,n){if(jt(e)||oi(e)){const i=this._getAllProxyEmitters(e);for(const r of i)this.stopListening(r,t,n)}else super.stopListening(e,t,n)}_getProxyEmitter(e,t){return function(n,i){const r=n[ft];return r&&r[i]?r[i].emitter:null}(this,gc(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(t=>this._getProxyEmitter(e,t)).filter(t=>!!t)}}:mc}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{$t[o]=mc.prototype[o]});class kC extends me(){constructor(e,t){super(),gl(this,gc(e,t)),this._domNode=e,this._options=t}attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,n){this.attach(e),me().prototype._addEventListener.call(this,e,t,n)}_removeEventListener(e,t){me().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=n=>{this.fire(e,n)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function gc(o,e){let t=function(n){return n["data-ck-expando"]||(n["data-ck-expando"]=J())}(o);for(const n of Object.keys(e).sort())e[n]&&(t+="-"+n);return t}let Vr;try{Vr={window,document}}catch{Vr={window:{},document:{}}}const oe=Vr;function pc(o){const e=[];let t=o;for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}function Ie(o){return Object.prototype.toString.call(o)=="[object Text]"}function ii(o){return Object.prototype.toString.apply(o)=="[object Range]"}function fc(o){const e=o.ownerDocument.defaultView.getComputedStyle(o);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const kc=["top","right","bottom","left","width","height"];class De{constructor(e){const t=ii(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),wc(e)||t)if(t){const n=De.getDomRangeRects(e);ri(this,De.getBoundingRect(n))}else ri(this,e.getBoundingClientRect());else if(oi(e)){const{innerWidth:n,innerHeight:i}=e;ri(this,{top:0,right:n,bottom:i,left:0,width:n,height:i})}else ri(this,e)}clone(){return new De(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new De(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!bc(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!bc(n);){const i=new De(n),r=t.getIntersection(i);if(!r)return null;r.getArea(){for(const e of o){const t=Ne._getElementCallbacks(e.target);if(t)for(const n of t)n(e)}})}};let si=Ne;function bC(o,e){o instanceof HTMLTextAreaElement&&(o.value=e),o.innerHTML=e}function Lr(o){return e=>e+o}function ai(o){let e=0;for(;o.previousSibling;)o=o.previousSibling,e++;return e}function Ac(o,e,t){o.insertBefore(t,o.childNodes[e]||null)}function On(o){return o&&o.nodeType===Node.COMMENT_NODE}function _c(o){try{oe.document.createAttribute(o)}catch{return!1}return!0}function on(o){return!!(o&&o.getClientRects&&o.getClientRects().length)}si._observerInstance=null,si._elementCallbacks=null;var Cc=Math.pow;function vc({element:o,target:e,positions:t,limiter:n,fitInViewport:i,viewportOffsetConfig:r}){Xt(e)&&(e=e()),Xt(n)&&(n=n());const s=function(g){return g&&g.parentNode?g.offsetParent===oe.document.body?null:g.offsetParent:null}(o),a=new De(o),l=new De(e);let c;const d=i&&function(g){g=Object.assign({top:0,bottom:0,left:0,right:0},g);const f=new De(oe.window);return f.top+=g.top,f.height-=g.top,f.bottom-=g.bottom,f.height-=g.bottom,f}(r)||null,u={targetRect:l,elementRect:a,positionedElementAncestor:s,viewportRect:d};if(n||i){const g=n&&new De(n).getVisible();Object.assign(u,{limiterRect:g,viewportRect:d}),c=function(f,b){const{elementRect:A}=b,E=A.getArea(),P=f.map(Y=>new jr(Y,b)).filter(Y=>!!Y.name);let z=0,j=null;for(const Y of P){const{limiterIntersectionArea:ie,viewportIntersectionArea:Ee}=Y;if(ie===E)return Y;const he=Cc(Ee,2)+Cc(ie,2);he>z&&(z=he,j=Y)}return j}(t,u)||new jr(t[0],u)}else c=new jr(t[0],u);return c}function yc(o){const{scrollX:e,scrollY:t}=oe.window;return o.clone().moveBy(e,t)}class jr{constructor(e,t){const n=e(t.targetRect,t.elementRect,t.viewportRect);if(!n)return;const{left:i,top:r,name:s,config:a}=n;this.name=s,this.config=a,this._positioningFunctionCorrdinates={left:i,top:r},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;if(e){const t=this._options.viewportRect;if(!t)return e.getIntersectionArea(this._rect);{const n=e.getIntersection(t);if(n)return n.getIntersectionArea(this._rect)}}return 0}get viewportIntersectionArea(){const e=this._options.viewportRect;return e?e.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=yc(this._rect),this._options.positionedElementAncestor&&function(e,t){const n=yc(new De(t)),i=fc(t);let r=0,s=0;r-=n.left,s-=n.top,r+=t.scrollLeft,s+=t.scrollTop,r-=i.left,s-=i.top,e.moveBy(r,s)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}function Ec(o){const e=o.parentNode;e&&e.removeChild(o)}function wC({window:o,rect:e,alignToTop:t,forceScroll:n,viewportOffset:i}){const r=e.clone().moveBy(0,i),s=e.clone().moveBy(0,-i),a=new De(o).excludeScrollbarsAndBorders(),l=t&&n,c=[s,r].every(b=>a.contains(b));let{scrollX:d,scrollY:u}=o;const g=d,f=u;l?u-=a.top-e.top+i:c||(Sc(s,a)?u-=a.top-e.top+i:xc(r,a)&&(u+=t?e.top-a.top-i:e.bottom-a.bottom+i)),c||(Dc(e,a)?d-=a.left-e.left+i:Bc(e,a)&&(d+=e.right-a.right+i)),d==g&&u===f||o.scrollTo(d,u)}function AC({parent:o,getRect:e,alignToTop:t,forceScroll:n,ancestorOffset:i=0}){const r=$r(o),s=t&&n;let a,l,c;for(;o!=r.document.body;)l=e(),a=new De(o).excludeScrollbarsAndBorders(),c=a.contains(l),s?o.scrollTop-=a.top-l.top+i:c||(Sc(l,a)?o.scrollTop-=a.top-l.top+i:xc(l,a)&&(o.scrollTop+=t?l.top-a.top-i:l.bottom-a.bottom+i)),c||(Dc(l,a)?o.scrollLeft-=a.left-l.left+i:Bc(l,a)&&(o.scrollLeft+=l.right-a.right+i)),o=o.parentNode}function xc(o,e){return o.bottom>e.bottom}function Sc(o,e){return o.tope.right}function $r(o){return ii(o)?o.startContainer.ownerDocument.defaultView:o.ownerDocument.defaultView}function _C(o){if(ii(o)){let e=o.commonAncestorContainer;return Ie(e)&&(e=e.parentNode),e}return o.parentNode}function Tc(o,e){const t=$r(o),n=new De(o);if(t===e)return n;{let i=t;for(;i!=e;){const r=i.frameElement,s=new De(r).excludeScrollbarsAndBorders();n.moveBy(s.left,s.top),i=i.parent}}return n}const CC={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},vC={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},se=function(){const o={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++)o[String.fromCharCode(e).toLowerCase()]=e;for(let e=48;e<=57;e++)o[e-48]=e;for(let e=112;e<=123;e++)o["f"+(e-111)]=e;for(const e of"`-=[];',./\\")o[e]=e.charCodeAt(0);return o}(),yC=Object.fromEntries(Object.entries(se).map(([o,e])=>[e,o.charAt(0).toUpperCase()+o.slice(1)]));function Nn(o){let e;if(typeof o=="string"){if(e=se[o.toLowerCase()],!e)throw new I("keyboard-unknown-key",null,{key:o})}else e=o.keyCode+(o.altKey?se.alt:0)+(o.ctrlKey?se.ctrl:0)+(o.shiftKey?se.shift:0)+(o.metaKey?se.cmd:0);return e}function li(o){return typeof o=="string"&&(o=function(e){return e.split("+").map(t=>t.trim())}(o)),o.map(e=>typeof e=="string"?function(t){if(t.endsWith("!"))return Nn(t.slice(0,-1));const n=Nn(t);return k.isMac&&n==se.ctrl?se.cmd:n}(e):e).reduce((e,t)=>t+e,0)}function Ic(o){let e=li(o);return Object.entries(k.isMac?CC:vC).reduce((t,[n,i])=>(e&se[n]&&(e&=~se[n],t+=i),t),"")+(e?yC[e]:"")}function Hr(o,e){const t=e==="ltr";switch(o){case se.arrowleft:return t?"left":"right";case se.arrowright:return t?"right":"left";case se.arrowup:return"up";case se.arrowdown:return"down"}}function Pe(o){return Array.isArray(o)?o:[o]}function EC(o,e,t=1){if(typeof t!="number")throw new I("translation-service-quantity-not-a-number",null,{quantity:t});const n=Object.keys(oe.window.CKEDITOR_TRANSLATIONS).length;n===1&&(o=Object.keys(oe.window.CKEDITOR_TRANSLATIONS)[0]);const i=e.id||e.string;if(n===0||!function(l,c){return!!oe.window.CKEDITOR_TRANSLATIONS[l]&&!!oe.window.CKEDITOR_TRANSLATIONS[l].dictionary[c]}(o,i))return t!==1?e.plural:e.string;const r=oe.window.CKEDITOR_TRANSLATIONS[o].dictionary,s=oe.window.CKEDITOR_TRANSLATIONS[o].getPluralForm||(l=>l===1?0:1),a=r[i];return typeof a=="string"?a:a[Number(s(t))]}oe.window.CKEDITOR_TRANSLATIONS||(oe.window.CKEDITOR_TRANSLATIONS={});const xC=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Pc(o){return xC.includes(o)?"rtl":"ltr"}class SC{constructor({uiLanguage:e="en",contentLanguage:t}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Pc(this.uiLanguage),this.contentLanguageDirection=Pc(this.contentLanguage),this.t=(n,i)=>this._t(n,i)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Pe(t),typeof e=="string"&&(e={string:e});const n=e.plural?t[0]:1;return function(i,r){return i.replace(/%(\d+)/g,(s,a)=>athis._items.length||t<0)throw new I("collection-add-item-invalid-index",this);let n=0;for(const i of e){const r=this._getItemIdBeforeAdding(i),s=t+n;this._items.splice(s,0,i),this._itemMap.set(r,i),this.fire("add",i,s),n++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if(typeof e=="string")t=this._itemMap.get(e);else{if(typeof e!="number")throw new I("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t=typeof e=="string"?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,n]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:n}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new I("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(n=>new t(n))},using:t=>{typeof t=="function"?this._setUpBindToBinding(t):this._setUpBindToBinding(n=>n[t])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(i,r,s)=>{const a=t._bindToCollection==this,l=t._bindToInternalToExternalMap.get(r);if(a&&l)this._bindToExternalToInternalMap.set(r,l),this._bindToInternalToExternalMap.set(l,r);else{const c=e(r);if(!c)return void this._skippedIndexesFromExternal.push(s);let d=s;for(const u of this._skippedIndexesFromExternal)s>u&&d--;for(const u of t._skippedIndexesFromExternal)d>=u&&d++;this._bindToExternalToInternalMap.set(r,c),this._bindToInternalToExternalMap.set(c,r),this.add(c,d);for(let u=0;u{const a=this._bindToExternalToInternalMap.get(r);a&&this.remove(a),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((l,c)=>(sc&&l.push(c),l),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],typeof n!="string")throw new I("collection-add-invalid-id",this);if(this.get(n))throw new I("collection-add-item-already-exists",this)}else e[t]=n=J();return n}_remove(e){let t,n,i,r=!1;const s=this._idProperty;if(typeof e=="string"?(n=e,i=this._itemMap.get(n),r=!i,i&&(t=this._items.indexOf(i))):typeof e=="number"?(t=e,i=this._items[t],r=!i,i&&(n=i[s])):(i=e,n=i[s],t=this._items.indexOf(i),r=t==-1||!this._itemMap.get(n)),r)throw new I("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const a=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(a),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function ze(o){const e=o.next();return e.done?null:e.value}class ht extends $t(ge()){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(e){if(this._elements.has(e))throw new I("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}class St{constructor(){this._listener=new($t())}listenTo(e){this._listener.listenTo(e,"keydown",(t,n)=>{this._listener.fire("_keydown:"+Nn(n),n)})}set(e,t,n={}){const i=li(e),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(s,a)=>{t(a,()=>{a.preventDefault(),a.stopPropagation(),s.stop()}),s.return=!0},{priority:r})}press(e){return!!this._listener.fire("_keydown:"+Nn(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function Dt(o){return et(o)?new Map(o):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(o)}function qr(o,e){let t;function n(...i){n.cancel(),t=setTimeout(()=>o(...i),e)}return n.cancel=()=>{clearTimeout(t)},n}function Ur(o,e){return!!(t=o.charAt(e-1))&&t.length==1&&/[\ud800-\udbff]/.test(t)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(o.charAt(e));var t}function Wr(o,e){return!!(t=o.charAt(e))&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t);var t}const DC=function(){const o=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],e=new RegExp("\\p{Regional_Indicator}{2}","u").source,t="(?:"+o.map(n=>n.source).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}();function Rc(o,e){const t=String(o).matchAll(DC);return Array.from(t).some(n=>n.index{this._renderViewIntoCollectionParent(n,i)}),this.on("remove",(t,n)=>{n.element&&this._parentElement&&n.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||!e.every(t=>typeof t=="string"))throw new I("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const r of e)i.delegate(r).to(t)}),this.on("remove",(n,i)=>{for(const r of e)i.stopDelegating(r,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}var BC=D(6062),G=D.n(BC),Oc=D(4793),TC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Oc.Z,TC),Oc.Z.locals;class re extends $t(ge()){constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new at,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e,n.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=bt.bind(this,this)}createCollection(e){const t=new rn(e);return this._viewCollections.add(t),t}registerChild(e){et(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){et(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new bt(e)}extendTemplate(e){bt.extend(this.template,e)}render(){if(this.isRendered)throw new I("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)}}class bt extends me(){constructor(e){super(),Object.assign(this,Fc(Mc(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new I("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)di(n)?yield n:Kr(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new IC({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,r)=>new Nc({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:r})}}static extend(e,t){if(e._isRendered)throw new I("template-extend-render",[this,e]);$c(e,Fc(Mc(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new I("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),ci(this.text)?this._bindToObservable({schema:this.text,updater:PC(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,n=e.revertData;for(const i in this.attributes){const r=t.getAttribute(i),s=this.attributes[i];n&&(n.attributes[i]=r);const a=Hc(s)?s[0].ns:null;if(ci(s)){const l=Hc(s)?s[0].value:s;n&&qc(i)&&l.unshift(r),this._bindToObservable({schema:l,updater:RC(t,i,a),data:e})}else if(i=="style"&&typeof s[0]!="string")this._renderStyleAttribute(s[0],e);else{n&&r&&qc(i)&&s.unshift(r);const l=s.map(c=>c&&c.value||c).reduce((c,d)=>c.concat(d),[]).reduce(Lc,"");zn(l)||t.setAttributeNS(a,i,l)}}}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const r=e[i];ci(r)?this._bindToObservable({schema:[r],updater:OC(n,i),data:t}):n.style[i]=r}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let r=0;for(const s of this.children)if(Gr(s)){if(!i){s.setParent(t);for(const a of s)n.appendChild(a.element)}}else if(di(s))i||(s.isRendered||s.render(),n.appendChild(s.element));else if(jt(s))n.appendChild(s);else if(i){const a={children:[],bindings:[],attributes:{}};e.revertData.children.push(a),s._renderNode({intoFragment:!1,node:n.childNodes[r++],isApplying:!0,revertData:a})}else n.appendChild(s.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(i=>{const[r,s]=t.split("@");return i.activateDomEventListener(r,s,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;zc(e,t,n);const r=e.filter(s=>!zn(s)).filter(s=>s.observable).map(s=>s.activateAttributeListener(e,t,n));i&&i.bindings.push(r)}_revertTemplateFromNode(e,t){for(const i of t.bindings)for(const r of i)r();if(t.text)return void(e.textContent=t.text);const n=e;for(const i in t.attributes){const r=t.attributes[i];r===null?n.removeAttribute(i):n.setAttribute(i,r)}for(let i=0;izc(e,t,n);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,i),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,i)}}}class IC extends fo{constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,n){const i=(r,s)=>{t&&!s.target.matches(t)||(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(s):this.observable.fire(this.eventNameOrFunction,s))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class Nc extends fo{constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!zn(super.getValue(e))&&(this.valueIfTrue||!0)}}function ci(o){return!!o&&(o.value&&(o=o.value),Array.isArray(o)?o.some(ci):o instanceof fo)}function zc(o,e,{node:t}){const n=function(r,s){return r.map(a=>a instanceof fo?a.getValue(s):a)}(o,t);let i;i=o.length==1&&o[0]instanceof Nc?n[0]:n.reduce(Lc,""),zn(i)?e.remove():e.set(i)}function PC(o){return{set(e){o.textContent=e},remove(){o.textContent=""}}}function RC(o,e,t){return{set(n){o.setAttributeNS(t,e,n)},remove(){o.removeAttributeNS(t,e)}}}function OC(o,e){return{set(t){o.style[e]=t},remove(){o.style[e]=null}}}function Mc(o){return Fr(o,e=>{if(e&&(e instanceof fo||Kr(e)||di(e)||Gr(e)))return e})}function Fc(o){if(typeof o=="string"?o=function(e){return{text:[e]}}(o):o.text&&function(e){e.text=Pe(e.text)}(o),o.on&&(o.eventListeners=function(e){for(const t in e)Vc(e,t);return e}(o.on),delete o.on),!o.text){o.attributes&&function(t){for(const n in t)t[n].value&&(t[n].value=Pe(t[n].value)),Vc(t,n)}(o.attributes);const e=[];if(o.children)if(Gr(o.children))e.push(o.children);else for(const t of o.children)Kr(t)||di(t)||jt(t)?e.push(t):e.push(new bt(t));o.children=e}return o}function Vc(o,e){o[e]=Pe(o[e])}function Lc(o,e){return zn(e)?o:zn(o)?e:`${o} ${e}`}function jc(o,e){for(const t in e)o[t]?o[t].push(...e[t]):o[t]=e[t]}function $c(o,e){if(e.attributes&&(o.attributes||(o.attributes={}),jc(o.attributes,e.attributes)),e.eventListeners&&(o.eventListeners||(o.eventListeners={}),jc(o.eventListeners,e.eventListeners)),e.text&&o.text.push(...e.text),e.children&&e.children.length){if(o.children.length!=e.children.length)throw new I("ui-template-extend-children-mismatch",o);let t=0;for(const n of e.children)$c(o.children[t++],n)}}function zn(o){return!o&&o!==0}function di(o){return o instanceof re}function Kr(o){return o instanceof bt}function Gr(o){return o instanceof rn}function Hc(o){return xe(o[0])&&o[0].ns}function qc(o){return o=="class"||o=="style"}class NC extends rn{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new bt({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=kr(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&e.childElementCount==0&&e.remove()}}var Uc=D(6574),zC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Uc.Z,zC),Uc.Z.locals;const Wc=class extends re{constructor(){super();const o=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon","ck-reset_all-excluded",o.if("isColorInherited","ck-icon_inherit-color")],viewBox:o.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const o=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=o.getAttribute("viewBox");e&&(this.viewBox=e);for(const{name:t,value:n}of Array.from(o.attributes))Wc.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;o.childNodes.length>0;)this.element.appendChild(o.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(o=>{o.style.fill=this.fillColor})}};let ko=Wc;ko.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"];var Kc=D(4906),MC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Kc.Z,MC),Kc.Z.locals;class Ae extends re{constructor(e){super(e),this._focusDelayed=null;const t=this.bindTemplate,n=J();this.set("ariaChecked",void 0),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${n}`),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._createLabelView(),this.iconView=new ko,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const i={tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",r=>!r),t.if("isVisible","ck-hidden",r=>!r),t.to("isOn",r=>r?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],role:t.to("role"),type:t.to("type",r=>r||"button"),tabindex:t.to("tabindex"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy"),"aria-disabled":t.if("isEnabled",!0,r=>!r),"aria-checked":t.to("isOn"),"aria-pressed":t.to("isOn",r=>!!this.isToggleable&&String(!!r)),"data-cke-tooltip-text":t.to("_tooltipString"),"data-cke-tooltip-position":t.to("tooltipPosition")},children:this.children,on:{click:t.to(r=>{this.isEnabled?this.fire("execute"):r.preventDefault()})}};k.isSafari&&(this._focusDelayed||(this._focusDelayed=qr(()=>this.focus(),0)),i.on.mousedown=t.to(()=>{this._focusDelayed()}),i.on.mouseup=t.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(i)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_createLabelView(){const e=new re,t=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:t.to("labelStyle"),id:this.ariaLabelledBy},children:[{text:t.to("label")}]}),e}_createKeystrokeView(){const e=new re;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Ic(t))}]}),e}_getTooltipString(e,t,n){return e?typeof e=="string"?e:(n&&(n=Ic(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}var Gc=D(6758),FC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Gc.Z,FC),Gc.Z.locals;class hi extends Ae{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 re;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}var Zc=D(6781),VC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Zc.Z,VC),Zc.Z.locals,D(1103),D(841);var Jc=D(3662),LC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Jc.Z,LC),Jc.Z.locals;class Yc extends re{constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${J()}`;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")}]})}}var Qc=D(2577),jC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Qc.Z,jC),Qc.Z.locals;class Xc extends re{constructor(e,t){super(e);const n=`ck-labeled-field-view-${J()}`,i=`ck-labeled-field-view-status-${J()}`;this.fieldView=t(this,n,i),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(n),this.statusView=this._createStatusView(i),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(s,a)=>s||a);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",s=>!s),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new Yc(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new re(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",i=>!i)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}var ed=D(4879),$C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(ed.Z,$C),ed.Z.locals;class HC extends re{constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.focusTracker=new ht,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0),this.set("inputMode","text");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"),readonly:t.to("isReadOnly"),inputmode:t.to("inputMode"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to((...n)=>{this.fire("input",...n),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,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||e===0?e:""}}class qC extends HC{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class UC extends re{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",n=>`ck-dropdown__panel_${n}`),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(n=>{n.target.tagName.toLocaleLowerCase()!=="input"&&n.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;typeof e.focus=="function"?e.focus():Q("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()}}}var td=D(5485),WC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(td.Z,WC),td.Z.locals;const Zr=class extends re{constructor(o,e,t){super(o);const n=this.bindTemplate;this.buttonView=e,this.panelView=t,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.keystrokes=new St,this.focusTracker=new ht,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",i=>!i)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[e,t]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.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.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",(e,t,n)=>{n&&(this.panelPosition==="auto"?this.panelView.position=Zr._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const o=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",o),this.keystrokes.set("esc",o)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:o,north:e,southEast:t,southWest:n,northEast:i,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=Zr.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[t,n,s,a,o,i,r,l,c,e]:[n,t,a,s,o,r,i,c,l,e]}};let Jr=Zr;Jr.defaultPanelPositions={south:(o,e)=>({top:o.bottom,left:o.left-(e.width-o.width)/2,name:"s"}),southEast:o=>({top:o.bottom,left:o.left,name:"se"}),southWest:(o,e)=>({top:o.bottom,left:o.left-e.width+o.width,name:"sw"}),southMiddleEast:(o,e)=>({top:o.bottom,left:o.left-(e.width-o.width)/4,name:"sme"}),southMiddleWest:(o,e)=>({top:o.bottom,left:o.left-3*(e.width-o.width)/4,name:"smw"}),north:(o,e)=>({top:o.top-e.height,left:o.left-(e.width-o.width)/2,name:"n"}),northEast:(o,e)=>({top:o.top-e.height,left:o.left,name:"ne"}),northWest:(o,e)=>({top:o.top-e.height,left:o.left-e.width+o.width,name:"nw"}),northMiddleEast:(o,e)=>({top:o.top-e.height,left:o.left-(e.width-o.width)/4,name:"nme"}),northMiddleWest:(o,e)=>({top:o.top-e.height,left:o.left-3*(e.width-o.width)/4,name:"nmw"})},Jr._getOptimalPosition=vc;const nd='';class od extends Ae{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 ko;return e.content=nd,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class bo{constructor(e){if(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 n=e.actions[t];typeof n=="string"&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(r,s)=>{this[t](),s()})}}get first(){return this.focusables.find(Yr)||null}get last(){return this.focusables.filter(Yr).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(t===null)return this[e===1?"first":"last"];let i=(t+n+e)%n;do{const r=this.focusables.get(i);if(Yr(r))return r;i=(i+n+e)%n}while(i!==t);return null}}function Yr(o){return!(!o.focus||!on(o.element))}class id extends re{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class KC extends re{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function rd(o){return Array.isArray(o)?{items:o,removeItems:[]}:o?Object.assign({items:[],removeItems:[]},o):{items:[],removeItems:[]}}class q extends ge(){constructor(e){super(),this._disableStack=new Set,this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",sd,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",sd),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function sd(o){o.return=!1,o.stop()}class ne extends ge(){constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{this.affectsData&&(e.isReadOnly||this._isEnabledBasedOnSelection&&!e.model.canEditAt(e.model.document.selection))&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",t=>{this.isEnabled||t.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",ad,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",ad),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function ad(o){o.return=!1,o.stop()}class ld extends ne{constructor(){super(...arguments),this._childCommandsDefinitions=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){Z(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:t})=>t.isEnabled);return e&&e.command}}class cd extends me(){constructor(e,t=[],n=[]){super(),this._plugins=new Map,this._context=e,this._availablePlugins=new Map;for(const i of t)i.pluginName&&this._availablePlugins.set(i.pluginName,i);this._contextPlugins=new Map;for(const[i,r]of n)this._contextPlugins.set(i,r),this._contextPlugins.set(r,i),i.pluginName&&this._availablePlugins.set(i.pluginName,i)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let n=e;throw typeof e=="function"&&(n=e.pluginName||e.name),new I("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[],n=[]){const i=this,r=this._context;(function b(A,E=new Set){A.forEach(P=>{l(P)&&(E.has(P)||(E.add(P),P.pluginName&&!i._availablePlugins.has(P.pluginName)&&i._availablePlugins.set(P.pluginName,P),P.requires&&b(P.requires,E)))})})(e),g(e);const s=[...function b(A,E=new Set){return A.map(P=>l(P)?P:i._availablePlugins.get(P)).reduce((P,z)=>E.has(z)?P:(E.add(z),z.requires&&(g(z.requires,z),b(z.requires,E).forEach(j=>P.add(j))),P.add(z)),new Set)}(e.filter(b=>!d(b,t)))];(function(b,A){for(const E of A){if(typeof E!="function")throw new I("plugincollection-replace-plugin-invalid-type",null,{pluginItem:E});const P=E.pluginName;if(!P)throw new I("plugincollection-replace-plugin-missing-name",null,{pluginItem:E});if(E.requires&&E.requires.length)throw new I("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:P});const z=i._availablePlugins.get(P);if(!z)throw new I("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:P});const j=b.indexOf(z);if(j===-1){if(i._contextPlugins.has(z))return;throw new I("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:P})}if(z.requires&&z.requires.length)throw new I("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:P});b.splice(j,1,E),i._availablePlugins.set(P,E)}})(s,n);const a=s.map(b=>{let A=i._contextPlugins.get(b);return A=A||new b(r),i._add(b,A),A});return f(a,"init").then(()=>f(a,"afterInit")).then(()=>a);function l(b){return typeof b=="function"}function c(b){return l(b)&&!!b.isContextPlugin}function d(b,A){return A.some(E=>E===b||u(b)===E||u(E)===b)}function u(b){return l(b)?b.pluginName||b.name:b}function g(b,A=null){b.map(E=>l(E)?E:i._availablePlugins.get(E)||E).forEach(E=>{(function(P,z){if(!l(P))throw z?new I("plugincollection-soft-required",r,{missingPlugin:P,requiredBy:u(z)}):new I("plugincollection-plugin-not-found",r,{plugin:P})})(E,A),function(P,z){if(c(z)&&!c(P))throw new I("plugincollection-context-required",r,{plugin:u(P),requiredBy:u(z)})}(E,A),function(P,z){if(z&&d(P,t))throw new I("plugincollection-required",r,{plugin:u(P),requiredBy:u(z)})}(E,A)})}function f(b,A){return b.reduce((E,P)=>P[A]?i._contextPlugins.has(P)?E:E.then(P[A].bind(P)):E,Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)typeof t.destroy!="function"||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new I("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}class dd{constructor(e){this._contextOwner=null,this.config=new hc(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new cd(this,t);const n=this.config.get("language")||{};this.locale=new SC({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new at}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const n of e.concat(t)){if(typeof n!="function")throw new I("context-initplugins-constructor-only",null,{Plugin:n});if(n.isContextPlugin!==!0)throw new I("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new I("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}class ui extends ge(){constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}class GC extends St{constructor(e){super(),this.editor=e}set(e,t,n={}){if(typeof t=="string"){const i=t;t=(r,s)=>{this.editor.execute(i),s()}}super.set(e,t,n)}}var hd=D(4717),ZC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(hd.Z,ZC),hd.Z.locals;const mi=new WeakMap;function JC(o,e){return!!e.hasClass("ck-placeholder")&&(o.removeClass("ck-placeholder",e),!0)}function Qr(o,e){const t=mi.get(o),n=[];let i=!1;for(const[r,s]of t)s.isDirectHost&&(n.push(r),ud(e,r,s)&&(i=!0));for(const[r,s]of t){if(s.isDirectHost)continue;const a=YC(r);a&&(n.includes(a)||(s.hostElement=a,ud(e,r,s)&&(i=!0)))}return i}function ud(o,e,t){const{text:n,isDirectHost:i,hostElement:r}=t;let s=!1;return r.getAttribute("data-placeholder")!==n&&(o.setAttribute("data-placeholder",n,r),s=!0),(i||e.childCount==1)&&function(a,l){if(!a.isAttached()||Array.from(a.getChildren()).some(u=>!u.is("uiElement")))return!1;const c=a.document,d=c.selection.anchor;return!(c.isComposing&&d&&d.parent===a||!l&&c.isFocused&&(!d||d.parent===a))}(r,t.keepOnFocus)?function(a,l){return!l.hasClass("ck-placeholder")&&(a.addClass("ck-placeholder",l),!0)}(o,r)&&(s=!0):JC(o,r)&&(s=!0),s}function YC(o){if(o.childCount){const e=o.getChild(0);if(e.is("element")&&!e.is("uiElement")&&!e.is("attributeElement"))return e}return null}class sn{is(){throw new Error("is() method is abstract")}}const md=function(o){return Mr(o,4)};class an extends me(sn){constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))==-1)throw new I("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Ue(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]e.data.length)throw new I("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new I("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;n!==null;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}wt.prototype.is=function(o){return o==="$textProxy"||o==="view:$textProxy"||o==="textProxy"||o==="view:textProxy"};class Mn{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)(typeof t=="string"||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const n of this._patterns){const i=gd(t,n);if(i)return{element:t,pattern:n,match:i}}return null}matchAll(...e){const t=[];for(const n of e)for(const i of this._patterns){const r=gd(n,i);r&&t.push({element:n,pattern:i,match:r})}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1)return null;const e=this._patterns[0],t=e.name;return typeof e=="function"||!t||t instanceof RegExp?null:t}}function gd(o,e){if(typeof e=="function")return e(o);const t={};return e.name&&(t.name=function(n,i){return n instanceof RegExp?!!i.match(n):n===i}(e.name,o.name),!t.name)||e.attributes&&(t.attributes=function(n,i){const r=new Set(i.getAttributeKeys());return Ge(n)?(n.style!==void 0&&Q("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Q("matcher-pattern-deprecated-attributes-class-key",n)):(r.delete("style"),r.delete("class")),Xr(n,r,s=>i.getAttribute(s))}(e.attributes,o),!t.attributes)||e.classes&&(t.classes=function(n,i){return Xr(n,i.getClassNames(),()=>{})}(e.classes,o),!t.classes)||e.styles&&(t.styles=function(n,i){return Xr(n,i.getStyleNames(!0),r=>i.getStyle(r))}(e.styles,o),!t.styles)?null:t}function Xr(o,e,t){const n=function(s){return Array.isArray(s)?s.map(a=>Ge(a)?(a.key!==void 0&&a.value!==void 0||Q("matcher-pattern-missing-key-or-value",a),[a.key,a.value]):[a,!0]):Ge(s)?Object.entries(s):[[s,!0]]}(o),i=Array.from(e),r=[];if(n.forEach(([s,a])=>{i.forEach(l=>{(function(c,d){return c===!0||c===d||c instanceof RegExp&&d.match(c)})(s,l)&&function(c,d,u){if(c===!0)return!0;const g=u(d);return c===g||c instanceof RegExp&&!!String(g).match(c)}(a,l,t)&&r.push(l)})}),n.length&&!(r.lengthi?0:i+e),(t=t>i?i:t)<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var r=Array(i);++n0){if(++e>=800)return arguments[0]}else e=0;return o.apply(void 0,arguments)}}(Av),_d=function(o,e){return Cv(bv(o,e,ln),o+"")},vv=function(o,e,t){if(!xe(t))return!1;var n=typeof e;return!!(n=="number"?ti(t)&&vr(e,t.length):n=="string"&&e in t)&&lo(t[e],o)},ss=function(o){return _d(function(e,t){var n=-1,i=t.length,r=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(r=o.length>3&&typeof r=="function"?(i--,r):void 0,s&&vv(t[0],t[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++nn===e);return Array.isArray(t)}set(e,t){if(xe(e))for(const[n,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=as(e);uv(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!xe(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([n])=>n===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?this._styleProcessor.getStyleNames(this._styles):this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),i=pi(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class Sv{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(xe(t))ls(n,as(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:r,value:s}=i(t);ls(n,r,s)}else ls(n,e,t)}getNormalized(e,t){if(!e)return Cd({},t);if(t[e]!==void 0)return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if(typeof n=="string")return pi(t,n);const i=n(e,t);if(i)return i}return pi(t,as(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return n===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter(i=>{const r=this.getNormalized(i,e);return r&&typeof r=="object"?Object.keys(r).length:r}),n=new Set([...t,...Object.keys(e)]);return Array.from(n.values())}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function as(o){return o.replace("-",".")}function ls(o,e,t){let n=t;xe(t)&&(n=Cd({},pi(o,e),t)),Ev(o,e,n)}class tt extends an{constructor(e,t,n,i){if(super(e),this._unsafeAttributesToRender=[],this._customProperties=new Map,this.name=t,this._attrs=function(r){const s=Dt(r);for(const[a,l]of s)l===null?s.delete(a):typeof l!="string"&&s.set(a,String(l));return s}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const r=this._attrs.get("class");vd(this._classes,r),this._attrs.delete("class")}this._styles=new xv(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style"))}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if(e=="class")return this._classes.size>0?[...this._classes].join(" "):void 0;if(e=="style"){const t=this._styles.toString();return t==""?void 0:t}return this._attrs.get(e)}hasAttribute(e){return e=="class"?this._classes.size>0:e=="style"?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof tt))return!1;if(this===e)return!0;if(this.name!=e.name||this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Mn(...e);let n=this.parent;for(;n&&!n.is("documentFragment");){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(i=>`${i[0]}="${i[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(t?` style="${t}"`:"")+(n==""?"":` ${n}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._unsafeAttributesToRender=this._unsafeAttributesToRender,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new pe(r,s)]:(et(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new pe(r,a):a instanceof wt?new pe(r,a.data):a))}(this.document,t);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,r.document=this.document,this._children.splice(e,0,r),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n0&&(this._classes.clear(),!0):e=="style"?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Pe(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Pe(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),typeof e!="string"?this._styles.set(e):this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Pe(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function vd(o,e){const t=e.split(/\s+/);o.clear(),t.forEach(n=>o.add(n))}tt.prototype.is=function(o,e){return e?e===this.name&&(o==="element"||o==="view:element"):o==="element"||o==="view:element"||o==="node"||o==="view:node"};class wo extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=yd}}function yd(){const o=[...this.getChildren()],e=o[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const t of o)if(!t.is("uiElement"))return null;return this.childCount}wo.prototype.is=function(o,e){return e?e===this.name&&(o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class fi extends ge(wo){constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",r=>r&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}destroy(){this.stopListening()}}fi.prototype.is=function(o,e){return e?e===this.name&&(o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};const Ed=Symbol("rootName");class xd extends fi{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Ed)}set rootName(e){this._setCustomProperty(Ed,e)}set _name(e){this.name=e}}xd.prototype.is=function(o,e){return e?e===this.name&&(o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class cn{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new I("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new I("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=U._createAt(e.startPosition):this._position=U._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,n;do n=this.position,t=this.next();while(!t.done&&e(t.value));t.done||(this._position=n)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===n.childCount)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let i;if(n instanceof pe){if(e.isAtEnd)return this._position=U._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof tt)return this.shallow?e.offset++:e=new U(i,0),this._position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof pe){if(this.singleCharacters)return e=new U(i,0),this._position=e,this._next();{let r,s=i.data.length;return i==this._boundaryEndParent?(s=this.boundaries.end.offset,r=new wt(i,0,s),e=U._createAfter(r)):(r=new wt(i,0,i.data.length),e.offset++),this._position=e,this._formatReturnValue("text",r,t,e,s)}}if(typeof i=="string"){let r;this.singleCharacters?r=1:r=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const s=new wt(n,e.offset,r);return e.offset+=r,this._position=e,this._formatReturnValue("text",s,t,e,r)}return e=U._createAfter(n),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===0)return{done:!0,value:void 0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let i;if(n instanceof pe){if(e.isAtStart)return this._position=U._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof tt)return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new U(i,i.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof pe){if(this.singleCharacters)return e=new U(i,i.data.length),this._position=e,this._previous();{let r,s=i.data.length;if(i==this._boundaryStartParent){const a=this.boundaries.start.offset;r=new wt(i,a,i.data.length-a),s=r.data.length,e=U._createBefore(r)}else r=new wt(i,0,i.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",r,t,e,s)}}if(typeof i=="string"){let r;if(this.singleCharacters)r=1;else{const a=n===this._boundaryStartParent?this.boundaries.start.offset:0;r=e.offset-a}e.offset-=r;const s=new wt(n,e.offset,r);return this._position=e,this._formatReturnValue("text",s,t,e,r)}return e=U._createBefore(n),this._position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,r){return t instanceof wt&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=U._createAfter(t.textNode):(i=U._createAfter(t.textNode),this._position=i)),t.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=U._createBefore(t.textNode):(i=U._createBefore(t.textNode),this._position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:r}}}}class U extends sn{constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof fi);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=U._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new cn(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return i===0?null:t[i-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=Ue(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(U._createBefore(e),t)}}function ki(o){return!(!o.item.is("attributeElement")&&!o.item.is("uiElement"))}X.prototype.is=function(o){return o==="range"||o==="view:range"};class At extends me(sn){constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake||this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel||this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=fr(this.getRanges());if(t!=fr(e.getRanges()))return!1;if(t==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let i=!1;for(let r of e.getRanges())if(r=r.getTrimmed(),n.start.isEqual(r.start)&&n.end.isEqual(r.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,n,i]=e;if(typeof n=="object"&&(i=n,n=void 0),t===null)this._setRanges([]),this._setFakeOptions(i);else if(t instanceof At||t instanceof cs)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof X)this._setRanges([t],i&&i.backward),this._setFakeOptions(i);else if(t instanceof U)this._setRanges([new X(t)]),this._setFakeOptions(i);else if(t instanceof an){const r=!!i&&!!i.backward;let s;if(n===void 0)throw new I("view-selection-setto-required-second-parameter",this);s=n=="in"?X._createIn(t):n=="on"?X._createOn(t):new X(U._createAt(t,n)),this._setRanges([s],r),this._setFakeOptions(i)}else{if(!et(t))throw new I("view-selection-setto-not-selectable",this);this._setRanges(t,i&&i.backward),this._setFakeOptions(i)}this.fire("change")}setFocus(e,t){if(this.anchor===null)throw new I("view-selection-setfocus-no-ranges",this);const n=U._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.pop(),n.compareWith(i)=="before"?this._addRange(new X(n,i),!0):this._addRange(new X(i,n)),this.fire("change")}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const n of e)this._addRange(n);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof X))throw new I("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new I("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new X(e.start,e.end))}}At.prototype.is=function(o){return o==="selection"||o==="view:selection"};class cs extends me(sn){constructor(...e){super(),this._selection=new At,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}cs.prototype.is=function(o){return o==="selection"||o=="documentSelection"||o=="view:selection"||o=="view:documentSelection"};class Fn extends ${constructor(e,t,n){super(e,t),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const ds=Symbol("bubbling contexts");function hs(o){return class extends o{fire(e,...t){try{const n=e instanceof $?e:new $(this,e),i=us(this);if(!i.size)return;if(Ao(n,"capturing",this),Vn(i,"$capture",n,...t))return n.return;const r=n.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,a=!!s&&!!Sd(i,s);let l=s||function(c){if(!c)return null;const d=c.start.parent,u=c.end.parent,g=d.getPath(),f=u.getPath();return g.length>f.length?d:u}(r);if(Ao(n,"atTarget",l),!a){if(Vn(i,"$text",n,...t))return n.return;Ao(n,"bubbling",l)}for(;l;){if(l.is("rootElement")){if(Vn(i,"$root",n,...t))return n.return}else if(l.is("element")&&Vn(i,l.name,n,...t))return n.return;if(Vn(i,l,n,...t))return n.return;l=l.parent,Ao(n,"bubbling",l)}return Ao(n,"bubbling",this),Vn(i,"$document",n,...t),n.return}catch(n){I.rethrowUnexpectedError(n,this)}}_addEventListener(e,t,n){const i=Pe(n.context||"$document"),r=us(this);for(const s of i){let a=r.get(s);a||(a=new(me()),r.set(s,a)),this.listenTo(a,e,t,n)}}_removeEventListener(e,t){const n=us(this);for(const i of n.values())this.stopListening(i,e,t)}}}{const o=hs(Object);["fire","_addEventListener","_removeEventListener"].forEach(e=>{hs[e]=o.prototype[e]})}function Ao(o,e,t){o instanceof Fn&&(o._eventPhase=e,o._currentTarget=t)}function Vn(o,e,t,...n){const i=typeof e=="string"?o.get(e):Sd(o,e);return!!i&&(i.fire(t,...n),t.stop.called)}function Sd(o,e){for(const[t,n]of o)if(typeof t=="function"&&t(e))return n;return null}function us(o){return o[ds]||(o[ds]=new Map),o[ds]}class Dd extends hs(ge()){constructor(e){super(),this._postFixers=new Set,this.selection=new cs,this.roots=new at({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(t=n(e),t)break;while(t)}}class dn extends tt{constructor(e,t,n,i){super(e,t,n,i),this._priority=10,this._id=null,this._clonesGroup=null,this.getFillerOffset=Dv}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new I("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function Dv(){if(ms(this))return null;let o=this.parent;for(;o&&o.is("attributeElement");){if(ms(o)>1)return null;o=o.parent}return!o||ms(o)>1?null:this.childCount}function ms(o){return Array.from(o.getChildren()).filter(e=>!e.is("uiElement")).length}dn.DEFAULT_PRIORITY=10,dn.prototype.is=function(o,e){return e?e===this.name&&(o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"):o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class gs extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Bv}_insertChild(e,t){if(t&&(t instanceof an||Array.from(t).length>0))throw new I("view-emptyelement-cannot-add",[this,t]);return 0}}function Bv(){return null}gs.prototype.is=function(o,e){return e?e===this.name&&(o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"):o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class bi extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Iv}_insertChild(e,t){if(t&&(t instanceof an||Array.from(t).length>0))throw new I("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const n of this.getAttributeKeys())t.setAttribute(n,this.getAttribute(n));return t}}function Tv(o){o.document.on("arrowKey",(e,t)=>function(n,i,r){if(i.keyCode==se.arrowright){const s=i.domTarget.ownerDocument.defaultView.getSelection(),a=s.rangeCount==1&&s.getRangeAt(0).collapsed;if(a||i.shiftKey){const l=s.focusNode,c=s.focusOffset,d=r.domPositionToView(l,c);if(d===null)return;let u=!1;const g=d.getLastMatchingPosition(f=>(f.item.is("uiElement")&&(u=!0),!(!f.item.is("uiElement")&&!f.item.is("attributeElement"))));if(u){const f=r.viewPositionToDom(g);a?s.collapse(f.parent,f.offset):s.extend(f.parent,f.offset)}}}}(0,t,o.domConverter),{priority:"low"})}function Iv(){return null}bi.prototype.is=function(o,e){return e?e===this.name&&(o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"):o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class ps extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Pv}_insertChild(e,t){if(t&&(t instanceof an||Array.from(t).length>0))throw new I("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function Pv(){return null}ps.prototype.is=function(o,e){return e?e===this.name&&(o==="rawElement"||o==="view:rawElement"||o==="element"||o==="view:element"):o==="rawElement"||o==="view:rawElement"||o===this.name||o==="view:"+this.name||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class hn extends me(sn){constructor(e,t){super(),this._children=[],this._customProperties=new Map,this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}get name(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new pe(r,s)]:(et(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new pe(r,a):a instanceof wt?new pe(r,a.data):a))}(this.document,t);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,this._children.splice(e,0,r),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n{const l=s[s.length-1],c=!a.is("uiElement");return l&&l.breakAttributes==c?l.nodes.push(a):s.push({breakAttributes:c,nodes:[a]}),s},[]);let i=null,r=e;for(const{nodes:s,breakAttributes:a}of n){const l=this._insertNodes(r,s,a);i||(i=l.start),r=l.end}return i?new X(i,r):new X(e)}remove(e){const t=e instanceof X?e:X._createOn(e);if(_o(t,this.document),t.isCollapsed)return new hn(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),r=n.parent,s=i.offset-n.offset,a=r._removeChildren(n.offset,s);for(const c of a)this._removeFromClonedElementsGroup(c);const l=this.mergeAttributes(n);return t.start=l,t.end=l.clone(),new hn(this.document,a)}clear(e,t){_o(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const r=i.item;let s;if(r.is("element")&&t.isSimilar(r))s=X._createOn(r);else if(!i.nextPosition.isAfter(e.start)&&r.is("$textProxy")){const a=r.getAncestors().find(l=>l.is("element")&&t.isSimilar(l));a&&(s=X._createIn(a))}s&&(s.end.isAfter(e.end)&&(s.end=e.end),s.start.isBefore(e.start)&&(s.start=e.start),this.remove(s))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,r=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-r}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof dn))throw new I("view-writer-wrap-invalid-attribute",this.document);if(_o(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some(s=>!s.is("uiElement")))&&(i=i.getLastMatchingPosition(s=>s.item.is("uiElement"))),i=this._wrapPosition(i,t);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new X(i)}return this._wrapRange(e,t);var n}unwrap(e,t){if(!(t instanceof dn))throw new I("view-writer-unwrap-invalid-attribute",this.document);if(_o(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),r=n.parent,s=this._unwrapChildren(r,n.offset,i.offset,t),a=this.mergeAttributes(s.start);a.isEqual(s.start)||s.end.offset--;const l=this.mergeAttributes(s.end);return new X(a,l)}rename(e,t){const n=new wo(this.document,e,t.getAttributes());return this.insert(U._createAfter(t),n),this.move(X._createIn(t),U._createAt(n,0)),this.remove(X._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return U._createAt(e,t)}createPositionAfter(e){return U._createAfter(e)}createPositionBefore(e){return U._createBefore(e)}createRange(e,t){return new X(e,t)}createRangeOn(e){return X._createOn(e)}createRangeIn(e){return X._createIn(e)}createSelection(...e){return new At(...e)}createSlot(e="children"){if(!this._slotFactory)throw new I("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,n){let i,r;if(i=n?fs(e):e.parent.is("$text")?e.parent.parent:e.parent,!i)throw new I("view-writer-invalid-position-container",this.document);r=n?this._breakAttributes(e,!0):e.parent.is("$text")?ks(e):e;const s=i._insertChild(r.offset,t);for(const d of t)this._addToClonedElementsGroup(d);const a=r.getShiftedBy(s),l=this.mergeAttributes(r);l.isEqual(r)||a.offset--;const c=this.mergeAttributes(a);return new X(l,c)}_wrapChildren(e,t,n,i){let r=t;const s=[];for(;r!1,e.parent._insertChild(e.offset,n);const i=new X(e,e.getShiftedBy(1));this.wrap(i,t);const r=new U(n.parent,n.index);n._remove();const s=r.nodeBefore,a=r.nodeAfter;return s instanceof pe&&a instanceof pe?Id(s,a):Td(r)}_wrapAttributeElement(e,t){if(!Rd(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Rd(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(_o(e,this.document),e.isCollapsed){const l=this._breakAttributes(e.start,t);return new X(l,l)}const r=this._breakAttributes(i,t),s=r.parent.childCount,a=this._breakAttributes(n,t);return r.offset+=r.parent.childCount-s,new X(a,r)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new I("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new I("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new I("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&bs(i.parent)||bs(i))return e.clone();if(i.is("$text"))return this._breakAttributes(ks(e),t);if(n==i.childCount){const r=new U(i.parent,i.index+1);return this._breakAttributes(r,t)}if(n===0){const r=new U(i.parent,i.index);return this._breakAttributes(r,t)}{const r=i.index+1,s=i._clone();i.parent._insertChild(r,s),this._addToClonedElementsGroup(s);const a=i.childCount-n,l=i._removeChildren(n,a);s._appendChild(l);const c=new U(i.parent,r);return this._breakAttributes(c,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const i of e.getChildren())this._addToClonedElementsGroup(i);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const i of e.getChildren())this._removeFromClonedElementsGroup(i);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function fs(o){let e=o.parent;for(;!bs(e);){if(!e)return;e=e.parent}return e}function Rv(o,e){return o.prioritye.priority)&&o.getIdentity()t instanceof n))throw new I("view-writer-insert-invalid-node-type",e);t.is("$text")||Pd(t.getChildren(),e)}}function bs(o){return o&&(o.is("containerElement")||o.is("documentFragment"))}function _o(o,e){const t=fs(o.start),n=fs(o.end);if(!t||!n||t!==n)throw new I("view-writer-invalid-range-container",e)}function Rd(o,e){return o.id===null&&e.id===null}const Od=o=>o.createTextNode(" "),Nd=o=>{const e=o.createElement("span");return e.dataset.ckeFiller="true",e.innerText=" ",e},zd=o=>{const e=o.createElement("br");return e.dataset.ckeFiller="true",e},_t=7,wi="⁠".repeat(_t);function nt(o){return Ie(o)&&o.data.substr(0,_t)===wi}function Co(o){return o.data.length==_t&&nt(o)}function Md(o){return nt(o)?o.data.slice(_t):o.data}function Nv(o,e){if(e.keyCode==se.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(t.rangeCount==1&&t.getRangeAt(0).collapsed){const n=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;nt(n)&&i<=_t&&t.collapse(n,0)}}}var Fd=D(9315),zv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Fd.Z,zv),Fd.Z.locals;class Mv extends ge(){constructor(e,t){super(),this.domDocuments=new Set,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this._inlineFiller=null,this._fakeSelectionContainer=null,this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),k.isBlink&&!k.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()}),this.set("isComposing",!1),this.on("change:isComposing",()=>{this.isComposing||this.render()})}markToSync(e,t){if(e==="text")this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if(e==="attributes")this.markedAttributes.add(t);else{if(e!=="children")throw new I("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!k.isAndroid)return;let e=null;const t=!(k.isBlink&&!k.isAndroid)||!this.isSelecting;for(const n of this.markedChildren)this._updateChildrenMappings(n);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=U._createBefore(e.parent)));for(const n of this.markedAttributes)this._updateAttrs(n);for(const n of this.markedChildren)this._updateChildren(n,{inlineFillerPosition:e});for(const n of this.markedTexts)!this.markedChildren.has(n.parent)&&this.domConverter.mapViewToDom(n.parent)&&this._updateText(n,{inlineFillerPosition:e});if(t)if(e){const n=this.domConverter.viewPositionToDom(e),i=n.parent.ownerDocument;nt(n.parent)?this._inlineFiller=n.parent:this._inlineFiller=Vd(i,n.parent,n.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){if(!this.domConverter.mapViewToDom(e))return;const t=Array.from(this.domConverter.mapViewToDom(e).childNodes),n=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),i=this._diffNodeLists(t,n),r=this._findUpdateActions(i,t,n,Fv);if(r.indexOf("update")!==-1){const s={equal:0,insert:0,delete:0};for(const a of r)if(a==="update"){const l=s.equal+s.insert,c=s.equal+s.delete,d=e.getChild(l);!d||d.is("uiElement")||d.is("rawElement")||this._updateElementMappings(d,t[c]),Ec(n[l]),s.equal++}else s[a]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?U._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Ie(t.parent)&&nt(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!nt(e))throw new I("view-renderer-filler-was-lost",this);Co(e)?e.remove():e.data=e.data.substr(_t),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root)||!t.is("element")||!function(s){if(s.getAttribute("contenteditable")=="false")return!1;const a=s.findAncestor(l=>l.hasAttribute("contenteditable"));return!a||a.getAttribute("contenteditable")=="true"}(t)||n===t.getFillerOffset())return!1;const i=e.nodeBefore,r=e.nodeAfter;return!(i instanceof pe||r instanceof pe)&&(!k.isAndroid||!i&&!r)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e);let i=this.domConverter.viewToDom(e).data;const r=t.inlineFillerPosition;r&&r.parent==e.parent&&r.offset==e.index&&(i=wi+i),Ld(n,i)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(r=>r.name),i=e.getAttributeKeys();for(const r of i)this.domConverter.setDomElementAttribute(t,r,e.getAttribute(r),e);for(const r of n)e.hasAttribute(r)||this.domConverter.removeDomElementAttribute(t,r)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;if(k.isAndroid){let u=null;for(const g of Array.from(n.childNodes)){if(u&&Ie(u)&&Ie(g)){n.normalize();break}u=g}}const i=t.inlineFillerPosition,r=n.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));i&&i.parent===e&&Vd(n.ownerDocument,s,i.offset);const a=this._diffNodeLists(r,s),l=this._findUpdateActions(a,r,s,Vv);let c=0;const d=new Set;for(const u of l)u==="delete"?(d.add(r[c]),Ec(r[c])):u!=="equal"&&u!=="update"||c++;c=0;for(const u of l)u==="insert"?(Ac(n,c,s[c]),c++):u==="update"?(Ld(r[c],s[c].data),c++):u==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(s[c])),c++);for(const u of d)u.parentNode||this.domConverter.unbindDomElement(u)}_diffNodeLists(e,t){return e=function(n,i){const r=Array.from(n);return r.length==0||!i||r[r.length-1]==i&&r.pop(),r}(e,this._fakeSelectionContainer),F(e,t,Lv.bind(null,this.domConverter))}_findUpdateActions(e,t,n,i){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let r=[],s=[],a=[];const l={equal:0,insert:0,delete:0};for(const c of e)c==="insert"?a.push(n[l.equal+l.insert]):c==="delete"?s.push(t[l.equal+l.delete]):(r=r.concat(F(s,a,i).map(d=>d==="equal"?"update":d)),r.push("equal"),s=[],a=[]),l[c]++;return r.concat(F(s,a,i).map(c=>c==="equal"?"update":c))}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}}_updateSelection(){if(k.isBlink&&!k.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&k.isAndroid||this._updateDomSelection(e))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(s){const a=s.createElement("div");return a.className="ck-fake-selection-container",Object.assign(a.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),a.textContent=" ",a}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=t.getSelection(),r=t.createRange();i.removeAllRanges(),r.selectNodeContents(n),i.addRange(r)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),k.isGecko&&function(r,s){const a=r.parent;if(a.nodeType!=Node.ELEMENT_NODE||r.offset!=a.childNodes.length-1)return;const l=a.childNodes[r.offset];l&&l.tagName=="BR"&&s.addRange(s.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const n=e.activeElement,i=this.domConverter.mapDomToView(n);n&&i&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function Vd(o,e,t){const n=e instanceof Array?e:e.childNodes,i=n[t];if(Ie(i))return i.data=wi+i.data,i;{const r=o.createTextNode(wi);return Array.isArray(e)?n.splice(t,0,r):Ac(e,t,r),r}}function Fv(o,e){return jt(o)&&jt(e)&&!Ie(o)&&!Ie(e)&&!On(o)&&!On(e)&&o.tagName.toLowerCase()===e.tagName.toLowerCase()}function Vv(o,e){return jt(o)&&jt(e)&&Ie(o)&&Ie(e)}function Lv(o,e,t){return e===t||(Ie(e)&&Ie(t)?e.data===t.data:!(!o.isBlockFiller(e)||!o.isBlockFiller(t)))}function Ld(o,e){const t=o.data;if(t==e)return;const n=R(t,e);for(const i of n)i.type==="insert"?o.insertData(i.index,i.values.join("")):o.deleteData(i.index,i.howMany)}const jv=zd(oe.document),$v=Od(oe.document),Hv=Nd(oe.document),Ai="data-ck-unsafe-attribute-",jd="data-ck-unsafe-element";class $d{constructor(e,{blockFillerMode:t,renderingMode:n="editing"}={}){this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Mn,this._encounteredRawContentDomNodes=new WeakSet,this.document=e,this.renderingMode=n,this.blockFillerMode=t||(n==="editing"?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?oe.document:oe.document.implementation.createHTMLDocument("")}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new At(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const n of Array.from(e.children))this.unbindDomElement(n)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,n){return this.renderingMode==="data"||!(e=e.toLowerCase()).startsWith("on")&&(e!=="srcdoc"||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&(n==="img"&&(e==="src"||e==="srcset")||n==="source"&&e==="srcset"||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(e,t){if(this.renderingMode==="data")return void(e.innerHTML=t);const n=new DOMParser().parseFromString(t,"text/html"),i=n.createDocumentFragment(),r=n.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);const s=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT),a=[];let l;for(;l=s.nextNode();)a.push(l);for(const c of a){for(const u of c.getAttributeNames())this.setDomElementAttribute(c,u,c.getAttribute(u));const d=c.tagName.toLowerCase();this._shouldRenameElement(d)&&(Ud(d),c.replaceWith(this._createReplacementDomElement(d,c)))}for(;e.firstChild;)e.firstChild.remove();e.append(i)}viewToDom(e,t={}){if(e.is("$text")){const n=this._processDataFromViewText(e);return this._domDocument.createTextNode(n)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let n;if(e.is("documentFragment"))n=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(n,e);else{if(e.is("uiElement"))return n=e.name==="$comment"?this._domDocument.createComment(e.getCustomProperty("$rawContent")):e.render(this._domDocument,this),t.bind&&this.bindElements(n,e),n;this._shouldRenameElement(e.name)?(Ud(e.name),n=this._createReplacementDomElement(e.name)):n=e.hasAttribute("xmlns")?this._domDocument.createElementNS(e.getAttribute("xmlns"),e.name):this._domDocument.createElement(e.name),e.is("rawElement")&&e.render(n,this),t.bind&&this.bindElements(n,e);for(const i of e.getAttributeKeys())this.setDomElementAttribute(n,i,e.getAttribute(i),e)}if(t.withChildren!==!1)for(const i of this.viewChildrenToDom(e,t))n.appendChild(i);return n}}setDomElementAttribute(e,t,n,i){const r=this.shouldRenderAttribute(t,n,e.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(t);r||Q("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:n}),_c(t)?(e.hasAttribute(t)&&!r?e.removeAttribute(t):e.hasAttribute(Ai+t)&&r&&e.removeAttribute(Ai+t),e.setAttribute(r?t:Ai+t,n)):Q("domconverter-invalid-attribute-detected",{domElement:e,key:t,value:n})}removeDomElementAttribute(e,t){t!=jd&&(e.removeAttribute(t),e.removeAttribute(Ai+t))}*viewChildrenToDom(e,t={}){const n=e.getFillerOffset&&e.getFillerOffset();let i=0;for(const r of e.getChildren()){n===i&&(yield this._getBlockFiller());const s=r.is("element")&&!!r.getCustomProperty("dataPipeline:transparentRendering")&&!ze(r.getAttributes());s&&this.renderingMode=="data"?yield*this.viewChildrenToDom(r,t):(s&&Q("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:r}),yield this.viewToDom(r,t)),i++}n===i&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=this._domDocument.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return nt(n)&&(i+=_t),{parent:n,offset:i}}{let n,i,r;if(e.offset===0){if(n=this.mapViewToDom(t),!n)return null;r=n.childNodes[0]}else{const s=e.nodeBefore;if(i=s.is("$text")?this.findCorrespondingDomText(s):this.mapViewToDom(s),!i)return null;n=i.parentNode,r=i.nextSibling}return Ie(r)&&nt(r)?{parent:r,offset:_t}:{parent:n,offset:i?ai(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const n=this.getHostViewElement(e);if(n)return n;if(On(e)&&t.skipComments)return null;if(Ie(e)){if(Co(e))return null;{const i=this._processDataFromDomText(e);return i===""?null:new pe(this.document,i)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let i;if(this.isDocumentFragment(e))i=new hn(this.document),t.bind&&this.bindDocumentFragments(e,i);else{i=this._createViewElement(e,t),t.bind&&this.bindElements(e,i);const r=e.attributes;if(r)for(let s=r.length,a=0;a{const{scrollLeft:a,scrollTop:l}=s;r.push([a,l])}),t.focus(),Hd(t,s=>{const[a,l]=r.shift();s.scrollLeft=a,s.scrollTop=l}),oe.window.scrollTo(n,i)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(jv):!(e.tagName!=="BR"||!qd(e,this.blockElements)||e.parentNode.childNodes.length!==1)||e.isEqualNode(Hv)||function(t,n){return t.isEqualNode($v)&&qd(t,n)&&t.parentNode.childNodes.length===1}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch{return!1}const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=pc(e);for(t.pop();t.length;){const n=t.pop(),i=this._domToViewMapping.get(n);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return Od(this._domDocument);case"markedNbsp":return Nd(this._domDocument);case"br":return zd(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(Ie(e)&&nt(e)&&t<_t||this.isElement(e)&&nt(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return t;if(t.charAt(0)==" "){const n=this._getTouchingInlineViewNode(e,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(t.charAt(t.length-1)==" "){const n=this._getTouchingInlineViewNode(e,!0),i=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";t.charAt(t.length-2)!=" "&&n&&!i||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return!1;const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==" "}_processDataFromDomText(e){let t=e.data;if(function(c,d){return pc(c).some(g=>g.tagName&&d.includes(g.tagName.toLowerCase()))}(e,this.preElements))return Md(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),r=this._checkShouldLeftTrimDomText(e,n),s=this._checkShouldRightTrimDomText(e,i);r&&(t=t.replace(/^ /,"")),s&&(t=t.replace(/ $/,"")),t=Md(new Text(t)),t=t.replace(/ \u00A0/g," ");const a=i&&this.isElement(i)&&i.tagName!="BR",l=i&&Ie(i)&&i.data.charAt(0)==" ";return(/( |\u00A0)\u00A0$/.test(t)||!i||a||l)&&(t=t.replace(/\u00A0$/," ")),(r||n&&this.isElement(n)&&n.tagName!="BR")&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?t.tagName==="BR":!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!nt(e)}_getTouchingInlineViewNode(e,t){const n=new cn({startPosition:t?U._createAfter(e):U._createBefore(e),direction:t?"forward":"backward"});for(const i of n){if(i.item.is("element")&&this.inlineObjectElements.includes(i.item.name))return i.item;if(i.item.is("containerElement")||i.item.is("element","br"))return null;if(i.item.is("$textProxy"))return i.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",i=t?"nextSibling":"previousSibling";let r=!0,s=e;do if(!r&&s[n]?s=s[n]:s[i]?(s=s[i],r=!1):(s=s.parentNode,r=!0),!s||this._isBlockElement(s))return null;while(!Ie(s)&&s.tagName!="BR"&&!this._isInlineObjectElement(s));return s}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if(On(e))return new bi(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new tt(this.document,n)}_isViewElementWithRawContent(e,t){return t.withChildren!==!1&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return this.renderingMode==="editing"&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const n=this._domDocument.createElement("span");if(n.setAttribute(jd,e),t){for(;t.firstChild;)n.appendChild(t.firstChild);for(const i of t.getAttributeNames())n.setAttribute(i,t.getAttribute(i))}return n}}function Hd(o,e){let t=o;for(;t;)e(t),t=t.parentElement}function qd(o,e){const t=o.parentNode;return!!t&&!!t.tagName&&e.includes(t.tagName.toLowerCase())}function Ud(o){o==="script"&&Q("domconverter-unsafe-script-element-detected"),o==="style"&&Q("domconverter-unsafe-style-element-detected")}class Ct extends $t(){constructor(e){super(),this._isEnabled=!1,this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&e.nodeType===3&&(e=e.parentNode),!(!e||e.nodeType!==1)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}const Wd=ss(function(o,e){Tn(e,Pn(e),o)});class Ln{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Wd(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Ht extends Ct{constructor(){super(...arguments),this.useCapture=!1}observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(n,i)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(i.target)&&this.onDomEvent(i)},{useCapture:this.useCapture})})}stopObserving(e){this.stopListening(e)}fire(e,t,n){this.isEnabled&&this.document.fire(e,new Ln(this.view,t,n))}}class qv extends Ht{constructor(){super(...arguments),this.domEventType=["keydown","keyup"]}onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Nn(this)}};this.fire(e.type,e,t)}}const ws=function(){return dt.Date.now()};var Uv=/\s/;const Wv=function(o){for(var e=o.length;e--&&Uv.test(o.charAt(e)););return e};var Kv=/^\s+/;const Gv=function(o){return o&&o.slice(0,Wv(o)+1).replace(Kv,"")};var Zv=/^[-+]0x[0-9a-f]+$/i,Jv=/^0b[01]+$/i,Yv=/^0o[0-7]+$/i,Qv=parseInt;const Kd=function(o){if(typeof o=="number")return o;if(gi(o))return NaN;if(xe(o)){var e=typeof o.valueOf=="function"?o.valueOf():o;o=xe(e)?e+"":e}if(typeof o!="string")return o===0?o:+o;o=Gv(o);var t=Jv.test(o);return t||Yv.test(o)?Qv(o.slice(2),t?2:8):Zv.test(o)?NaN:+o};var Xv=Math.max,ey=Math.min;const vo=function(o,e,t){var n,i,r,s,a,l,c=0,d=!1,u=!1,g=!0;if(typeof o!="function")throw new TypeError("Expected a function");function f(z){var j=n,Y=i;return n=i=void 0,c=z,s=o.apply(Y,j)}function b(z){var j=z-l;return l===void 0||j>=e||j<0||u&&z-c>=r}function A(){var z=ws();if(b(z))return E(z);a=setTimeout(A,function(j){var Y=e-(j-l);return u?ey(Y,r-(j-c)):Y}(z))}function E(z){return a=void 0,g&&n?f(z):(n=i=void 0,s)}function P(){var z=ws(),j=b(z);if(n=arguments,i=this,l=z,j){if(a===void 0)return function(Y){return c=Y,a=setTimeout(A,e),d?f(Y):s}(l);if(u)return clearTimeout(a),a=setTimeout(A,e),f(l)}return a===void 0&&(a=setTimeout(A,e)),s}return e=Kd(e)||0,xe(t)&&(d=!!t.leading,r=(u="maxWait"in t)?Xv(Kd(t.maxWait)||0,e):r,g="trailing"in t?!!t.trailing:g),P.cancel=function(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0},P.flush=function(){return a===void 0?s:E(ws())},P};class ty extends Ct{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=vo(t=>{this.document.fire("selectionChangeDone",t)},200)}observe(){const e=this.document;e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new At(t.getRanges(),{backward:t.isBackward,fake:!1});e!=se.arrowleft&&e!=se.arrowup||n.setTo(n.getFirstPosition()),e!=se.arrowright&&e!=se.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}const ny=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this},oy=function(o){return this.__data__.has(o)};function _i(o){var e=-1,t=o==null?0:o.length;for(this.__data__=new Xo;++ea))return!1;var c=r.get(o),d=r.get(e);if(c&&d)return c==e&&d==o;var u=-1,g=!0,f=2&t?new iy:void 0;for(r.set(o,e),r.set(e,o);++u{this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this.flush(),e.change(()=>{})},50)}),t.on("blur",(n,i)=>{const r=t.selection.editableElement;r!==null&&r!==i.target||(t.isFocused=!1,this._isFocusChanging=!1,e.change(()=>{}))})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class py extends Ct{constructor(e){super(e),this.mutationObserver=e.getObserver(eh),this.focusObserver=e.getObserver(_s),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=vo(t=>{this.document.fire("selectionChangeDone",t)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=vo(()=>this.document.isSelecting=!1,5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,n=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},{priority:"highest"}),this.listenTo(e,"keydown",n,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",n,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",n,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",(i,r)=>{this.document.isComposing&&!k.isAndroid||(this._handleSelectionChange(r,t),this._documentIsSelectingInactivityTimeoutDebounced())}),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount!=0){if(this.view.hasDomSelection=!0,!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(n))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(this.focusObserver.flush(),this.selection.isSimilar(i))this.view.forceRender();else{const r={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class fy extends Ht{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0},{priority:"low"}),t.on("compositionend",()=>{t.isComposing=!1},{priority:"low"})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class th{constructor(e,t={}){this._files=t.cacheFiles?nh(e):null,this._native=e}get files(){return this._files||(this._files=nh(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,n){this._native.setDragImage(e,t,n)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}function nh(o){const e=Array.from(o.files||[]),t=Array.from(o.items||[]);return e.length?e:t.filter(n=>n.kind==="file").map(n=>n.getAsFile())}class ky extends Ht{constructor(){super(...arguments),this.domEventType="beforeinput"}onDomEvent(e){const t=e.getTargetRanges(),n=this.view,i=n.document;let r=null,s=null,a=[];if(e.dataTransfer&&(r=new th(e.dataTransfer)),e.data!==null?s=e.data:r&&(s=r.getData("text/plain")),i.selection.isFake)a=Array.from(i.selection.getRanges());else if(t.length)a=t.map(l=>n.domConverter.domRangeToView(l));else if(k.isAndroid){const l=e.target.ownerDocument.defaultView.getSelection();a=Array.from(n.domConverter.domSelectionToView(l).getRanges())}if(k.isAndroid&&e.inputType=="insertCompositionText"&&s&&s.endsWith(` +/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(Se))))," */")),Z.styleSheet)Z.styleSheet.cssText=Q;else{for(;Z.firstChild;)Z.removeChild(Z.firstChild);Z.appendChild(document.createTextNode(Q))}}var K=null,J=0;function te(Z,ee){var I,Q,_e;if(ee.singleton){var Se=J++;I=K||(K=T(ee)),Q=L.bind(null,I,Se,!1),_e=L.bind(null,I,Se,!0)}else I=T(ee),Q=$.bind(null,I,ee),_e=function(){(function(Te){if(Te.parentNode===null)return!1;Te.parentNode.removeChild(Te)})(I)};return Q(Z),function(Te){if(Te){if(Te.css===Z.css&&Te.media===Z.media&&Te.sourceMap===Z.sourceMap)return;Q(Z=Te)}else _e()}}w.exports=function(Z,ee){(ee=ee||{}).singleton||typeof ee.singleton=="boolean"||(ee.singleton=B());var I=R(Z=Z||[],ee);return function(Q){if(Q=Q||[],Object.prototype.toString.call(Q)==="[object Array]"){for(var _e=0;_e{var S=w&&w.__esModule?()=>w.default:()=>w;return D.d(S,{a:S}),S},D.d=(w,S)=>{for(var p in S)D.o(S,p)&&!D.o(w,p)&&Object.defineProperty(w,p,{enumerable:!0,get:S[p]})},D.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),D.o=(w,S)=>Object.prototype.hasOwnProperty.call(w,S),D.nc=void 0;var M={};return(()=>{function w({emitter:o,activator:e,callback:t,contextElements:n}){o.listenTo(document,"mousedown",(i,r)=>{if(!e())return;const s=typeof r.composedPath=="function"?r.composedPath():[],a=typeof n=="function"?n():n;for(const l of a)if(l.contains(r.target)||s.includes(l))return;t()})}function S(o){return class extends o{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function p({view:o}){o.listenTo(o.element,"submit",(e,t)=>{t.preventDefault(),o.fire("submit")},{useCapture:!0})}D.d(M,{default:()=>$a});const y=function(){try{return navigator.userAgent.toLowerCase()}catch{return""}}(),B={isMac:_(y),isWindows:(v=y,v.indexOf("windows")>-1),isGecko:function(o){return!!o.match(/gecko\/\d+/)}(y),isSafari:function(o){return o.indexOf(" applewebkit/")>-1&&o.indexOf("chrome")===-1}(y),isiOS:function(o){return!!o.match(/iphone|ipad/i)||_(o)&&navigator.maxTouchPoints>0}(y),isAndroid:function(o){return o.indexOf("android")>-1}(y),isBlink:function(o){return o.indexOf("chrome/")>-1&&o.indexOf("edge/")<0}(y),features:{isRegExpUnicodePropertySupported:function(){let o=!1;try{o="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return o}()}};var v;const k=B;function _(o){return o.indexOf("macintosh")>-1}function R(o,e,t,n){t=t||function(l,c){return l===c};const i=Array.isArray(o)?o:Array.prototype.slice.call(o),r=Array.isArray(e)?e:Array.prototype.slice.call(e),s=function(l,c,d){const u=T(l,c,d);if(u===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const g=O(l,u),f=O(c,u),b=T(g,f,d),A=l.length-b,E=c.length-b;return{firstIndex:u,lastIndexOld:A,lastIndexNew:E}}(i,r,t);return n?function(l,c){const{firstIndex:d,lastIndexOld:u,lastIndexNew:g}=l;if(d===-1)return Array(c).fill("equal");let f=[];return d>0&&(f=f.concat(Array(d).fill("equal"))),g-d>0&&(f=f.concat(Array(g-d).fill("insert"))),u-d>0&&(f=f.concat(Array(u-d).fill("delete"))),g0&&d.push({index:u,type:"insert",values:l.slice(u,f)}),g-u>0&&d.push({index:u+(f-u),type:"delete",howMany:g-u}),d}(r,s)}function T(o,e,t){for(let n=0;n200||i>200||n+i>300)return F.fastDiff(o,e,t,!0);let r,s;if(iP?-1:1;d[A+z]&&(d[A]=d[A+z].slice(0)),d[A]||(d[A]=[]),d[A].push(E>P?r:s);let j=Math.max(E,P),Y=j-A;for(;Yc;f--)u[f]=g(f);u[c]=g(c),b++}while(u[c]!==l);return d[c].slice(1)}F.fastDiff=R;const L=function(){return function o(){o.called=!0}};class ${constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=L(),this.off=L()}}const K=new Array(256).fill("").map((o,e)=>("0"+e.toString(16)).slice(-2));function J(){const o=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+K[o>>0&255]+K[o>>8&255]+K[o>>16&255]+K[o>>24&255]+K[e>>0&255]+K[e>>8&255]+K[e>>16&255]+K[e>>24&255]+K[t>>0&255]+K[t>>8&255]+K[t>>16&255]+K[t>>24&255]+K[n>>0&255]+K[n>>8&255]+K[n>>16&255]+K[n>>24&255]}const te={get(o="normal"){return typeof o!="number"?this[o]||this.normal:o},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function Z(o,e){const t=te.get(e.priority);for(let n=0;n{if(typeof u=="object"&&u!==null){if(s.has(u))return`[object ${u.constructor.name}]`;s.add(u)}return u},l=r?` ${JSON.stringify(r,a)}`:"",c=_e(i);return i+l+c}(e,n)),this.name="CKEditorError",this.context=t,this.data=n}is(e){return e==="CKEditorError"}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const n=new I(e.message,t);throw n.stack=e.stack,n}}function Q(o,e){console.warn(...Se(o,e))}function _e(o){return` +Read more: ${ee}#error-${o}`}function Se(o,e){const t=_e(o);return e?[o,e,t]:[o,t]}const Te="38.0.1",Vt=new Date(2023,4,23),pt=typeof window=="object"?window:D.g;if(pt.CKEDITOR_VERSION)throw new I("ckeditor-duplicated-modules",null);pt.CKEDITOR_VERSION=Te;const ft=Symbol("listeningTo"),yn=Symbol("emitterId"),xt=Symbol("delegations"),ml=me(Object);function me(o){return o?class extends o{on(e,t,n){this.listenTo(this,e,t,n)}once(e,t,n){let i=!1;this.listenTo(this,e,(r,...s)=>{i||(i=!0,r.off(),t.call(this,r,...s))},n)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,n,i={}){let r,s;this[ft]||(this[ft]={});const a=this[ft];mr(e)||gl(e);const l=mr(e);(r=a[l])||(r=a[l]={emitter:e,callbacks:{}}),(s=r.callbacks[t])||(s=r.callbacks[t]=[]),s.push(n),function(c,d,u,g,f){d._addEventListener?d._addEventListener(u,g,f):c._addEventListener.call(d,u,g,f)}(this,e,t,n,i)}stopListening(e,t,n){const i=this[ft];let r=e&&mr(e);const s=i&&r?i[r]:void 0,a=s&&t?s.callbacks[t]:void 0;if(!(!i||e&&!s||t&&!a))if(n)pr(this,e,t,n),a.indexOf(n)!==-1&&(a.length===1?delete s.callbacks[t]:pr(this,e,t,n));else if(a){for(;n=a.pop();)pr(this,e,t,n);delete s.callbacks[t]}else if(s){for(t in s.callbacks)this.stopListening(e,t);delete i[r]}else{for(r in i)this.stopListening(i[r].emitter);delete this[ft]}}fire(e,...t){try{const n=e instanceof $?e:new $(this,e),i=n.name;let r=fl(this,i);if(n.path.push(this),r){const a=[n,...t];r=Array.from(r);for(let l=0;l{this[xt]||(this[xt]=new Map),e.forEach(i=>{const r=this[xt].get(i);r?r.set(t,n):this[xt].set(i,new Map([[t,n]]))})}}}stopDelegating(e,t){if(this[xt])if(e)if(t){const n=this[xt].get(e);n&&n.delete(t)}else this[xt].delete(e);else this[xt].clear()}_addEventListener(e,t,n){(function(s,a){const l=pl(s);if(l[a])return;let c=a,d=null;const u=[];for(;c!==""&&!l[c];)l[c]={callbacks:[],childEvents:[]},u.push(l[c]),d&&l[c].childEvents.push(d),d=c,c=c.substr(0,c.lastIndexOf(":"));if(c!==""){for(const g of u)g.callbacks=l[c].callbacks.slice();l[c].childEvents.push(d)}})(this,e);const i=gr(this,e),r={callback:t,priority:te.get(n.priority)};for(const s of i)Z(s,r)}_removeEventListener(e,t){const n=gr(this,e);for(const i of n)for(let r=0;r-1?fl(o,e.substr(0,e.lastIndexOf(":"))):null}function kl(o,e,t){for(let[n,i]of o){i?typeof i=="function"&&(i=i(e.name)):i=e.name;const r=new $(e.source,i);r.path=[...e.path],n.fire(r,...t)}}function pr(o,e,t,n){e._removeEventListener?e._removeEventListener(t,n):o._removeEventListener.call(e,t,n)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{me[o]=ml.prototype[o]});const xe=function(o){var e=typeof o;return o!=null&&(e=="object"||e=="function")},Ko=Symbol("observableProperties"),Go=Symbol("boundObservables"),Zo=Symbol("boundProperties"),En=Symbol("decoratedMethods"),bl=Symbol("decoratedOriginal"),wl=ge(me());function ge(o){return o?class extends o{set(e,t){if(xe(e))return void Object.keys(e).forEach(i=>{this.set(i,e[i])},this);fr(this);const n=this[Ko];if(e in this&&!n.has(e))throw new I("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(i){const r=n.get(e);let s=this.fire(`set:${e}`,e,i,r);s===void 0&&(s=i),r===s&&n.has(e)||(n.set(e,s),this.fire(`change:${e}`,e,s,r))}}),this[e]=t}bind(...e){if(!e.length||!Al(e))throw new I("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new I("observable-bind-duplicate-properties",this);fr(this);const t=this[Zo];e.forEach(i=>{if(t.has(i))throw new I("observable-bind-rebind",this)});const n=new Map;return e.forEach(i=>{const r={property:i,to:[]};t.set(i,r),n.set(i,r)}),{to:F0,toMany:V0,_observable:this,_bindProperties:e,_to:[],_bindings:n}}unbind(...e){if(!this[Ko])return;const t=this[Zo],n=this[Go];if(e.length){if(!Al(e))throw new I("observable-unbind-wrong-properties",this);e.forEach(i=>{const r=t.get(i);r&&(r.to.forEach(([s,a])=>{const l=n.get(s),c=l[a];c.delete(r),c.size||delete l[a],Object.keys(l).length||(n.delete(s),this.stopListening(s,"change"))}),t.delete(i))})}else n.forEach((i,r)=>{this.stopListening(r,"change")}),n.clear(),t.clear()}decorate(e){fr(this);const t=this[e];if(!t)throw new I("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(n,i)=>{n.return=t.apply(this,i)}),this[e]=function(...n){return this.fire(e,n)},this[e][bl]=t,this[En]||(this[En]=[]),this[En].push(e)}stopListening(e,t,n){if(!e&&this[En]){for(const i of this[En])this[i]=this[i][bl];delete this[En]}super.stopListening(e,t,n)}}:wl}function fr(o){o[Ko]||(Object.defineProperty(o,Ko,{value:new Map}),Object.defineProperty(o,Go,{value:new Map}),Object.defineProperty(o,Zo,{value:new Map}))}function F0(...o){const e=function(...r){if(!r.length)throw new I("observable-bind-to-parse-error",null);const s={to:[]};let a;return typeof r[r.length-1]=="function"&&(s.callback=r.pop()),r.forEach(l=>{if(typeof l=="string")a.properties.push(l);else{if(typeof l!="object")throw new I("observable-bind-to-parse-error",null);a={observable:l,properties:[]},s.to.push(a)}}),s}(...o),t=Array.from(this._bindings.keys()),n=t.length;if(!e.callback&&e.to.length>1)throw new I("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new I("observable-bind-to-extra-callback",this);var i;e.to.forEach(r=>{if(r.properties.length&&r.properties.length!==n)throw new I("observable-bind-to-properties-length",this);r.properties.length||(r.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(t[0]).callback=e.callback),i=this._observable,this._to.forEach(r=>{const s=i[Go];let a;s.get(r.observable)||i.listenTo(r.observable,"change",(l,c)=>{a=s.get(r.observable)[c],a&&a.forEach(d=>{_l(i,d.property)})})}),function(r){let s;r._bindings.forEach((a,l)=>{r._to.forEach(c=>{s=c.properties[a.callback?0:r._bindProperties.indexOf(l)],a.to.push([c.observable,s]),function(d,u,g,f){const b=d[Go],A=b.get(g),E=A||{};E[f]||(E[f]=new Set),E[f].add(u),A||b.set(g,E)}(r._observable,a,c.observable,s)})})}(this),this._bindProperties.forEach(r=>{_l(this._observable,r)})}function V0(o,e,t){if(this._bindings.size>1)throw new I("observable-bind-to-many-not-one-binding",this);this.to(...function(n,i){const r=n.map(s=>[s,i]);return Array.prototype.concat.apply([],r)}(o,e),t)}function Al(o){return o.every(e=>typeof e=="string")}function _l(o,e){const t=o[Zo].get(e);let n;t.callback?n=t.callback.apply(o,t.to.map(i=>i[0][i[1]])):(n=t.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(o,e)?o[e]=n:o.set(e,n)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{ge[o]=wl.prototype[o]});class Cl{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}function kr(o){let e=0;for(const t of o)e++;return e}function Ue(o,e){const t=Math.min(o.length,e.length);for(let n=0;n-1},t_=function(o,e){var t=this.__data__,n=Jo(t,o);return n<0?(++this.size,t.push([o,e])):t[n][1]=e,this};function xn(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e-1&&o%1==0&&o-1&&o%1==0&&o<=9007199254740991};var ye={};ye["[object Float32Array]"]=ye["[object Float64Array]"]=ye["[object Int8Array]"]=ye["[object Int16Array]"]=ye["[object Int32Array]"]=ye["[object Uint8Array]"]=ye["[object Uint8ClampedArray]"]=ye["[object Uint16Array]"]=ye["[object Uint32Array]"]=!0,ye["[object Arguments]"]=ye["[object Array]"]=ye["[object ArrayBuffer]"]=ye["[object Boolean]"]=ye["[object DataView]"]=ye["[object Date]"]=ye["[object Error]"]=ye["[object Function]"]=ye["[object Map]"]=ye["[object Number]"]=ye["[object Object]"]=ye["[object RegExp]"]=ye["[object Set]"]=ye["[object String]"]=ye["[object WeakMap]"]=!1;const M_=function(o){return st(o)&&zl(o.length)&&!!ye[Lt(o)]},Er=function(o){return function(e){return o(e)}};var Ml=x&&!x.nodeType&&x,go=Ml&&!0&&m&&!m.nodeType&&m,xr=go&&go.exports===Ml&&vl.process;const In=function(){try{var o=go&&go.require&&go.require("util").types;return o||xr&&xr.binding&&xr.binding("util")}catch{}}();var Fl=In&&In.isTypedArray;const Sr=Fl?Er(Fl):M_;var F_=Object.prototype.hasOwnProperty;const Vl=function(o,e){var t=We(o),n=!t&&vr(o),i=!t&&!n&&mo(o),r=!t&&!n&&!i&&Sr(o),s=t||n||i||r,a=s?P_(o.length,String):[],l=a.length;for(var c in o)!e&&!F_.call(o,c)||s&&(c=="length"||i&&(c=="offset"||c=="parent")||r&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||yr(c,l))||a.push(c);return a};var V_=Object.prototype;const Dr=function(o){var e=o&&o.constructor;return o===(typeof e=="function"&&e.prototype||V_)},L_=Sl(Object.keys,Object);var j_=Object.prototype.hasOwnProperty;const $_=function(o){if(!Dr(o))return L_(o);var e=[];for(var t in Object(o))j_.call(o,t)&&t!="constructor"&&e.push(t);return e},ti=function(o){return o!=null&&zl(o.length)&&!Xt(o)},Br=function(o){return ti(o)?Vl(o):$_(o)},H_=function(o,e){return o&&Tn(e,Br(e),o)},q_=function(o){var e=[];if(o!=null)for(var t in Object(o))e.push(t);return e};var U_=Object.prototype.hasOwnProperty;const W_=function(o){if(!xe(o))return q_(o);var e=Dr(o),t=[];for(var n in o)(n!="constructor"||!e&&U_.call(o,n))&&t.push(n);return t},Pn=function(o){return ti(o)?Vl(o,!0):W_(o)},K_=function(o,e){return o&&Tn(e,Pn(e),o)};var Ll=x&&!x.nodeType&&x,jl=Ll&&!0&&m&&!m.nodeType&&m,$l=jl&&jl.exports===Ll?dt.Buffer:void 0,Hl=$l?$l.allocUnsafe:void 0;const ql=function(o,e){if(e)return o.slice();var t=o.length,n=Hl?Hl(t):new o.constructor(t);return o.copy(n),n},Tr=function(o,e){var t=-1,n=o.length;for(e||(e=Array(n));++t{this._setToTarget(e,i,t[i],n)})}}function uc(o){return Vr(o,fC)}function fC(o){return Rn(o)?o:void 0}function jt(o){if(o){if(o.defaultView)return o instanceof o.defaultView.Document;if(o.ownerDocument&&o.ownerDocument.defaultView)return o instanceof o.ownerDocument.defaultView.Node}return!1}function oi(o){const e=Object.prototype.toString.apply(o);return e=="[object Window]"||e=="[object global]"}const mc=$t(me());function $t(o){return o?class extends o{listenTo(e,t,n,i={}){if(jt(e)||oi(e)){const r={capture:!!i.useCapture,passive:!!i.usePassive},s=this._getProxyEmitter(e,r)||new kC(e,r);this.listenTo(s,t,n,i)}else super.listenTo(e,t,n,i)}stopListening(e,t,n){if(jt(e)||oi(e)){const i=this._getAllProxyEmitters(e);for(const r of i)this.stopListening(r,t,n)}else super.stopListening(e,t,n)}_getProxyEmitter(e,t){return function(n,i){const r=n[ft];return r&&r[i]?r[i].emitter:null}(this,gc(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(t=>this._getProxyEmitter(e,t)).filter(t=>!!t)}}:mc}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{$t[o]=mc.prototype[o]});class kC extends me(){constructor(e,t){super(),gl(this,gc(e,t)),this._domNode=e,this._options=t}attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,n){this.attach(e),me().prototype._addEventListener.call(this,e,t,n)}_removeEventListener(e,t){me().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=n=>{this.fire(e,n)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function gc(o,e){let t=function(n){return n["data-ck-expando"]||(n["data-ck-expando"]=J())}(o);for(const n of Object.keys(e).sort())e[n]&&(t+="-"+n);return t}let Lr;try{Lr={window,document}}catch{Lr={window:{},document:{}}}const oe=Lr;function pc(o){const e=[];let t=o;for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}function Ie(o){return Object.prototype.toString.call(o)=="[object Text]"}function ii(o){return Object.prototype.toString.apply(o)=="[object Range]"}function fc(o){const e=o.ownerDocument.defaultView.getComputedStyle(o);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const kc=["top","right","bottom","left","width","height"];class De{constructor(e){const t=ii(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),wc(e)||t)if(t){const n=De.getDomRangeRects(e);ri(this,De.getBoundingRect(n))}else ri(this,e.getBoundingClientRect());else if(oi(e)){const{innerWidth:n,innerHeight:i}=e;ri(this,{top:0,right:n,bottom:i,left:0,width:n,height:i})}else ri(this,e)}clone(){return new De(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new De(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!bc(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!bc(n);){const i=new De(n),r=t.getIntersection(i);if(!r)return null;r.getArea(){for(const e of o){const t=Ne._getElementCallbacks(e.target);if(t)for(const n of t)n(e)}})}};let si=Ne;function bC(o,e){o instanceof HTMLTextAreaElement&&(o.value=e),o.innerHTML=e}function jr(o){return e=>e+o}function ai(o){let e=0;for(;o.previousSibling;)o=o.previousSibling,e++;return e}function Ac(o,e,t){o.insertBefore(t,o.childNodes[e]||null)}function On(o){return o&&o.nodeType===Node.COMMENT_NODE}function _c(o){try{oe.document.createAttribute(o)}catch{return!1}return!0}function on(o){return!!(o&&o.getClientRects&&o.getClientRects().length)}si._observerInstance=null,si._elementCallbacks=null;var Cc=Math.pow;function vc({element:o,target:e,positions:t,limiter:n,fitInViewport:i,viewportOffsetConfig:r}){Xt(e)&&(e=e()),Xt(n)&&(n=n());const s=function(g){return g&&g.parentNode?g.offsetParent===oe.document.body?null:g.offsetParent:null}(o),a=new De(o),l=new De(e);let c;const d=i&&function(g){g=Object.assign({top:0,bottom:0,left:0,right:0},g);const f=new De(oe.window);return f.top+=g.top,f.height-=g.top,f.bottom-=g.bottom,f.height-=g.bottom,f}(r)||null,u={targetRect:l,elementRect:a,positionedElementAncestor:s,viewportRect:d};if(n||i){const g=n&&new De(n).getVisible();Object.assign(u,{limiterRect:g,viewportRect:d}),c=function(f,b){const{elementRect:A}=b,E=A.getArea(),P=f.map(Y=>new $r(Y,b)).filter(Y=>!!Y.name);let z=0,j=null;for(const Y of P){const{limiterIntersectionArea:ie,viewportIntersectionArea:Ee}=Y;if(ie===E)return Y;const he=Cc(Ee,2)+Cc(ie,2);he>z&&(z=he,j=Y)}return j}(t,u)||new $r(t[0],u)}else c=new $r(t[0],u);return c}function yc(o){const{scrollX:e,scrollY:t}=oe.window;return o.clone().moveBy(e,t)}class $r{constructor(e,t){const n=e(t.targetRect,t.elementRect,t.viewportRect);if(!n)return;const{left:i,top:r,name:s,config:a}=n;this.name=s,this.config=a,this._positioningFunctionCorrdinates={left:i,top:r},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;if(e){const t=this._options.viewportRect;if(!t)return e.getIntersectionArea(this._rect);{const n=e.getIntersection(t);if(n)return n.getIntersectionArea(this._rect)}}return 0}get viewportIntersectionArea(){const e=this._options.viewportRect;return e?e.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=yc(this._rect),this._options.positionedElementAncestor&&function(e,t){const n=yc(new De(t)),i=fc(t);let r=0,s=0;r-=n.left,s-=n.top,r+=t.scrollLeft,s+=t.scrollTop,r-=i.left,s-=i.top,e.moveBy(r,s)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}function Ec(o){const e=o.parentNode;e&&e.removeChild(o)}function wC({window:o,rect:e,alignToTop:t,forceScroll:n,viewportOffset:i}){const r=e.clone().moveBy(0,i),s=e.clone().moveBy(0,-i),a=new De(o).excludeScrollbarsAndBorders(),l=t&&n,c=[s,r].every(b=>a.contains(b));let{scrollX:d,scrollY:u}=o;const g=d,f=u;l?u-=a.top-e.top+i:c||(Sc(s,a)?u-=a.top-e.top+i:xc(r,a)&&(u+=t?e.top-a.top-i:e.bottom-a.bottom+i)),c||(Dc(e,a)?d-=a.left-e.left+i:Bc(e,a)&&(d+=e.right-a.right+i)),d==g&&u===f||o.scrollTo(d,u)}function AC({parent:o,getRect:e,alignToTop:t,forceScroll:n,ancestorOffset:i=0}){const r=Hr(o),s=t&&n;let a,l,c;for(;o!=r.document.body;)l=e(),a=new De(o).excludeScrollbarsAndBorders(),c=a.contains(l),s?o.scrollTop-=a.top-l.top+i:c||(Sc(l,a)?o.scrollTop-=a.top-l.top+i:xc(l,a)&&(o.scrollTop+=t?l.top-a.top-i:l.bottom-a.bottom+i)),c||(Dc(l,a)?o.scrollLeft-=a.left-l.left+i:Bc(l,a)&&(o.scrollLeft+=l.right-a.right+i)),o=o.parentNode}function xc(o,e){return o.bottom>e.bottom}function Sc(o,e){return o.tope.right}function Hr(o){return ii(o)?o.startContainer.ownerDocument.defaultView:o.ownerDocument.defaultView}function _C(o){if(ii(o)){let e=o.commonAncestorContainer;return Ie(e)&&(e=e.parentNode),e}return o.parentNode}function Tc(o,e){const t=Hr(o),n=new De(o);if(t===e)return n;{let i=t;for(;i!=e;){const r=i.frameElement,s=new De(r).excludeScrollbarsAndBorders();n.moveBy(s.left,s.top),i=i.parent}}return n}const CC={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},vC={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},se=function(){const o={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++)o[String.fromCharCode(e).toLowerCase()]=e;for(let e=48;e<=57;e++)o[e-48]=e;for(let e=112;e<=123;e++)o["f"+(e-111)]=e;for(const e of"`-=[];',./\\")o[e]=e.charCodeAt(0);return o}(),yC=Object.fromEntries(Object.entries(se).map(([o,e])=>[e,o.charAt(0).toUpperCase()+o.slice(1)]));function Nn(o){let e;if(typeof o=="string"){if(e=se[o.toLowerCase()],!e)throw new I("keyboard-unknown-key",null,{key:o})}else e=o.keyCode+(o.altKey?se.alt:0)+(o.ctrlKey?se.ctrl:0)+(o.shiftKey?se.shift:0)+(o.metaKey?se.cmd:0);return e}function li(o){return typeof o=="string"&&(o=function(e){return e.split("+").map(t=>t.trim())}(o)),o.map(e=>typeof e=="string"?function(t){if(t.endsWith("!"))return Nn(t.slice(0,-1));const n=Nn(t);return k.isMac&&n==se.ctrl?se.cmd:n}(e):e).reduce((e,t)=>t+e,0)}function Ic(o){let e=li(o);return Object.entries(k.isMac?CC:vC).reduce((t,[n,i])=>(e&se[n]&&(e&=~se[n],t+=i),t),"")+(e?yC[e]:"")}function qr(o,e){const t=e==="ltr";switch(o){case se.arrowleft:return t?"left":"right";case se.arrowright:return t?"right":"left";case se.arrowup:return"up";case se.arrowdown:return"down"}}function Pe(o){return Array.isArray(o)?o:[o]}function EC(o,e,t=1){if(typeof t!="number")throw new I("translation-service-quantity-not-a-number",null,{quantity:t});const n=Object.keys(oe.window.CKEDITOR_TRANSLATIONS).length;n===1&&(o=Object.keys(oe.window.CKEDITOR_TRANSLATIONS)[0]);const i=e.id||e.string;if(n===0||!function(l,c){return!!oe.window.CKEDITOR_TRANSLATIONS[l]&&!!oe.window.CKEDITOR_TRANSLATIONS[l].dictionary[c]}(o,i))return t!==1?e.plural:e.string;const r=oe.window.CKEDITOR_TRANSLATIONS[o].dictionary,s=oe.window.CKEDITOR_TRANSLATIONS[o].getPluralForm||(l=>l===1?0:1),a=r[i];return typeof a=="string"?a:a[Number(s(t))]}oe.window.CKEDITOR_TRANSLATIONS||(oe.window.CKEDITOR_TRANSLATIONS={});const xC=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Pc(o){return xC.includes(o)?"rtl":"ltr"}class SC{constructor({uiLanguage:e="en",contentLanguage:t}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Pc(this.uiLanguage),this.contentLanguageDirection=Pc(this.contentLanguage),this.t=(n,i)=>this._t(n,i)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Pe(t),typeof e=="string"&&(e={string:e});const n=e.plural?t[0]:1;return function(i,r){return i.replace(/%(\d+)/g,(s,a)=>athis._items.length||t<0)throw new I("collection-add-item-invalid-index",this);let n=0;for(const i of e){const r=this._getItemIdBeforeAdding(i),s=t+n;this._items.splice(s,0,i),this._itemMap.set(r,i),this.fire("add",i,s),n++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if(typeof e=="string")t=this._itemMap.get(e);else{if(typeof e!="number")throw new I("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t=typeof e=="string"?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,n]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:n}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new I("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(n=>new t(n))},using:t=>{typeof t=="function"?this._setUpBindToBinding(t):this._setUpBindToBinding(n=>n[t])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(i,r,s)=>{const a=t._bindToCollection==this,l=t._bindToInternalToExternalMap.get(r);if(a&&l)this._bindToExternalToInternalMap.set(r,l),this._bindToInternalToExternalMap.set(l,r);else{const c=e(r);if(!c)return void this._skippedIndexesFromExternal.push(s);let d=s;for(const u of this._skippedIndexesFromExternal)s>u&&d--;for(const u of t._skippedIndexesFromExternal)d>=u&&d++;this._bindToExternalToInternalMap.set(r,c),this._bindToInternalToExternalMap.set(c,r),this.add(c,d);for(let u=0;u{const a=this._bindToExternalToInternalMap.get(r);a&&this.remove(a),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((l,c)=>(sc&&l.push(c),l),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],typeof n!="string")throw new I("collection-add-invalid-id",this);if(this.get(n))throw new I("collection-add-item-already-exists",this)}else e[t]=n=J();return n}_remove(e){let t,n,i,r=!1;const s=this._idProperty;if(typeof e=="string"?(n=e,i=this._itemMap.get(n),r=!i,i&&(t=this._items.indexOf(i))):typeof e=="number"?(t=e,i=this._items[t],r=!i,i&&(n=i[s])):(i=e,n=i[s],t=this._items.indexOf(i),r=t==-1||!this._itemMap.get(n)),r)throw new I("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const a=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(a),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function ze(o){const e=o.next();return e.done?null:e.value}class ht extends $t(ge()){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(e){if(this._elements.has(e))throw new I("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}class St{constructor(){this._listener=new($t())}listenTo(e){this._listener.listenTo(e,"keydown",(t,n)=>{this._listener.fire("_keydown:"+Nn(n),n)})}set(e,t,n={}){const i=li(e),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(s,a)=>{t(a,()=>{a.preventDefault(),a.stopPropagation(),s.stop()}),s.return=!0},{priority:r})}press(e){return!!this._listener.fire("_keydown:"+Nn(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function Dt(o){return et(o)?new Map(o):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(o)}function Ur(o,e){let t;function n(...i){n.cancel(),t=setTimeout(()=>o(...i),e)}return n.cancel=()=>{clearTimeout(t)},n}function Wr(o,e){return!!(t=o.charAt(e-1))&&t.length==1&&/[\ud800-\udbff]/.test(t)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(o.charAt(e));var t}function Kr(o,e){return!!(t=o.charAt(e))&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t);var t}const DC=function(){const o=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],e=new RegExp("\\p{Regional_Indicator}{2}","u").source,t="(?:"+o.map(n=>n.source).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}();function Rc(o,e){const t=String(o).matchAll(DC);return Array.from(t).some(n=>n.index{this._renderViewIntoCollectionParent(n,i)}),this.on("remove",(t,n)=>{n.element&&this._parentElement&&n.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||!e.every(t=>typeof t=="string"))throw new I("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const r of e)i.delegate(r).to(t)}),this.on("remove",(n,i)=>{for(const r of e)i.stopDelegating(r,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}var BC=D(6062),G=D.n(BC),Oc=D(4793),TC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Oc.Z,TC),Oc.Z.locals;class re extends $t(ge()){constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new at,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e,n.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=bt.bind(this,this)}createCollection(e){const t=new rn(e);return this._viewCollections.add(t),t}registerChild(e){et(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){et(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new bt(e)}extendTemplate(e){bt.extend(this.template,e)}render(){if(this.isRendered)throw new I("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)}}class bt extends me(){constructor(e){super(),Object.assign(this,Fc(Mc(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new I("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)di(n)?yield n:Gr(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new IC({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,r)=>new Nc({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:r})}}static extend(e,t){if(e._isRendered)throw new I("template-extend-render",[this,e]);$c(e,Fc(Mc(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new I("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),ci(this.text)?this._bindToObservable({schema:this.text,updater:PC(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,n=e.revertData;for(const i in this.attributes){const r=t.getAttribute(i),s=this.attributes[i];n&&(n.attributes[i]=r);const a=Hc(s)?s[0].ns:null;if(ci(s)){const l=Hc(s)?s[0].value:s;n&&qc(i)&&l.unshift(r),this._bindToObservable({schema:l,updater:RC(t,i,a),data:e})}else if(i=="style"&&typeof s[0]!="string")this._renderStyleAttribute(s[0],e);else{n&&r&&qc(i)&&s.unshift(r);const l=s.map(c=>c&&c.value||c).reduce((c,d)=>c.concat(d),[]).reduce(Lc,"");zn(l)||t.setAttributeNS(a,i,l)}}}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const r=e[i];ci(r)?this._bindToObservable({schema:[r],updater:OC(n,i),data:t}):n.style[i]=r}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let r=0;for(const s of this.children)if(Zr(s)){if(!i){s.setParent(t);for(const a of s)n.appendChild(a.element)}}else if(di(s))i||(s.isRendered||s.render(),n.appendChild(s.element));else if(jt(s))n.appendChild(s);else if(i){const a={children:[],bindings:[],attributes:{}};e.revertData.children.push(a),s._renderNode({intoFragment:!1,node:n.childNodes[r++],isApplying:!0,revertData:a})}else n.appendChild(s.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(i=>{const[r,s]=t.split("@");return i.activateDomEventListener(r,s,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;zc(e,t,n);const r=e.filter(s=>!zn(s)).filter(s=>s.observable).map(s=>s.activateAttributeListener(e,t,n));i&&i.bindings.push(r)}_revertTemplateFromNode(e,t){for(const i of t.bindings)for(const r of i)r();if(t.text)return void(e.textContent=t.text);const n=e;for(const i in t.attributes){const r=t.attributes[i];r===null?n.removeAttribute(i):n.setAttribute(i,r)}for(let i=0;izc(e,t,n);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,i),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,i)}}}class IC extends fo{constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,n){const i=(r,s)=>{t&&!s.target.matches(t)||(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(s):this.observable.fire(this.eventNameOrFunction,s))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class Nc extends fo{constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!zn(super.getValue(e))&&(this.valueIfTrue||!0)}}function ci(o){return!!o&&(o.value&&(o=o.value),Array.isArray(o)?o.some(ci):o instanceof fo)}function zc(o,e,{node:t}){const n=function(r,s){return r.map(a=>a instanceof fo?a.getValue(s):a)}(o,t);let i;i=o.length==1&&o[0]instanceof Nc?n[0]:n.reduce(Lc,""),zn(i)?e.remove():e.set(i)}function PC(o){return{set(e){o.textContent=e},remove(){o.textContent=""}}}function RC(o,e,t){return{set(n){o.setAttributeNS(t,e,n)},remove(){o.removeAttributeNS(t,e)}}}function OC(o,e){return{set(t){o.style[e]=t},remove(){o.style[e]=null}}}function Mc(o){return Vr(o,e=>{if(e&&(e instanceof fo||Gr(e)||di(e)||Zr(e)))return e})}function Fc(o){if(typeof o=="string"?o=function(e){return{text:[e]}}(o):o.text&&function(e){e.text=Pe(e.text)}(o),o.on&&(o.eventListeners=function(e){for(const t in e)Vc(e,t);return e}(o.on),delete o.on),!o.text){o.attributes&&function(t){for(const n in t)t[n].value&&(t[n].value=Pe(t[n].value)),Vc(t,n)}(o.attributes);const e=[];if(o.children)if(Zr(o.children))e.push(o.children);else for(const t of o.children)Gr(t)||di(t)||jt(t)?e.push(t):e.push(new bt(t));o.children=e}return o}function Vc(o,e){o[e]=Pe(o[e])}function Lc(o,e){return zn(e)?o:zn(o)?e:`${o} ${e}`}function jc(o,e){for(const t in e)o[t]?o[t].push(...e[t]):o[t]=e[t]}function $c(o,e){if(e.attributes&&(o.attributes||(o.attributes={}),jc(o.attributes,e.attributes)),e.eventListeners&&(o.eventListeners||(o.eventListeners={}),jc(o.eventListeners,e.eventListeners)),e.text&&o.text.push(...e.text),e.children&&e.children.length){if(o.children.length!=e.children.length)throw new I("ui-template-extend-children-mismatch",o);let t=0;for(const n of e.children)$c(o.children[t++],n)}}function zn(o){return!o&&o!==0}function di(o){return o instanceof re}function Gr(o){return o instanceof bt}function Zr(o){return o instanceof rn}function Hc(o){return xe(o[0])&&o[0].ns}function qc(o){return o=="class"||o=="style"}class NC extends rn{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new bt({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=br(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&e.childElementCount==0&&e.remove()}}var Uc=D(6574),zC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Uc.Z,zC),Uc.Z.locals;const Wc=class extends re{constructor(){super();const o=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon","ck-reset_all-excluded",o.if("isColorInherited","ck-icon_inherit-color")],viewBox:o.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const o=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=o.getAttribute("viewBox");e&&(this.viewBox=e);for(const{name:t,value:n}of Array.from(o.attributes))Wc.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;o.childNodes.length>0;)this.element.appendChild(o.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(o=>{o.style.fill=this.fillColor})}};let ko=Wc;ko.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"];var Kc=D(4906),MC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Kc.Z,MC),Kc.Z.locals;class Ae extends re{constructor(e){super(e),this._focusDelayed=null;const t=this.bindTemplate,n=J();this.set("ariaChecked",void 0),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${n}`),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._createLabelView(),this.iconView=new ko,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const i={tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",r=>!r),t.if("isVisible","ck-hidden",r=>!r),t.to("isOn",r=>r?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],role:t.to("role"),type:t.to("type",r=>r||"button"),tabindex:t.to("tabindex"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy"),"aria-disabled":t.if("isEnabled",!0,r=>!r),"aria-checked":t.to("isOn"),"aria-pressed":t.to("isOn",r=>!!this.isToggleable&&String(!!r)),"data-cke-tooltip-text":t.to("_tooltipString"),"data-cke-tooltip-position":t.to("tooltipPosition")},children:this.children,on:{click:t.to(r=>{this.isEnabled?this.fire("execute"):r.preventDefault()})}};k.isSafari&&(this._focusDelayed||(this._focusDelayed=Ur(()=>this.focus(),0)),i.on.mousedown=t.to(()=>{this._focusDelayed()}),i.on.mouseup=t.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(i)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_createLabelView(){const e=new re,t=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:t.to("labelStyle"),id:this.ariaLabelledBy},children:[{text:t.to("label")}]}),e}_createKeystrokeView(){const e=new re;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Ic(t))}]}),e}_getTooltipString(e,t,n){return e?typeof e=="string"?e:(n&&(n=Ic(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}var Gc=D(6758),FC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Gc.Z,FC),Gc.Z.locals;class hi extends Ae{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 re;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}var Zc=D(6781),VC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Zc.Z,VC),Zc.Z.locals,D(1103),D(841);var Jc=D(3662),LC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Jc.Z,LC),Jc.Z.locals;class Yc extends re{constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${J()}`;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")}]})}}var Qc=D(2577),jC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Qc.Z,jC),Qc.Z.locals;class Xc extends re{constructor(e,t){super(e);const n=`ck-labeled-field-view-${J()}`,i=`ck-labeled-field-view-status-${J()}`;this.fieldView=t(this,n,i),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(n),this.statusView=this._createStatusView(i),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(s,a)=>s||a);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",s=>!s),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new Yc(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new re(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",i=>!i)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}var ed=D(4879),$C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(ed.Z,$C),ed.Z.locals;class HC extends re{constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.focusTracker=new ht,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0),this.set("inputMode","text");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"),readonly:t.to("isReadOnly"),inputmode:t.to("inputMode"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to((...n)=>{this.fire("input",...n),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,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||e===0?e:""}}class qC extends HC{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class UC extends re{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",n=>`ck-dropdown__panel_${n}`),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(n=>{n.target.tagName.toLocaleLowerCase()!=="input"&&n.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;typeof e.focus=="function"?e.focus():Q("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()}}}var td=D(5485),WC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(td.Z,WC),td.Z.locals;const Jr=class extends re{constructor(o,e,t){super(o);const n=this.bindTemplate;this.buttonView=e,this.panelView=t,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.keystrokes=new St,this.focusTracker=new ht,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",i=>!i)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[e,t]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.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.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",(e,t,n)=>{n&&(this.panelPosition==="auto"?this.panelView.position=Jr._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const o=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",o),this.keystrokes.set("esc",o)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:o,north:e,southEast:t,southWest:n,northEast:i,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=Jr.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[t,n,s,a,o,i,r,l,c,e]:[n,t,a,s,o,r,i,c,l,e]}};let Yr=Jr;Yr.defaultPanelPositions={south:(o,e)=>({top:o.bottom,left:o.left-(e.width-o.width)/2,name:"s"}),southEast:o=>({top:o.bottom,left:o.left,name:"se"}),southWest:(o,e)=>({top:o.bottom,left:o.left-e.width+o.width,name:"sw"}),southMiddleEast:(o,e)=>({top:o.bottom,left:o.left-(e.width-o.width)/4,name:"sme"}),southMiddleWest:(o,e)=>({top:o.bottom,left:o.left-3*(e.width-o.width)/4,name:"smw"}),north:(o,e)=>({top:o.top-e.height,left:o.left-(e.width-o.width)/2,name:"n"}),northEast:(o,e)=>({top:o.top-e.height,left:o.left,name:"ne"}),northWest:(o,e)=>({top:o.top-e.height,left:o.left-e.width+o.width,name:"nw"}),northMiddleEast:(o,e)=>({top:o.top-e.height,left:o.left-(e.width-o.width)/4,name:"nme"}),northMiddleWest:(o,e)=>({top:o.top-e.height,left:o.left-3*(e.width-o.width)/4,name:"nmw"})},Yr._getOptimalPosition=vc;const nd='';class od extends Ae{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 ko;return e.content=nd,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class bo{constructor(e){if(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 n=e.actions[t];typeof n=="string"&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(r,s)=>{this[t](),s()})}}get first(){return this.focusables.find(Qr)||null}get last(){return this.focusables.filter(Qr).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(t===null)return this[e===1?"first":"last"];let i=(t+n+e)%n;do{const r=this.focusables.get(i);if(Qr(r))return r;i=(i+n+e)%n}while(i!==t);return null}}function Qr(o){return!(!o.focus||!on(o.element))}class id extends re{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class KC extends re{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function rd(o){return Array.isArray(o)?{items:o,removeItems:[]}:o?Object.assign({items:[],removeItems:[]},o):{items:[],removeItems:[]}}class q extends ge(){constructor(e){super(),this._disableStack=new Set,this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",sd,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",sd),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function sd(o){o.return=!1,o.stop()}class ne extends ge(){constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{this.affectsData&&(e.isReadOnly||this._isEnabledBasedOnSelection&&!e.model.canEditAt(e.model.document.selection))&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",t=>{this.isEnabled||t.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",ad,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",ad),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function ad(o){o.return=!1,o.stop()}class ld extends ne{constructor(){super(...arguments),this._childCommandsDefinitions=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){Z(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:t})=>t.isEnabled);return e&&e.command}}class cd extends me(){constructor(e,t=[],n=[]){super(),this._plugins=new Map,this._context=e,this._availablePlugins=new Map;for(const i of t)i.pluginName&&this._availablePlugins.set(i.pluginName,i);this._contextPlugins=new Map;for(const[i,r]of n)this._contextPlugins.set(i,r),this._contextPlugins.set(r,i),i.pluginName&&this._availablePlugins.set(i.pluginName,i)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let n=e;throw typeof e=="function"&&(n=e.pluginName||e.name),new I("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[],n=[]){const i=this,r=this._context;(function b(A,E=new Set){A.forEach(P=>{l(P)&&(E.has(P)||(E.add(P),P.pluginName&&!i._availablePlugins.has(P.pluginName)&&i._availablePlugins.set(P.pluginName,P),P.requires&&b(P.requires,E)))})})(e),g(e);const s=[...function b(A,E=new Set){return A.map(P=>l(P)?P:i._availablePlugins.get(P)).reduce((P,z)=>E.has(z)?P:(E.add(z),z.requires&&(g(z.requires,z),b(z.requires,E).forEach(j=>P.add(j))),P.add(z)),new Set)}(e.filter(b=>!d(b,t)))];(function(b,A){for(const E of A){if(typeof E!="function")throw new I("plugincollection-replace-plugin-invalid-type",null,{pluginItem:E});const P=E.pluginName;if(!P)throw new I("plugincollection-replace-plugin-missing-name",null,{pluginItem:E});if(E.requires&&E.requires.length)throw new I("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:P});const z=i._availablePlugins.get(P);if(!z)throw new I("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:P});const j=b.indexOf(z);if(j===-1){if(i._contextPlugins.has(z))return;throw new I("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:P})}if(z.requires&&z.requires.length)throw new I("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:P});b.splice(j,1,E),i._availablePlugins.set(P,E)}})(s,n);const a=s.map(b=>{let A=i._contextPlugins.get(b);return A=A||new b(r),i._add(b,A),A});return f(a,"init").then(()=>f(a,"afterInit")).then(()=>a);function l(b){return typeof b=="function"}function c(b){return l(b)&&!!b.isContextPlugin}function d(b,A){return A.some(E=>E===b||u(b)===E||u(E)===b)}function u(b){return l(b)?b.pluginName||b.name:b}function g(b,A=null){b.map(E=>l(E)?E:i._availablePlugins.get(E)||E).forEach(E=>{(function(P,z){if(!l(P))throw z?new I("plugincollection-soft-required",r,{missingPlugin:P,requiredBy:u(z)}):new I("plugincollection-plugin-not-found",r,{plugin:P})})(E,A),function(P,z){if(c(z)&&!c(P))throw new I("plugincollection-context-required",r,{plugin:u(P),requiredBy:u(z)})}(E,A),function(P,z){if(z&&d(P,t))throw new I("plugincollection-required",r,{plugin:u(P),requiredBy:u(z)})}(E,A)})}function f(b,A){return b.reduce((E,P)=>P[A]?i._contextPlugins.has(P)?E:E.then(P[A].bind(P)):E,Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)typeof t.destroy!="function"||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new I("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}class dd{constructor(e){this._contextOwner=null,this.config=new hc(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new cd(this,t);const n=this.config.get("language")||{};this.locale=new SC({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new at}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const n of e.concat(t)){if(typeof n!="function")throw new I("context-initplugins-constructor-only",null,{Plugin:n});if(n.isContextPlugin!==!0)throw new I("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new I("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}class ui extends ge(){constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}class GC extends St{constructor(e){super(),this.editor=e}set(e,t,n={}){if(typeof t=="string"){const i=t;t=(r,s)=>{this.editor.execute(i),s()}}super.set(e,t,n)}}var hd=D(4717),ZC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(hd.Z,ZC),hd.Z.locals;const mi=new WeakMap;function JC(o,e){return!!e.hasClass("ck-placeholder")&&(o.removeClass("ck-placeholder",e),!0)}function Xr(o,e){const t=mi.get(o),n=[];let i=!1;for(const[r,s]of t)s.isDirectHost&&(n.push(r),ud(e,r,s)&&(i=!0));for(const[r,s]of t){if(s.isDirectHost)continue;const a=YC(r);a&&(n.includes(a)||(s.hostElement=a,ud(e,r,s)&&(i=!0)))}return i}function ud(o,e,t){const{text:n,isDirectHost:i,hostElement:r}=t;let s=!1;return r.getAttribute("data-placeholder")!==n&&(o.setAttribute("data-placeholder",n,r),s=!0),(i||e.childCount==1)&&function(a,l){if(!a.isAttached()||Array.from(a.getChildren()).some(u=>!u.is("uiElement")))return!1;const c=a.document,d=c.selection.anchor;return!(c.isComposing&&d&&d.parent===a||!l&&c.isFocused&&(!d||d.parent===a))}(r,t.keepOnFocus)?function(a,l){return!l.hasClass("ck-placeholder")&&(a.addClass("ck-placeholder",l),!0)}(o,r)&&(s=!0):JC(o,r)&&(s=!0),s}function YC(o){if(o.childCount){const e=o.getChild(0);if(e.is("element")&&!e.is("uiElement")&&!e.is("attributeElement"))return e}return null}class sn{is(){throw new Error("is() method is abstract")}}const md=function(o){return Fr(o,4)};class an extends me(sn){constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))==-1)throw new I("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Ue(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]e.data.length)throw new I("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new I("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;n!==null;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}wt.prototype.is=function(o){return o==="$textProxy"||o==="view:$textProxy"||o==="textProxy"||o==="view:textProxy"};class Mn{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)(typeof t=="string"||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const n of this._patterns){const i=gd(t,n);if(i)return{element:t,pattern:n,match:i}}return null}matchAll(...e){const t=[];for(const n of e)for(const i of this._patterns){const r=gd(n,i);r&&t.push({element:n,pattern:i,match:r})}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1)return null;const e=this._patterns[0],t=e.name;return typeof e=="function"||!t||t instanceof RegExp?null:t}}function gd(o,e){if(typeof e=="function")return e(o);const t={};return e.name&&(t.name=function(n,i){return n instanceof RegExp?!!i.match(n):n===i}(e.name,o.name),!t.name)||e.attributes&&(t.attributes=function(n,i){const r=new Set(i.getAttributeKeys());return Ge(n)?(n.style!==void 0&&Q("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Q("matcher-pattern-deprecated-attributes-class-key",n)):(r.delete("style"),r.delete("class")),es(n,r,s=>i.getAttribute(s))}(e.attributes,o),!t.attributes)||e.classes&&(t.classes=function(n,i){return es(n,i.getClassNames(),()=>{})}(e.classes,o),!t.classes)||e.styles&&(t.styles=function(n,i){return es(n,i.getStyleNames(!0),r=>i.getStyle(r))}(e.styles,o),!t.styles)?null:t}function es(o,e,t){const n=function(s){return Array.isArray(s)?s.map(a=>Ge(a)?(a.key!==void 0&&a.value!==void 0||Q("matcher-pattern-missing-key-or-value",a),[a.key,a.value]):[a,!0]):Ge(s)?Object.entries(s):[[s,!0]]}(o),i=Array.from(e),r=[];if(n.forEach(([s,a])=>{i.forEach(l=>{(function(c,d){return c===!0||c===d||c instanceof RegExp&&d.match(c)})(s,l)&&function(c,d,u){if(c===!0)return!0;const g=u(d);return c===g||c instanceof RegExp&&!!String(g).match(c)}(a,l,t)&&r.push(l)})}),n.length&&!(r.lengthi?0:i+e),(t=t>i?i:t)<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var r=Array(i);++n0){if(++e>=800)return arguments[0]}else e=0;return o.apply(void 0,arguments)}}(Av),_d=function(o,e){return Cv(bv(o,e,ln),o+"")},vv=function(o,e,t){if(!xe(t))return!1;var n=typeof e;return!!(n=="number"?ti(t)&&yr(e,t.length):n=="string"&&e in t)&&lo(t[e],o)},as=function(o){return _d(function(e,t){var n=-1,i=t.length,r=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(r=o.length>3&&typeof r=="function"?(i--,r):void 0,s&&vv(t[0],t[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++nn===e);return Array.isArray(t)}set(e,t){if(xe(e))for(const[n,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=ls(e);uv(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!xe(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([n])=>n===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?this._styleProcessor.getStyleNames(this._styles):this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),i=pi(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class Sv{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(xe(t))cs(n,ls(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:r,value:s}=i(t);cs(n,r,s)}else cs(n,e,t)}getNormalized(e,t){if(!e)return Cd({},t);if(t[e]!==void 0)return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if(typeof n=="string")return pi(t,n);const i=n(e,t);if(i)return i}return pi(t,ls(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return n===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter(i=>{const r=this.getNormalized(i,e);return r&&typeof r=="object"?Object.keys(r).length:r}),n=new Set([...t,...Object.keys(e)]);return Array.from(n.values())}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function ls(o){return o.replace("-",".")}function cs(o,e,t){let n=t;xe(t)&&(n=Cd({},pi(o,e),t)),Ev(o,e,n)}class tt extends an{constructor(e,t,n,i){if(super(e),this._unsafeAttributesToRender=[],this._customProperties=new Map,this.name=t,this._attrs=function(r){const s=Dt(r);for(const[a,l]of s)l===null?s.delete(a):typeof l!="string"&&s.set(a,String(l));return s}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const r=this._attrs.get("class");vd(this._classes,r),this._attrs.delete("class")}this._styles=new xv(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style"))}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if(e=="class")return this._classes.size>0?[...this._classes].join(" "):void 0;if(e=="style"){const t=this._styles.toString();return t==""?void 0:t}return this._attrs.get(e)}hasAttribute(e){return e=="class"?this._classes.size>0:e=="style"?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof tt))return!1;if(this===e)return!0;if(this.name!=e.name||this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Mn(...e);let n=this.parent;for(;n&&!n.is("documentFragment");){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(i=>`${i[0]}="${i[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(t?` style="${t}"`:"")+(n==""?"":` ${n}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._unsafeAttributesToRender=this._unsafeAttributesToRender,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new pe(r,s)]:(et(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new pe(r,a):a instanceof wt?new pe(r,a.data):a))}(this.document,t);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,r.document=this.document,this._children.splice(e,0,r),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n0&&(this._classes.clear(),!0):e=="style"?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Pe(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Pe(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),typeof e!="string"?this._styles.set(e):this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Pe(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function vd(o,e){const t=e.split(/\s+/);o.clear(),t.forEach(n=>o.add(n))}tt.prototype.is=function(o,e){return e?e===this.name&&(o==="element"||o==="view:element"):o==="element"||o==="view:element"||o==="node"||o==="view:node"};class wo extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=yd}}function yd(){const o=[...this.getChildren()],e=o[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const t of o)if(!t.is("uiElement"))return null;return this.childCount}wo.prototype.is=function(o,e){return e?e===this.name&&(o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class fi extends ge(wo){constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",r=>r&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}destroy(){this.stopListening()}}fi.prototype.is=function(o,e){return e?e===this.name&&(o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};const Ed=Symbol("rootName");class xd extends fi{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Ed)}set rootName(e){this._setCustomProperty(Ed,e)}set _name(e){this.name=e}}xd.prototype.is=function(o,e){return e?e===this.name&&(o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class cn{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new I("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new I("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=U._createAt(e.startPosition):this._position=U._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,n;do n=this.position,t=this.next();while(!t.done&&e(t.value));t.done||(this._position=n)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===n.childCount)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let i;if(n instanceof pe){if(e.isAtEnd)return this._position=U._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof tt)return this.shallow?e.offset++:e=new U(i,0),this._position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof pe){if(this.singleCharacters)return e=new U(i,0),this._position=e,this._next();{let r,s=i.data.length;return i==this._boundaryEndParent?(s=this.boundaries.end.offset,r=new wt(i,0,s),e=U._createAfter(r)):(r=new wt(i,0,i.data.length),e.offset++),this._position=e,this._formatReturnValue("text",r,t,e,s)}}if(typeof i=="string"){let r;this.singleCharacters?r=1:r=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const s=new wt(n,e.offset,r);return e.offset+=r,this._position=e,this._formatReturnValue("text",s,t,e,r)}return e=U._createAfter(n),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===0)return{done:!0,value:void 0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let i;if(n instanceof pe){if(e.isAtStart)return this._position=U._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof tt)return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new U(i,i.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof pe){if(this.singleCharacters)return e=new U(i,i.data.length),this._position=e,this._previous();{let r,s=i.data.length;if(i==this._boundaryStartParent){const a=this.boundaries.start.offset;r=new wt(i,a,i.data.length-a),s=r.data.length,e=U._createBefore(r)}else r=new wt(i,0,i.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",r,t,e,s)}}if(typeof i=="string"){let r;if(this.singleCharacters)r=1;else{const a=n===this._boundaryStartParent?this.boundaries.start.offset:0;r=e.offset-a}e.offset-=r;const s=new wt(n,e.offset,r);return this._position=e,this._formatReturnValue("text",s,t,e,r)}return e=U._createBefore(n),this._position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,r){return t instanceof wt&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=U._createAfter(t.textNode):(i=U._createAfter(t.textNode),this._position=i)),t.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=U._createBefore(t.textNode):(i=U._createBefore(t.textNode),this._position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:r}}}}class U extends sn{constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof fi);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=U._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new cn(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return i===0?null:t[i-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=Ue(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(U._createBefore(e),t)}}function ki(o){return!(!o.item.is("attributeElement")&&!o.item.is("uiElement"))}X.prototype.is=function(o){return o==="range"||o==="view:range"};class At extends me(sn){constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake||this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel||this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=kr(this.getRanges());if(t!=kr(e.getRanges()))return!1;if(t==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let i=!1;for(let r of e.getRanges())if(r=r.getTrimmed(),n.start.isEqual(r.start)&&n.end.isEqual(r.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,n,i]=e;if(typeof n=="object"&&(i=n,n=void 0),t===null)this._setRanges([]),this._setFakeOptions(i);else if(t instanceof At||t instanceof ds)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof X)this._setRanges([t],i&&i.backward),this._setFakeOptions(i);else if(t instanceof U)this._setRanges([new X(t)]),this._setFakeOptions(i);else if(t instanceof an){const r=!!i&&!!i.backward;let s;if(n===void 0)throw new I("view-selection-setto-required-second-parameter",this);s=n=="in"?X._createIn(t):n=="on"?X._createOn(t):new X(U._createAt(t,n)),this._setRanges([s],r),this._setFakeOptions(i)}else{if(!et(t))throw new I("view-selection-setto-not-selectable",this);this._setRanges(t,i&&i.backward),this._setFakeOptions(i)}this.fire("change")}setFocus(e,t){if(this.anchor===null)throw new I("view-selection-setfocus-no-ranges",this);const n=U._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.pop(),n.compareWith(i)=="before"?this._addRange(new X(n,i),!0):this._addRange(new X(i,n)),this.fire("change")}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const n of e)this._addRange(n);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof X))throw new I("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new I("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new X(e.start,e.end))}}At.prototype.is=function(o){return o==="selection"||o==="view:selection"};class ds extends me(sn){constructor(...e){super(),this._selection=new At,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}ds.prototype.is=function(o){return o==="selection"||o=="documentSelection"||o=="view:selection"||o=="view:documentSelection"};class Fn extends ${constructor(e,t,n){super(e,t),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const hs=Symbol("bubbling contexts");function us(o){return class extends o{fire(e,...t){try{const n=e instanceof $?e:new $(this,e),i=ms(this);if(!i.size)return;if(Ao(n,"capturing",this),Vn(i,"$capture",n,...t))return n.return;const r=n.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,a=!!s&&!!Sd(i,s);let l=s||function(c){if(!c)return null;const d=c.start.parent,u=c.end.parent,g=d.getPath(),f=u.getPath();return g.length>f.length?d:u}(r);if(Ao(n,"atTarget",l),!a){if(Vn(i,"$text",n,...t))return n.return;Ao(n,"bubbling",l)}for(;l;){if(l.is("rootElement")){if(Vn(i,"$root",n,...t))return n.return}else if(l.is("element")&&Vn(i,l.name,n,...t))return n.return;if(Vn(i,l,n,...t))return n.return;l=l.parent,Ao(n,"bubbling",l)}return Ao(n,"bubbling",this),Vn(i,"$document",n,...t),n.return}catch(n){I.rethrowUnexpectedError(n,this)}}_addEventListener(e,t,n){const i=Pe(n.context||"$document"),r=ms(this);for(const s of i){let a=r.get(s);a||(a=new(me()),r.set(s,a)),this.listenTo(a,e,t,n)}}_removeEventListener(e,t){const n=ms(this);for(const i of n.values())this.stopListening(i,e,t)}}}{const o=us(Object);["fire","_addEventListener","_removeEventListener"].forEach(e=>{us[e]=o.prototype[e]})}function Ao(o,e,t){o instanceof Fn&&(o._eventPhase=e,o._currentTarget=t)}function Vn(o,e,t,...n){const i=typeof e=="string"?o.get(e):Sd(o,e);return!!i&&(i.fire(t,...n),t.stop.called)}function Sd(o,e){for(const[t,n]of o)if(typeof t=="function"&&t(e))return n;return null}function ms(o){return o[hs]||(o[hs]=new Map),o[hs]}class Dd extends us(ge()){constructor(e){super(),this._postFixers=new Set,this.selection=new ds,this.roots=new at({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(t=n(e),t)break;while(t)}}class dn extends tt{constructor(e,t,n,i){super(e,t,n,i),this._priority=10,this._id=null,this._clonesGroup=null,this.getFillerOffset=Dv}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new I("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function Dv(){if(gs(this))return null;let o=this.parent;for(;o&&o.is("attributeElement");){if(gs(o)>1)return null;o=o.parent}return!o||gs(o)>1?null:this.childCount}function gs(o){return Array.from(o.getChildren()).filter(e=>!e.is("uiElement")).length}dn.DEFAULT_PRIORITY=10,dn.prototype.is=function(o,e){return e?e===this.name&&(o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"):o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class ps extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Bv}_insertChild(e,t){if(t&&(t instanceof an||Array.from(t).length>0))throw new I("view-emptyelement-cannot-add",[this,t]);return 0}}function Bv(){return null}ps.prototype.is=function(o,e){return e?e===this.name&&(o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"):o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class bi extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Iv}_insertChild(e,t){if(t&&(t instanceof an||Array.from(t).length>0))throw new I("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const n of this.getAttributeKeys())t.setAttribute(n,this.getAttribute(n));return t}}function Tv(o){o.document.on("arrowKey",(e,t)=>function(n,i,r){if(i.keyCode==se.arrowright){const s=i.domTarget.ownerDocument.defaultView.getSelection(),a=s.rangeCount==1&&s.getRangeAt(0).collapsed;if(a||i.shiftKey){const l=s.focusNode,c=s.focusOffset,d=r.domPositionToView(l,c);if(d===null)return;let u=!1;const g=d.getLastMatchingPosition(f=>(f.item.is("uiElement")&&(u=!0),!(!f.item.is("uiElement")&&!f.item.is("attributeElement"))));if(u){const f=r.viewPositionToDom(g);a?s.collapse(f.parent,f.offset):s.extend(f.parent,f.offset)}}}}(0,t,o.domConverter),{priority:"low"})}function Iv(){return null}bi.prototype.is=function(o,e){return e?e===this.name&&(o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"):o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class fs extends tt{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Pv}_insertChild(e,t){if(t&&(t instanceof an||Array.from(t).length>0))throw new I("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function Pv(){return null}fs.prototype.is=function(o,e){return e?e===this.name&&(o==="rawElement"||o==="view:rawElement"||o==="element"||o==="view:element"):o==="rawElement"||o==="view:rawElement"||o===this.name||o==="view:"+this.name||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class hn extends me(sn){constructor(e,t){super(),this._children=[],this._customProperties=new Map,this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}get name(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new pe(r,s)]:(et(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new pe(r,a):a instanceof wt?new pe(r,a.data):a))}(this.document,t);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,this._children.splice(e,0,r),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n{const l=s[s.length-1],c=!a.is("uiElement");return l&&l.breakAttributes==c?l.nodes.push(a):s.push({breakAttributes:c,nodes:[a]}),s},[]);let i=null,r=e;for(const{nodes:s,breakAttributes:a}of n){const l=this._insertNodes(r,s,a);i||(i=l.start),r=l.end}return i?new X(i,r):new X(e)}remove(e){const t=e instanceof X?e:X._createOn(e);if(_o(t,this.document),t.isCollapsed)return new hn(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),r=n.parent,s=i.offset-n.offset,a=r._removeChildren(n.offset,s);for(const c of a)this._removeFromClonedElementsGroup(c);const l=this.mergeAttributes(n);return t.start=l,t.end=l.clone(),new hn(this.document,a)}clear(e,t){_o(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const r=i.item;let s;if(r.is("element")&&t.isSimilar(r))s=X._createOn(r);else if(!i.nextPosition.isAfter(e.start)&&r.is("$textProxy")){const a=r.getAncestors().find(l=>l.is("element")&&t.isSimilar(l));a&&(s=X._createIn(a))}s&&(s.end.isAfter(e.end)&&(s.end=e.end),s.start.isBefore(e.start)&&(s.start=e.start),this.remove(s))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,r=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-r}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof dn))throw new I("view-writer-wrap-invalid-attribute",this.document);if(_o(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some(s=>!s.is("uiElement")))&&(i=i.getLastMatchingPosition(s=>s.item.is("uiElement"))),i=this._wrapPosition(i,t);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new X(i)}return this._wrapRange(e,t);var n}unwrap(e,t){if(!(t instanceof dn))throw new I("view-writer-unwrap-invalid-attribute",this.document);if(_o(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),r=n.parent,s=this._unwrapChildren(r,n.offset,i.offset,t),a=this.mergeAttributes(s.start);a.isEqual(s.start)||s.end.offset--;const l=this.mergeAttributes(s.end);return new X(a,l)}rename(e,t){const n=new wo(this.document,e,t.getAttributes());return this.insert(U._createAfter(t),n),this.move(X._createIn(t),U._createAt(n,0)),this.remove(X._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return U._createAt(e,t)}createPositionAfter(e){return U._createAfter(e)}createPositionBefore(e){return U._createBefore(e)}createRange(e,t){return new X(e,t)}createRangeOn(e){return X._createOn(e)}createRangeIn(e){return X._createIn(e)}createSelection(...e){return new At(...e)}createSlot(e="children"){if(!this._slotFactory)throw new I("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,n){let i,r;if(i=n?ks(e):e.parent.is("$text")?e.parent.parent:e.parent,!i)throw new I("view-writer-invalid-position-container",this.document);r=n?this._breakAttributes(e,!0):e.parent.is("$text")?bs(e):e;const s=i._insertChild(r.offset,t);for(const d of t)this._addToClonedElementsGroup(d);const a=r.getShiftedBy(s),l=this.mergeAttributes(r);l.isEqual(r)||a.offset--;const c=this.mergeAttributes(a);return new X(l,c)}_wrapChildren(e,t,n,i){let r=t;const s=[];for(;r!1,e.parent._insertChild(e.offset,n);const i=new X(e,e.getShiftedBy(1));this.wrap(i,t);const r=new U(n.parent,n.index);n._remove();const s=r.nodeBefore,a=r.nodeAfter;return s instanceof pe&&a instanceof pe?Id(s,a):Td(r)}_wrapAttributeElement(e,t){if(!Rd(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Rd(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(_o(e,this.document),e.isCollapsed){const l=this._breakAttributes(e.start,t);return new X(l,l)}const r=this._breakAttributes(i,t),s=r.parent.childCount,a=this._breakAttributes(n,t);return r.offset+=r.parent.childCount-s,new X(a,r)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new I("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new I("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new I("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&ws(i.parent)||ws(i))return e.clone();if(i.is("$text"))return this._breakAttributes(bs(e),t);if(n==i.childCount){const r=new U(i.parent,i.index+1);return this._breakAttributes(r,t)}if(n===0){const r=new U(i.parent,i.index);return this._breakAttributes(r,t)}{const r=i.index+1,s=i._clone();i.parent._insertChild(r,s),this._addToClonedElementsGroup(s);const a=i.childCount-n,l=i._removeChildren(n,a);s._appendChild(l);const c=new U(i.parent,r);return this._breakAttributes(c,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const i of e.getChildren())this._addToClonedElementsGroup(i);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const i of e.getChildren())this._removeFromClonedElementsGroup(i);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function ks(o){let e=o.parent;for(;!ws(e);){if(!e)return;e=e.parent}return e}function Rv(o,e){return o.prioritye.priority)&&o.getIdentity()t instanceof n))throw new I("view-writer-insert-invalid-node-type",e);t.is("$text")||Pd(t.getChildren(),e)}}function ws(o){return o&&(o.is("containerElement")||o.is("documentFragment"))}function _o(o,e){const t=ks(o.start),n=ks(o.end);if(!t||!n||t!==n)throw new I("view-writer-invalid-range-container",e)}function Rd(o,e){return o.id===null&&e.id===null}const Od=o=>o.createTextNode(" "),Nd=o=>{const e=o.createElement("span");return e.dataset.ckeFiller="true",e.innerText=" ",e},zd=o=>{const e=o.createElement("br");return e.dataset.ckeFiller="true",e},_t=7,wi="⁠".repeat(_t);function nt(o){return Ie(o)&&o.data.substr(0,_t)===wi}function Co(o){return o.data.length==_t&&nt(o)}function Md(o){return nt(o)?o.data.slice(_t):o.data}function Nv(o,e){if(e.keyCode==se.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(t.rangeCount==1&&t.getRangeAt(0).collapsed){const n=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;nt(n)&&i<=_t&&t.collapse(n,0)}}}var Fd=D(9315),zv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Fd.Z,zv),Fd.Z.locals;class Mv extends ge(){constructor(e,t){super(),this.domDocuments=new Set,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this._inlineFiller=null,this._fakeSelectionContainer=null,this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),k.isBlink&&!k.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()}),this.set("isComposing",!1),this.on("change:isComposing",()=>{this.isComposing||this.render()})}markToSync(e,t){if(e==="text")this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if(e==="attributes")this.markedAttributes.add(t);else{if(e!=="children")throw new I("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!k.isAndroid)return;let e=null;const t=!(k.isBlink&&!k.isAndroid)||!this.isSelecting;for(const n of this.markedChildren)this._updateChildrenMappings(n);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=U._createBefore(e.parent)));for(const n of this.markedAttributes)this._updateAttrs(n);for(const n of this.markedChildren)this._updateChildren(n,{inlineFillerPosition:e});for(const n of this.markedTexts)!this.markedChildren.has(n.parent)&&this.domConverter.mapViewToDom(n.parent)&&this._updateText(n,{inlineFillerPosition:e});if(t)if(e){const n=this.domConverter.viewPositionToDom(e),i=n.parent.ownerDocument;nt(n.parent)?this._inlineFiller=n.parent:this._inlineFiller=Vd(i,n.parent,n.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){if(!this.domConverter.mapViewToDom(e))return;const t=Array.from(this.domConverter.mapViewToDom(e).childNodes),n=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),i=this._diffNodeLists(t,n),r=this._findUpdateActions(i,t,n,Fv);if(r.indexOf("update")!==-1){const s={equal:0,insert:0,delete:0};for(const a of r)if(a==="update"){const l=s.equal+s.insert,c=s.equal+s.delete,d=e.getChild(l);!d||d.is("uiElement")||d.is("rawElement")||this._updateElementMappings(d,t[c]),Ec(n[l]),s.equal++}else s[a]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?U._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Ie(t.parent)&&nt(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!nt(e))throw new I("view-renderer-filler-was-lost",this);Co(e)?e.remove():e.data=e.data.substr(_t),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root)||!t.is("element")||!function(s){if(s.getAttribute("contenteditable")=="false")return!1;const a=s.findAncestor(l=>l.hasAttribute("contenteditable"));return!a||a.getAttribute("contenteditable")=="true"}(t)||n===t.getFillerOffset())return!1;const i=e.nodeBefore,r=e.nodeAfter;return!(i instanceof pe||r instanceof pe)&&(!k.isAndroid||!i&&!r)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e);let i=this.domConverter.viewToDom(e).data;const r=t.inlineFillerPosition;r&&r.parent==e.parent&&r.offset==e.index&&(i=wi+i),Ld(n,i)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(r=>r.name),i=e.getAttributeKeys();for(const r of i)this.domConverter.setDomElementAttribute(t,r,e.getAttribute(r),e);for(const r of n)e.hasAttribute(r)||this.domConverter.removeDomElementAttribute(t,r)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;if(k.isAndroid){let u=null;for(const g of Array.from(n.childNodes)){if(u&&Ie(u)&&Ie(g)){n.normalize();break}u=g}}const i=t.inlineFillerPosition,r=n.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));i&&i.parent===e&&Vd(n.ownerDocument,s,i.offset);const a=this._diffNodeLists(r,s),l=this._findUpdateActions(a,r,s,Vv);let c=0;const d=new Set;for(const u of l)u==="delete"?(d.add(r[c]),Ec(r[c])):u!=="equal"&&u!=="update"||c++;c=0;for(const u of l)u==="insert"?(Ac(n,c,s[c]),c++):u==="update"?(Ld(r[c],s[c].data),c++):u==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(s[c])),c++);for(const u of d)u.parentNode||this.domConverter.unbindDomElement(u)}_diffNodeLists(e,t){return e=function(n,i){const r=Array.from(n);return r.length==0||!i||r[r.length-1]==i&&r.pop(),r}(e,this._fakeSelectionContainer),F(e,t,Lv.bind(null,this.domConverter))}_findUpdateActions(e,t,n,i){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let r=[],s=[],a=[];const l={equal:0,insert:0,delete:0};for(const c of e)c==="insert"?a.push(n[l.equal+l.insert]):c==="delete"?s.push(t[l.equal+l.delete]):(r=r.concat(F(s,a,i).map(d=>d==="equal"?"update":d)),r.push("equal"),s=[],a=[]),l[c]++;return r.concat(F(s,a,i).map(c=>c==="equal"?"update":c))}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}}_updateSelection(){if(k.isBlink&&!k.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&k.isAndroid||this._updateDomSelection(e))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(s){const a=s.createElement("div");return a.className="ck-fake-selection-container",Object.assign(a.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),a.textContent=" ",a}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=t.getSelection(),r=t.createRange();i.removeAllRanges(),r.selectNodeContents(n),i.addRange(r)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),k.isGecko&&function(r,s){const a=r.parent;if(a.nodeType!=Node.ELEMENT_NODE||r.offset!=a.childNodes.length-1)return;const l=a.childNodes[r.offset];l&&l.tagName=="BR"&&s.addRange(s.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const n=e.activeElement,i=this.domConverter.mapDomToView(n);n&&i&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function Vd(o,e,t){const n=e instanceof Array?e:e.childNodes,i=n[t];if(Ie(i))return i.data=wi+i.data,i;{const r=o.createTextNode(wi);return Array.isArray(e)?n.splice(t,0,r):Ac(e,t,r),r}}function Fv(o,e){return jt(o)&&jt(e)&&!Ie(o)&&!Ie(e)&&!On(o)&&!On(e)&&o.tagName.toLowerCase()===e.tagName.toLowerCase()}function Vv(o,e){return jt(o)&&jt(e)&&Ie(o)&&Ie(e)}function Lv(o,e,t){return e===t||(Ie(e)&&Ie(t)?e.data===t.data:!(!o.isBlockFiller(e)||!o.isBlockFiller(t)))}function Ld(o,e){const t=o.data;if(t==e)return;const n=R(t,e);for(const i of n)i.type==="insert"?o.insertData(i.index,i.values.join("")):o.deleteData(i.index,i.howMany)}const jv=zd(oe.document),$v=Od(oe.document),Hv=Nd(oe.document),Ai="data-ck-unsafe-attribute-",jd="data-ck-unsafe-element";class $d{constructor(e,{blockFillerMode:t,renderingMode:n="editing"}={}){this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Mn,this._encounteredRawContentDomNodes=new WeakSet,this.document=e,this.renderingMode=n,this.blockFillerMode=t||(n==="editing"?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?oe.document:oe.document.implementation.createHTMLDocument("")}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new At(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const n of Array.from(e.children))this.unbindDomElement(n)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,n){return this.renderingMode==="data"||!(e=e.toLowerCase()).startsWith("on")&&(e!=="srcdoc"||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&(n==="img"&&(e==="src"||e==="srcset")||n==="source"&&e==="srcset"||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(e,t){if(this.renderingMode==="data")return void(e.innerHTML=t);const n=new DOMParser().parseFromString(t,"text/html"),i=n.createDocumentFragment(),r=n.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);const s=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT),a=[];let l;for(;l=s.nextNode();)a.push(l);for(const c of a){for(const u of c.getAttributeNames())this.setDomElementAttribute(c,u,c.getAttribute(u));const d=c.tagName.toLowerCase();this._shouldRenameElement(d)&&(Ud(d),c.replaceWith(this._createReplacementDomElement(d,c)))}for(;e.firstChild;)e.firstChild.remove();e.append(i)}viewToDom(e,t={}){if(e.is("$text")){const n=this._processDataFromViewText(e);return this._domDocument.createTextNode(n)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let n;if(e.is("documentFragment"))n=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(n,e);else{if(e.is("uiElement"))return n=e.name==="$comment"?this._domDocument.createComment(e.getCustomProperty("$rawContent")):e.render(this._domDocument,this),t.bind&&this.bindElements(n,e),n;this._shouldRenameElement(e.name)?(Ud(e.name),n=this._createReplacementDomElement(e.name)):n=e.hasAttribute("xmlns")?this._domDocument.createElementNS(e.getAttribute("xmlns"),e.name):this._domDocument.createElement(e.name),e.is("rawElement")&&e.render(n,this),t.bind&&this.bindElements(n,e);for(const i of e.getAttributeKeys())this.setDomElementAttribute(n,i,e.getAttribute(i),e)}if(t.withChildren!==!1)for(const i of this.viewChildrenToDom(e,t))n.appendChild(i);return n}}setDomElementAttribute(e,t,n,i){const r=this.shouldRenderAttribute(t,n,e.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(t);r||Q("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:n}),_c(t)?(e.hasAttribute(t)&&!r?e.removeAttribute(t):e.hasAttribute(Ai+t)&&r&&e.removeAttribute(Ai+t),e.setAttribute(r?t:Ai+t,n)):Q("domconverter-invalid-attribute-detected",{domElement:e,key:t,value:n})}removeDomElementAttribute(e,t){t!=jd&&(e.removeAttribute(t),e.removeAttribute(Ai+t))}*viewChildrenToDom(e,t={}){const n=e.getFillerOffset&&e.getFillerOffset();let i=0;for(const r of e.getChildren()){n===i&&(yield this._getBlockFiller());const s=r.is("element")&&!!r.getCustomProperty("dataPipeline:transparentRendering")&&!ze(r.getAttributes());s&&this.renderingMode=="data"?yield*this.viewChildrenToDom(r,t):(s&&Q("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:r}),yield this.viewToDom(r,t)),i++}n===i&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=this._domDocument.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return nt(n)&&(i+=_t),{parent:n,offset:i}}{let n,i,r;if(e.offset===0){if(n=this.mapViewToDom(t),!n)return null;r=n.childNodes[0]}else{const s=e.nodeBefore;if(i=s.is("$text")?this.findCorrespondingDomText(s):this.mapViewToDom(s),!i)return null;n=i.parentNode,r=i.nextSibling}return Ie(r)&&nt(r)?{parent:r,offset:_t}:{parent:n,offset:i?ai(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const n=this.getHostViewElement(e);if(n)return n;if(On(e)&&t.skipComments)return null;if(Ie(e)){if(Co(e))return null;{const i=this._processDataFromDomText(e);return i===""?null:new pe(this.document,i)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let i;if(this.isDocumentFragment(e))i=new hn(this.document),t.bind&&this.bindDocumentFragments(e,i);else{i=this._createViewElement(e,t),t.bind&&this.bindElements(e,i);const r=e.attributes;if(r)for(let s=r.length,a=0;a{const{scrollLeft:a,scrollTop:l}=s;r.push([a,l])}),t.focus(),Hd(t,s=>{const[a,l]=r.shift();s.scrollLeft=a,s.scrollTop=l}),oe.window.scrollTo(n,i)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(jv):!(e.tagName!=="BR"||!qd(e,this.blockElements)||e.parentNode.childNodes.length!==1)||e.isEqualNode(Hv)||function(t,n){return t.isEqualNode($v)&&qd(t,n)&&t.parentNode.childNodes.length===1}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch{return!1}const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=pc(e);for(t.pop();t.length;){const n=t.pop(),i=this._domToViewMapping.get(n);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return Od(this._domDocument);case"markedNbsp":return Nd(this._domDocument);case"br":return zd(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(Ie(e)&&nt(e)&&t<_t||this.isElement(e)&&nt(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return t;if(t.charAt(0)==" "){const n=this._getTouchingInlineViewNode(e,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(t.charAt(t.length-1)==" "){const n=this._getTouchingInlineViewNode(e,!0),i=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";t.charAt(t.length-2)!=" "&&n&&!i||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return!1;const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==" "}_processDataFromDomText(e){let t=e.data;if(function(c,d){return pc(c).some(g=>g.tagName&&d.includes(g.tagName.toLowerCase()))}(e,this.preElements))return Md(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),r=this._checkShouldLeftTrimDomText(e,n),s=this._checkShouldRightTrimDomText(e,i);r&&(t=t.replace(/^ /,"")),s&&(t=t.replace(/ $/,"")),t=Md(new Text(t)),t=t.replace(/ \u00A0/g," ");const a=i&&this.isElement(i)&&i.tagName!="BR",l=i&&Ie(i)&&i.data.charAt(0)==" ";return(/( |\u00A0)\u00A0$/.test(t)||!i||a||l)&&(t=t.replace(/\u00A0$/," ")),(r||n&&this.isElement(n)&&n.tagName!="BR")&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?t.tagName==="BR":!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!nt(e)}_getTouchingInlineViewNode(e,t){const n=new cn({startPosition:t?U._createAfter(e):U._createBefore(e),direction:t?"forward":"backward"});for(const i of n){if(i.item.is("element")&&this.inlineObjectElements.includes(i.item.name))return i.item;if(i.item.is("containerElement")||i.item.is("element","br"))return null;if(i.item.is("$textProxy"))return i.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",i=t?"nextSibling":"previousSibling";let r=!0,s=e;do if(!r&&s[n]?s=s[n]:s[i]?(s=s[i],r=!1):(s=s.parentNode,r=!0),!s||this._isBlockElement(s))return null;while(!Ie(s)&&s.tagName!="BR"&&!this._isInlineObjectElement(s));return s}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if(On(e))return new bi(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new tt(this.document,n)}_isViewElementWithRawContent(e,t){return t.withChildren!==!1&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return this.renderingMode==="editing"&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const n=this._domDocument.createElement("span");if(n.setAttribute(jd,e),t){for(;t.firstChild;)n.appendChild(t.firstChild);for(const i of t.getAttributeNames())n.setAttribute(i,t.getAttribute(i))}return n}}function Hd(o,e){let t=o;for(;t;)e(t),t=t.parentElement}function qd(o,e){const t=o.parentNode;return!!t&&!!t.tagName&&e.includes(t.tagName.toLowerCase())}function Ud(o){o==="script"&&Q("domconverter-unsafe-script-element-detected"),o==="style"&&Q("domconverter-unsafe-style-element-detected")}class Ct extends $t(){constructor(e){super(),this._isEnabled=!1,this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&e.nodeType===3&&(e=e.parentNode),!(!e||e.nodeType!==1)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}const Wd=as(function(o,e){Tn(e,Pn(e),o)});class Ln{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Wd(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Ht extends Ct{constructor(){super(...arguments),this.useCapture=!1}observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(n,i)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(i.target)&&this.onDomEvent(i)},{useCapture:this.useCapture})})}stopObserving(e){this.stopListening(e)}fire(e,t,n){this.isEnabled&&this.document.fire(e,new Ln(this.view,t,n))}}class qv extends Ht{constructor(){super(...arguments),this.domEventType=["keydown","keyup"]}onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Nn(this)}};this.fire(e.type,e,t)}}const As=function(){return dt.Date.now()};var Uv=/\s/;const Wv=function(o){for(var e=o.length;e--&&Uv.test(o.charAt(e)););return e};var Kv=/^\s+/;const Gv=function(o){return o&&o.slice(0,Wv(o)+1).replace(Kv,"")};var Zv=/^[-+]0x[0-9a-f]+$/i,Jv=/^0b[01]+$/i,Yv=/^0o[0-7]+$/i,Qv=parseInt;const Kd=function(o){if(typeof o=="number")return o;if(gi(o))return NaN;if(xe(o)){var e=typeof o.valueOf=="function"?o.valueOf():o;o=xe(e)?e+"":e}if(typeof o!="string")return o===0?o:+o;o=Gv(o);var t=Jv.test(o);return t||Yv.test(o)?Qv(o.slice(2),t?2:8):Zv.test(o)?NaN:+o};var Xv=Math.max,ey=Math.min;const vo=function(o,e,t){var n,i,r,s,a,l,c=0,d=!1,u=!1,g=!0;if(typeof o!="function")throw new TypeError("Expected a function");function f(z){var j=n,Y=i;return n=i=void 0,c=z,s=o.apply(Y,j)}function b(z){var j=z-l;return l===void 0||j>=e||j<0||u&&z-c>=r}function A(){var z=As();if(b(z))return E(z);a=setTimeout(A,function(j){var Y=e-(j-l);return u?ey(Y,r-(j-c)):Y}(z))}function E(z){return a=void 0,g&&n?f(z):(n=i=void 0,s)}function P(){var z=As(),j=b(z);if(n=arguments,i=this,l=z,j){if(a===void 0)return function(Y){return c=Y,a=setTimeout(A,e),d?f(Y):s}(l);if(u)return clearTimeout(a),a=setTimeout(A,e),f(l)}return a===void 0&&(a=setTimeout(A,e)),s}return e=Kd(e)||0,xe(t)&&(d=!!t.leading,r=(u="maxWait"in t)?Xv(Kd(t.maxWait)||0,e):r,g="trailing"in t?!!t.trailing:g),P.cancel=function(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0},P.flush=function(){return a===void 0?s:E(As())},P};class ty extends Ct{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=vo(t=>{this.document.fire("selectionChangeDone",t)},200)}observe(){const e=this.document;e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new At(t.getRanges(),{backward:t.isBackward,fake:!1});e!=se.arrowleft&&e!=se.arrowup||n.setTo(n.getFirstPosition()),e!=se.arrowright&&e!=se.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}const ny=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this},oy=function(o){return this.__data__.has(o)};function _i(o){var e=-1,t=o==null?0:o.length;for(this.__data__=new Xo;++ea))return!1;var c=r.get(o),d=r.get(e);if(c&&d)return c==e&&d==o;var u=-1,g=!0,f=2&t?new iy:void 0;for(r.set(o,e),r.set(e,o);++u{this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this.flush(),e.change(()=>{})},50)}),t.on("blur",(n,i)=>{const r=t.selection.editableElement;r!==null&&r!==i.target||(t.isFocused=!1,this._isFocusChanging=!1,e.change(()=>{}))})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class py extends Ct{constructor(e){super(e),this.mutationObserver=e.getObserver(eh),this.focusObserver=e.getObserver(Cs),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=vo(t=>{this.document.fire("selectionChangeDone",t)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=vo(()=>this.document.isSelecting=!1,5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,n=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},{priority:"highest"}),this.listenTo(e,"keydown",n,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",n,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",n,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",(i,r)=>{this.document.isComposing&&!k.isAndroid||(this._handleSelectionChange(r,t),this._documentIsSelectingInactivityTimeoutDebounced())}),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount!=0){if(this.view.hasDomSelection=!0,!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(n))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(this.focusObserver.flush(),this.selection.isSimilar(i))this.view.forceRender();else{const r={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class fy extends Ht{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0},{priority:"low"}),t.on("compositionend",()=>{t.isComposing=!1},{priority:"low"})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class th{constructor(e,t={}){this._files=t.cacheFiles?nh(e):null,this._native=e}get files(){return this._files||(this._files=nh(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,n){this._native.setDragImage(e,t,n)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}function nh(o){const e=Array.from(o.files||[]),t=Array.from(o.items||[]);return e.length?e:t.filter(n=>n.kind==="file").map(n=>n.getAsFile())}class ky extends Ht{constructor(){super(...arguments),this.domEventType="beforeinput"}onDomEvent(e){const t=e.getTargetRanges(),n=this.view,i=n.document;let r=null,s=null,a=[];if(e.dataTransfer&&(r=new th(e.dataTransfer)),e.data!==null?s=e.data:r&&(s=r.getData("text/plain")),i.selection.isFake)a=Array.from(i.selection.getRanges());else if(t.length)a=t.map(l=>n.domConverter.domRangeToView(l));else if(k.isAndroid){const l=e.target.ownerDocument.defaultView.getSelection();a=Array.from(n.domConverter.domSelectionToView(l).getRanges())}if(k.isAndroid&&e.inputType=="insertCompositionText"&&s&&s.endsWith(` `))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[n.createRange(a[0].end)]});else if(e.inputType=="insertText"&&s&&s.includes(` -`)){const l=s.split(/\n{1,2}/g);let c=a;for(let d=0;d{if(this.isEnabled&&((i=n.keyCode)==se.arrowright||i==se.arrowleft||i==se.arrowup||i==se.arrowdown)){const r=new Fn(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(r,n),r.stop.called&&t.stop()}var i})}observe(){}stopObserving(){}}class wy extends Ct{constructor(e){super(e);const t=this.document;t.on("keydown",(n,i)=>{if(!this.isEnabled||i.keyCode!=se.tab||i.ctrlKey)return;const r=new Fn(t,"tab",t.selection.getFirstRange());t.fire(r,i),r.stop.called&&n.stop()})}observe(){}stopObserving(){}}class Ay extends ge(){constructor(e){super(),this.domRoots=new Map,this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this.document=new Dd(e),this.domConverter=new $d(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Mv(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new Bd(this.document),this.addObserver(eh),this.addObserver(_s),this.addObserver(py),this.addObserver(qv),this.addObserver(ty),this.addObserver(fy),this.addObserver(by),this.addObserver(ky),this.addObserver(wy),this.document.on("arrowKey",Nv,{priority:"low"}),Tv(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:s,value:a}of Array.from(e.attributes))i[s]=a,s==="class"?this._writer.addClass(a.split(" "),n):this._writer.setAttribute(s,a,n);this._initialDomRootAttributes.set(e,i);const r=()=>{this._writer.setAttribute("contenteditable",(!n.isReadOnly).toString(),n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};r(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(s,a)=>this._renderer.markToSync("children",a)),n.on("change:attributes",(s,a)=>this._renderer.markToSync("attributes",a)),n.on("change:text",(s,a)=>this._renderer.markToSync("text",a)),n.on("change:isReadOnly",()=>this.change(r)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const s of this._observers.values())s.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:i})=>t.removeAttribute(i));const n=this._initialDomRootAttributes.get(t);for(const i in n)t.setAttribute(i,n[i]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const i of this._observers.values())i.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[n,i]of this.domRoots)t.observe(i,n);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:n=20,ancestorOffset:i=20}={}){const r=this.document.selection.getFirstRange();r&&function({target:s,viewportOffset:a=0,ancestorOffset:l=0,alignToTop:c,forceScroll:d}){const u=$r(s);let g=u,f=null;for(;g;){let b;b=_C(g==u?s:f),AC({parent:b,getRect:()=>Tc(s,g),alignToTop:c,ancestorOffset:l,forceScroll:d});const A=Tc(s,g);if(wC({window:g,rect:A,viewportOffset:a,alignToTop:c,forceScroll:d}),g.parent!=g){if(f=g.frameElement,g=g.parent,!f)return}else g=null}}({target:this.domConverter.viewRangeToDom(r),viewportOffset:n,ancestorOffset:i,alignToTop:e,forceScroll:t})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new I("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(t){I.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(_s).flush(),this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return U._createAt(e,t)}createPositionAfter(e){return U._createAfter(e)}createPositionBefore(e){return U._createBefore(e)}createRange(e,t){return new X(e,t)}createRangeOn(e){return X._createOn(e)}createRangeIn(e){return X._createIn(e)}createSelection(...e){return new At(...e)}_disableRendering(e){this._renderingDisabled=e,e==0&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class qt{is(){throw new Error("is() method is abstract")}}class un extends qt{constructor(e){super(),this.parent=null,this._attrs=Dt(e)}get document(){return null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))===null)throw new I("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if((e=this.parent.getChildStartOffset(this))===null)throw new I("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.parent!==null&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Ue(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i](t[n[0]]=n[1],t),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Dt(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}un.prototype.is=function(o){return o==="node"||o==="model:node"};class yo{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((n,i)=>n+i.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new I("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&e1e4)return n.slice(0,r).concat(i).concat(n.slice(r+s,n.length));{const a=Array.from(n);return a.splice(r,s,...i),a}}(this._nodes,Array.from(t),e,0)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map(e=>e.toJSON())}}class fe extends un{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new fe(this.data,this.getAttributes())}static fromJSON(e){return new fe(e.data,e.attributes)}}fe.prototype.is=function(o){return o==="$text"||o==="model:$text"||o==="text"||o==="model:text"||o==="node"||o==="model:node"};class ut extends qt{constructor(e,t,n){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new I("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new I("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}ut.prototype.is=function(o){return o==="$textProxy"||o==="model:$textProxy"||o==="textProxy"||o==="model:textProxy"};class ke extends un{constructor(e,t,n){super(t),this._children=new yo,this.name=e,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(n=>n._clone(!0)):void 0;return new ke(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new fe(i)]:(et(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new fe(r):r instanceof ut?new fe(r.data,r.getAttributes()):r))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}static fromJSON(e){let t;if(e.children){t=[];for(const n of e.children)n.name?t.push(ke.fromJSON(n)):t.push(fe.fromJSON(n))}return new ke(e.name,e.attributes,t)}}ke.prototype.is=function(o,e){return e?e===this.name&&(o==="element"||o==="model:element"):o==="element"||o==="model:element"||o==="node"||o==="model:node"};class vt{constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new I("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if(t!="forward"&&t!="backward")throw new I("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=H._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,n,i,r;do i=this.position,r=this._visitedParent,{done:t,value:n}=this.next();while(!t&&e(n));t||(this._position=i,this._visitedParent=r)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===n.maxOffset)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const i=Eo(t,n),r=i||oh(t,n,i);if(r instanceof ke)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=r),this._position=t,mn("elementStart",r,e,t,1);if(r instanceof fe){let s;if(this.singleCharacters)s=1;else{let c=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsetd&&(d=this.boundaries.start.offset),a=t.offset-d}const l=t.offset-s.startOffset,c=new ut(s,l-a,a);return t.offset-=a,this._position=t,mn("text",c,e,t,a)}return t.path.pop(),this._position=t,this._visitedParent=n.parent,mn("elementStart",n,e,t,1)}}function mn(o,e,t,n,i){return{done:!1,value:{type:o,item:e,previousPosition:t,nextPosition:n,length:i}}}class H extends qt{constructor(e,t,n="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new I("model-position-root-invalid",e);if(!(t instanceof Array)||t.length===0)throw new I("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t1)return!1;if(i===1)return rh(e,this,n);if(i===-1)return rh(this,e,n)}return this.path.length===e.path.length||(this.path.length>e.path.length?Cs(this.path,t):Cs(e.path,t))}hasSameParentAs(e){return this.root!==e.root?!1:Ue(this.getParentPath(),e.getParentPath())=="same"}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=H._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?H._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=H._createAt(this);if(this.root!=e.root)return n;if(Ue(e.getParentPath(),this.getParentPath())=="same"){if(e.offsetthis.offset)return null;n.offset-=t}}else if(Ue(e.getParentPath(),this.getParentPath())=="prefix"){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=H._createAt(this);if(this.root!=e.root)return n;if(Ue(e.getParentPath(),this.getParentPath())=="same")(e.offset=i;){if(n.path[s]+a!==r.maxOffset)return!1;a=1,s--,r=r.parent}return!0}(o,t+1)}function Cs(o,e){for(;et+1;){const r=i.maxOffset-n.offset;r!==0&&e.push(new V(n,n.getShiftedBy(r))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const r=this.end.path[n.path.length-1],s=r-n.offset;s!==0&&e.push(new V(n,n.getShiftedBy(s))),n.offset=r,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new vt(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new vt(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new vt(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new V(this.start,this.end)]}getTransformedByOperations(e){const t=[new V(this.start,this.end)];for(const n of e)for(let i=0;i0?new this(n,i):new this(i,n)}static _createIn(e){return new this(H._createAt(e,0),H._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(H._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0)throw new I("range-create-from-ranges-empty-array",null);if(e.length==1)return e[0].clone();const t=e[0];e.sort((r,s)=>r.start.isAfter(s.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let r=n-1;e[r].end.isEqual(i.start);r++)i.start=H._createAt(e[r].start);for(let r=n+1;r{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);if(!n)throw new I("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),r=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=H._createAt(i,r)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const n=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const i of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(i);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(n)==e&&this._modelToViewMapping.delete(n))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),n.size==0&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),i.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new V(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new X(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const i of t)if(i.is("attributeElement"))for(const r of i.getElementsWithSameId())n.add(r);else n.add(i);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let i=0;for(let r=0;r1?e[0]+":"+e[1]:e[0]}var Cy=Object.defineProperty,vy=Object.defineProperties,yy=Object.getOwnPropertyDescriptors,ah=Object.getOwnPropertySymbols,Ey=Object.prototype.hasOwnProperty,xy=Object.prototype.propertyIsEnumerable,lh=(o,e,t)=>e in o?Cy(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,vs=(o,e)=>{for(var t in e||(e={}))Ey.call(e,t)&&lh(o,t,e[t]);if(ah)for(var t of ah(e))xy.call(e,t)&&lh(o,t,e[t]);return o},ch=(o,e)=>vy(o,yy(e));class dh extends me(){constructor(e){super(),this._conversionApi=vs({dispatcher:this},e),this._firedEventsMap=new WeakMap}convertChanges(e,t,n){const i=this._createConversionApi(n,e.getRefreshedItems());for(const s of e.getMarkersToRemove())this._convertMarkerRemove(s.name,s.range,i);const r=this._reduceChanges(e.getChanges());for(const s of r)s.type==="insert"?this._convertInsert(V._createFromPositionAndShift(s.position,s.length),i):s.type==="reinsert"?this._convertReinsert(V._createFromPositionAndShift(s.position,s.length),i):s.type==="remove"?this._convertRemove(s.position,s.length,s.name,i):this._convertAttribute(s.range,s.attributeKey,s.attributeOldValue,s.attributeNewValue,i);for(const s of i.mapper.flushUnboundMarkerNames()){const a=t.get(s).getRange();this._convertMarkerRemove(s,a,i),this._convertMarkerAdd(s,a,i)}for(const s of e.getMarkersToAdd())this._convertMarkerAdd(s.name,s.range,i);i.mapper.flushDeferredBindings(),i.consumable.verifyAllConsumed("insert")}convert(e,t,n,i={}){const r=this._createConversionApi(n,void 0,i);this._convertInsert(e,r);for(const[s,a]of t)this._convertMarkerAdd(s,a,r);r.consumable.verifyAllConsumed("insert")}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition())),r=this._createConversionApi(n);if(this._addConsumablesForSelection(r.consumable,e,i),this.fire("selection",{selection:e},r),e.isCollapsed){for(const s of i){const a=s.getRange();if(!Sy(e.getFirstPosition(),s,r.mapper))continue;const l={item:e,markerName:s.name,markerRange:a};r.consumable.test(e,"addMarker:"+s.name)&&this.fire(`addMarker:${s.name}`,l,r)}for(const s of e.getAttributeKeys()){const a={item:e,range:e.getFirstRange(),attributeKey:s,attributeOldValue:null,attributeNewValue:e.getAttribute(s)};r.consumable.test(e,"attribute:"+a.attributeKey)&&this.fire(`attribute:${a.attributeKey}:$text`,a,r)}}}_convertInsert(e,t,n={}){n.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,Array.from(e));for(const i of Array.from(e.getWalker({shallow:!0})).map(hh))this._testAndFire("insert",i,t)}_convertRemove(e,t,n,i){this.fire(`remove:${n}`,{position:e,length:t},i)}_convertAttribute(e,t,n,i,r){this._addConsumablesForRange(r.consumable,e,`attribute:${t}`);for(const s of e){const a={item:s.item,range:V._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${t}`,a,r)}}_convertReinsert(e,t){const n=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,n);for(const i of n.map(hh))this._testAndFire("insert",ch(vs({},i),{reconversion:!0}),t)}_convertMarkerAdd(e,t,n){if(t.root.rootName=="$graveyard")return;const i=`addMarker:${e}`;if(n.consumable.add(t,i),this.fire(i,{markerName:e,markerRange:t},n),n.consumable.consume(t,i)){this._addConsumablesForRange(n.consumable,t,i);for(const r of t.getItems()){if(!n.consumable.test(r,i))continue;const s={item:r,range:V._createOn(r),markerName:e,markerRange:t};this.fire(i,s,n)}}}_convertMarkerRemove(e,t,n){t.root.rootName!="$graveyard"&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},n)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const n of t){const i=n.item;if(e.test(i,"insert")===null){e.add(i,"insert");for(const r of i.getAttributeKeys())e.add(i,"attribute:"+r)}}return e}_addConsumablesForRange(e,t,n){for(const i of t.getItems())e.add(i,n);return e}_addConsumablesForSelection(e,t,n){e.add(t,"selection");for(const i of n)e.add(t,"addMarker:"+i.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,n){const i=function(l,c){const d=c.item.is("element")?c.item.name:"$text";return`${l}:${d}`}(e,t),r=t.item.is("$textProxy")?n.consumable._getSymbolForTextProxy(t.item):t.item,s=this._firedEventsMap.get(n),a=s.get(r);if(a){if(a.has(i))return;a.add(i)}else s.set(r,new Set([i]));this.fire(i,t,n)}_testAndFireAddAttributes(e,t){const n={item:e,range:V._createOn(e)};for(const i of n.item.getAttributeKeys())n.attributeKey=i,n.attributeOldValue=null,n.attributeNewValue=n.item.getAttribute(i),this._testAndFire(`attribute:${i}`,n,t)}_createConversionApi(e,t=new Set,n={}){const i=ch(vs({},this._conversionApi),{consumable:new _y,writer:e,options:n,convertItem:r=>this._convertInsert(V._createOn(r),i),convertChildren:r=>this._convertInsert(V._createIn(r),i,{doNotAddConsumables:!0}),convertAttributes:r=>this._testAndFireAddAttributes(r,i),canReuseView:r=>!t.has(i.mapper.toModelElement(r))});return this._firedEventsMap.set(i,new Map),i}}function Sy(o,e,t){const n=e.getRange(),i=Array.from(o.getAncestors());return i.shift(),i.reverse(),!i.some(r=>{if(n.containsItem(r))return!!t.toViewElement(r).getCustomProperty("addHighlight")})}function hh(o){return{item:o.item,range:V._createFromPositionAndShift(o.previousPosition,o.length)}}class ot extends me(qt){constructor(...e){super(),this._lastRangeBackward=!1,this._attrs=new Map,this._ranges=[],e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return this._ranges.length===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new V(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new V(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new V(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[t,n,i]=e;if(typeof n=="object"&&(i=n,n=void 0),t===null)this._setRanges([]);else if(t instanceof ot)this._setRanges(t.getRanges(),t.isBackward);else if(t&&typeof t.getRanges=="function")this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof V)this._setRanges([t],!!i&&!!i.backward);else if(t instanceof H)this._setRanges([new V(t)]);else if(t instanceof un){const r=!!i&&!!i.backward;let s;if(n=="in")s=V._createIn(t);else if(n=="on")s=V._createOn(t);else{if(n===void 0)throw new I("model-selection-setto-required-second-parameter",[this,t]);s=new V(H._createAt(t,n))}this._setRanges([s],r)}else{if(!et(t))throw new I("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,i&&!!i.backward)}}_setRanges(e,t=!1){const n=Array.from(e),i=n.some(r=>{if(!(r instanceof V))throw new I("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(s=>!s.isEqual(r))});(n.length!==this._ranges.length||i)&&(this._replaceAllRanges(n),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(this.anchor===null)throw new I("model-selection-setfocus-no-ranges",[this,e]);const n=H._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(i)=="before"?(this._pushRange(new V(n,i)),this._lastRangeBackward=!0):(this._pushRange(new V(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=mh(t.start,e);By(n,t)&&(yield n);for(const r of t.getWalker()){const s=r.item;r.type=="elementEnd"&&Dy(s,e,t)&&(yield s)}const i=mh(t.end,e);Ty(i,t)&&(yield i)}}containsEntireContent(e=this.anchor.root){const t=H._createAt(e,0),n=H._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new V(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function uh(o,e){return!e.has(o)&&(e.add(o),o.root.document.model.schema.isBlock(o)&&!!o.parent)}function Dy(o,e,t){return uh(o,e)&&ys(o,t)}function mh(o,e){const t=o.parent.root.document.model.schema,n=o.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const r=n.find(s=>!i&&(i=t.isLimit(s),!i&&uh(s,e)));return n.forEach(s=>e.add(s)),r}function ys(o,e){const t=function(n){const i=n.root.document.model.schema;let r=n.parent;for(;r;){if(i.isBlock(r))return r;r=r.parent}}(o);return t?!e.containsRange(V._createOn(t),!0):!0}function By(o,e){return!!o&&(!(!e.isCollapsed&&!o.isEmpty)||!e.start.isTouching(H._createAt(o,o.maxOffset))&&ys(o,e))}function Ty(o,e){return!!o&&(!(!e.isCollapsed&&!o.isEmpty)||!e.end.isTouching(H._createAt(o,0))&&ys(o,e))}ot.prototype.is=function(o){return o==="selection"||o==="model:selection"};class Bt extends me(V){constructor(e,t){super(e,t),Iy.call(this)}detach(){this.stopListening()}toRange(){return new V(this.start,this.end)}static fromRange(e){return new Bt(e.start,e.end)}}function Iy(){this.listenTo(this.root.document.model,"applyOperation",(o,e)=>{const t=e[0];t.isDocumentOperation&&Py.call(this,t)},{priority:"low"})}function Py(o){const e=this.getTransformedByOperation(o),t=V._createFromRanges(e),n=!t.isEqual(this),i=function(s,a){switch(a.type){case"insert":return s.containsPosition(a.position);case"move":case"remove":case"reinsert":case"merge":return s.containsPosition(a.sourcePosition)||s.start.isEqual(a.sourcePosition)||s.containsPosition(a.targetPosition);case"split":return s.containsPosition(a.splitPosition)||s.containsPosition(a.insertionPosition)}return!1}(this,o);let r=null;if(n){t.root.rootName=="$graveyard"&&(r=o.type=="remove"?o.sourcePosition:o.deletionPosition);const s=this.toRange();this.start=t.start,this.end=t.end,this.fire("change:range",s,{deletionPosition:r})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:r})}Bt.prototype.is=function(o){return o==="liveRange"||o==="model:liveRange"||o=="range"||o==="model:range"};const yi="selection:";class mt extends me(qt){constructor(e){super(),this._selection=new Ry(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return yi+e}static _isStoreAttributeKey(e){return e.startsWith(yi)}}mt.prototype.is=function(o){return o==="selection"||o=="model:selection"||o=="documentSelection"||o=="model:documentSelection"};class Ry extends ot{constructor(e){super(),this.markers=new at({idProperty:"name"}),this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&i.type!="marker"&&i.type!="rename"&&i.type!="noop"&&(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(t,n,i,r)=>{this._updateMarker(n,r)}),this.listenTo(this._document,"change",(t,n)=>{(function(i,r){const s=i.document.differ;for(const a of s.getChanges()){if(a.type!="insert")continue;const l=a.position.parent;a.length===l.maxOffset&&i.enqueueChange(r,c=>{const d=Array.from(l.getAttributeKeys()).filter(u=>u.startsWith(yi));for(const u of d)c.removeAttribute(u,l)})}})(this._model,n)})}get isCollapsed(){return this._ranges.length===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=r.deletionPosition;const s=this._ranges.indexOf(t);this._ranges.splice(s,1),t.detach()}}),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const i of this._model.markers){const r=i.name.split(":",1)[0];if(!this._observedMarkers.has(r))continue;const s=i.getRange();for(const a of this.getRanges())s.containsRange(a,!a.isCollapsed)&&e.push(i)}const n=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const r=Array.from(this.markers),s=this.markers.has(e);if(t){let a=!1;for(const l of this.getRanges())if(t.containsRange(l,!l.isCollapsed)){a=!0;break}a&&!s?(this.markers.add(e),i=!0):!a&&s&&(this.markers.remove(e),i=!0)}else s&&(this.markers.remove(e),i=!0);i&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(e){const t=Dt(this._getSurroundingAttributes()),n=Dt(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[r,s]of this._attributePriority)s=="low"&&(this._attrs.delete(r),this._attributePriority.delete(r));this._setAttributesTo(t);const i=[];for(const[r,s]of this.getAttributes())n.has(r)&&n.get(r)===s||i.push(r);for(const[r]of n)this.hasAttribute(r)||i.push(r);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";return i=="low"&&this._attributePriority.get(e)=="normal"?!1:super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return(n!="low"||this._attributePriority.get(e)!="normal")&&(this._attributePriority.set(e,n),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[n,i]of this.getAttributes())e.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of e)this._setAttribute(n,i,!1)&&t.add(n);return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())t.startsWith(yi)&&(yield[t.substr(10),e.getAttribute(t)])}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,r=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=Ei(i)),n||(n=Ei(r)),!this.isGravityOverridden&&!n){let s=i;for(;s&&!t.isInline(s)&&!n;)s=s.previousSibling,n=Ei(s)}if(!n){let s=r;for(;s&&!t.isInline(s)&&!n;)s=s.nextSibling,n=Ei(s)}n||(n=this.getStoredAttributes())}else{const i=this.getFirstRange();for(const r of i){if(r.item.is("element")&&t.isObject(r.item))break;if(r.type=="text"){n=r.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Ei(o){return o instanceof ut||o instanceof fe?o.getAttributes():null}class gh{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}const Ut=function(o){return Mr(o,5)};class Oy extends gh{elementToElement(e){return this.add(function(t){const n=kh(t.model),i=xo(t.view,"container");return n.attributes.length&&(n.children=!0),r=>{r.on(`insert:${n.name}`,function(s,a=zy){return(l,c,d)=>{if(!a(c.item,d.consumable,{preflight:!0}))return;const u=s(c.item,d,c);if(!u)return;a(c.item,d.consumable);const g=d.mapper.toViewPosition(c.range.start);d.mapper.bindElements(c.item,u),d.writer.insert(g,u),d.convertAttributes(c.item),Ch(u,c.item.getChildren(),d,{reconversion:c.reconversion})}}(i,_h(n)),{priority:t.converterPriority||"normal"}),(n.children||n.attributes.length)&&r.on("reduceChanges",Ah(n),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(t){const n=kh(t.model),i=xo(t.view,"container");return n.children=!0,r=>{if(r._conversionApi.schema.checkChild(n.name,"$text"))throw new I("conversion-element-to-structure-disallowed-text",r,{elementName:n.name});var s,a;r.on(`insert:${n.name}`,(s=i,a=_h(n),(l,c,d)=>{if(!a(c.item,d.consumable,{preflight:!0}))return;const u=new Map;d.writer._registerSlotFactory(function(b,A,E){return(P,z)=>{const j=P.createContainerElement("$slot");let Y=null;if(z==="children")Y=Array.from(b.getChildren());else{if(typeof z!="function")throw new I("conversion-slot-mode-unknown",E.dispatcher,{modeOrFilter:z});Y=Array.from(b.getChildren()).filter(ie=>z(ie))}return A.set(j,Y),j}}(c.item,u,d));const g=s(c.item,d,c);if(d.writer._clearSlotFactory(),!g)return;(function(b,A,E){const P=Array.from(A.values()).flat(),z=new Set(P);if(z.size!=P.length)throw new I("conversion-slot-filter-overlap",E.dispatcher,{element:b});if(z.size!=b.childCount)throw new I("conversion-slot-filter-incomplete",E.dispatcher,{element:b})})(c.item,u,d),a(c.item,d.consumable);const f=d.mapper.toViewPosition(c.range.start);d.mapper.bindElements(c.item,g),d.writer.insert(f,g),d.convertAttributes(c.item),function(b,A,E,P){E.mapper.on("modelToViewPosition",Y,{priority:"highest"});let z=null,j=null;for([z,j]of A)Ch(b,j,E,P),E.writer.move(E.writer.createRangeIn(z),E.writer.createPositionBefore(z)),E.writer.remove(z);function Y(ie,Ee){const he=Ee.modelPosition.nodeAfter,Mt=j.indexOf(he);Mt<0||(Ee.viewPosition=Ee.mapper.findPositionIn(z,Mt))}E.mapper.off("modelToViewPosition",Y)}(g,u,d,{reconversion:c.reconversion})}),{priority:t.converterPriority||"normal"}),r.on("reduceChanges",Ah(n),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(t){t=Ut(t);let n=t.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)t.view[s]=xo(t.view[s],"attribute");else t.view=xo(t.view,"attribute");const r=bh(t);return s=>{s.on(i,function(a){return(l,c,d)=>{if(!d.consumable.test(c.item,l.name))return;const u=a(c.attributeOldValue,d,c),g=a(c.attributeNewValue,d,c);if(!u&&!g)return;d.consumable.consume(c.item,l.name);const f=d.writer,b=f.document.selection;if(c.item instanceof ot||c.item instanceof mt)f.wrap(b.getFirstRange(),g);else{let A=d.mapper.toViewRange(c.range);c.attributeOldValue!==null&&u&&(A=f.unwrap(A,u)),c.attributeNewValue!==null&&g&&f.wrap(A,g)}}}(r),{priority:t.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Ut(t);let n=t.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)t.view[s]=wh(t.view[s]);else t.view=wh(t.view);const r=bh(t);return s=>{var a;s.on(i,(a=r,(l,c,d)=>{if(!d.consumable.test(c.item,l.name))return;const u=a(c.attributeOldValue,d,c),g=a(c.attributeNewValue,d,c);if(!u&&!g)return;d.consumable.consume(c.item,l.name);const f=d.mapper.toViewElement(c.item),b=d.writer;if(!f)throw new I("conversion-attribute-to-attribute-on-text",d.dispatcher,c);if(c.attributeOldValue!==null&&u)if(u.key=="class"){const A=Pe(u.value);for(const E of A)b.removeClass(E,f)}else if(u.key=="style"){const A=Object.keys(u.value);for(const E of A)b.removeStyle(E,f)}else b.removeAttribute(u.key,f);if(c.attributeNewValue!==null&&g)if(g.key=="class"){const A=Pe(g.value);for(const E of A)b.addClass(E,f)}else if(g.key=="style"){const A=Object.keys(g.value);for(const E of A)b.setStyle(E,g.value[E],f)}else b.setAttribute(g.key,g.value,f)}),{priority:t.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(t){const n=xo(t.view,"ui");return i=>{var r;i.on(`addMarker:${t.model}`,(r=n,(s,a,l)=>{a.isOpening=!0;const c=r(a,l);a.isOpening=!1;const d=r(a,l);if(!c||!d)return;const u=a.markerRange;if(u.isCollapsed&&!l.consumable.consume(u,s.name))return;for(const b of u)if(!l.consumable.consume(b.item,s.name))return;const g=l.mapper,f=l.writer;f.insert(g.toViewPosition(u.start),c),l.mapper.bindElementToMarker(c,a.markerName),u.isCollapsed||(f.insert(g.toViewPosition(u.end),d),l.mapper.bindElementToMarker(d,a.markerName)),s.stop()}),{priority:t.converterPriority||"normal"}),i.on(`removeMarker:${t.model}`,(s,a,l)=>{const c=l.mapper.markerNameToElements(a.markerName);if(c){for(const d of c)l.mapper.unbindElementFromMarkerName(d,a.markerName),l.writer.clear(l.writer.createRangeOn(d),d);l.writer.clearClonedElementsGroup(a.markerName),s.stop()}},{priority:t.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(t){return n=>{var i;n.on(`addMarker:${t.model}`,(i=t.view,(r,s,a)=>{if(!s.item||!(s.item instanceof ot||s.item instanceof mt||s.item.is("$textProxy")))return;const l=Es(i,s,a);if(!l||!a.consumable.consume(s.item,r.name))return;const c=a.writer,d=ph(c,l),u=c.document.selection;if(s.item instanceof ot||s.item instanceof mt)c.wrap(u.getFirstRange(),d);else{const g=a.mapper.toViewRange(s.range),f=c.wrap(g,d);for(const b of f.getItems())if(b.is("attributeElement")&&b.isSimilar(d)){a.mapper.bindElementToMarker(b,s.markerName);break}}}),{priority:t.converterPriority||"normal"}),n.on(`addMarker:${t.model}`,function(r){return(s,a,l)=>{if(!a.item||!(a.item instanceof ke))return;const c=Es(r,a,l);if(!c||!l.consumable.test(a.item,s.name))return;const d=l.mapper.toViewElement(a.item);if(d&&d.getCustomProperty("addHighlight")){l.consumable.consume(a.item,s.name);for(const u of V._createIn(a.item))l.consumable.consume(u.item,s.name);d.getCustomProperty("addHighlight")(d,c,l.writer),l.mapper.bindElementToMarker(d,a.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),n.on(`removeMarker:${t.model}`,function(r){return(s,a,l)=>{if(a.markerRange.isCollapsed)return;const c=Es(r,a,l);if(!c)return;const d=ph(l.writer,c),u=l.mapper.markerNameToElements(a.markerName);if(u){for(const g of u)l.mapper.unbindElementFromMarkerName(g,a.markerName),g.is("attributeElement")?l.writer.unwrap(l.writer.createRangeOn(g),d):g.getCustomProperty("removeHighlight")(g,c.id,l.writer);l.writer.clearClonedElementsGroup(a.markerName),s.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(t){t=Ut(t);const n=t.model;let i=t.view;return i||(i=r=>({group:n,name:r.substr(t.model.length+1)})),r=>{var s;r.on(`addMarker:${n}`,(s=i,(a,l,c)=>{const d=s(l.markerName,c);if(!d)return;const u=l.markerRange;c.consumable.consume(u,a.name)&&(fh(u,!1,c,l,d),fh(u,!0,c,l,d),a.stop())}),{priority:t.converterPriority||"normal"}),r.on(`removeMarker:${n}`,function(a){return(l,c,d)=>{const u=a(c.markerName,d);if(!u)return;const g=d.mapper.markerNameToElements(c.markerName);if(g){for(const b of g)d.mapper.unbindElementFromMarkerName(b,c.markerName),b.is("containerElement")?(f(`data-${u.group}-start-before`,b),f(`data-${u.group}-start-after`,b),f(`data-${u.group}-end-before`,b),f(`data-${u.group}-end-after`,b)):d.writer.clear(d.writer.createRangeOn(b),b);d.writer.clearClonedElementsGroup(c.markerName),l.stop()}function f(b,A){if(A.hasAttribute(b)){const E=new Set(A.getAttribute(b).split(","));E.delete(u.name),E.size==0?d.writer.removeAttribute(b,A):d.writer.setAttribute(b,Array.from(E).join(","),A)}}}}(i),{priority:t.converterPriority||"normal"})}}(e))}}function ph(o,e){const t=o.createAttributeElement("span",e.attributes);return e.classes&&t._addClass(e.classes),typeof e.priority=="number"&&(t._priority=e.priority),t._id=e.id,t}function fh(o,e,t,n,i){const r=e?o.start:o.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let l,c;e&&s||!e&&!a?(l=s,c=!0):(l=a,c=!1);const d=t.mapper.toViewElement(l);if(d)return void function(u,g,f,b,A,E){const P=`data-${E.group}-${g?"start":"end"}-${f?"before":"after"}`,z=u.hasAttribute(P)?u.getAttribute(P).split(","):[];z.unshift(E.name),b.writer.setAttribute(P,z.join(","),u),b.mapper.bindElementToMarker(u,A.markerName)}(d,e,c,t,n,i)}(function(l,c,d,u,g){const f=`${g.group}-${c?"start":"end"}`,b=g.name?{name:g.name}:null,A=d.writer.createUIElement(f,b);d.writer.insert(l,A),d.mapper.bindElementToMarker(A,u.markerName)})(t.mapper.toViewPosition(r),e,t,n,i)}function kh(o){return typeof o=="string"&&(o={name:o}),o.attributes?Array.isArray(o.attributes)||(o.attributes=[o.attributes]):o.attributes=[],o.children=!!o.children,o}function xo(o,e){return typeof o=="function"?o:(t,n)=>function(i,r,s){typeof i=="string"&&(i={name:i});let a;const l=r.writer,c=Object.assign({},i.attributes);if(s=="container")a=l.createContainerElement(i.name,c);else if(s=="attribute"){const d={priority:i.priority||dn.DEFAULT_PRIORITY};a=l.createAttributeElement(i.name,c,d)}else a=l.createUIElement(i.name,c);if(i.styles){const d=Object.keys(i.styles);for(const u of d)l.setStyle(u,i.styles[u],a)}if(i.classes){const d=i.classes;if(typeof d=="string")l.addClass(d,a);else for(const u of d)l.addClass(u,a)}return a}(o,n,e)}function bh(o){return o.model.values?(e,t,n)=>{const i=o.view[e];return i?i(e,t,n):null}:o.view}function wh(o){return typeof o=="string"?e=>({key:o,value:e}):typeof o=="object"?o.value?()=>o:e=>({key:o.key,value:e}):o}function Es(o,e,t){const n=typeof o=="function"?o(e,t):o;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function Ah(o){const e=function(t){return(n,i)=>{if(!n.is("element",t.name))return!1;if(i.type=="attribute"){if(t.attributes.includes(i.attributeKey))return!0}else if(t.children)return!0;return!1}}(o);return(t,n)=>{const i=[];n.reconvertedElements||(n.reconvertedElements=new Set);for(const r of n.changes){const s=r.type=="attribute"?r.range.start.nodeAfter:r.position.parent;if(s&&e(s,r)){if(!n.reconvertedElements.has(s)){n.reconvertedElements.add(s);const a=H._createBefore(s);let l=i.length;for(let c=i.length-1;c>=0;c--){const d=i[c],u=(d.type=="attribute"?d.range.start:d.position).compareWith(a);if(u=="before"||d.type=="remove"&&u=="same")break;l=c}i.splice(l,0,{type:"remove",name:s.name,position:a,length:1},{type:"reinsert",name:s.name,position:a,length:1})}}else i.push(r)}n.changes=i}}function _h(o){return(e,t,n={})=>{const i=["insert"];for(const r of o.attributes)e.hasAttribute(r)&&i.push(`attribute:${r}`);return!!i.every(r=>t.test(e,r))&&(n.preflight||i.forEach(r=>t.consume(e,r)),!0)}}function Ch(o,e,t,n){for(const i of e)Ny(o.root,i,t,n)||t.convertItem(i)}function Ny(o,e,t,n){const{writer:i,mapper:r}=t;if(!n.reconversion)return!1;const s=r.toViewElement(e);return!(!s||s.root==o)&&!!t.canReuseView(s)&&(i.move(i.createRangeOn(s),r.toViewPosition(H._createBefore(e))),!0)}function zy(o,e,{preflight:t}={}){return t?e.test(o,"insert"):e.consume(o,"insert")}function vh(o){const{schema:e,document:t}=o.model;for(const n of t.getRootNames()){const i=t.getRoot(n);if(i.isEmpty&&!e.checkChild(i,"$text")&&e.checkChild(i,"paragraph"))return o.insertElement("paragraph",i),!0}return!1}function yh(o,e,t){const n=t.createContext(o);return!!t.checkChild(n,"paragraph")&&!!t.checkChild(n.push("paragraph"),e)}function Eh(o,e){const t=e.createElement("paragraph");return e.insert(t,o),e.createPositionAt(t,0)}var My=Object.defineProperty,Fy=Object.defineProperties,Vy=Object.getOwnPropertyDescriptors,xh=Object.getOwnPropertySymbols,Ly=Object.prototype.hasOwnProperty,jy=Object.prototype.propertyIsEnumerable,Sh=(o,e,t)=>e in o?My(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class $y extends gh{elementToElement(e){return this.add(Dh(e))}elementToAttribute(e){return this.add(function(t){t=Ut(t),Bh(t);const n=Th(t,!1),i=xs(t.view),r=i?`element:${i}`:"element";return s=>{s.on(r,n,{priority:t.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Ut(t);let n=null;(typeof t.view=="string"||t.view.key)&&(n=function(r){typeof r.view=="string"&&(r.view={key:r.view});const s=r.view.key;let a;return s=="class"||s=="style"?a={[s=="class"?"classes":"styles"]:r.view.value}:a={attributes:{[s]:r.view.value===void 0?/[\s\S]*/:r.view.value}},r.view.name&&(a.name=r.view.name),r.view=a,s}(t)),Bh(t,n);const i=Th(t,!0);return r=>{r.on("element",i,{priority:t.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(t){const n=function(s){return(a,l)=>{const c=typeof s=="string"?s:s(a,l);return l.writer.createElement("$marker",{"data-name":c})}}(t.model);return Dh((i=((s,a)=>{for(var l in a||(a={}))Ly.call(a,l)&&Sh(s,l,a[l]);if(xh)for(var l of xh(a))jy.call(a,l)&&Sh(s,l,a[l]);return s})({},t),r={model:n},Fy(i,Vy(r))));var i,r}(e))}dataToMarker(e){return this.add(function(t){t=Ut(t),t.model||(t.model=s=>s?t.view+":"+s:t.view);const n={view:t.view,model:t.model},i=Ss(Ih(n,"start")),r=Ss(Ih(n,"end"));return s=>{s.on(`element:${t.view}-start`,i,{priority:t.converterPriority||"normal"}),s.on(`element:${t.view}-end`,r,{priority:t.converterPriority||"normal"});const a=te.get("low"),l=te.get("highest"),c=te.get(t.converterPriority)/l;s.on("element",function(d){return(u,g,f)=>{const b=`data-${d.view}`;function A(E,P){for(const z of P){const j=d.model(z,f),Y=f.writer.createElement("$marker",{"data-name":j});f.writer.insert(Y,E),g.modelCursor.isEqual(E)?g.modelCursor=g.modelCursor.getShiftedBy(1):g.modelCursor=g.modelCursor._getTransformedByInsertion(E,1),g.modelRange=g.modelRange._getTransformedByInsertion(E,1)[0]}}(f.consumable.test(g.viewItem,{attributes:b+"-end-after"})||f.consumable.test(g.viewItem,{attributes:b+"-start-after"})||f.consumable.test(g.viewItem,{attributes:b+"-end-before"})||f.consumable.test(g.viewItem,{attributes:b+"-start-before"}))&&(g.modelRange||Object.assign(g,f.convertChildren(g.viewItem,g.modelCursor)),f.consumable.consume(g.viewItem,{attributes:b+"-end-after"})&&A(g.modelRange.end,g.viewItem.getAttribute(b+"-end-after").split(",")),f.consumable.consume(g.viewItem,{attributes:b+"-start-after"})&&A(g.modelRange.end,g.viewItem.getAttribute(b+"-start-after").split(",")),f.consumable.consume(g.viewItem,{attributes:b+"-end-before"})&&A(g.modelRange.start,g.viewItem.getAttribute(b+"-end-before").split(",")),f.consumable.consume(g.viewItem,{attributes:b+"-start-before"})&&A(g.modelRange.start,g.viewItem.getAttribute(b+"-start-before").split(",")))}}(n),{priority:a+c})}}(e))}}function Dh(o){const e=Ss(o=Ut(o)),t=xs(o.view),n=t?`element:${t}`:"element";return i=>{i.on(n,e,{priority:o.converterPriority||"normal"})}}function xs(o){return typeof o=="string"?o:typeof o=="object"&&typeof o.name=="string"?o.name:null}function Ss(o){const e=new Mn(o.view);return(t,n,i)=>{const r=e.match(n.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!i.consumable.test(n.viewItem,s))return;const a=function(l,c,d){return l instanceof Function?l(c,d):d.writer.createElement(l)}(o.model,n.viewItem,i);a&&i.safeInsert(a,n.modelCursor)&&(i.consumable.consume(n.viewItem,s),i.convertChildren(n.viewItem,a),i.updateConversionResult(a,n))}}function Bh(o,e=null){const t=e===null||(r=>r.getAttribute(e)),n=typeof o.model!="object"?o.model:o.model.key,i=typeof o.model!="object"||o.model.value===void 0?t:o.model.value;o.model={key:n,value:i}}function Th(o,e){const t=new Mn(o.view);return(n,i,r)=>{if(!i.modelRange&&e)return;const s=t.match(i.viewItem);if(!s||(function(d,u){const g=typeof d=="function"?d(u):d;return typeof g=="object"&&!xs(g)?!1:!g.classes&&!g.attributes&&!g.styles}(o.view,i.viewItem)?s.match.name=!0:delete s.match.name,!r.consumable.test(i.viewItem,s.match)))return;const a=o.model.key,l=typeof o.model.value=="function"?o.model.value(i.viewItem,r):o.model.value;if(l===null)return;i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor)),function(d,u,g,f){let b=!1;for(const A of Array.from(d.getItems({shallow:g})))f.schema.checkAttribute(A,u.key)&&(b=!0,A.hasAttribute(u.key)||f.writer.setAttribute(u.key,u.value,A));return b}(i.modelRange,{key:a,value:l},e,r)&&(r.consumable.test(i.viewItem,{name:!0})&&(s.match.name=!0),r.consumable.consume(i.viewItem,s.match))}}function Ih(o,e){return{view:`${o.view}-${e}`,model:(t,n)=>{const i=t.getAttribute("name"),r=o.model(i,n);return n.writer.createElement("$marker",{"data-name":r})}}}function Hy(o){o.document.registerPostFixer(e=>function(t,n){const i=n.document.selection,r=n.schema,s=[];let a=!1;for(const l of i.getRanges()){const c=Ph(l,r);c&&!c.isEqual(l)?(s.push(c),a=!0):s.push(l)}return a&&t.setSelection(function(l){const c=[...l],d=new Set;let u=1;for(;u!d.has(f))}(s),{backward:i.isBackward}),!1}(e,o))}function Ph(o,e){return o.isCollapsed?function(t,n){const i=t.start,r=n.getNearestSelectionRange(i);if(!r){const a=i.getAncestors().reverse().find(l=>n.isObject(l));return a?V._createOn(a):null}if(!r.isCollapsed)return r;const s=r.start;return i.isEqual(s)?null:new V(s)}(o,e):function(t,n){const{start:i,end:r}=t,s=n.checkChild(i,"$text"),a=n.checkChild(r,"$text"),l=n.getLimitElement(i),c=n.getLimitElement(r);if(l===c){if(s&&a)return null;if(function(g,f,b){const A=g.nodeAfter&&!b.isLimit(g.nodeAfter)||b.checkChild(g,"$text"),E=f.nodeBefore&&!b.isLimit(f.nodeBefore)||b.checkChild(f,"$text");return A||E}(i,r,n)){const g=i.nodeAfter&&n.isSelectable(i.nodeAfter)?null:n.getNearestSelectionRange(i,"forward"),f=r.nodeBefore&&n.isSelectable(r.nodeBefore)?null:n.getNearestSelectionRange(r,"backward"),b=g?g.start:i,A=f?f.end:r;return new V(b,A)}}const d=l&&!l.is("rootElement"),u=c&&!c.is("rootElement");if(d||u){const g=i.nodeAfter&&r.nodeBefore&&i.nodeAfter.parent===r.nodeBefore.parent,f=d&&(!g||!Oh(i.nodeAfter,n)),b=u&&(!g||!Oh(r.nodeBefore,n));let A=i,E=r;return f&&(A=H._createBefore(Rh(l,n))),b&&(E=H._createAfter(Rh(c,n))),new V(A,E)}return null}(o,e)}function Rh(o,e){let t=o,n=t;for(;e.isLimit(n)&&n.parent;)t=n,n=n.parent;return t}function Oh(o,e){return o&&e.isSelectable(o)}class qy extends ge(){constructor(e,t){super(),this.model=e,this.view=new Ay(t),this.mapper=new sh,this.downcastDispatcher=new dh({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,r=this.model.markers;var s,a,l;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(c=>{this.downcastDispatcher.convertChanges(n.differ,r,c),this.downcastDispatcher.convertSelection(i,r,c)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(c,d){return(u,g)=>{const f=g.newSelection,b=[];for(const E of f.getRanges())b.push(d.toModelRange(E));const A=c.createSelection(b,{backward:f.isBackward});A.isEqual(c.document.selection)||c.change(E=>{E.setSelection(A)})}}(this.model,this.mapper)),this.listenTo(this.view.document,"beforeinput",(s=this.mapper,a=this.model.schema,l=this.view,(c,d)=>{if(!l.document.isComposing||k.isAndroid)for(let u=0;u{if(!u.consumable.consume(d.item,c.name))return;const g=u.writer,f=u.mapper.toViewPosition(d.range.start),b=g.createText(d.item.data);g.insert(f,b)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(c,d,u)=>{u.convertAttributes(d.item),d.reconversion||!d.item.is("element")||d.item.isEmpty||u.convertChildren(d.item)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(c,d,u)=>{const g=u.mapper.toViewPosition(d.position),f=d.position.getShiftedBy(d.length),b=u.mapper.toViewPosition(f,{isPhantom:!0}),A=u.writer.createRange(g,b),E=u.writer.remove(A.getTrimmed());for(const P of u.writer.createRangeIn(E).getItems())u.mapper.unbindViewElement(P,{defer:!0})},{priority:"low"}),this.downcastDispatcher.on("selection",(c,d,u)=>{const g=u.writer,f=g.document.selection;for(const b of f.getRanges())b.isCollapsed&&b.end.parent.isAttached()&&u.writer.mergeAttributes(b.start);g.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(c,d,u)=>{const g=d.selection;if(g.isCollapsed||!u.consumable.consume(g,"selection"))return;const f=[];for(const b of g.getRanges())f.push(u.mapper.toViewRange(b));u.writer.setSelection(f,{backward:g.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(c,d,u)=>{const g=d.selection;if(!g.isCollapsed||!u.consumable.consume(g,"selection"))return;const f=u.writer,b=g.getFirstPosition(),A=u.mapper.toViewPosition(b),E=f.breakAttributes(A);f.setSelection(E)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(c=>{if(c.rootName=="$graveyard")return null;const d=new xd(this.view.document,c.name);return d.rootName=c.rootName,this.mapper.bindElements(c,d),d})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t=typeof e=="string"?e:e.name,n=this.model.markers.get(t);if(!n)throw new I("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change(()=>{this.model.markers._refresh(n)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}}class So{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new Uy(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return n===void 0?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);n!==void 0&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const s of n)s!="style"&&s!="class"&&t.attributes.push(s);const i=e.getClassNames();for(const s of i)t.classes.push(s);const r=e.getStyleNames();for(const s of r)t.styles.push(s);return t}static createFrom(e,t){if(t||(t=new So),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,So.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=So.createFrom(n,t);return t}}const xi=["attributes","classes","styles"];class Uy{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t of xi)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t of xi)if(t in e){const n=this._test(t,e[t]);if(n!==!0)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t of xi)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t of xi)t in e&&this._revert(t,e[t])}_add(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n){if(e==="attributes"&&(r==="class"||r==="style"))throw new I("viewconsumable-invalid-attribute",this);if(i.set(r,!0),e==="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!0)}}_test(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){const s=i.get(r);if(s===void 0)return null;if(!s)return!1}else{const s=r=="class"?"classes":"styles",a=this._test(s,[...this._consumables[s].keys()]);if(a!==!0)return a}return!0}_consume(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){if(i.set(r,!1),e=="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!1)}else{const s=r=="class"?"classes":"styles";this._consume(s,[...this._consumables[s].keys()])}}_revert(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style")i.get(r)===!1&&i.set(r,!0);else{const s=r=="class"?"classes":"styles";this._revert(s,[...this._consumables[s].keys()])}}}class Wy extends ge(){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new gn(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new gn(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new I("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new I("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t=typeof e=="string"?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof H){const n=e.nodeBefore,i=e.nodeAfter;if(!(n instanceof ke))throw new I("schema-check-merge-no-element-before",this);if(!(i instanceof ke))throw new I("schema-check-merge-no-element-after",this);return this.checkMerge(n,i)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const r=e(n,i);typeof r=="boolean"&&(t.stop(),t.return=r)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const r=e(n,i);typeof r=="boolean"&&(t.stop(),t.return=r)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(e instanceof H?t=e.parent:t=(e instanceof V?[e]:Array.from(e.getRanges())).reduce((n,i)=>{const r=i.getCommonAncestor();return n?n.getCommonAncestor(r,{includeSelf:!0}):r},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new fe("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const i of n)for(const r of i)if(this.checkAttribute(r.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(n){for(const i of n)yield*i.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new V(e);let n,i;const r=e.getAncestors().reverse().find(s=>this.isLimit(s))||e.root;t!="both"&&t!="backward"||(n=new vt({boundaries:V._createIn(r),startPosition:e,direction:"backward"})),t!="both"&&t!="forward"||(i=new vt({boundaries:V._createIn(r),startPosition:e}));for(const s of function*(a,l){let c=!1;for(;!c;){if(c=!0,a){const d=a.next();d.done||(c=!1,yield{walker:a,value:d.value})}if(l){const d=l.next();d.done||(c=!1,yield{walker:l,value:d.value})}}}(n,i)){const a=s.walker==n?"elementEnd":"elementStart",l=s.value;if(l.type==a&&this.isObject(l.item))return V._createOn(l.item);if(this.checkChild(l.nextPosition,"$text"))return new V(l.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}setAllowedAttributes(e,t,n){const i=n.model;for(const[r,s]of Object.entries(t))i.schema.checkAttribute(e,r)&&n.setAttribute(r,s,e)}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))Nh(this,n,t);else{const i=V._createIn(n).getPositions();for(const r of i)Nh(this,r.nodeBefore||r.parent,t)}}getAttributesWithProperty(e,t,n){const i={};for(const[r,s]of e.getAttributes()){const a=this.getAttributeProperties(r);a[t]!==void 0&&(n!==void 0&&n!==a[t]||(i[r]=s))}return i}createContext(e){return new gn(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=Ky(t[i],i);for(const i of n)Gy(e,i);for(const i of n)Zy(e,i);for(const i of n)Jy(e,i);for(const i of n)Yy(e,i),Qy(e,i);for(const i of n)Xy(e,i),e1(e,i),t1(e,i);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(n==0)return!0;{const r=this.getDefinition(i);return this._checkContextMatch(r,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const r of e.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(V._createIn(r),t)),this.checkAttribute(r,t)||(n.isEqual(i)||(yield new V(n,i)),n=H._createAfter(r)),i=H._createAfter(r);n.isEqual(i)||(yield new V(n,i))}}class gn{constructor(e){if(e instanceof gn)return e;let t;t=typeof e=="string"?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(o1)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new gn([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function Ky(o,e){const t={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,i){for(const r of n){const s=Object.keys(r).filter(a=>a.startsWith("is"));for(const a of s)i[a]=!!r[a]}}(o,t),pn(o,t,"allowIn"),pn(o,t,"allowContentOf"),pn(o,t,"allowWhere"),pn(o,t,"allowAttributes"),pn(o,t,"allowAttributesOf"),pn(o,t,"allowChildren"),pn(o,t,"inheritTypesFrom"),function(n,i){for(const r of n){const s=r.inheritAllFrom;s&&(i.allowContentOf.push(s),i.allowWhere.push(s),i.allowAttributesOf.push(s),i.inheritTypesFrom.push(s))}}(o,t),t}function Gy(o,e){const t=o[e];for(const n of t.allowChildren){const i=o[n];i&&i.allowIn.push(e)}t.allowChildren.length=0}function Zy(o,e){for(const t of o[e].allowContentOf)o[t]&&n1(o,t).forEach(n=>{n.allowIn.push(e)});delete o[e].allowContentOf}function Jy(o,e){for(const t of o[e].allowWhere){const n=o[t];if(n){const i=n.allowIn;o[e].allowIn.push(...i)}}delete o[e].allowWhere}function Yy(o,e){for(const t of o[e].allowAttributesOf){const n=o[t];if(n){const i=n.allowAttributes;o[e].allowAttributes.push(...i)}}delete o[e].allowAttributesOf}function Qy(o,e){const t=o[e];for(const n of t.inheritTypesFrom){const i=o[n];if(i){const r=Object.keys(i).filter(s=>s.startsWith("is"));for(const s of r)s in t||(t[s]=i[s])}}delete t.inheritTypesFrom}function Xy(o,e){const t=o[e],n=t.allowIn.filter(i=>o[i]);t.allowIn=Array.from(new Set(n))}function e1(o,e){const t=o[e];for(const n of t.allowIn)o[n].allowChildren.push(e)}function t1(o,e){const t=o[e];t.allowAttributes=Array.from(new Set(t.allowAttributes))}function pn(o,e,t){for(const n of o){const i=n[t];typeof i=="string"?e[t].push(i):Array.isArray(i)&&e[t].push(...i)}}function n1(o,e){const t=o[e];return(n=o,Object.keys(n).map(i=>n[i])).filter(i=>i.allowIn.includes(t.name));var n}function o1(o){return typeof o=="string"||o.is("documentFragment")?{name:typeof o=="string"?o:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:o.is("element")?o.name:"$text",*getAttributeKeys(){yield*o.getAttributeKeys()},getAttribute:e=>o.getAttribute(e)}}function Nh(o,e,t){for(const n of e.getAttributeKeys())o.checkAttribute(e,n)||t.removeAttribute(n,e)}var i1=Object.defineProperty,r1=Object.defineProperties,s1=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,a1=Object.prototype.hasOwnProperty,l1=Object.prototype.propertyIsEnumerable,Mh=(o,e,t)=>e in o?i1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class c1 extends me(){constructor(e){var t;super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi=(t=((n,i)=>{for(var r in i||(i={}))a1.call(i,r)&&Mh(n,r,i[r]);if(zh)for(var r of zh(i))l1.call(i,r)&&Mh(n,r,i[r]);return n})({},e),r1(t,s1({consumable:null,writer:null,store:null,convertItem:(n,i)=>this._convertItem(n,i),convertChildren:(n,i)=>this._convertChildren(n,i),safeInsert:(n,i)=>this._safeInsert(n,i),updateConversionResult:(n,i)=>this._updateConversionResult(n,i),splitToAllowedParent:(n,i)=>this._splitToAllowedParent(n,i),getSplitParts:n=>this._getSplitParts(n),keepEmptyElement:n=>this._keepEmptyElement(n)})))}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(s,a){let l;for(const c of new gn(s)){const d={};for(const g of c.getAttributeKeys())d[g]=c.getAttribute(g);const u=a.createElement(c.name,d);l&&a.insert(u,l),l=H._createAt(u,0)}return l}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=So.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),r=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const s of Array.from(this._modelCursor.parent.getChildren()))t.append(s,r);r.markers=function(s,a){const l=new Set,c=new Map,d=V._createIn(s).getItems();for(const u of d)u.is("element","$marker")&&l.add(u);for(const u of l){const g=u.getAttribute("data-name"),f=a.createPositionBefore(u);c.has(g)?c.get(g).end=f.clone():c.set(g,new V(f.clone())),a.remove(u)}return c}(r,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(e,t){const n={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof V))throw new I("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:H._createAt(t,0);const i=new V(n);for(const r of Array.from(e.getChildren())){const s=this._convertItem(r,n);s.modelRange instanceof V&&(i.end=s.modelRange.end,n=s.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const r=this._cursorParents.get(e);t.modelCursor=r?i.createPositionAt(r,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let r=n.findAllowedParent(t,e);if(r){if(r===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return yh(t,e,n)?{position:Eh(t,i)}:null;const s=this.conversionApi.writer.split(t,r),a=[];for(const c of s.range.getWalker())if(c.type=="elementEnd")a.push(c.item);else{const d=a.pop(),u=c.item;this._registerSplitPair(d,u)}const l=s.range.end.parent;return this._cursorParents.set(e,l),{position:s.position,cursorParent:l}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}class d1{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class h1{constructor(e){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new $d(e,{renderingMode:"data"}),this.htmlWriter=new d1}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){e.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),i=t.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class u1 extends me(){constructor(e,t){super(),this.model=e,this.mapper=new sh,this.downcastDispatcher=new dh({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewPosition(i.range.start),l=s.createText(i.item.data);s.insert(a,l)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(n,i,r)=>{r.convertAttributes(i.item),i.reconversion||!i.item.is("element")||i.item.isEmpty||r.convertChildren(i.item)},{priority:"lowest"}),this.upcastDispatcher=new c1({schema:e.schema}),this.viewDocument=new Dd(t),this.stylesProcessor=t,this.htmlProcessor=new h1(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Bd(this.viewDocument),this.upcastDispatcher.on("text",(n,i,{schema:r,consumable:s,writer:a})=>{let l=i.modelCursor;if(!s.test(i.viewItem))return;if(!r.checkChild(l,"$text")){if(!yh(l,"$text",r)||i.viewItem.data.trim().length==0)return;const d=l.nodeBefore;l=Eh(l,a),d&&d.is("element","$marker")&&(a.move(a.createRangeOn(d),l),l=a.createPositionAfter(d))}s.consume(i.viewItem);const c=a.createText(i.viewItem.data);a.insert(c,l),i.modelRange=a.createRange(l,l.getShiftedBy(c.offsetSize)),i.modelCursor=i.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),ge().prototype.decorate.call(this,"init"),ge().prototype.decorate.call(this,"set"),ge().prototype.decorate.call(this,"get"),ge().prototype.decorate.call(this,"toView"),ge().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},vh)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new I("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return i.isAttached()||Q("datacontroller-get-detached-root",this),n!=="empty"||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const r=V._createIn(e),s=new hn(n);this.mapper.bindElements(e,s);const a=e.is("documentFragment")?e.markers:function(l){const c=[],d=l.root.document;if(!d)return new Map;const u=V._createIn(l);for(const g of d.model.markers){const f=g.getRange(),b=f.isCollapsed,A=f.start.isEqual(u.start)||f.end.isEqual(u.end);if(b&&A)c.push([g.name,f]);else{const E=u.getIntersection(f);E&&c.push([g.name,E])}}return c.sort(([g,f],[b,A])=>{if(f.end.compareWith(A.start)!=="after")return 1;if(f.start.compareWith(A.end)!=="before")return-1;switch(f.start.compareWith(A.start)){case"before":return 1;case"after":return-1;default:switch(f.end.compareWith(A.end)){case"before":return 1;case"after":return-1;default:return b.localeCompare(g)}}}),new Map(c)}(e);return this.downcastDispatcher.convert(r,a,i,t),s}init(e){if(this.model.document.version)throw new I("datacontroller-init-document-not-empty",this);let t={};if(typeof e=="string"?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new I("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},n=>{for(const i of Object.keys(t)){const r=this.model.document.getRoot(i);n.insert(this.parse(t[i],r),r,0)}}),Promise.resolve()}set(e,t={}){let n={};if(typeof e=="string"?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new I("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},i=>{i.setSelection(null),i.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const r of Object.keys(n)){const s=this.model.document.getRoot(r);i.remove(i.createRangeIn(s)),i.insert(this.parse(n[r],s),s,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRoot(t))return!1;return!0}}class m1{constructor(e,t){this._helpers=new Map,this._downcast=Pe(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Pe(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new I("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new I("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of Ds(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of Ds(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of Ds(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new I("conversion-group-exists",this);const i=n?new Oy(t):new $y(t);this._helpers.set(e,i)}}function*Ds(o){if(o.model.values)for(const e of o.model.values){const t={key:o.model.key,value:e},n=o.view[e],i=o.upcastAlso?o.upcastAlso[e]:void 0;yield*Fh(t,n,i)}else yield*Fh(o.model,o.view,o.upcastAlso)}function*Fh(o,e,t){if(yield{model:o,view:e},t)for(const n of Pe(t))yield{model:o,view:n}}class it{constructor(e){this.baseVersion=e,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function Bs(o,e){const t=Lh(e),n=t.reduce((s,a)=>s+a.offsetSize,0),i=o.parent;To(o);const r=o.index;return i._insertChild(r,t),Bo(i,r+t.length),Bo(i,r),new V(o,o.getShiftedBy(n))}function Vh(o){if(!o.isFlat)throw new I("operation-utils-remove-range-not-flat",this);const e=o.start.parent;To(o.start),To(o.end);const t=e._removeChildren(o.start.index,o.end.index-o.start.index);return Bo(e,o.start.index),t}function Do(o,e){if(!o.isFlat)throw new I("operation-utils-move-range-not-flat",this);const t=Vh(o);return Bs(e=e._getTransformedByDeletion(o.start,o.end.offset-o.start.offset),t)}function Lh(o){const e=[];(function t(n){if(typeof n=="string")e.push(new fe(n));else if(n instanceof ut)e.push(new fe(n.data,n.getAttributes()));else if(n instanceof un)e.push(n);else if(et(n))for(const i of n)t(i)})(o);for(let t=1;te.maxOffset)throw new I("move-operation-nodes-do-not-exist",this);if(e===t&&n=n&&this.targetPosition.path[r]n._clone(!0))),t=new $e(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new H(e,[0]);return new ce(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsett._clone(!0))),Bs(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const r of e.nodes)r.name?n.push(ke.fromJSON(r)):n.push(fe.fromJSON(r));const i=new $e(H.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class be extends it{constructor(e,t,n,i,r){super(r),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new H(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new V(this.splitPosition,e)}get affectedSelectable(){const e=[V._createFromPositionAndShift(this.splitPosition,0),V._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(V._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new be(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new H(e,[0]);return new Re(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset{if(o.key===e.key&&o.range.start.hasSameParentAs(e.range.start)){const n=o.range.getDifference(e.range).map(r=>new Me(r,o.key,o.oldValue,o.newValue,0)),i=o.range.getIntersection(e.range);return i&&t.aIsStrong&&n.push(new Me(i,e.key,e.newValue,o.newValue,0)),n.length==0?[new je(0)]:n}return[o]}),ae(Me,$e,(o,e)=>{if(o.range.start.hasSameParentAs(e.position)&&o.range.containsPosition(e.position)){const t=o.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(n=>new Me(n,o.key,o.oldValue,o.newValue,o.baseVersion));if(e.shouldReceiveAttributes){const n=qh(e,o.key,o.oldValue);n&&t.unshift(n)}return t}return o.range=o.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[o]}),ae(Me,Re,(o,e)=>{const t=[];o.range.start.hasSameParentAs(e.deletionPosition)&&(o.range.containsPosition(e.deletionPosition)||o.range.start.isEqual(e.deletionPosition))&&t.push(V._createFromPositionAndShift(e.graveyardPosition,1));const n=o.range._getTransformedByMergeOperation(e);return n.isCollapsed||t.push(n),t.map(i=>new Me(i,o.key,o.oldValue,o.newValue,o.baseVersion))}),ae(Me,ce,(o,e)=>function(n,i){const r=V._createFromPositionAndShift(i.sourcePosition,i.howMany);let s=null,a=[];r.containsRange(n,!0)?s=n:n.start.hasSameParentAs(r.start)?(a=n.getDifference(r),s=n.getIntersection(r)):a=[n];const l=[];for(let c of a){c=c._getTransformedByDeletion(i.sourcePosition,i.howMany);const d=i.getMovedRangeStart(),u=c.start.hasSameParentAs(d),g=c._getTransformedByInsertion(d,i.howMany,u);l.push(...g)}return s&&l.push(s._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany,!1)[0]),l}(o.range,e).map(n=>new Me(n,o.key,o.oldValue,o.newValue,o.baseVersion))),ae(Me,be,(o,e)=>{if(o.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||o.range.end.offset++,[o];if(o.range.start.hasSameParentAs(e.splitPosition)&&o.range.containsPosition(e.splitPosition)){const t=o.clone();return t.range=new V(e.moveTargetPosition.clone(),o.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),o.range.end=e.splitPosition.clone(),o.range.end.stickiness="toPrevious",[o,t]}return o.range=o.range._getTransformedBySplitOperation(e),[o]}),ae($e,Me,(o,e)=>{const t=[o];if(o.shouldReceiveAttributes&&o.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(o.position)){const n=qh(o,e.key,e.newValue);n&&t.push(n)}return t}),ae($e,$e,(o,e,t)=>(o.position.isEqual(e.position)&&t.aIsStrong||(o.position=o.position._getTransformedByInsertOperation(e)),[o])),ae($e,ce,(o,e)=>(o.position=o.position._getTransformedByMoveOperation(e),[o])),ae($e,be,(o,e)=>(o.position=o.position._getTransformedBySplitOperation(e),[o])),ae($e,Re,(o,e)=>(o.position=o.position._getTransformedByMergeOperation(e),[o])),ae(Ze,$e,(o,e)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByInsertOperation(e)[0]),o.newRange&&(o.newRange=o.newRange._getTransformedByInsertOperation(e)[0]),[o])),ae(Ze,Ze,(o,e,t)=>{if(o.name==e.name){if(!t.aIsStrong)return[new je(0)];o.oldRange=e.newRange?e.newRange.clone():null}return[o]}),ae(Ze,Re,(o,e)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByMergeOperation(e)),o.newRange&&(o.newRange=o.newRange._getTransformedByMergeOperation(e)),[o])),ae(Ze,ce,(o,e,t)=>{if(o.oldRange&&(o.oldRange=V._createFromRanges(o.oldRange._getTransformedByMoveOperation(e))),o.newRange){if(t.abRelation){const n=V._createFromRanges(o.newRange._getTransformedByMoveOperation(e));if(t.abRelation.side=="left"&&e.targetPosition.isEqual(o.newRange.start))return o.newRange.end=n.end,o.newRange.start.path=t.abRelation.path,[o];if(t.abRelation.side=="right"&&e.targetPosition.isEqual(o.newRange.end))return o.newRange.start=n.start,o.newRange.end.path=t.abRelation.path,[o]}o.newRange=V._createFromRanges(o.newRange._getTransformedByMoveOperation(e))}return[o]}),ae(Ze,be,(o,e,t)=>{if(o.oldRange&&(o.oldRange=o.oldRange._getTransformedBySplitOperation(e)),o.newRange){if(t.abRelation){const n=o.newRange._getTransformedBySplitOperation(e);return o.newRange.start.isEqual(e.splitPosition)&&t.abRelation.wasStartBeforeMergedElement?o.newRange.start=H._createAt(e.insertionPosition):o.newRange.start.isEqual(e.splitPosition)&&!t.abRelation.wasInLeftElement&&(o.newRange.start=H._createAt(e.moveTargetPosition)),o.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasInRightElement?o.newRange.end=H._createAt(e.moveTargetPosition):o.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasEndBeforeMergedElement?o.newRange.end=H._createAt(e.insertionPosition):o.newRange.end=n.end,[o]}o.newRange=o.newRange._getTransformedBySplitOperation(e)}return[o]}),ae(Re,$e,(o,e)=>(o.sourcePosition.hasSameParentAs(e.position)&&(o.howMany+=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByInsertOperation(e),o.targetPosition=o.targetPosition._getTransformedByInsertOperation(e),[o])),ae(Re,Re,(o,e,t)=>{if(o.sourcePosition.isEqual(e.sourcePosition)&&o.targetPosition.isEqual(e.targetPosition)){if(t.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),o.sourcePosition=new H(e.graveyardPosition.root,n),o.howMany=0,[o]}return[new je(0)]}if(o.sourcePosition.isEqual(e.sourcePosition)&&!o.targetPosition.isEqual(e.targetPosition)&&!t.bWasUndone&&t.abRelation!="splitAtSource"){const n=o.targetPosition.root.rootName=="$graveyard",i=e.targetPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const r=e.targetPosition._getTransformedByMergeOperation(e),s=o.targetPosition._getTransformedByMergeOperation(e);return[new ce(r,o.howMany,s,0)]}return[new je(0)]}return o.sourcePosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMergeOperation(e),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),o.graveyardPosition.isEqual(e.graveyardPosition)&&t.aIsStrong||(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(e)),[o]}),ae(Re,ce,(o,e,t)=>{const n=V._createFromPositionAndShift(e.sourcePosition,e.howMany);return e.type=="remove"&&!t.bWasUndone&&!t.forceWeakRemove&&o.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(o.sourcePosition)?[new je(0)]:(o.sourcePosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.sourcePosition.hasSameParentAs(e.sourcePosition)&&(o.howMany-=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMoveOperation(e),o.targetPosition=o.targetPosition._getTransformedByMoveOperation(e),o.graveyardPosition.isEqual(e.targetPosition)||(o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(e)),[o])}),ae(Re,be,(o,e,t)=>{if(e.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),o.deletionPosition.isEqual(e.graveyardPosition)&&(o.howMany=e.howMany)),o.targetPosition.isEqual(e.splitPosition)){const n=e.howMany!=0,i=e.graveyardPosition&&o.deletionPosition.isEqual(e.graveyardPosition);if(n||i||t.abRelation=="mergeTargetNotMoved")return o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(e),[o]}if(o.sourcePosition.isEqual(e.splitPosition)){if(t.abRelation=="mergeSourceNotMoved")return o.howMany=0,o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o];if(t.abRelation=="mergeSameElement"||o.sourcePosition.offset>0)return o.sourcePosition=e.moveTargetPosition.clone(),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o]}return o.sourcePosition.hasSameParentAs(e.splitPosition)&&(o.howMany=e.splitPosition.offset),o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(e),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o]}),ae(ce,$e,(o,e)=>{const t=V._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByInsertOperation(e,!1)[0];return o.sourcePosition=t.start,o.howMany=t.end.offset-t.start.offset,o.targetPosition.isEqual(e.position)||(o.targetPosition=o.targetPosition._getTransformedByInsertOperation(e)),[o]}),ae(ce,ce,(o,e,t)=>{const n=V._createFromPositionAndShift(o.sourcePosition,o.howMany),i=V._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=t.aIsStrong,a=!t.aIsStrong;if(t.abRelation=="insertBefore"||t.baRelation=="insertAfter"?a=!0:t.abRelation!="insertAfter"&&t.baRelation!="insertBefore"||(a=!1),r=o.targetPosition.isEqual(e.targetPosition)&&a?o.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):o.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Uh(o,e)&&Uh(e,o))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(i,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),jn([n],r);if(i.containsPosition(o.targetPosition)&&i.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),jn([n],r);const l=Ue(o.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(l=="prefix"||l=="extension")return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),jn([n],r);o.type!="remove"||e.type=="remove"||t.aWasUndone||t.forceWeakRemove?o.type=="remove"||e.type!="remove"||t.bWasUndone||t.forceWeakRemove||(s=!1):s=!0;const c=[],d=n.getDifference(i);for(const g of d){g.start=g.start._getTransformedByDeletion(e.sourcePosition,e.howMany),g.end=g.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const f=Ue(g.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same",b=g._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,f);c.push(...b)}const u=n.getIntersection(i);return u!==null&&s&&(u.start=u.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),u.end=u.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),c.length===0?c.push(u):c.length==1?i.start.isBefore(n.start)||i.start.isEqual(n.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),c.length===0?[new je(o.baseVersion)]:jn(c,r)}),ae(ce,be,(o,e,t)=>{let n=o.targetPosition.clone();o.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&t.abRelation!="moveTargetAfter"||(n=o.targetPosition._getTransformedBySplitOperation(e));const i=V._createFromPositionAndShift(o.sourcePosition,o.howMany);if(i.end.isEqual(e.insertionPosition))return e.graveyardPosition||o.howMany++,o.targetPosition=n,[o];if(i.start.hasSameParentAs(e.splitPosition)&&i.containsPosition(e.splitPosition)){let s=new V(e.splitPosition,i.end);return s=s._getTransformedBySplitOperation(e),jn([new V(i.start,e.splitPosition),s],n)}o.targetPosition.isEqual(e.splitPosition)&&t.abRelation=="insertAtSource"&&(n=e.moveTargetPosition),o.targetPosition.isEqual(e.insertionPosition)&&t.abRelation=="insertBetween"&&(n=o.targetPosition);const r=[i._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const s=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);o.howMany>1&&s&&!t.aWasUndone&&r.push(V._createFromPositionAndShift(e.insertionPosition,1))}return jn(r,n)}),ae(ce,Re,(o,e,t)=>{const n=V._createFromPositionAndShift(o.sourcePosition,o.howMany);if(e.deletionPosition.hasSameParentAs(o.sourcePosition)&&n.containsPosition(e.sourcePosition)){if(o.type!="remove"||t.forceWeakRemove){if(o.howMany==1)return t.bWasUndone?(o.sourcePosition=e.graveyardPosition.clone(),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),[o]):[new je(0)]}else if(!t.aWasUndone){const r=[];let s=e.graveyardPosition.clone(),a=e.targetPosition._getTransformedByMergeOperation(e);o.howMany>1&&(r.push(new ce(o.sourcePosition,o.howMany-1,o.targetPosition,0)),s=s._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1),a=a._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1));const l=e.deletionPosition._getCombined(o.sourcePosition,o.targetPosition),c=new ce(s,1,l,0),d=c.getMovedRangeStart().path.slice();d.push(0);const u=new H(c.targetPosition.root,d);a=a._getTransformedByMove(s,l,1);const g=new ce(a,e.howMany,u,0);return r.push(c),r.push(g),r}}const i=V._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByMergeOperation(e);return o.sourcePosition=i.start,o.howMany=i.end.offset-i.start.offset,o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),[o]}),ae(Je,$e,(o,e)=>(o.position=o.position._getTransformedByInsertOperation(e),[o])),ae(Je,Re,(o,e)=>o.position.isEqual(e.deletionPosition)?(o.position=e.graveyardPosition.clone(),o.position.stickiness="toNext",[o]):(o.position=o.position._getTransformedByMergeOperation(e),[o])),ae(Je,ce,(o,e)=>(o.position=o.position._getTransformedByMoveOperation(e),[o])),ae(Je,Je,(o,e,t)=>{if(o.position.isEqual(e.position)){if(!t.aIsStrong)return[new je(0)];o.oldName=e.newName}return[o]}),ae(Je,be,(o,e)=>{if(Ue(o.position.path,e.splitPosition.getParentPath())=="same"&&!e.graveyardPosition){const t=new Je(o.position.getShiftedBy(1),o.oldName,o.newName,0);return[o,t]}return o.position=o.position._getTransformedBySplitOperation(e),[o]}),ae(Tt,Tt,(o,e,t)=>{if(o.root===e.root&&o.key===e.key){if(!t.aIsStrong||o.newValue===e.newValue)return[new je(0)];o.oldValue=e.newValue}return[o]}),ae(yt,yt,(o,e,t)=>o.rootName!==e.rootName||o.isAdd!==e.isAdd||t.bWasUndone?[o]:[new je(0)]),ae(be,$e,(o,e)=>(o.splitPosition.hasSameParentAs(e.position)&&o.splitPosition.offset{if(!o.graveyardPosition&&!t.bWasUndone&&o.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const i=new H(e.graveyardPosition.root,n),r=be.getInsertionPosition(new H(e.graveyardPosition.root,n)),s=new be(i,0,r,null,0);return o.splitPosition=o.splitPosition._getTransformedByMergeOperation(e),o.insertionPosition=be.getInsertionPosition(o.splitPosition),o.graveyardPosition=s.insertionPosition.clone(),o.graveyardPosition.stickiness="toNext",[s,o]}return o.splitPosition.hasSameParentAs(e.deletionPosition)&&!o.splitPosition.isAfter(e.deletionPosition)&&o.howMany--,o.splitPosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.splitPosition=o.splitPosition._getTransformedByMergeOperation(e),o.insertionPosition=be.getInsertionPosition(o.splitPosition),o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(e)),[o]}),ae(be,ce,(o,e,t)=>{const n=V._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.graveyardPosition){const r=n.start.isEqual(o.graveyardPosition)||n.containsPosition(o.graveyardPosition);if(!t.bWasUndone&&r){const s=o.splitPosition._getTransformedByMoveOperation(e),a=o.graveyardPosition._getTransformedByMoveOperation(e),l=a.path.slice();l.push(0);const c=new H(a.root,l);return[new ce(s,o.howMany,c,0)]}o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(e)}const i=o.splitPosition.isEqual(e.targetPosition);if(i&&(t.baRelation=="insertAtSource"||t.abRelation=="splitBefore"))return o.howMany+=e.howMany,o.splitPosition=o.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),o.insertionPosition=be.getInsertionPosition(o.splitPosition),[o];if(i&&t.abRelation&&t.abRelation.howMany){const{howMany:r,offset:s}=t.abRelation;return o.howMany+=r,o.splitPosition=o.splitPosition.getShiftedBy(s),[o]}if(o.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(o.splitPosition)){const r=e.howMany-(o.splitPosition.offset-e.sourcePosition.offset);return o.howMany-=r,o.splitPosition.hasSameParentAs(e.targetPosition)&&o.splitPosition.offset{if(o.splitPosition.isEqual(e.splitPosition)){if(!o.graveyardPosition&&!e.graveyardPosition)return[new je(0)];if(o.graveyardPosition&&e.graveyardPosition&&o.graveyardPosition.isEqual(e.graveyardPosition))return[new je(0)];if(t.abRelation=="splitBefore")return o.howMany=0,o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(e),[o]}if(o.graveyardPosition&&e.graveyardPosition&&o.graveyardPosition.isEqual(e.graveyardPosition)){const n=o.splitPosition.root.rootName=="$graveyard",i=e.splitPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const r=[];return e.howMany&&r.push(new ce(e.moveTargetPosition,e.howMany,e.splitPosition,0)),o.howMany&&r.push(new ce(o.splitPosition,o.howMany,o.moveTargetPosition,0)),r}return[new je(0)]}if(o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(e)),o.splitPosition.isEqual(e.insertionPosition)&&t.abRelation=="splitBefore")return o.howMany++,[o];if(e.splitPosition.isEqual(o.insertionPosition)&&t.baRelation=="splitBefore"){const n=e.insertionPosition.path.slice();n.push(0);const i=new H(e.insertionPosition.root,n);return[o,new ce(o.insertionPosition,1,i,0)]}return o.splitPosition.hasSameParentAs(e.splitPosition)&&o.splitPosition.offset{const t=e[0];t.isDocumentOperation&&w1.call(this,t)},{priority:"low"})}function w1(o){const e=this.getTransformedByOperation(o);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}Ye.prototype.is=function(o){return o==="livePosition"||o==="model:livePosition"||o=="position"||o==="model:position"};class $n{constructor(e={}){typeof e=="string"&&(e=e==="transparent"?{isUndoable:!1}:{},Q("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:n=!0,isUndo:i=!1,isTyping:r=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=n,this.isUndo=i,this.isTyping=r}get type(){return Q("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(e.baseVersion!==null)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}var A1=Object.defineProperty,Wh=Object.getOwnPropertySymbols,_1=Object.prototype.hasOwnProperty,C1=Object.prototype.propertyIsEnumerable,Kh=(o,e,t)=>e in o?A1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class v1{constructor(e){this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changedRoots=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set,this._markerCollection=e}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0&&this._changedRoots.size==0}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const n of t.range.getItems({shallow:!0}))this._isInInsertedElement(n.parent)||this._markAttribute(n);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const n=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);n||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const n=V._createFromPositionAndShift(t.position,1);for(const i of this._markerCollection.getMarkersIntersectingRange(n)){const r=i.getData();this.bufferMarkerChange(i.name,r,r)}break}case"split":{const n=t.splitPosition.parent;this._isInInsertedElement(n)||this._markRemove(n,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const n=t.sourcePosition.parent;this._isInInsertedElement(n.parent)||this._markRemove(n.parent,n.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const r=t.targetPosition.parent;this._isInInsertedElement(r)||this._markInsert(r,t.targetPosition.offset,n.maxOffset);break}case"detachRoot":case"addRoot":this._bufferRootStateChange(t.rootName,t.isAdd);break;case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{const n=t.root.rootName;this._bufferRootAttributeChange(n,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n){const i=this._changedMarkers.get(e);i?(i.newMarkerData=n,i.oldMarkerData.range==null&&n.range==null&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{newMarkerData:n,oldMarkerData:t})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)n.oldMarkerData.range!=null&&e.push({name:t,range:n.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)n.newMarkerData.range!=null&&e.push({name:t,range:n.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}}))}hasDataChanges(){if(this._changesInElement.size>0||this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const n=e.range&&!t.range,i=!e.range&&t.range,r=e.range&&t.range&&!e.range.isEqual(t.range);if(n||i||r)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const n of this._changesInElement.keys()){const i=this._changesInElement.get(n).sort((d,u)=>d.offset===u.offset?d.type!=u.type?d.type=="remove"?-1:1:0:d.offsetn.position.root!=i.position.root?n.position.root.rootNamen);for(const n of t)delete n.changeCount,n.type=="attribute"&&(delete n.position,delete n.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(E1),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(e=>{const t=((n,i)=>{for(var r in i||(i={}))_1.call(i,r)&&Kh(n,r,i[r]);if(Wh)for(var r of Wh(i))C1.call(i,r)&&Kh(n,r,i[r]);return n})({},e);return t.state!==void 0&&delete t.attributes,t})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const n=this._changedRoots.get(e);n.state!==void 0?(delete n.state,n.attributes===void 0&&this._changedRoots.delete(e)):n.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,n,i){const r=this._changedRoots.get(e)||{name:e},s=r.attributes||{};if(s[t]){const a=s[t];i===a.oldValue?delete s[t]:a.newValue=i}else s[t]={oldValue:n,newValue:i};Object.entries(s).length===0?(delete r.attributes,r.state===void 0&&this._changedRoots.delete(e)):(r.attributes=s,this._changedRoots.set(e,r))}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e);const t=V._createOn(e);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const i=n.getData();this.bufferMarkerChange(n.name,i,i)}this._cachedChanges=null}_markInsert(e,t,n){const i={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,n){const i={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let i=0;in.offset){if(i>r){const s={type:"attribute",offset:r,howMany:i-r,count:this._changeCount++};this._handleChange(s,t),t.push(s)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offsetr?(e.nodesToHandle=i-r,e.offset=r):e.nodesToHandle=0);if(n.type=="remove"&&e.offsetn.offset){const s={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(s,t),t.push(s),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}n.type=="attribute"&&(e.offset>=n.offset&&i<=r?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=r&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:H._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:H._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[r,s]of t){const a=n.has(r)?n.get(r):null;a!==s&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:s,attributeNewValue:a,changeCount:this._changeCount++}),n.delete(r)}for(const[r,s]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:s,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n){for(const r of n)if(r.type=="insert"&&i>=r.offset&&in){for(let s=0;sthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new I("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const n=this._operations[0];e===void 0&&(e=n.baseVersion);let i=t-1;for(const[a,l]of this._gaps)e>a&&ea&&ithis.lastOperation.baseVersion)return[];let r=this._baseVersionToOperationIndex.get(e);r===void 0&&(r=0);let s=this._baseVersionToOperationIndex.get(i);return s===void 0&&(s=this._operations.length-1),this._operations.slice(r,s+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(t!==void 0)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Di extends ke{constructor(e,t,n="main"){super(t),this._isAttached=!0,this._document=e,this.rootName=n}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Di.prototype.is=function(o,e){return e?e===this.name&&(o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"):o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"||o==="node"||o==="model:node"};var S1=Object.defineProperty,D1=Object.defineProperties,B1=Object.getOwnPropertyDescriptors,Zh=Object.getOwnPropertySymbols,T1=Object.prototype.hasOwnProperty,I1=Object.prototype.propertyIsEnumerable,Jh=(o,e,t)=>e in o?S1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Yh=(o,e)=>{for(var t in e||(e={}))T1.call(e,t)&&Jh(o,t,e[t]);if(Zh)for(var t of Zh(e))I1.call(e,t)&&Jh(o,t,e[t]);return o},Qh=(o,e)=>D1(o,B1(e));const Is="$graveyard";class P1 extends me(){constructor(e){super(),this.model=e,this.history=new x1,this.selection=new mt(this),this.roots=new at({idProperty:"rootName"}),this.differ=new v1(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Is),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&this.history.addOperation(i)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,n,i,r,s)=>{const a=Qh(Yh({},n.getData()),{range:r});this.differ.bufferMarkerChange(n.name,s,a),i===null&&n.on("change",(l,c)=>{const d=n.getData();this.differ.bufferMarkerChange(n.name,Qh(Yh({},d),{range:c}),d)})}),this.registerPostFixer(t=>{let n=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(t.remove(t.createRangeIn(i)),n=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(t.removeMarker(i),n=!0);return n})}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Is)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new I("model-document-createroot-name-exists",this,{name:t});const n=new Di(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return Array.from(this.roots).filter(t=>t.rootName!=Is&&(e||t.isAttached())).map(t=>t.rootName)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=md(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return Xh(e.start)&&Xh(e.end)}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break;while(t)}}function Xh(o){const e=o.textNode;if(e){const t=e.data,n=o.offset-e.startOffset;return!Ur(t,n)&&!Wr(t,n)}return!0}var R1=Object.defineProperty,O1=Object.defineProperties,N1=Object.getOwnPropertyDescriptors,eu=Object.getOwnPropertySymbols,z1=Object.prototype.hasOwnProperty,M1=Object.prototype.propertyIsEnumerable,tu=(o,e,t)=>e in o?R1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class F1 extends me(){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Hn?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const r=e instanceof Hn?e.name:e;if(r.includes(","))throw new I("markercollection-incorrect-marker-name",this);const s=this._markers.get(r);if(s){const d=s.getData(),u=s.getRange();let g=!1;return u.isEqual(t)||(s._attachLiveRange(Bt.fromRange(t)),g=!0),n!=s.managedUsingOperations&&(s._managedUsingOperations=n,g=!0),typeof i=="boolean"&&i!=s.affectsData&&(s._affectsData=i,g=!0),g&&this.fire(`update:${r}`,s,u,t,d),s}const a=Bt.fromRange(t),l=new Hn(r,a,n,i);var c;return this._markers.set(r,l),this.fire(`update:${r}`,l,null,t,(c=((d,u)=>{for(var g in u||(u={}))z1.call(u,g)&&tu(d,g,u[g]);if(eu)for(var g of eu(u))M1.call(u,g)&&tu(d,g,u[g]);return d})({},l.getData()),O1(c,N1({range:null})))),l}_remove(e){const t=e instanceof Hn?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire(`update:${t}`,n,n.getRange(),null,n.getData()),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof Hn?e.name:e,n=this._markers.get(t);if(!n)throw new I("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire(`update:${t}`,n,i,i,n.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)t.getRange().getIntersection(e)!==null&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Hn extends me(qt){constructor(e,t,n,i){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Hn.prototype.is=function(o){return o==="marker"||o==="model:marker"};class V1 extends it{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new I("detach-operation-on-document-node",this)}_execute(){Vh(V._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class It extends qt{constructor(e){super(),this.markers=new Map,this._children=new yo,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(ke.fromJSON(n)):t.push(fe.fromJSON(n));return new It(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new fe(i)]:(et(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new fe(r):r instanceof ut?new fe(r.data,r.getAttributes()):r))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}}It.prototype.is=function(o){return o==="documentFragment"||o==="model:documentFragment"};class L1{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new fe(e,t)}createElement(e,t){return new ke(e,t)}createDocumentFragment(){return new It}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof fe&&e.data=="")return;const i=H._createAt(t,n);if(e.parent){if(iu(e.root,i.root))return void this.move(V._createOn(e),i);if(e.root.document)throw new I("model-writer-insert-forbidden-move",this);this.remove(e)}const r=i.root.document?i.root.document.version:null,s=new $e(i,e,r);if(e instanceof fe&&(s.shouldReceiveAttributes=!0),this.batch.addOperation(s),this.model.applyOperation(s),e instanceof It)for(const[a,l]of e.markers){const c=H._createAt(l.root,0),d={range:new V(l.start._getCombined(c,i),l.end._getCombined(c,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(a)?this.updateMarker(a,d):this.addMarker(a,d)}}insertText(e,t,n,i){t instanceof It||t instanceof ke||t instanceof H?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,i)}insertElement(e,t,n,i){t instanceof It||t instanceof ke||t instanceof H?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,i)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof It||t instanceof ke?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof It||t instanceof ke?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof V){const i=n.getMinimalFlatRanges();for(const r of i)nu(this,e,t,r)}else ou(this,e,t,n)}setAttributes(e,t){for(const[n,i]of Dt(e))this.setAttribute(n,i,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof V){const n=t.getMinimalFlatRanges();for(const i of n)nu(this,e,null,i)}else ou(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=n=>{for(const i of n.getAttributeKeys())this.removeAttribute(i,n)};if(e instanceof V)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof V))throw new I("writer-move-invalid-range",this);if(!e.isFlat)throw new I("writer-move-range-not-flat",this);const i=H._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!iu(e.root,i.root))throw new I("writer-move-different-document",this);const r=e.root.document?e.root.document.version:null,s=new ce(e.start,e.end.offset-e.start.offset,i,r);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof V?e:V._createOn(e)).getMinimalFlatRanges().reverse();for(const n of t)this._addOperationForAffectedMarkers("move",n),j1(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof ke))throw new I("writer-merge-no-element-before",this);if(!(n instanceof ke))throw new I("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(V._createIn(n),H._createAt(t,"end")),this.remove(n)}_merge(e){const t=H._createAt(e.nodeBefore,"end"),n=H._createAt(e.nodeAfter,0),i=e.root.document.graveyard,r=new H(i,[0]),s=e.root.document.version,a=new Re(n,e.nodeAfter.maxOffset,t,r,s);this.batch.addOperation(a),this.model.applyOperation(a)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof ke))throw new I("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new Je(H._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,r=e.parent;if(!r.parent)throw new I("writer-split-element-no-parent",this);if(t||(t=r.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new I("writer-split-invalid-limit-element",this);do{const s=r.root.document?r.root.document.version:null,a=r.maxOffset-e.offset,l=be.getInsertionPosition(e),c=new be(e,a,l,null,s);this.batch.addOperation(c),this.model.applyOperation(c),n||i||(n=r,i=e.parent.nextSibling),r=(e=this.createPositionAfter(e.parent)).parent}while(r!==t);return{position:e,range:new V(H._createAt(n,"end"),H._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new I("writer-wrap-range-not-flat",this);const n=t instanceof ke?t:new ke(t);if(n.childCount>0)throw new I("writer-wrap-element-not-empty",this);if(n.parent!==null)throw new I("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new V(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,H._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new I("writer-unwrap-element-no-parent",this);this.move(V._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||typeof t.usingOperation!="boolean")throw new I("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,r=t.affectsData!==void 0&&t.affectsData;if(this.model.markers.has(e))throw new I("writer-addmarker-marker-exists",this);if(!i)throw new I("writer-addmarker-no-range",this);return n?(Io(this,e,null,i,r),this.model.markers.get(e)):this.model.markers._set(e,i,n,r)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e=="string"?e:e.name,i=this.model.markers.get(n);if(!i)throw new I("writer-updatemarker-marker-not-exists",this);if(!t)return Q("writer-updatemarker-reconvert-using-editingcontroller",{markerName:n}),void this.model.markers._refresh(i);const r=typeof t.usingOperation=="boolean",s=typeof t.affectsData=="boolean",a=s?t.affectsData:i.affectsData;if(!r&&!t.range&&!s)throw new I("writer-updatemarker-wrong-options",this);const l=i.getRange(),c=t.range?t.range:l;r&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?Io(this,n,null,c,a):(Io(this,n,l,null,a),this.model.markers._set(n,c,void 0,a)):i.managedUsingOperations?Io(this,n,l,c,a):this.model.markers._set(n,c,void 0,a)}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t))throw new I("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);if(!n.managedUsingOperations)return void this.model.markers._remove(t);Io(this,t,n.getRange(),null,n.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const n=this.model.document.getRoot(e);if(n&&n.isAttached())throw new I("writer-addroot-root-exists",this);const i=this.model.document,r=new yt(e,t,!0,i,i.version);return this.batch.addOperation(r),this.model.applyOperation(r),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new I("writer-detachroot-no-root",this);for(const r of this.model.markers)r.getRange().root===t&&this.removeMarker(r);for(const r of t.getAttributeKeys())this.removeAttribute(r,t);this.remove(this.createRangeIn(t));const n=this.model.document,i=new yt(t.rootName,t.name,!1,n,n.version);this.batch.addOperation(i),this.model.applyOperation(i)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,t);else for(const[n,i]of Dt(e))this._setSelectionAttribute(n,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=mt._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=mt._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new I("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let r=!1;if(e==="move"){const s=t;r=s.containsPosition(i.start)||s.start.isEqual(i.start)||s.containsPosition(i.end)||s.end.isEqual(i.end)}else{const s=t,a=s.nodeBefore,l=s.nodeAfter,c=i.start.parent==a&&i.start.isAtEnd,d=i.end.parent==l&&i.end.offset==0,u=i.end.nodeAfter==l,g=i.start.nodeAfter==l;r=c||d||u||g}r&&this.updateMarker(n.name,{range:i})}}}function nu(o,e,t,n){const i=o.model,r=i.document;let s,a,l,c=n.start;for(const u of n.getWalker({shallow:!0}))l=u.item.getAttribute(e),s&&a!=l&&(a!=t&&d(),c=s),s=u.nextPosition,a=l;function d(){const u=new V(c,s),g=u.root.document?r.version:null,f=new Me(u,e,a,t,g);o.batch.addOperation(f),i.applyOperation(f)}s instanceof H&&s!=c&&a!=t&&d()}function ou(o,e,t,n){const i=o.model,r=i.document,s=n.getAttribute(e);let a,l;if(s!=t){if(n.root===n){const c=n.document?r.version:null;l=new Tt(n,e,s,t,c)}else{a=new V(H._createBefore(n),o.createPositionAfter(n));const c=a.root.document?r.version:null;l=new Me(a,e,s,t,c)}o.batch.addOperation(l),i.applyOperation(l)}}function Io(o,e,t,n,i){const r=o.model,s=r.document,a=new Ze(e,t,n,r.markers,!!i,s.version);o.batch.addOperation(a),r.applyOperation(a)}function j1(o,e,t,n){let i;if(o.root.document){const r=n.document,s=new H(r.graveyard,[0]);i=new ce(o,e,s,r.version)}else i=new V1(o,e);t.addOperation(i),n.applyOperation(i)}function iu(o,e){return o===e||o instanceof Di&&e instanceof Di}function $1(o,e,t={}){if(e.isCollapsed)return;const n=e.getFirstRange();if(n.root.rootName=="$graveyard")return;const i=o.schema;o.change(r=>{if(!t.doNotResetEntireContent&&function(c,d){const u=c.getLimitElement(d);if(!d.containsEntireContent(u))return!1;const g=d.getFirstRange();return g.start.parent==g.end.parent?!1:c.checkChild(u,"paragraph")}(i,e))return void function(c,d){const u=c.model.schema.getLimitElement(d);c.remove(c.createRangeIn(u)),au(c,c.createPositionAt(u,0),d)}(r,e);const s={};if(!t.doNotAutoparagraph){const c=e.getSelectedElement();c&&Object.assign(s,i.getAttributesWithProperty(c,"copyOnReplace",!0))}const[a,l]=function(c){const d=c.root.document.model,u=c.start;let g=c.end;if(d.hasContent(c,{ignoreMarkers:!0})){const f=function(b){const A=b.parent,E=A.root.document.model.schema,P=A.getAncestors({parentFirst:!0,includeSelf:!0});for(const z of P){if(E.isLimit(z))return null;if(E.isBlock(z))return z}}(g);if(f&&g.isTouching(d.createPositionAt(f,0))){const b=d.createSelection(c);d.modifySelection(b,{direction:"backward"});const A=b.getLastPosition(),E=d.createRange(A,g);d.hasContent(E,{ignoreMarkers:!0})||(g=A)}}return[Ye.fromPosition(u,"toPrevious"),Ye.fromPosition(g,"toNext")]}(n);a.isTouching(l)||r.remove(r.createRange(a,l)),t.leaveUnmerged||(function(c,d,u){const g=c.model;if(!Ps(c.model.schema,d,u))return;const[f,b]=function(A,E){const P=A.getAncestors(),z=E.getAncestors();let j=0;for(;P[j]&&P[j]==z[j];)j++;return[P[j],z[j]]}(d,u);!f||!b||(!g.hasContent(f,{ignoreMarkers:!0})&&g.hasContent(b,{ignoreMarkers:!0})?su(c,d,u,f.parent):ru(c,d,u,f.parent))}(r,a,l),i.removeDisallowedAttributes(a.parent.getChildren(),r)),lu(r,e,a),!t.doNotAutoparagraph&&function(c,d){const u=c.checkChild(d,"$text"),g=c.checkChild(d,"paragraph");return!u&&g}(i,a)&&au(r,a,e,s),a.detach(),l.detach()})}function ru(o,e,t,n){const i=e.parent,r=t.parent;if(i!=n&&r!=n){for(e=o.createPositionAfter(i),(t=o.createPositionBefore(r)).isEqual(e)||o.insert(r,e),o.merge(e);t.parent.isEmpty;){const s=t.parent;t=o.createPositionBefore(s),o.remove(s)}Ps(o.model.schema,e,t)&&ru(o,e,t,n)}}function su(o,e,t,n){const i=e.parent,r=t.parent;if(i!=n&&r!=n){for(e=o.createPositionAfter(i),(t=o.createPositionBefore(r)).isEqual(e)||o.insert(i,t);e.parent.isEmpty;){const s=e.parent;e=o.createPositionBefore(s),o.remove(s)}t=o.createPositionBefore(r),function(s,a){const l=a.nodeBefore,c=a.nodeAfter;l.name!=c.name&&s.rename(l,c.name),s.clearAttributes(l),s.setAttributes(Object.fromEntries(c.getAttributes()),l),s.merge(a)}(o,t),Ps(o.model.schema,e,t)&&su(o,e,t,n)}}function Ps(o,e,t){const n=e.parent,i=t.parent;return n!=i&&!o.isLimit(n)&&!o.isLimit(i)&&function(r,s,a){const l=new V(r,s);for(const c of l.getWalker())if(a.isLimit(c.item))return!1;return!0}(e,t,o)}function au(o,e,t,n={}){const i=o.createElement("paragraph");o.model.schema.setAllowedAttributes(i,n,o),o.insert(i,e),lu(o,t,o.createPositionAt(i,0))}function lu(o,e,t){e instanceof mt?o.setSelection(t):e.setTo(t)}function cu(o,e){const t=[];Array.from(o.getItems({direction:"backward"})).map(n=>e.createRangeOn(n)).filter(n=>(n.start.isAfter(o.start)||n.start.isEqual(o.start))&&(n.end.isBefore(o.end)||n.end.isEqual(o.end))).forEach(n=>{t.push(n.start.parent),e.remove(n)}),t.forEach(n=>{let i=n;for(;i.parent&&i.isEmpty;){const r=e.createRangeOn(i);i=i.parent,e.remove(r)}})}class H1{constructor(e,t,n){this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null,this._nodeToSelect=null,this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(e);if(n.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new I("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?V._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new V(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Ye.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new I("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Ye.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Ye.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof ke)||!this._canMergeLeft(e))return;const t=Ye._createBefore(e);t.stickiness="toNext";const n=Ye.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Ye._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Ye._createAt(t.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof ke)||!this._canMergeRight(e))return;const t=Ye._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new I("insertcontent-invalid-insertion-position",this);this.position=H._createAt(t.nodeBefore,"end");const n=Ye.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Ye._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Ye._createAt(t.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof ke&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof ke&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const n=this.position.parent;this.position=this.writer.createPositionBefore(n),n.isEmpty&&n.parent===t&&this.writer.remove(n)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const n=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=n,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function du(o,e,t="auto"){const n=o.getSelectedElement();if(n&&e.schema.isObject(n)&&!e.schema.isInline(n))return t=="before"||t=="after"?e.createRange(e.createPositionAt(n,t)):e.createRangeOn(n);const i=ze(o.getSelectedBlocks());if(!i)return e.createRange(o.focus);if(i.isEmpty)return e.createRange(e.createPositionAt(i,0));const r=e.createPositionAfter(i);return o.focus.isTouching(r)?e.createRange(r):e.createRange(e.createPositionBefore(i))}function q1(o,e,t,n={}){if(!o.schema.isObject(e))throw new I("insertobject-element-not-an-object",o,{object:e});const i=t||o.document.selection;let r=i;n.findOptimalPosition&&o.schema.isBlock(e)&&(r=o.createSelection(du(i,o,n.findOptimalPosition)));const s=ze(i.getSelectedBlocks()),a={};return s&&Object.assign(a,o.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),o.change(l=>{r.isCollapsed||o.deleteContent(r,{doNotAutoparagraph:!0});let c=e;const d=r.anchor.parent;!o.schema.checkChild(d,e)&&o.schema.checkChild(d,"paragraph")&&o.schema.checkChild("paragraph",e)&&(c=l.createElement("paragraph"),l.insert(e,c)),o.schema.setAllowedAttributes(c,a,l);const u=o.insertContent(c,r);return u.isCollapsed||n.setSelection&&function(g,f,b,A){const E=g.model;if(b=="on")return void g.setSelection(f,"on");if(b!="after")throw new I("insertobject-invalid-place-parameter-value",E);let P=f.nextSibling;if(E.schema.isInline(f))return void g.setSelection(f,"after");!(P&&E.schema.checkChild(P,"$text"))&&E.schema.checkChild(f.parent,"paragraph")&&(P=g.createElement("paragraph"),E.schema.setAllowedAttributes(P,A,g),E.insertContent(P,g.createPositionAfter(f))),P&&g.setSelection(P,0)}(l,e,n.setSelection,a),u})}const U1=' ,.?!:;"-()';function W1(o,e){const{isForward:t,walker:n,unit:i,schema:r,treatEmojiAsSingleUnit:s}=o,{type:a,item:l,nextPosition:c}=e;if(a=="text")return o.unit==="word"?function(d,u){let g=d.position.textNode;for(g||(g=u?d.position.nodeAfter:d.position.nodeBefore);g&&g.is("$text");){const f=d.position.offset-g.startOffset;if(Z1(g,f,u))g=u?d.position.nodeAfter:d.position.nodeBefore;else{if(G1(g.data,f,u))break;d.next()}}return d.position}(n,t):function(d,u,g){const f=d.position.textNode;if(f){const b=f.data;let A=d.position.offset-f.startOffset;for(;Ur(b,A)||u=="character"&&Wr(b,A)||g&&Rc(b,A);)d.next(),A=d.position.offset-f.startOffset}return d.position}(n,i,s);if(a==(t?"elementStart":"elementEnd")){if(r.isSelectable(l))return H._createAt(l,t?"after":"before");if(r.checkChild(c,"$text"))return c}else{if(r.isLimit(l))return void n.skip(()=>!0);if(r.checkChild(c,"$text"))return c}}function K1(o,e){const t=o.root,n=H._createAt(t,e?"end":0);return e?new V(o,n):new V(n,o)}function G1(o,e,t){const n=e+(t?0:-1);return U1.includes(o.charAt(n))}function Z1(o,e,t){return e===(t?o.offsetSize:0)}class J1 extends ge(){constructor(){super(),this.markers=new F1,this.document=new P1(this),this.schema=new Wy,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if(t.name==="$marker")return!0}),Hy(this),this.document.registerPostFixer(vh),this.on("insertContent",(e,[t,n])=>{e.return=function(i,r,s){return i.change(a=>{const l=s||i.document.selection;l.isCollapsed||i.deleteContent(l,{doNotAutoparagraph:!0});const c=new H1(i,a,l.anchor),d=[];let u;if(r.is("documentFragment")){if(r.markers.size){const b=[];for(const[A,E]of r.markers){const{start:P,end:z}=E,j=P.isEqual(z);b.push({position:P,name:A,isCollapsed:j},{position:z,name:A,isCollapsed:j})}b.sort(({position:A},{position:E})=>A.isBefore(E)?1:-1);for(const{position:A,name:E,isCollapsed:P}of b){let z=null,j=null;const Y=A.parent===r&&A.isAtStart,ie=A.parent===r&&A.isAtEnd;Y||ie?P&&(j=Y?"start":"end"):(z=a.createElement("$marker"),a.insert(z,A)),d.push({name:E,element:z,collapsed:j})}}u=r.getChildren()}else u=[r];c.handleNodes(u);let g=c.getSelectionRange();if(r.is("documentFragment")&&d.length){const b=g?Bt.fromRange(g):null,A={};for(let E=d.length-1;E>=0;E--){const{name:P,element:z,collapsed:j}=d[E],Y=!A[P];if(Y&&(A[P]=[]),z){const ie=a.createPositionAt(z,"before");A[P].push(ie),a.remove(z)}else{const ie=c.getAffectedRange();if(!ie){j&&A[P].push(c.position);continue}j?A[P].push(ie[j]):A[P].push(Y?ie.start:ie.end)}}for(const[E,[P,z]]of Object.entries(A))P&&z&&P.root===z.root&&a.addMarker(E,{usingOperation:!0,affectsData:!0,range:new V(P,z)});b&&(g=b.toRange(),b.detach())}g&&(l instanceof mt?a.setSelection(g):l.setTo(g));const f=c.getAffectedRange()||i.createRange(l.anchor);return c.destroy(),f})}(this,t,n)}),this.on("insertObject",(e,[t,n,i])=>{e.return=q1(this,t,n,i)}),this.on("canEditAt",e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()})}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new $n,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){I.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{e?typeof e=="function"?(t=e,e=new $n):e instanceof $n||(e=new $n(e)):e=new $n,this._pendingChanges.push({batch:e,callback:t}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(n){I.rethrowUnexpectedError(n,this)}}applyOperation(e){e._execute()}insertContent(e,t,n,...i){const r=Rs(t,n);return this.fire("insertContent",[e,r,n,...i])}insertObject(e,t,n,i,...r){const s=Rs(t,n);return this.fire("insertObject",[e,s,i,i,...r])}deleteContent(e,t){$1(this,e,t)}modifySelection(e,t){(function(n,i,r={}){const s=n.schema,a=r.direction!="backward",l=r.unit?r.unit:"character",c=!!r.treatEmojiAsSingleUnit,d=i.focus,u=new vt({boundaries:K1(d,a),singleCharacters:!0,direction:a?"forward":"backward"}),g={walker:u,schema:s,isForward:a,unit:l,treatEmojiAsSingleUnit:c};let f;for(;f=u.next();){if(f.done)return;const b=W1(g,f.value);if(b)return void(i instanceof mt?n.change(A=>{A.setSelectionFocus(b)}):i.setFocus(b))}})(this,e,t)}getSelectedContent(e){return function(t,n){return t.change(i=>{const r=i.createDocumentFragment(),s=n.getFirstRange();if(!s||s.isCollapsed)return r;const a=s.start.root,l=s.start.getCommonPath(s.end),c=a.getNodeByPath(l);let d;d=s.start.parent==s.end.parent?s:i.createRange(i.createPositionAt(c,s.start.path[l.length]),i.createPositionAt(c,s.end.path[l.length]+1));const u=d.end.offset-d.start.offset;for(const g of d.getItems({shallow:!0}))g.is("$textProxy")?i.appendText(g.data,g.getAttributes(),r):i.append(i.cloneElement(g,!0),r);if(d!=s){const g=s._getTransformedByMove(d.start,i.createPositionAt(r,0),u)[0],f=i.createRange(i.createPositionAt(r,0),g.start);cu(i.createRange(g.end,i.createPositionAt(r,"end")),i),cu(f,i)}return r})}(this,e)}hasContent(e,t={}){const n=e instanceof V?e:V._createIn(e);if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:r=!1}=t;if(!r){for(const s of this.markers.getMarkersIntersectingRange(n))if(s.affectsData)return!0}for(const s of n.getItems())if(this.schema.isContent(s)&&(!s.is("$textProxy")||!i||s.data.search(/\S/)!==-1))return!0;return!1}canEditAt(e){const t=Rs(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,n){return new H(e,t,n)}createPositionAt(e,t){return H._createAt(e,t)}createPositionAfter(e){return H._createAfter(e)}createPositionBefore(e){return H._createBefore(e)}createRange(e,t){return new V(e,t)}createRangeIn(e){return V._createIn(e)}createRangeOn(e){return V._createOn(e)}createSelection(...e){return new ot(...e)}createBatch(e){return new $n(e)}createOperationFromJSON(e){return g1.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new L1(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function Rs(o,e){if(o)return o instanceof ot||o instanceof mt?o:o instanceof un?e||e===0?new ot(o,e):o.is("rootElement")?new ot(o,"in"):new ot(o,"on"):new ot(o)}class Y1 extends Ht{constructor(){super(...arguments),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Os extends Ht{constructor(){super(...arguments),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Bi{constructor(e){this.document=e}createDocumentFragment(e){return new hn(this.document,e)}createElement(e,t,n){return new tt(this.document,e,t,n)}createText(e){return new pe(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const i=n.getChildIndex(e);return this.removeChildren(i,1,n),this.insertChild(i,t,n),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new tt(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Ge(e)&&n===void 0?t._setStyle(e):n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return U._createAt(e,t)}createPositionAfter(e){return U._createAfter(e)}createPositionBefore(e){return U._createBefore(e)}createRange(e,t){return new X(e,t)}createRangeOn(e){return X._createOn(e)}createRangeIn(e){return X._createIn(e)}createSelection(...e){return new At(...e)}}function Q1(o=""){if(o==="")return{top:void 0,right:void 0,bottom:void 0,left:void 0};const e=o.replace(/, /g,",").split(" ").map(r=>r.replace(/,/g,", ")),t=e[0],n=e[2]||t,i=e[1]||t;return{top:t,bottom:n,right:i,left:e[3]||i}}function X1({top:o,right:e,bottom:t,left:n}){const i=[];return n!==e?i.push(o,e,t,n):t!==o?i.push(o,e,t):e!==o?i.push(o,e):i.push(o),i.join(" ")}function eE(o){var e,t;o.setNormalizer("margin",(e="margin",n=>({path:e,value:Q1(n)}))),o.setNormalizer("margin-top",n=>({path:"margin.top",value:n})),o.setNormalizer("margin-right",n=>({path:"margin.right",value:n})),o.setNormalizer("margin-bottom",n=>({path:"margin.bottom",value:n})),o.setNormalizer("margin-left",n=>({path:"margin.left",value:n})),o.setReducer("margin",(t="margin",n=>{const{top:i,right:r,bottom:s,left:a}=n,l=[];return[i,r,a,s].every(c=>!!c)?l.push([t,X1(n)]):(i&&l.push([t+"-top",i]),r&&l.push([t+"-right",r]),s&&l.push([t+"-bottom",s]),a&&l.push([t+"-left",a])),l})),o.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}class tE{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new I("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class nE extends ge(){constructor(e={}){super();const t=this.constructor,n=e.language||t.defaultConfig&&t.defaultConfig.language;this._context=e.context||new dd({language:n}),this._context._addEditor(this,!e.context);const i=Array.from(t.builtinPlugins||[]);this.config=new hc(e,t.defaultConfig),this.config.define("plugins",i),this.config.define(this._context._getEditorConfig()),this.plugins=new cd(this,i,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new tE,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new J1,this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const r=new Sv;this.data=new u1(this.model,r),this.editing=new qy(this.model,r),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new m1([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 GC(this),this.keystrokes.listenTo(this.editing.view.document)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new I("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new I("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 I("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))}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[],r=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(i),n,r)}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(t=>this.once("ready",t))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(n){I.rethrowUnexpectedError(n,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}}function Ti(o){return class extends o{setData(e){this.data.set(e)}getData(e){return this.data.get(e)}}}{const o=Ti(Object);Ti.setData=o.prototype.setData,Ti.getData=o.prototype.getData}function Ns(o){return class extends o{updateSourceElement(e=this.data.get()){if(!this.sourceElement)throw new I("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),n=this.sourceElement instanceof HTMLTextAreaElement;bC(this.sourceElement,t||n?e:"")}}}Ns.updateSourceElement=Ns(Object).prototype.updateSourceElement;class Ii extends ui{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new at({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new I("pendingactions-add-invalid-message",this);const t=new(ge());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const ve={bold:'',cancel:'',caption:'',check:'',cog:'',eraser:'',image:'',lowVision:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:''};var hu=D(5542),oE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(hu.Z,oE),hu.Z.locals;const{threeVerticalDots:uu}=ve,iE={alignLeft:ve.alignLeft,bold:ve.bold,importExport:ve.importExport,paragraph:ve.paragraph,plus:ve.plus,text:ve.text,threeVerticalDots:ve.threeVerticalDots};class zs extends re{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new ht,this.keystrokes=new St,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new rE(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r=e.uiLanguageDirection==="rtl";this._focusCycler=new bo({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var a;this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(a=this,a.bindTemplate.to(l=>{l.target===a.element&&l.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new aE(this):new sE(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,n){this.items.addMany(this._buildItemsFromConfig(e,t,n))}_buildItemsFromConfig(e,t,n){const i=rd(e),r=n||i.removeItems;return this._cleanItemsConfiguration(i.items,t,r).map(s=>xe(s)?this._createNestedToolbarDropdown(s,t,r):s==="|"?new id:s==="-"?new KC:t.create(s)).filter(s=>!!s)}_cleanItemsConfiguration(e,t,n){const i=e.filter((r,s,a)=>r==="|"||n.indexOf(r)===-1&&(r==="-"?!this.options.shouldGroupWhenFull||(Q("toolbarview-line-break-ignored-when-grouping-items",a),!1):!(!xe(r)&&!t.has(r))||(Q("toolbarview-item-unavailable",{item:r}),!1)));return this._cleanSeparatorsAndLineBreaks(i)}_cleanSeparatorsAndLineBreaks(e){const t=s=>s!=="-"&&s!=="|",n=e.length,i=e.findIndex(t);if(i===-1)return[];const r=n-e.slice().reverse().findIndex(t);return e.slice(i,r).filter((s,a,l)=>t(s)?!0:!(a>0&&l[a-1]===s))}_createNestedToolbarDropdown(e,t,n){let{label:i,icon:r,items:s,tooltip:a=!0,withText:l=!1}=e;if(s=this._cleanItemsConfiguration(s,t,n),!s.length)return null;const c=Pt(this.locale);return i||Q("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:i,tooltip:a,withText:!!l}),r!==!1?c.buttonView.icon=iE[r]||r||uu:c.buttonView.withText=!0,Pi(c,()=>c.toolbarView._buildItemsFromConfig(s,t,n)),c}}class rE extends re{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class sE{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(n=>n),e.focusables.bindTo(e.items).using(n=>n),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class aE{constructor(e){this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCycleableItems.bind(this)),e.children.on("change",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(t,n)=>{const i=n.index,r=Array.from(n.added);for(const s of n.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(s):this.ungroupedItems.remove(s);for(let s=i;sthis.ungroupedItems.length?this.groupedItems.add(a,s-this.ungroupedItems.length):this.ungroupedItems.add(a,s)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!on(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new De(e.lastChild),i=new De(e);if(!this.cachedPadding){const r=oe.window.getComputedStyle(e),s=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[s])}return t==="ltr"?n.right>i.right-this.cachedPadding:n.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new id),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,n=Pt(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",Pi(n,this.groupedItems),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:uu}),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var mu=D(1046),lE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(mu.Z,lE),mu.Z.locals;class cE extends re{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new ht,this.keystrokes=new St,this._focusCycler=new bo({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",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")},children:this.items})}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)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class gu extends re{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",n=>!n)],role:"presentation"},children:this.children})}focus(){this.children.first.focus()}}class dE extends re{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var pu=D(7686),hE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(pu.Z,hE),pu.Z.locals;class Ms extends re{constructor(e){super(e);const t=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(),this.arrowView=this._createArrowView(),this.keystrokes=new St,this.focusTracker=new ht,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.to("class"),t.if("isVisible","ck-hidden",n=>!n),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(){const e=new Ae;return e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const e=new Ae,t=e.bindTemplate;return e.icon=nd,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",n=>String(n))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}var fu=D(7339),uE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(fu.Z,uE),fu.Z.locals;var ku=D(3949),mE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(ku.Z,mE),ku.Z.locals;function Pt(o,e=od){const t=new e(o),n=new UC(o),i=new Jr(o,t,n);return t.bind("isEnabled").to(i),t instanceof Ms?t.arrowView.bind("isOn").to(i,"isOpen"):t.bind("isOn").to(i,"isOpen"),function(r){(function(s){s.on("render",()=>{w({emitter:s,activator:()=>s.isOpen,callback:()=>{s.isOpen=!1},contextElements:[s.element]})})})(r),function(s){s.on("execute",a=>{a.source instanceof hi||(s.isOpen=!1)})}(r),function(s){s.focusTracker.on("change:isFocused",(a,l,c)=>{s.isOpen&&!c&&(s.isOpen=!1)})}(r),function(s){s.keystrokes.set("arrowdown",(a,l)=>{s.isOpen&&(s.panelView.focus(),l())}),s.keystrokes.set("arrowup",(a,l)=>{s.isOpen&&(s.panelView.focusLast(),l())})}(r),function(s){s.on("change:isOpen",(a,l,c)=>{if(c)return;const d=s.panelView.element;d&&d.contains(oe.document.activeElement)&&s.buttonView.focus()})}(r),function(s){s.on("change:isOpen",(a,l,c)=>{c&&s.panelView.focus()},{priority:"low"})}(r)}(i),i}function Pi(o,e,t={}){o.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),o.isOpen?bu(o,e,t):o.once("change:isOpen",()=>bu(o,e,t),{priority:"highest"}),t.enableActiveItemFocusOnDropdownOpen&&Au(o,()=>o.toolbarView.items.find(n=>n.isOn))}function bu(o,e,t){const n=o.locale,i=n.t,r=o.toolbarView=new zs(n),s=typeof e=="function"?e():e;r.ariaLabel=t.ariaLabel||i("Dropdown toolbar"),t.maxWidth&&(r.maxWidth=t.maxWidth),t.class&&(r.class=t.class),t.isCompact&&(r.isCompact=t.isCompact),t.isVertical&&(r.isVertical=!0),s instanceof rn?r.items.bindTo(s).using(a=>a):r.items.addMany(s),o.panelView.children.add(r),r.items.delegate("execute").to(o)}function Fs(o,e,t={}){o.isOpen?wu(o,e,t):o.once("change:isOpen",()=>wu(o,e,t),{priority:"highest"}),Au(o,()=>o.listView.items.find(n=>n instanceof gu&&n.children.first.isOn))}function wu(o,e,t){const n=o.locale,i=o.listView=new cE(n),r=typeof e=="function"?e():e;i.ariaLabel=t.ariaLabel,i.role=t.role,i.items.bindTo(r).using(s=>{if(s.type==="separator")return new dE(n);if(s.type==="button"||s.type==="switchbutton"){const a=new gu(n);let l;return l=s.type==="button"?new Ae(n):new hi(n),l.bind(...Object.keys(s.model)).to(s.model),l.delegate("execute").to(a),a.children.add(l),a}return null}),o.panelView.children.add(i),i.items.delegate("execute").to(o)}function Au(o,e){o.on("change:isOpen",()=>{if(!o.isOpen)return;const t=e();t&&(typeof t.focus=="function"?t.focus():Q("ui-dropdown-focus-child-on-open-child-missing-focus",{view:t}))},{priority:te.low-10})}function _u(o,e,t){const n=new qC(o.locale);return n.set({id:e,ariaDescribedById:t}),n.bind("isReadOnly").to(o,"isEnabled",i=>!i),n.bind("hasError").to(o,"errorText",i=>!!i),n.on("input",()=>{o.errorText=null}),o.bind("isEmpty","isFocused","placeholder").to(n),n}const Po=(o,e=0,t=1)=>o>t?t:oMath.round(t*o)/t,Vs=o=>(o[0]==="#"&&(o=o.substring(1)),o.length<6?{r:parseInt(o[0]+o[0],16),g:parseInt(o[1]+o[1],16),b:parseInt(o[2]+o[2],16),a:o.length===4?He(parseInt(o[3]+o[3],16)/255,2):1}:{r:parseInt(o.substring(0,2),16),g:parseInt(o.substring(2,4),16),b:parseInt(o.substring(4,6),16),a:o.length===8?He(parseInt(o.substring(6,8),16)/255,2):1}),gE=({h:o,s:e,v:t,a:n})=>{const i=(200-e)*t/100;return{h:He(o),s:He(i>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0),l:He(i/2),a:He(n,2)}},Ls=o=>{const{h:e,s:t,l:n}=gE(o);return`hsl(${e}, ${t}%, ${n}%)`},pE=({h:o,s:e,v:t,a:n})=>{o=o/360*6,e/=100,t/=100;const i=Math.floor(o),r=t*(1-e),s=t*(1-(o-i)*e),a=t*(1-(1-o+i)*e),l=i%6;return{r:He(255*[t,s,r,r,a,t][l]),g:He(255*[a,t,t,s,r,r][l]),b:He(255*[r,r,a,t,t,s][l]),a:He(n,2)}},Ri=o=>{const e=o.toString(16);return e.length<2?"0"+e:e},fE=({r:o,g:e,b:t,a:n})=>{const i=n<1?Ri(He(255*n)):"";return"#"+Ri(o)+Ri(e)+Ri(t)+i},kE=({r:o,g:e,b:t,a:n})=>{const i=Math.max(o,e,t),r=i-Math.min(o,e,t),s=r?i===o?(e-t)/r:i===e?2+(t-o)/r:4+(o-e)/r:0;return{h:He(60*(s<0?s+6:s)),s:He(i?r/i*100:0),v:He(i/255*100),a:n}},Cu=(o,e)=>{if(o===e)return!0;for(const t in o)if(o[t]!==e[t])return!1;return!0},vu={},yu=o=>{let e=vu[o];return e||(e=document.createElement("template"),e.innerHTML=o,vu[o]=e),e},js=(o,e,t)=>{o.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))};let qn=!1;const $s=o=>"touches"in o,Eu=(o,e)=>{const t=$s(e)?e.touches[0]:e,n=o.el.getBoundingClientRect();js(o.el,"move",o.getMove({x:Po((t.pageX-(n.left+window.pageXOffset))/n.width),y:Po((t.pageY-(n.top+window.pageYOffset))/n.height)}))};class xu{constructor(e,t,n,i){const r=yu(`
`);e.appendChild(r.content.cloneNode(!0));const s=e.querySelector(`[part=${t}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(qn?"touchmove":"mousemove",this),t(qn?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!(t=>!(qn&&!$s(t)||(qn||(qn=$s(t)),0)))(e)||!qn&&e.button!=0)return;this.el.focus(),Eu(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),Eu(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((t,n)=>{const i=n.keyCode;i>40||t.xy&&i<37||i<33||(n.preventDefault(),js(t.el,"move",t.getMove({x:i===39?.01:i===37?-.01:i===34?.05:i===33?-.05:i===35?1:i===36?-1:0,y:i===40?.01:i===38?-.01:0},!0)))})(this,e)}}style(e){e.forEach((t,n)=>{for(const i in t)this.nodes[n].style.setProperty(i,t[i])})}}class bE extends xu{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:e/360*100+"%",color:Ls({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${He(e)}`)}getMove(e,t){return{h:t?Po(this.h+360*e.x,0,360):360*e.x}}}class wE extends xu{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:100-e.v+"%",left:`${e.s}%`,color:Ls(e)},{"background-color":Ls({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${He(e.s)}%, Brightness ${He(e.v)}%`)}getMove(e,t){return{s:t?Po(this.hsva.s+100*e.x,0,100):100*e.x,v:t?Po(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const Oi=Symbol("same"),Hs=Symbol("color"),Su=Symbol("hsva"),qs=Symbol("update"),Du=Symbol("parts"),Bu=Symbol("css"),Tu=Symbol("sliders");class AE extends HTMLElement{static get observedAttributes(){return["color"]}get[Bu](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[Tu](){return[wE,bE]}get color(){return this[Hs]}set color(e){if(!this[Oi](e)){const t=this.colorModel.toHsva(e);this[qs](t),this[Hs]=e}}constructor(){super();const e=yu(``),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[Du]=this[Tu].map(n=>new n(t))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,n){const i=this.colorModel.fromAttr(n);this[Oi](i)||(this.color=i)}handleEvent(e){const t=this[Su],n={...t,...e.detail};let i;this[qs](n),Cu(n,t)||this[Oi](i=this.colorModel.fromHsva(n))||(this[Hs]=i,js(this,"color-changed",{value:i}))}[Oi](e){return this.color&&this.colorModel.equal(e,this.color)}[qs](e){this[Su]=e,this[Du].forEach(t=>t.update(e))}}const _E={defaultColor:"#000",toHsva:o=>kE(Vs(o)),fromHsva:({h:o,s:e,v:t})=>fE(pE({h:o,s:e,v:t,a:1})),equal:(o,e)=>o.toLowerCase()===e.toLowerCase()||Cu(Vs(o),Vs(e)),fromAttr:o=>o};class CE extends AE{get colorModel(){return _E}}customElements.define("hex-color-picker",class extends CE{});var Iu=D(3398),vE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Iu.Z,vE),Iu.Z.locals;class yE{constructor(e){this._components=new Map,this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(Us(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new I("componentfactory-item-missing",this,{name:e});return this._components.get(Us(e)).callback(this.editor.locale)}has(e){return this._components.has(Us(e))}}function Us(o){return String(o).toLowerCase()}var Pu=D(8793),EE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Pu.Z,EE),Pu.Z.locals;var xE=Object.defineProperty,Ru=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,DE=Object.prototype.propertyIsEnumerable,Ou=(o,e,t)=>e in o?xE(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,le=(o,e)=>{for(var t in e||(e={}))SE.call(e,t)&&Ou(o,t,e[t]);if(Ru)for(var t of Ru(e))DE.call(e,t)&&Ou(o,t,e[t]);return o};const Nu=Lr("px"),zu=oe.document.body,Ws=class extends re{constructor(o){super(o);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>`ck-balloon-panel_${t}`),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",Nu),left:e.to("left",Nu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(o){this.show();const e=Ws.defaultPositions,t=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast,e.viewportStickyNorth],limiter:zu,fitInViewport:!0},o),n=Ws._getOptimalPosition(t),i=parseInt(n.left),r=parseInt(n.top),s=n.name,a=n.config||{},{withArrow:l=!0}=a;this.top=r,this.left=i,this.position=s,this.withArrow=l}pin(o){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(o):this._stopPinning()},this._startPinning(o),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(o){this.attachTo(o);const e=Ks(o.target),t=o.limiter?Ks(o.limiter):zu;this.listenTo(oe.document,"scroll",(n,i)=>{const r=i.target,s=e&&r.contains(e),a=t&&r.contains(t);!s&&!a&&e&&t||this.attachTo(o)},{useCapture:!0}),this.listenTo(oe.window,"resize",()=>{this.attachTo(o)})}_stopPinning(){this.stopListening(oe.document,"scroll"),this.stopListening(oe.window,"resize")}};let Qe=Ws;function Ks(o){return Rn(o)?o:ii(o)?o.commonAncestorContainer:typeof o=="function"?Ks(o()):null}function Mu(o={}){const{sideOffset:e=Qe.arrowSideOffset,heightOffset:t=Qe.arrowHeightOffset,stickyVerticalOffset:n=Qe.stickyVerticalOffset,config:i}=o;return{northWestArrowSouthWest:(a,l)=>le({top:r(a,l),left:a.left-e,name:"arrow_sw"},i&&{config:i}),northWestArrowSouthMiddleWest:(a,l)=>le({top:r(a,l),left:a.left-.25*l.width-e,name:"arrow_smw"},i&&{config:i}),northWestArrowSouth:(a,l)=>le({top:r(a,l),left:a.left-l.width/2,name:"arrow_s"},i&&{config:i}),northWestArrowSouthMiddleEast:(a,l)=>le({top:r(a,l),left:a.left-.75*l.width+e,name:"arrow_sme"},i&&{config:i}),northWestArrowSouthEast:(a,l)=>le({top:r(a,l),left:a.left-l.width+e,name:"arrow_se"},i&&{config:i}),northArrowSouthWest:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-e,name:"arrow_sw"},i&&{config:i}),northArrowSouthMiddleWest:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-.25*l.width-e,name:"arrow_smw"},i&&{config:i}),northArrowSouth:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-l.width/2,name:"arrow_s"},i&&{config:i}),northArrowSouthMiddleEast:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-.75*l.width+e,name:"arrow_sme"},i&&{config:i}),northArrowSouthEast:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-l.width+e,name:"arrow_se"},i&&{config:i}),northEastArrowSouthWest:(a,l)=>le({top:r(a,l),left:a.right-e,name:"arrow_sw"},i&&{config:i}),northEastArrowSouthMiddleWest:(a,l)=>le({top:r(a,l),left:a.right-.25*l.width-e,name:"arrow_smw"},i&&{config:i}),northEastArrowSouth:(a,l)=>le({top:r(a,l),left:a.right-l.width/2,name:"arrow_s"},i&&{config:i}),northEastArrowSouthMiddleEast:(a,l)=>le({top:r(a,l),left:a.right-.75*l.width+e,name:"arrow_sme"},i&&{config:i}),northEastArrowSouthEast:(a,l)=>le({top:r(a,l),left:a.right-l.width+e,name:"arrow_se"},i&&{config:i}),southWestArrowNorthWest:a=>le({top:s(a),left:a.left-e,name:"arrow_nw"},i&&{config:i}),southWestArrowNorthMiddleWest:(a,l)=>le({top:s(a),left:a.left-.25*l.width-e,name:"arrow_nmw"},i&&{config:i}),southWestArrowNorth:(a,l)=>le({top:s(a),left:a.left-l.width/2,name:"arrow_n"},i&&{config:i}),southWestArrowNorthMiddleEast:(a,l)=>le({top:s(a),left:a.left-.75*l.width+e,name:"arrow_nme"},i&&{config:i}),southWestArrowNorthEast:(a,l)=>le({top:s(a),left:a.left-l.width+e,name:"arrow_ne"},i&&{config:i}),southArrowNorthWest:a=>le({top:s(a),left:a.left+a.width/2-e,name:"arrow_nw"},i&&{config:i}),southArrowNorthMiddleWest:(a,l)=>le({top:s(a),left:a.left+a.width/2-.25*l.width-e,name:"arrow_nmw"},i&&{config:i}),southArrowNorth:(a,l)=>le({top:s(a),left:a.left+a.width/2-l.width/2,name:"arrow_n"},i&&{config:i}),southArrowNorthMiddleEast:(a,l)=>le({top:s(a),left:a.left+a.width/2-.75*l.width+e,name:"arrow_nme"},i&&{config:i}),southArrowNorthEast:(a,l)=>le({top:s(a),left:a.left+a.width/2-l.width+e,name:"arrow_ne"},i&&{config:i}),southEastArrowNorthWest:a=>le({top:s(a),left:a.right-e,name:"arrow_nw"},i&&{config:i}),southEastArrowNorthMiddleWest:(a,l)=>le({top:s(a),left:a.right-.25*l.width-e,name:"arrow_nmw"},i&&{config:i}),southEastArrowNorth:(a,l)=>le({top:s(a),left:a.right-l.width/2,name:"arrow_n"},i&&{config:i}),southEastArrowNorthMiddleEast:(a,l)=>le({top:s(a),left:a.right-.75*l.width+e,name:"arrow_nme"},i&&{config:i}),southEastArrowNorthEast:(a,l)=>le({top:s(a),left:a.right-l.width+e,name:"arrow_ne"},i&&{config:i}),westArrowEast:(a,l)=>le({top:a.top+a.height/2-l.height/2,left:a.left-l.width-t,name:"arrow_e"},i&&{config:i}),eastArrowWest:(a,l)=>le({top:a.top+a.height/2-l.height/2,left:a.right+t,name:"arrow_w"},i&&{config:i}),viewportStickyNorth:(a,l,c)=>a.getIntersection(c)?{top:c.top+n,left:a.left+a.width/2-l.width/2,name:"arrowless",config:le({withArrow:!1},i)}:null};function r(a,l){return a.top-l.height-t}function s(a){return a.bottom+t}}Qe.arrowSideOffset=25,Qe.arrowHeightOffset=10,Qe.stickyVerticalOffset=20,Qe._getOptimalPosition=vc,Qe.defaultPositions=Mu();var Fu=D(3332),BE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Fu.Z,BE),Fu.Z.locals;const Vu="ck-tooltip",Xe=class extends $t(){constructor(o){if(super(),this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver=null,Xe._editors.add(o),Xe._instance)return Xe._instance;Xe._instance=this,this.tooltipTextView=new re(o.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 Qe(o.locale),this.balloonPanelView.class=Vu,this.balloonPanelView.content.add(this.tooltipTextView),this._pinTooltipDebounced=vo(this._pinTooltip,600),this.listenTo(oe.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(oe.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(oe.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(oe.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(oe.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(o){const e=o.ui.view&&o.ui.view.body;Xe._editors.delete(o),this.stopListening(o.ui),e&&e.has(this.balloonPanelView)&&e.remove(this.balloonPanelView),Xe._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Xe._instance=null)}static getPositioningFunctions(o){const e=Xe.defaultBalloonPositions;return{s:[e.southArrowNorth,e.southArrowNorthEast,e.southArrowNorthWest],n:[e.northArrowSouth],e:[e.eastArrowWest],w:[e.westArrowEast],sw:[e.southArrowNorthEast],se:[e.southArrowNorthWest]}[o]}_onEnterOrFocus(o,{target:e}){const t=Gs(e);var n;t&&t!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(t,{text:(n=t).dataset.ckeTooltipText,position:n.dataset.ckeTooltipPosition||"s",cssClass:n.dataset.ckeTooltipClass||""}))}_onLeaveOrBlur(o,{target:e,relatedTarget:t}){if(o.name==="mouseleave"){if(!Rn(e)||this._currentElementWithTooltip&&e!==this._currentElementWithTooltip)return;const n=Gs(e),i=Gs(t);n&&n!==i&&this._unpinTooltip()}else{if(this._currentElementWithTooltip&&e!==this._currentElementWithTooltip)return;this._unpinTooltip()}}_onScroll(o,{target:e}){this._currentElementWithTooltip&&(e.contains(this.balloonPanelView.element)&&e.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(o,{text:e,position:t,cssClass:n}){const i=ze(Xe._editors.values()).ui.view.body;i.has(this.balloonPanelView)||i.add(this.balloonPanelView),this.tooltipTextView.text=e,this.balloonPanelView.pin({target:o,positions:Xe.getPositioningFunctions(t)}),this._resizeObserver=new si(o,()=>{on(o)||this._unpinTooltip()}),this.balloonPanelView.class=[Vu,n].filter(r=>r).join(" ");for(const r of Xe._editors)this.listenTo(r.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=o,this._currentTooltipPosition=t}_unpinTooltip(){this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const o of Xe._editors)this.stopListening(o.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver&&this._resizeObserver.destroy()}_updateTooltipPosition(){on(this._currentElementWithTooltip)?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Xe.getPositioningFunctions(this._currentTooltipPosition)}):this._unpinTooltip()}};let Ni=Xe;function Gs(o){return Rn(o)?o.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}Ni.defaultBalloonPositions=Mu({heightOffset:5,sideOffset:13}),Ni._editors=new Set,Ni._instance=null;const Zs=function(o,e,t){var n=!0,i=!0;if(typeof o!="function")throw new TypeError("Expected a function");return xe(t)&&(n="leading"in t?!!t.leading:n,i="trailing"in t?!!t.trailing:i),vo(o,e,{leading:n,maxWait:e,trailing:i})};var TE=Object.defineProperty,Lu=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,PE=Object.prototype.propertyIsEnumerable,ju=(o,e,t)=>e in o?TE(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,RE=(o,e)=>{for(var t in e||(e={}))IE.call(e,t)&&ju(o,t,e[t]);if(Lu)for(var t of Lu(e))PE.call(e,t)&&ju(o,t,e[t]);return o};const OE=50,NE=350,zE="Powered by",zi={top:-99999,left:-99999,name:"invalid",config:{withArrow:!1}};class ME extends $t(){constructor(e){super(),this.editor=e,this._balloonView=null,this._lastFocusedEditableElement=null,this._showBalloonThrottled=Zs(this._showBalloon.bind(this),50,{leading:!0}),e.on("ready",this._handleEditorReady.bind(this))}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;(function(t){function n(f){return f.match(/^[a-zA-Z0-9+/=$]+$/g)&&f.length>=40&&f.length<=255?"VALID":"INVALID"}let i="",r="";if(!t)return"INVALID";try{i=atob(t)}catch{return"INVALID"}const s=i.split("-"),a=s[0],l=s[1];if(!l)return n(t);try{atob(l)}catch{try{if(atob(a),!atob(a).length)return n(t)}catch{return n(t)}}if(a.length<40||a.length>255)return"INVALID";try{atob(a)}catch{return"INVALID"}try{r=atob(l)}catch{return"INVALID"}if(r.length!==8)return"INVALID";const c=Number(r.substring(0,4)),d=Number(r.substring(4,6))-1,u=Number(r.substring(6,8)),g=new Date(c,d,u);return g{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,n,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_createBalloonView(){const e=this.editor,t=this._balloonView=new Qe,n=Hu(e),i=new FE(e.locale,n.label);t.content.add(i),t.set({class:"ck-powered-by-balloon"}),e.ui.view.body.add(t),e.ui.focusTracker.add(t.element),this._balloonView=t}_showBalloon(){if(!this._lastFocusedEditableElement)return;const e=function(t,n){const i=Hu(t),r=i.side==="right"?function(s,a){return $u(s,a,(l,c)=>l.left+l.width-c.width-a.horizontalOffset)}(n,i):function(s,a){return $u(s,a,l=>l.left+a.horizontalOffset)}(n,i);return{target:n,positions:[r]}}(this.editor,this._lastFocusedEditableElement);e&&(this._balloonView||this._createBalloonView(),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,n=e.ui.focusTracker.focusedElement;if(!t||!n)return void(this._lastFocusedEditableElement=null);const i=Array.from(e.ui.getEditableElementsNames()).map(r=>e.ui.getEditableElement(r));i.includes(n)?this._lastFocusedEditableElement=n:this._lastFocusedEditableElement=i[0]}}class FE extends re{constructor(e,t){super(e);const n=new ko,i=this.bindTemplate;n.set({content:` -`,isColorInherited:!1}),n.extendTemplate({attributes:{style:{width:"53px",height:"10px"}}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],n],on:{dragstart:i.to(r=>r.preventDefault())}}]})}}function $u(o,e,t){return(n,i)=>{const r=n.getVisible();if(!r||n.widthc.bottom)return zi}}return{top:s,left:a,name:`position_${e.position}-side_${e.side}`,config:{withArrow:!1}}}}function Hu(o){const e=o.config.get("ui.poweredBy"),t=e&&e.position||"border";return RE({position:t,label:zE,verticalOffset:t==="inside"?5:0,horizontalOffset:5,side:o.locale.contentLanguageDirection==="ltr"?"right":"left"},e)}class VE extends ge(){constructor(e){super(),this.isReady=!1,this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this.editor=e,this.componentFactory=new yE(e),this.focusTracker=new ht,this.tooltipManager=new Ni(e),this.poweredBy=new ME(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",()=>{this.isReady=!0}),this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update()),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const n=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?n():this.once("ready",n)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const n=e.config.get("toolbar.viewportTopOffset");return n?(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:n}):{top:0}}_initFocusTracking(){const e=this.editor,t=e.editing.view;let n,i;e.keystrokes.set("Alt+F10",(r,s)=>{const a=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(a)&&!Array.from(t.domRoots.values()).includes(a)&&(n=a);const l=this._getCurrentFocusedToolbarDefinition();l&&i||(i=this._getFocusableCandidateToolbarDefinitions());for(let c=0;c{const a=this._getCurrentFocusedToolbarDefinition();a&&(n?(n.focus(),n=null):e.editing.view.focus(),a.options.afterBlur&&a.options.afterBlur(),s())})}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:n,options:i}=t;(on(n.element)||i.beforeFocus)&&e.push(t)}return e.sort((t,n)=>qu(t)-qu(n)),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:n}}=e;return n&&n(),!!on(t.element)&&(t.focus(),!0)}}function qu(o){const{toolbarView:e,options:t}=o;let n=10;return on(e.element)&&n--,t.isContextual&&n--,n}var Uu=D(9688),LE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Uu.Z,LE),Uu.Z.locals;class jE extends re{constructor(e){super(e),this.body=new NC(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class $E extends jE{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 Yc;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class HE extends re{constructor(e,t,n){super(e),this.name=null,this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(n){e.change(i=>{const r=e.document.getRoot(n.name);i.addClass(n.isFocused?"ck-focused":"ck-blurred",r),i.removeClass(n.isFocused?"ck-blurred":"ck-focused",r)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(r,s,a)=>{a?n(i):t(i)})}(this):t(this)}}class qE extends HE{constructor(e,t,n,i={}){super(e,t,n);const r=e.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=i.label||(()=>r("Editor editing area: %0",this.name))}render(){super.render();const e=this._editingView;e.change(t=>{const n=e.document.getRoot(this.name);t.setAttribute("aria-label",this._generateLabel(this),n)})}}var Wu=D(8847),UE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Wu.Z,UE),Wu.Z.locals;class Ku extends ui{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Js extends ge(){constructor(e,t){super(),t&&Wd(this,t),e&&this.set(e)}}var Gu=D(4650),WE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Gu.Z,WE),Gu.Z.locals;var Zu=D(7676),KE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Zu.Z,KE),Zu.Z.locals;const Mi=Lr("px");class Fi extends q{constructor(e){super(e),this._viewToStack=new Map,this._idToStack=new Map,this._view=null,this._rotatorView=null,this._fakePanelsView=null,this.positionLimiter=()=>{const t=this.editor.editing.view,n=t.document.selection.editableElement;return n?t.domConverter.mapViewToDom(n.root):null},this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}static get pluginName(){return"ContextualBalloon"}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 I("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new I("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._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new I("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new Qe(this.editor.locale),this.editor.ui.view.body.add(this._view),this.editor.ui.focusTracker.add(this._view.element),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new GE(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,i)=>!i&&n>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,i)=>{if(i<2)return"";const r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[r,i])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new ZE(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,n)=>!n&&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:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}}class GE extends re{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new ht,this.buttonPrevView=this._createButtonView(t("Previous"),''),this.buttonNextView=this._createButtonView(t("Next"),''),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",n.to("isNavigationVisible",i=>i?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.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 n=new Ae(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class ZE extends re{constructor(e,t){super(e);const n=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",n.to("numberOfPanels",i=>i?"":"ck-hidden")],style:{top:n.to("top",Mi),left:n.to("left",Mi),width:n.to("width",Mi),height:n.to("height",Mi)}},children:this.content}),this.on("change:numberOfPanels",(i,r,s,a)=>{s>a?this._addPanels(s-a):this._removePanels(a-s),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new re;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:n,height:i}=new De(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}var Ju=D(5868),JE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Ju.Z,JE),Ju.Z.locals;const Ro=Lr("px");class YE extends re{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("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new bt({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",n=>n?"block":"none"),height:t.to("isSticky",n=>n?Ro(this._panelRect.height):null)}}}).render(),this._contentPanel=new bt({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",n=>n?Ro(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",n=>n?Ro(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",n=>n?Ro(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(oe.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.topt||0),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement;let r;const s=e.config.get("placeholder");s&&(r=typeof s=="string"?s:s[this.view.editable.name]),!r&&i&&i.tagName.toLowerCase()==="textarea"&&(r=i.getAttribute("placeholder")),r&&function({view:a,element:l,text:c,isDirectHost:d=!0,keepOnFocus:u=!1}){const g=a.document;mi.has(g)||(mi.set(g,new Map),g.registerPostFixer(f=>Qr(g,f)),g.on("change:isComposing",()=>{a.change(f=>Qr(g,f))},{priority:"high"})),mi.get(g).set(l,{text:c,isDirectHost:d,keepOnFocus:u,hostElement:d?l:null}),a.change(f=>Qr(g,f))}({view:t,element:n,text:r,isDirectHost:!1,keepOnFocus:!0})}}var Qu=D(3143),e2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Qu.Z,e2),Qu.Z.locals;class t2 extends $E{constructor(e,t,n={}){super(e),this.stickyPanel=new YE(e),this.toolbar=new zs(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new qE(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Xu{constructor(e){if(this.crashes=[],this.state="initializing",this._now=Date.now,this.crashes=[],this._crashNumberLimit=typeof e.crashNumberLimit=="number"?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod=typeof e.minimumNonErrorTimePeriod=="number"?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=t=>{const n="error"in t?t.error:t.reason;n instanceof Error&&this._handleError(n,t)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter(n=>n!==t)}_fire(e,...t){const n=this._listeners[e]||[];for(const i of n)i.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const n=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:n}),n?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&e.context!==void 0&&e.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(e)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit?!0:(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function Ys(o,e=new Set){const t=[o],n=new Set;let i=0;for(;t.length>i;){const r=t[i++];if(!n.has(r)&&n2(r)&&!e.has(r))if(n.add(r),Symbol.iterator in r)try{for(const s of r)t.push(s)}catch{}else for(const s in r)s!=="defaultValue"&&t.push(r[s])}return n}function n2(o){const e=Object.prototype.toString.call(o),t=typeof o;return!(t==="number"||t==="boolean"||t==="string"||t==="symbol"||t==="function"||e==="[object Date]"||e==="[object RegExp]"||e==="[object Module]"||o==null||o._watchdogExcluded||o instanceof EventTarget||o instanceof Event)}function em(o,e,t=new Set){if(o===e&&typeof(n=o)=="object"&&n!==null)return!0;var n;const i=Ys(o,t),r=Ys(e,t);for(const s of i)if(r.has(s))return!0;return!1}class tm extends Xu{constructor(e,t={}){super(t),this._editor=null,this._throttledSave=Zs(this._save.bind(this),typeof t.saveInterval=="number"?t.saveInterval:5e3),e&&(this._creator=(n,i)=>e.create(n,i)),this._destructor=n=>n.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(e=>{console.error("An error happened during the editor destroying.",e)}).then(()=>{if(typeof this._elementOrData=="string")return this.create(this._data,this._config,this._config.context);{const e=Object.assign({},this._config,{initialData:this._data});return this.create(this._elementOrData,e,e.context)}}).then(()=>{this._fire("restart")})}create(e=this._elementOrData,t=this._config,n){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=e,this._config=this._cloneEditorConfiguration(t)||{},this._config.context=n,this._creator(e,this._config))).then(i=>{this._editor=i,i.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=i.model.document.version,this._data=this._getData(),this.state="ready",this._fire("stateChange")})}destroy(){return Promise.resolve().then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.flush();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)})}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._lastDocumentVersion=e}catch(t){console.error(t,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e={};for(const t of this._editor.model.document.getRootNames())e[t]=this._editor.data.get({rootName:t});return e}_isErrorComingFromThisItem(e){return em(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return Fr(e,(t,n)=>Rn(t)||n==="context"?t:void 0)}}const Oo=Symbol("MainQueueId");class o2{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._activeActions=0}onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const n=e===Oo;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const i=(n?Promise.all(this._queues.values()):Promise.all([this._queues.get(Oo),this._queues.get(e)])).then(t),r=i.catch(()=>{});return this._queues.set(e,r),i.finally(()=>{this._activeActions--,this._queues.get(e)===r&&this._activeActions===0&&this._onEmptyCallbacks.forEach(s=>s())})}}function nm(o){return Array.isArray(o)?o:[o]}class Vi extends Ti(Ns(nE)){constructor(e,t={}){if(!Li(e)&&t.initialData!==void 0)throw new I("editor-create-initial-data",null);super(t),this.config.get("initialData")===void 0&&this.config.set("initialData",function(r){return Li(r)?(s=r,s instanceof HTMLTextAreaElement?s.value:s.innerHTML):r;var s}(e)),Li(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new t2(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new XE(this,i),function(r){if(!Xt(r.updateSourceElement))throw new I("attachtoform-missing-elementapi-interface",r);const s=r.sourceElement;if(function(a){return!!a&&a.tagName.toLowerCase()==="textarea"}(s)&&s.form){let a;const l=s.form,c=()=>r.updateSourceElement();Xt(l.submit)&&(a=l.submit,l.submit=()=>{c(),a.apply(l)}),l.addEventListener("submit",c),r.on("destroy",()=>{l.removeEventListener("submit",c),a&&(l.submit=a)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(Li(e)?e:null)).then(()=>i.data.init(i.config.get("initialData"))).then(()=>i.fire("ready")).then(()=>i))})}}function Li(o){return Rn(o)}Vi.Context=dd,Vi.EditorWatchdog=tm,Vi.ContextWatchdog=class extends Xu{constructor(o,e={}){super(e),this._watchdogs=new Map,this._context=null,this._contextProps=new Set,this._actionQueues=new o2,this._watchdogConfig=e,this._creator=t=>o.create(t),this._destructor=t=>t.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(o){this._creator=o}setDestructor(o){this._destructor=o}get context(){return this._context}create(o={}){return this._actionQueues.enqueue(Oo,()=>(this._contextConfig=o,this._create()))}getItem(o){return this._getWatchdog(o)._item}getItemState(o){return this._getWatchdog(o).state}add(o){const e=nm(o);return Promise.all(e.map(t=>this._actionQueues.enqueue(t.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let n;if(this._watchdogs.has(t.id))throw new Error(`Item with the given id is already added: '${t.id}'.`);if(t.type==="editor")return n=new tm(null,this._watchdogConfig),n.setCreator(t.creator),n._setExcludedProperties(this._contextProps),t.destructor&&n.setDestructor(t.destructor),this._watchdogs.set(t.id,n),n.on("error",(i,{error:r,causesRestart:s})=>{this._fire("itemError",{itemId:t.id,error:r}),s&&this._actionQueues.enqueue(t.id,()=>new Promise(a=>{const l=()=>{n.off("restart",l),this._fire("itemRestart",{itemId:t.id}),a()};n.on("restart",l)}))}),n.create(t.sourceElementOrData,t.config,this._context);throw new Error(`Not supported item type: '${t.type}'.`)})))}remove(o){const e=nm(o);return Promise.all(e.map(t=>this._actionQueues.enqueue(t,()=>{const n=this._getWatchdog(t);return this._watchdogs.delete(t),n.destroy()})))}destroy(){return this._actionQueues.enqueue(Oo,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(Oo,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(o=>{console.error("An error happened during destroying the context or items.",o)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(o=>(this._context=o,this._contextProps=Ys(this._context),Promise.all(Array.from(this._watchdogs.values()).map(e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const o=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(e=>e.destroy())).then(()=>this._destructor(o))})}_getWatchdog(o){const e=this._watchdogs.get(o);if(!e)throw new Error(`Item with the given id was not registered: ${o}.`);return e}_isErrorComingFromThisItem(o){for(const e of this._watchdogs.values())if(e._isErrorComingFromThisItem(o))return!1;return em(this._context,o.context)}};class Qs extends Ht{constructor(e){super(e),this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];const t=this.document;function n(i){return(r,s)=>{s.preventDefault();const a=s.dropRange?[s.dropRange]:null,l=new $(t,i);t.fire(l,{dataTransfer:s.dataTransfer,method:r.name,targetRanges:a,target:s.target,domEvent:s.domEvent}),l.stop.called&&s.stopPropagation()}}this.listenTo(t,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",n("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,n=e.type=="drop"||e.type=="paste",i={dataTransfer:new th(t,{cacheFiles:n})};e.type!="drop"&&e.type!="dragover"||(i.dropRange=function(r,s){const a=s.target.ownerDocument,l=s.clientX,c=s.clientY;let d;return a.caretRangeFromPoint&&a.caretRangeFromPoint(l,c)?d=a.caretRangeFromPoint(l,c):s.rangeParent&&(d=a.createRange(),d.setStart(s.rangeParent,s.rangeOffset),d.collapse(!0)),d?r.domConverter.domRangeToView(d):null}(this.view,e)),this.fire(e.type,e,i)}}const om=["figcaption","li"];function im(o){let e="";if(o.is("$text")||o.is("$textProxy"))e=o.data;else if(o.is("element","img")&&o.hasAttribute("alt"))e=o.getAttribute("alt");else if(o.is("element","br"))e=` +`)){const l=s.split(/\n{1,2}/g);let c=a;for(let d=0;d{if(this.isEnabled&&((i=n.keyCode)==se.arrowright||i==se.arrowleft||i==se.arrowup||i==se.arrowdown)){const r=new Fn(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(r,n),r.stop.called&&t.stop()}var i})}observe(){}stopObserving(){}}class wy extends Ct{constructor(e){super(e);const t=this.document;t.on("keydown",(n,i)=>{if(!this.isEnabled||i.keyCode!=se.tab||i.ctrlKey)return;const r=new Fn(t,"tab",t.selection.getFirstRange());t.fire(r,i),r.stop.called&&n.stop()})}observe(){}stopObserving(){}}class Ay extends ge(){constructor(e){super(),this.domRoots=new Map,this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this.document=new Dd(e),this.domConverter=new $d(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Mv(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new Bd(this.document),this.addObserver(eh),this.addObserver(Cs),this.addObserver(py),this.addObserver(qv),this.addObserver(ty),this.addObserver(fy),this.addObserver(by),this.addObserver(ky),this.addObserver(wy),this.document.on("arrowKey",Nv,{priority:"low"}),Tv(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:s,value:a}of Array.from(e.attributes))i[s]=a,s==="class"?this._writer.addClass(a.split(" "),n):this._writer.setAttribute(s,a,n);this._initialDomRootAttributes.set(e,i);const r=()=>{this._writer.setAttribute("contenteditable",(!n.isReadOnly).toString(),n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};r(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(s,a)=>this._renderer.markToSync("children",a)),n.on("change:attributes",(s,a)=>this._renderer.markToSync("attributes",a)),n.on("change:text",(s,a)=>this._renderer.markToSync("text",a)),n.on("change:isReadOnly",()=>this.change(r)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const s of this._observers.values())s.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:i})=>t.removeAttribute(i));const n=this._initialDomRootAttributes.get(t);for(const i in n)t.setAttribute(i,n[i]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const i of this._observers.values())i.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[n,i]of this.domRoots)t.observe(i,n);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:n=20,ancestorOffset:i=20}={}){const r=this.document.selection.getFirstRange();r&&function({target:s,viewportOffset:a=0,ancestorOffset:l=0,alignToTop:c,forceScroll:d}){const u=Hr(s);let g=u,f=null;for(;g;){let b;b=_C(g==u?s:f),AC({parent:b,getRect:()=>Tc(s,g),alignToTop:c,ancestorOffset:l,forceScroll:d});const A=Tc(s,g);if(wC({window:g,rect:A,viewportOffset:a,alignToTop:c,forceScroll:d}),g.parent!=g){if(f=g.frameElement,g=g.parent,!f)return}else g=null}}({target:this.domConverter.viewRangeToDom(r),viewportOffset:n,ancestorOffset:i,alignToTop:e,forceScroll:t})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new I("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(t){I.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(Cs).flush(),this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return U._createAt(e,t)}createPositionAfter(e){return U._createAfter(e)}createPositionBefore(e){return U._createBefore(e)}createRange(e,t){return new X(e,t)}createRangeOn(e){return X._createOn(e)}createRangeIn(e){return X._createIn(e)}createSelection(...e){return new At(...e)}_disableRendering(e){this._renderingDisabled=e,e==0&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class qt{is(){throw new Error("is() method is abstract")}}class un extends qt{constructor(e){super(),this.parent=null,this._attrs=Dt(e)}get document(){return null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))===null)throw new I("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if((e=this.parent.getChildStartOffset(this))===null)throw new I("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.parent!==null&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Ue(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i](t[n[0]]=n[1],t),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Dt(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}un.prototype.is=function(o){return o==="node"||o==="model:node"};class yo{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((n,i)=>n+i.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new I("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&e1e4)return n.slice(0,r).concat(i).concat(n.slice(r+s,n.length));{const a=Array.from(n);return a.splice(r,s,...i),a}}(this._nodes,Array.from(t),e,0)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map(e=>e.toJSON())}}class fe extends un{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new fe(this.data,this.getAttributes())}static fromJSON(e){return new fe(e.data,e.attributes)}}fe.prototype.is=function(o){return o==="$text"||o==="model:$text"||o==="text"||o==="model:text"||o==="node"||o==="model:node"};class ut extends qt{constructor(e,t,n){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new I("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new I("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}ut.prototype.is=function(o){return o==="$textProxy"||o==="model:$textProxy"||o==="textProxy"||o==="model:textProxy"};class ke extends un{constructor(e,t,n){super(t),this._children=new yo,this.name=e,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(n=>n._clone(!0)):void 0;return new ke(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new fe(i)]:(et(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new fe(r):r instanceof ut?new fe(r.data,r.getAttributes()):r))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}static fromJSON(e){let t;if(e.children){t=[];for(const n of e.children)n.name?t.push(ke.fromJSON(n)):t.push(fe.fromJSON(n))}return new ke(e.name,e.attributes,t)}}ke.prototype.is=function(o,e){return e?e===this.name&&(o==="element"||o==="model:element"):o==="element"||o==="model:element"||o==="node"||o==="model:node"};class vt{constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new I("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if(t!="forward"&&t!="backward")throw new I("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=H._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,n,i,r;do i=this.position,r=this._visitedParent,{done:t,value:n}=this.next();while(!t&&e(n));t||(this._position=i,this._visitedParent=r)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===n.maxOffset)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const i=Eo(t,n),r=i||oh(t,n,i);if(r instanceof ke)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=r),this._position=t,mn("elementStart",r,e,t,1);if(r instanceof fe){let s;if(this.singleCharacters)s=1;else{let c=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsetd&&(d=this.boundaries.start.offset),a=t.offset-d}const l=t.offset-s.startOffset,c=new ut(s,l-a,a);return t.offset-=a,this._position=t,mn("text",c,e,t,a)}return t.path.pop(),this._position=t,this._visitedParent=n.parent,mn("elementStart",n,e,t,1)}}function mn(o,e,t,n,i){return{done:!1,value:{type:o,item:e,previousPosition:t,nextPosition:n,length:i}}}class H extends qt{constructor(e,t,n="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new I("model-position-root-invalid",e);if(!(t instanceof Array)||t.length===0)throw new I("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t1)return!1;if(i===1)return rh(e,this,n);if(i===-1)return rh(this,e,n)}return this.path.length===e.path.length||(this.path.length>e.path.length?vs(this.path,t):vs(e.path,t))}hasSameParentAs(e){return this.root!==e.root?!1:Ue(this.getParentPath(),e.getParentPath())=="same"}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=H._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?H._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=H._createAt(this);if(this.root!=e.root)return n;if(Ue(e.getParentPath(),this.getParentPath())=="same"){if(e.offsetthis.offset)return null;n.offset-=t}}else if(Ue(e.getParentPath(),this.getParentPath())=="prefix"){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=H._createAt(this);if(this.root!=e.root)return n;if(Ue(e.getParentPath(),this.getParentPath())=="same")(e.offset=i;){if(n.path[s]+a!==r.maxOffset)return!1;a=1,s--,r=r.parent}return!0}(o,t+1)}function vs(o,e){for(;et+1;){const r=i.maxOffset-n.offset;r!==0&&e.push(new V(n,n.getShiftedBy(r))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const r=this.end.path[n.path.length-1],s=r-n.offset;s!==0&&e.push(new V(n,n.getShiftedBy(s))),n.offset=r,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new vt(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new vt(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new vt(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new V(this.start,this.end)]}getTransformedByOperations(e){const t=[new V(this.start,this.end)];for(const n of e)for(let i=0;i0?new this(n,i):new this(i,n)}static _createIn(e){return new this(H._createAt(e,0),H._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(H._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0)throw new I("range-create-from-ranges-empty-array",null);if(e.length==1)return e[0].clone();const t=e[0];e.sort((r,s)=>r.start.isAfter(s.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let r=n-1;e[r].end.isEqual(i.start);r++)i.start=H._createAt(e[r].start);for(let r=n+1;r{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);if(!n)throw new I("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),r=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=H._createAt(i,r)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const n=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const i of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(i);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(n)==e&&this._modelToViewMapping.delete(n))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),n.size==0&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),i.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new V(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new X(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const i of t)if(i.is("attributeElement"))for(const r of i.getElementsWithSameId())n.add(r);else n.add(i);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let i=0;for(let r=0;r1?e[0]+":"+e[1]:e[0]}var Cy=Object.defineProperty,vy=Object.defineProperties,yy=Object.getOwnPropertyDescriptors,ah=Object.getOwnPropertySymbols,Ey=Object.prototype.hasOwnProperty,xy=Object.prototype.propertyIsEnumerable,lh=(o,e,t)=>e in o?Cy(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,ys=(o,e)=>{for(var t in e||(e={}))Ey.call(e,t)&&lh(o,t,e[t]);if(ah)for(var t of ah(e))xy.call(e,t)&&lh(o,t,e[t]);return o},ch=(o,e)=>vy(o,yy(e));class dh extends me(){constructor(e){super(),this._conversionApi=ys({dispatcher:this},e),this._firedEventsMap=new WeakMap}convertChanges(e,t,n){const i=this._createConversionApi(n,e.getRefreshedItems());for(const s of e.getMarkersToRemove())this._convertMarkerRemove(s.name,s.range,i);const r=this._reduceChanges(e.getChanges());for(const s of r)s.type==="insert"?this._convertInsert(V._createFromPositionAndShift(s.position,s.length),i):s.type==="reinsert"?this._convertReinsert(V._createFromPositionAndShift(s.position,s.length),i):s.type==="remove"?this._convertRemove(s.position,s.length,s.name,i):this._convertAttribute(s.range,s.attributeKey,s.attributeOldValue,s.attributeNewValue,i);for(const s of i.mapper.flushUnboundMarkerNames()){const a=t.get(s).getRange();this._convertMarkerRemove(s,a,i),this._convertMarkerAdd(s,a,i)}for(const s of e.getMarkersToAdd())this._convertMarkerAdd(s.name,s.range,i);i.mapper.flushDeferredBindings(),i.consumable.verifyAllConsumed("insert")}convert(e,t,n,i={}){const r=this._createConversionApi(n,void 0,i);this._convertInsert(e,r);for(const[s,a]of t)this._convertMarkerAdd(s,a,r);r.consumable.verifyAllConsumed("insert")}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition())),r=this._createConversionApi(n);if(this._addConsumablesForSelection(r.consumable,e,i),this.fire("selection",{selection:e},r),e.isCollapsed){for(const s of i){const a=s.getRange();if(!Sy(e.getFirstPosition(),s,r.mapper))continue;const l={item:e,markerName:s.name,markerRange:a};r.consumable.test(e,"addMarker:"+s.name)&&this.fire(`addMarker:${s.name}`,l,r)}for(const s of e.getAttributeKeys()){const a={item:e,range:e.getFirstRange(),attributeKey:s,attributeOldValue:null,attributeNewValue:e.getAttribute(s)};r.consumable.test(e,"attribute:"+a.attributeKey)&&this.fire(`attribute:${a.attributeKey}:$text`,a,r)}}}_convertInsert(e,t,n={}){n.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,Array.from(e));for(const i of Array.from(e.getWalker({shallow:!0})).map(hh))this._testAndFire("insert",i,t)}_convertRemove(e,t,n,i){this.fire(`remove:${n}`,{position:e,length:t},i)}_convertAttribute(e,t,n,i,r){this._addConsumablesForRange(r.consumable,e,`attribute:${t}`);for(const s of e){const a={item:s.item,range:V._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${t}`,a,r)}}_convertReinsert(e,t){const n=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,n);for(const i of n.map(hh))this._testAndFire("insert",ch(ys({},i),{reconversion:!0}),t)}_convertMarkerAdd(e,t,n){if(t.root.rootName=="$graveyard")return;const i=`addMarker:${e}`;if(n.consumable.add(t,i),this.fire(i,{markerName:e,markerRange:t},n),n.consumable.consume(t,i)){this._addConsumablesForRange(n.consumable,t,i);for(const r of t.getItems()){if(!n.consumable.test(r,i))continue;const s={item:r,range:V._createOn(r),markerName:e,markerRange:t};this.fire(i,s,n)}}}_convertMarkerRemove(e,t,n){t.root.rootName!="$graveyard"&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},n)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const n of t){const i=n.item;if(e.test(i,"insert")===null){e.add(i,"insert");for(const r of i.getAttributeKeys())e.add(i,"attribute:"+r)}}return e}_addConsumablesForRange(e,t,n){for(const i of t.getItems())e.add(i,n);return e}_addConsumablesForSelection(e,t,n){e.add(t,"selection");for(const i of n)e.add(t,"addMarker:"+i.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,n){const i=function(l,c){const d=c.item.is("element")?c.item.name:"$text";return`${l}:${d}`}(e,t),r=t.item.is("$textProxy")?n.consumable._getSymbolForTextProxy(t.item):t.item,s=this._firedEventsMap.get(n),a=s.get(r);if(a){if(a.has(i))return;a.add(i)}else s.set(r,new Set([i]));this.fire(i,t,n)}_testAndFireAddAttributes(e,t){const n={item:e,range:V._createOn(e)};for(const i of n.item.getAttributeKeys())n.attributeKey=i,n.attributeOldValue=null,n.attributeNewValue=n.item.getAttribute(i),this._testAndFire(`attribute:${i}`,n,t)}_createConversionApi(e,t=new Set,n={}){const i=ch(ys({},this._conversionApi),{consumable:new _y,writer:e,options:n,convertItem:r=>this._convertInsert(V._createOn(r),i),convertChildren:r=>this._convertInsert(V._createIn(r),i,{doNotAddConsumables:!0}),convertAttributes:r=>this._testAndFireAddAttributes(r,i),canReuseView:r=>!t.has(i.mapper.toModelElement(r))});return this._firedEventsMap.set(i,new Map),i}}function Sy(o,e,t){const n=e.getRange(),i=Array.from(o.getAncestors());return i.shift(),i.reverse(),!i.some(r=>{if(n.containsItem(r))return!!t.toViewElement(r).getCustomProperty("addHighlight")})}function hh(o){return{item:o.item,range:V._createFromPositionAndShift(o.previousPosition,o.length)}}class ot extends me(qt){constructor(...e){super(),this._lastRangeBackward=!1,this._attrs=new Map,this._ranges=[],e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return this._ranges.length===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new V(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new V(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new V(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[t,n,i]=e;if(typeof n=="object"&&(i=n,n=void 0),t===null)this._setRanges([]);else if(t instanceof ot)this._setRanges(t.getRanges(),t.isBackward);else if(t&&typeof t.getRanges=="function")this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof V)this._setRanges([t],!!i&&!!i.backward);else if(t instanceof H)this._setRanges([new V(t)]);else if(t instanceof un){const r=!!i&&!!i.backward;let s;if(n=="in")s=V._createIn(t);else if(n=="on")s=V._createOn(t);else{if(n===void 0)throw new I("model-selection-setto-required-second-parameter",[this,t]);s=new V(H._createAt(t,n))}this._setRanges([s],r)}else{if(!et(t))throw new I("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,i&&!!i.backward)}}_setRanges(e,t=!1){const n=Array.from(e),i=n.some(r=>{if(!(r instanceof V))throw new I("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(s=>!s.isEqual(r))});(n.length!==this._ranges.length||i)&&(this._replaceAllRanges(n),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(this.anchor===null)throw new I("model-selection-setfocus-no-ranges",[this,e]);const n=H._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(i)=="before"?(this._pushRange(new V(n,i)),this._lastRangeBackward=!0):(this._pushRange(new V(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=mh(t.start,e);By(n,t)&&(yield n);for(const r of t.getWalker()){const s=r.item;r.type=="elementEnd"&&Dy(s,e,t)&&(yield s)}const i=mh(t.end,e);Ty(i,t)&&(yield i)}}containsEntireContent(e=this.anchor.root){const t=H._createAt(e,0),n=H._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new V(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function uh(o,e){return!e.has(o)&&(e.add(o),o.root.document.model.schema.isBlock(o)&&!!o.parent)}function Dy(o,e,t){return uh(o,e)&&Es(o,t)}function mh(o,e){const t=o.parent.root.document.model.schema,n=o.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const r=n.find(s=>!i&&(i=t.isLimit(s),!i&&uh(s,e)));return n.forEach(s=>e.add(s)),r}function Es(o,e){const t=function(n){const i=n.root.document.model.schema;let r=n.parent;for(;r;){if(i.isBlock(r))return r;r=r.parent}}(o);return t?!e.containsRange(V._createOn(t),!0):!0}function By(o,e){return!!o&&(!(!e.isCollapsed&&!o.isEmpty)||!e.start.isTouching(H._createAt(o,o.maxOffset))&&Es(o,e))}function Ty(o,e){return!!o&&(!(!e.isCollapsed&&!o.isEmpty)||!e.end.isTouching(H._createAt(o,0))&&Es(o,e))}ot.prototype.is=function(o){return o==="selection"||o==="model:selection"};class Bt extends me(V){constructor(e,t){super(e,t),Iy.call(this)}detach(){this.stopListening()}toRange(){return new V(this.start,this.end)}static fromRange(e){return new Bt(e.start,e.end)}}function Iy(){this.listenTo(this.root.document.model,"applyOperation",(o,e)=>{const t=e[0];t.isDocumentOperation&&Py.call(this,t)},{priority:"low"})}function Py(o){const e=this.getTransformedByOperation(o),t=V._createFromRanges(e),n=!t.isEqual(this),i=function(s,a){switch(a.type){case"insert":return s.containsPosition(a.position);case"move":case"remove":case"reinsert":case"merge":return s.containsPosition(a.sourcePosition)||s.start.isEqual(a.sourcePosition)||s.containsPosition(a.targetPosition);case"split":return s.containsPosition(a.splitPosition)||s.containsPosition(a.insertionPosition)}return!1}(this,o);let r=null;if(n){t.root.rootName=="$graveyard"&&(r=o.type=="remove"?o.sourcePosition:o.deletionPosition);const s=this.toRange();this.start=t.start,this.end=t.end,this.fire("change:range",s,{deletionPosition:r})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:r})}Bt.prototype.is=function(o){return o==="liveRange"||o==="model:liveRange"||o=="range"||o==="model:range"};const yi="selection:";class mt extends me(qt){constructor(e){super(),this._selection=new Ry(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return yi+e}static _isStoreAttributeKey(e){return e.startsWith(yi)}}mt.prototype.is=function(o){return o==="selection"||o=="model:selection"||o=="documentSelection"||o=="model:documentSelection"};class Ry extends ot{constructor(e){super(),this.markers=new at({idProperty:"name"}),this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&i.type!="marker"&&i.type!="rename"&&i.type!="noop"&&(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(t,n,i,r)=>{this._updateMarker(n,r)}),this.listenTo(this._document,"change",(t,n)=>{(function(i,r){const s=i.document.differ;for(const a of s.getChanges()){if(a.type!="insert")continue;const l=a.position.parent;a.length===l.maxOffset&&i.enqueueChange(r,c=>{const d=Array.from(l.getAttributeKeys()).filter(u=>u.startsWith(yi));for(const u of d)c.removeAttribute(u,l)})}})(this._model,n)})}get isCollapsed(){return this._ranges.length===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=r.deletionPosition;const s=this._ranges.indexOf(t);this._ranges.splice(s,1),t.detach()}}),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const i of this._model.markers){const r=i.name.split(":",1)[0];if(!this._observedMarkers.has(r))continue;const s=i.getRange();for(const a of this.getRanges())s.containsRange(a,!a.isCollapsed)&&e.push(i)}const n=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const r=Array.from(this.markers),s=this.markers.has(e);if(t){let a=!1;for(const l of this.getRanges())if(t.containsRange(l,!l.isCollapsed)){a=!0;break}a&&!s?(this.markers.add(e),i=!0):!a&&s&&(this.markers.remove(e),i=!0)}else s&&(this.markers.remove(e),i=!0);i&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(e){const t=Dt(this._getSurroundingAttributes()),n=Dt(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[r,s]of this._attributePriority)s=="low"&&(this._attrs.delete(r),this._attributePriority.delete(r));this._setAttributesTo(t);const i=[];for(const[r,s]of this.getAttributes())n.has(r)&&n.get(r)===s||i.push(r);for(const[r]of n)this.hasAttribute(r)||i.push(r);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";return i=="low"&&this._attributePriority.get(e)=="normal"?!1:super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return(n!="low"||this._attributePriority.get(e)!="normal")&&(this._attributePriority.set(e,n),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[n,i]of this.getAttributes())e.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of e)this._setAttribute(n,i,!1)&&t.add(n);return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())t.startsWith(yi)&&(yield[t.substr(10),e.getAttribute(t)])}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,r=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=Ei(i)),n||(n=Ei(r)),!this.isGravityOverridden&&!n){let s=i;for(;s&&!t.isInline(s)&&!n;)s=s.previousSibling,n=Ei(s)}if(!n){let s=r;for(;s&&!t.isInline(s)&&!n;)s=s.nextSibling,n=Ei(s)}n||(n=this.getStoredAttributes())}else{const i=this.getFirstRange();for(const r of i){if(r.item.is("element")&&t.isObject(r.item))break;if(r.type=="text"){n=r.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Ei(o){return o instanceof ut||o instanceof fe?o.getAttributes():null}class gh{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}const Ut=function(o){return Fr(o,5)};class Oy extends gh{elementToElement(e){return this.add(function(t){const n=kh(t.model),i=xo(t.view,"container");return n.attributes.length&&(n.children=!0),r=>{r.on(`insert:${n.name}`,function(s,a=zy){return(l,c,d)=>{if(!a(c.item,d.consumable,{preflight:!0}))return;const u=s(c.item,d,c);if(!u)return;a(c.item,d.consumable);const g=d.mapper.toViewPosition(c.range.start);d.mapper.bindElements(c.item,u),d.writer.insert(g,u),d.convertAttributes(c.item),Ch(u,c.item.getChildren(),d,{reconversion:c.reconversion})}}(i,_h(n)),{priority:t.converterPriority||"normal"}),(n.children||n.attributes.length)&&r.on("reduceChanges",Ah(n),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(t){const n=kh(t.model),i=xo(t.view,"container");return n.children=!0,r=>{if(r._conversionApi.schema.checkChild(n.name,"$text"))throw new I("conversion-element-to-structure-disallowed-text",r,{elementName:n.name});var s,a;r.on(`insert:${n.name}`,(s=i,a=_h(n),(l,c,d)=>{if(!a(c.item,d.consumable,{preflight:!0}))return;const u=new Map;d.writer._registerSlotFactory(function(b,A,E){return(P,z)=>{const j=P.createContainerElement("$slot");let Y=null;if(z==="children")Y=Array.from(b.getChildren());else{if(typeof z!="function")throw new I("conversion-slot-mode-unknown",E.dispatcher,{modeOrFilter:z});Y=Array.from(b.getChildren()).filter(ie=>z(ie))}return A.set(j,Y),j}}(c.item,u,d));const g=s(c.item,d,c);if(d.writer._clearSlotFactory(),!g)return;(function(b,A,E){const P=Array.from(A.values()).flat(),z=new Set(P);if(z.size!=P.length)throw new I("conversion-slot-filter-overlap",E.dispatcher,{element:b});if(z.size!=b.childCount)throw new I("conversion-slot-filter-incomplete",E.dispatcher,{element:b})})(c.item,u,d),a(c.item,d.consumable);const f=d.mapper.toViewPosition(c.range.start);d.mapper.bindElements(c.item,g),d.writer.insert(f,g),d.convertAttributes(c.item),function(b,A,E,P){E.mapper.on("modelToViewPosition",Y,{priority:"highest"});let z=null,j=null;for([z,j]of A)Ch(b,j,E,P),E.writer.move(E.writer.createRangeIn(z),E.writer.createPositionBefore(z)),E.writer.remove(z);function Y(ie,Ee){const he=Ee.modelPosition.nodeAfter,Mt=j.indexOf(he);Mt<0||(Ee.viewPosition=Ee.mapper.findPositionIn(z,Mt))}E.mapper.off("modelToViewPosition",Y)}(g,u,d,{reconversion:c.reconversion})}),{priority:t.converterPriority||"normal"}),r.on("reduceChanges",Ah(n),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(t){t=Ut(t);let n=t.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)t.view[s]=xo(t.view[s],"attribute");else t.view=xo(t.view,"attribute");const r=bh(t);return s=>{s.on(i,function(a){return(l,c,d)=>{if(!d.consumable.test(c.item,l.name))return;const u=a(c.attributeOldValue,d,c),g=a(c.attributeNewValue,d,c);if(!u&&!g)return;d.consumable.consume(c.item,l.name);const f=d.writer,b=f.document.selection;if(c.item instanceof ot||c.item instanceof mt)f.wrap(b.getFirstRange(),g);else{let A=d.mapper.toViewRange(c.range);c.attributeOldValue!==null&&u&&(A=f.unwrap(A,u)),c.attributeNewValue!==null&&g&&f.wrap(A,g)}}}(r),{priority:t.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Ut(t);let n=t.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)t.view[s]=wh(t.view[s]);else t.view=wh(t.view);const r=bh(t);return s=>{var a;s.on(i,(a=r,(l,c,d)=>{if(!d.consumable.test(c.item,l.name))return;const u=a(c.attributeOldValue,d,c),g=a(c.attributeNewValue,d,c);if(!u&&!g)return;d.consumable.consume(c.item,l.name);const f=d.mapper.toViewElement(c.item),b=d.writer;if(!f)throw new I("conversion-attribute-to-attribute-on-text",d.dispatcher,c);if(c.attributeOldValue!==null&&u)if(u.key=="class"){const A=Pe(u.value);for(const E of A)b.removeClass(E,f)}else if(u.key=="style"){const A=Object.keys(u.value);for(const E of A)b.removeStyle(E,f)}else b.removeAttribute(u.key,f);if(c.attributeNewValue!==null&&g)if(g.key=="class"){const A=Pe(g.value);for(const E of A)b.addClass(E,f)}else if(g.key=="style"){const A=Object.keys(g.value);for(const E of A)b.setStyle(E,g.value[E],f)}else b.setAttribute(g.key,g.value,f)}),{priority:t.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(t){const n=xo(t.view,"ui");return i=>{var r;i.on(`addMarker:${t.model}`,(r=n,(s,a,l)=>{a.isOpening=!0;const c=r(a,l);a.isOpening=!1;const d=r(a,l);if(!c||!d)return;const u=a.markerRange;if(u.isCollapsed&&!l.consumable.consume(u,s.name))return;for(const b of u)if(!l.consumable.consume(b.item,s.name))return;const g=l.mapper,f=l.writer;f.insert(g.toViewPosition(u.start),c),l.mapper.bindElementToMarker(c,a.markerName),u.isCollapsed||(f.insert(g.toViewPosition(u.end),d),l.mapper.bindElementToMarker(d,a.markerName)),s.stop()}),{priority:t.converterPriority||"normal"}),i.on(`removeMarker:${t.model}`,(s,a,l)=>{const c=l.mapper.markerNameToElements(a.markerName);if(c){for(const d of c)l.mapper.unbindElementFromMarkerName(d,a.markerName),l.writer.clear(l.writer.createRangeOn(d),d);l.writer.clearClonedElementsGroup(a.markerName),s.stop()}},{priority:t.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(t){return n=>{var i;n.on(`addMarker:${t.model}`,(i=t.view,(r,s,a)=>{if(!s.item||!(s.item instanceof ot||s.item instanceof mt||s.item.is("$textProxy")))return;const l=xs(i,s,a);if(!l||!a.consumable.consume(s.item,r.name))return;const c=a.writer,d=ph(c,l),u=c.document.selection;if(s.item instanceof ot||s.item instanceof mt)c.wrap(u.getFirstRange(),d);else{const g=a.mapper.toViewRange(s.range),f=c.wrap(g,d);for(const b of f.getItems())if(b.is("attributeElement")&&b.isSimilar(d)){a.mapper.bindElementToMarker(b,s.markerName);break}}}),{priority:t.converterPriority||"normal"}),n.on(`addMarker:${t.model}`,function(r){return(s,a,l)=>{if(!a.item||!(a.item instanceof ke))return;const c=xs(r,a,l);if(!c||!l.consumable.test(a.item,s.name))return;const d=l.mapper.toViewElement(a.item);if(d&&d.getCustomProperty("addHighlight")){l.consumable.consume(a.item,s.name);for(const u of V._createIn(a.item))l.consumable.consume(u.item,s.name);d.getCustomProperty("addHighlight")(d,c,l.writer),l.mapper.bindElementToMarker(d,a.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),n.on(`removeMarker:${t.model}`,function(r){return(s,a,l)=>{if(a.markerRange.isCollapsed)return;const c=xs(r,a,l);if(!c)return;const d=ph(l.writer,c),u=l.mapper.markerNameToElements(a.markerName);if(u){for(const g of u)l.mapper.unbindElementFromMarkerName(g,a.markerName),g.is("attributeElement")?l.writer.unwrap(l.writer.createRangeOn(g),d):g.getCustomProperty("removeHighlight")(g,c.id,l.writer);l.writer.clearClonedElementsGroup(a.markerName),s.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(t){t=Ut(t);const n=t.model;let i=t.view;return i||(i=r=>({group:n,name:r.substr(t.model.length+1)})),r=>{var s;r.on(`addMarker:${n}`,(s=i,(a,l,c)=>{const d=s(l.markerName,c);if(!d)return;const u=l.markerRange;c.consumable.consume(u,a.name)&&(fh(u,!1,c,l,d),fh(u,!0,c,l,d),a.stop())}),{priority:t.converterPriority||"normal"}),r.on(`removeMarker:${n}`,function(a){return(l,c,d)=>{const u=a(c.markerName,d);if(!u)return;const g=d.mapper.markerNameToElements(c.markerName);if(g){for(const b of g)d.mapper.unbindElementFromMarkerName(b,c.markerName),b.is("containerElement")?(f(`data-${u.group}-start-before`,b),f(`data-${u.group}-start-after`,b),f(`data-${u.group}-end-before`,b),f(`data-${u.group}-end-after`,b)):d.writer.clear(d.writer.createRangeOn(b),b);d.writer.clearClonedElementsGroup(c.markerName),l.stop()}function f(b,A){if(A.hasAttribute(b)){const E=new Set(A.getAttribute(b).split(","));E.delete(u.name),E.size==0?d.writer.removeAttribute(b,A):d.writer.setAttribute(b,Array.from(E).join(","),A)}}}}(i),{priority:t.converterPriority||"normal"})}}(e))}}function ph(o,e){const t=o.createAttributeElement("span",e.attributes);return e.classes&&t._addClass(e.classes),typeof e.priority=="number"&&(t._priority=e.priority),t._id=e.id,t}function fh(o,e,t,n,i){const r=e?o.start:o.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let l,c;e&&s||!e&&!a?(l=s,c=!0):(l=a,c=!1);const d=t.mapper.toViewElement(l);if(d)return void function(u,g,f,b,A,E){const P=`data-${E.group}-${g?"start":"end"}-${f?"before":"after"}`,z=u.hasAttribute(P)?u.getAttribute(P).split(","):[];z.unshift(E.name),b.writer.setAttribute(P,z.join(","),u),b.mapper.bindElementToMarker(u,A.markerName)}(d,e,c,t,n,i)}(function(l,c,d,u,g){const f=`${g.group}-${c?"start":"end"}`,b=g.name?{name:g.name}:null,A=d.writer.createUIElement(f,b);d.writer.insert(l,A),d.mapper.bindElementToMarker(A,u.markerName)})(t.mapper.toViewPosition(r),e,t,n,i)}function kh(o){return typeof o=="string"&&(o={name:o}),o.attributes?Array.isArray(o.attributes)||(o.attributes=[o.attributes]):o.attributes=[],o.children=!!o.children,o}function xo(o,e){return typeof o=="function"?o:(t,n)=>function(i,r,s){typeof i=="string"&&(i={name:i});let a;const l=r.writer,c=Object.assign({},i.attributes);if(s=="container")a=l.createContainerElement(i.name,c);else if(s=="attribute"){const d={priority:i.priority||dn.DEFAULT_PRIORITY};a=l.createAttributeElement(i.name,c,d)}else a=l.createUIElement(i.name,c);if(i.styles){const d=Object.keys(i.styles);for(const u of d)l.setStyle(u,i.styles[u],a)}if(i.classes){const d=i.classes;if(typeof d=="string")l.addClass(d,a);else for(const u of d)l.addClass(u,a)}return a}(o,n,e)}function bh(o){return o.model.values?(e,t,n)=>{const i=o.view[e];return i?i(e,t,n):null}:o.view}function wh(o){return typeof o=="string"?e=>({key:o,value:e}):typeof o=="object"?o.value?()=>o:e=>({key:o.key,value:e}):o}function xs(o,e,t){const n=typeof o=="function"?o(e,t):o;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function Ah(o){const e=function(t){return(n,i)=>{if(!n.is("element",t.name))return!1;if(i.type=="attribute"){if(t.attributes.includes(i.attributeKey))return!0}else if(t.children)return!0;return!1}}(o);return(t,n)=>{const i=[];n.reconvertedElements||(n.reconvertedElements=new Set);for(const r of n.changes){const s=r.type=="attribute"?r.range.start.nodeAfter:r.position.parent;if(s&&e(s,r)){if(!n.reconvertedElements.has(s)){n.reconvertedElements.add(s);const a=H._createBefore(s);let l=i.length;for(let c=i.length-1;c>=0;c--){const d=i[c],u=(d.type=="attribute"?d.range.start:d.position).compareWith(a);if(u=="before"||d.type=="remove"&&u=="same")break;l=c}i.splice(l,0,{type:"remove",name:s.name,position:a,length:1},{type:"reinsert",name:s.name,position:a,length:1})}}else i.push(r)}n.changes=i}}function _h(o){return(e,t,n={})=>{const i=["insert"];for(const r of o.attributes)e.hasAttribute(r)&&i.push(`attribute:${r}`);return!!i.every(r=>t.test(e,r))&&(n.preflight||i.forEach(r=>t.consume(e,r)),!0)}}function Ch(o,e,t,n){for(const i of e)Ny(o.root,i,t,n)||t.convertItem(i)}function Ny(o,e,t,n){const{writer:i,mapper:r}=t;if(!n.reconversion)return!1;const s=r.toViewElement(e);return!(!s||s.root==o)&&!!t.canReuseView(s)&&(i.move(i.createRangeOn(s),r.toViewPosition(H._createBefore(e))),!0)}function zy(o,e,{preflight:t}={}){return t?e.test(o,"insert"):e.consume(o,"insert")}function vh(o){const{schema:e,document:t}=o.model;for(const n of t.getRootNames()){const i=t.getRoot(n);if(i.isEmpty&&!e.checkChild(i,"$text")&&e.checkChild(i,"paragraph"))return o.insertElement("paragraph",i),!0}return!1}function yh(o,e,t){const n=t.createContext(o);return!!t.checkChild(n,"paragraph")&&!!t.checkChild(n.push("paragraph"),e)}function Eh(o,e){const t=e.createElement("paragraph");return e.insert(t,o),e.createPositionAt(t,0)}var My=Object.defineProperty,Fy=Object.defineProperties,Vy=Object.getOwnPropertyDescriptors,xh=Object.getOwnPropertySymbols,Ly=Object.prototype.hasOwnProperty,jy=Object.prototype.propertyIsEnumerable,Sh=(o,e,t)=>e in o?My(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class $y extends gh{elementToElement(e){return this.add(Dh(e))}elementToAttribute(e){return this.add(function(t){t=Ut(t),Bh(t);const n=Th(t,!1),i=Ss(t.view),r=i?`element:${i}`:"element";return s=>{s.on(r,n,{priority:t.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Ut(t);let n=null;(typeof t.view=="string"||t.view.key)&&(n=function(r){typeof r.view=="string"&&(r.view={key:r.view});const s=r.view.key;let a;return s=="class"||s=="style"?a={[s=="class"?"classes":"styles"]:r.view.value}:a={attributes:{[s]:r.view.value===void 0?/[\s\S]*/:r.view.value}},r.view.name&&(a.name=r.view.name),r.view=a,s}(t)),Bh(t,n);const i=Th(t,!0);return r=>{r.on("element",i,{priority:t.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(t){const n=function(s){return(a,l)=>{const c=typeof s=="string"?s:s(a,l);return l.writer.createElement("$marker",{"data-name":c})}}(t.model);return Dh((i=((s,a)=>{for(var l in a||(a={}))Ly.call(a,l)&&Sh(s,l,a[l]);if(xh)for(var l of xh(a))jy.call(a,l)&&Sh(s,l,a[l]);return s})({},t),r={model:n},Fy(i,Vy(r))));var i,r}(e))}dataToMarker(e){return this.add(function(t){t=Ut(t),t.model||(t.model=s=>s?t.view+":"+s:t.view);const n={view:t.view,model:t.model},i=Ds(Ih(n,"start")),r=Ds(Ih(n,"end"));return s=>{s.on(`element:${t.view}-start`,i,{priority:t.converterPriority||"normal"}),s.on(`element:${t.view}-end`,r,{priority:t.converterPriority||"normal"});const a=te.get("low"),l=te.get("highest"),c=te.get(t.converterPriority)/l;s.on("element",function(d){return(u,g,f)=>{const b=`data-${d.view}`;function A(E,P){for(const z of P){const j=d.model(z,f),Y=f.writer.createElement("$marker",{"data-name":j});f.writer.insert(Y,E),g.modelCursor.isEqual(E)?g.modelCursor=g.modelCursor.getShiftedBy(1):g.modelCursor=g.modelCursor._getTransformedByInsertion(E,1),g.modelRange=g.modelRange._getTransformedByInsertion(E,1)[0]}}(f.consumable.test(g.viewItem,{attributes:b+"-end-after"})||f.consumable.test(g.viewItem,{attributes:b+"-start-after"})||f.consumable.test(g.viewItem,{attributes:b+"-end-before"})||f.consumable.test(g.viewItem,{attributes:b+"-start-before"}))&&(g.modelRange||Object.assign(g,f.convertChildren(g.viewItem,g.modelCursor)),f.consumable.consume(g.viewItem,{attributes:b+"-end-after"})&&A(g.modelRange.end,g.viewItem.getAttribute(b+"-end-after").split(",")),f.consumable.consume(g.viewItem,{attributes:b+"-start-after"})&&A(g.modelRange.end,g.viewItem.getAttribute(b+"-start-after").split(",")),f.consumable.consume(g.viewItem,{attributes:b+"-end-before"})&&A(g.modelRange.start,g.viewItem.getAttribute(b+"-end-before").split(",")),f.consumable.consume(g.viewItem,{attributes:b+"-start-before"})&&A(g.modelRange.start,g.viewItem.getAttribute(b+"-start-before").split(",")))}}(n),{priority:a+c})}}(e))}}function Dh(o){const e=Ds(o=Ut(o)),t=Ss(o.view),n=t?`element:${t}`:"element";return i=>{i.on(n,e,{priority:o.converterPriority||"normal"})}}function Ss(o){return typeof o=="string"?o:typeof o=="object"&&typeof o.name=="string"?o.name:null}function Ds(o){const e=new Mn(o.view);return(t,n,i)=>{const r=e.match(n.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!i.consumable.test(n.viewItem,s))return;const a=function(l,c,d){return l instanceof Function?l(c,d):d.writer.createElement(l)}(o.model,n.viewItem,i);a&&i.safeInsert(a,n.modelCursor)&&(i.consumable.consume(n.viewItem,s),i.convertChildren(n.viewItem,a),i.updateConversionResult(a,n))}}function Bh(o,e=null){const t=e===null||(r=>r.getAttribute(e)),n=typeof o.model!="object"?o.model:o.model.key,i=typeof o.model!="object"||o.model.value===void 0?t:o.model.value;o.model={key:n,value:i}}function Th(o,e){const t=new Mn(o.view);return(n,i,r)=>{if(!i.modelRange&&e)return;const s=t.match(i.viewItem);if(!s||(function(d,u){const g=typeof d=="function"?d(u):d;return typeof g=="object"&&!Ss(g)?!1:!g.classes&&!g.attributes&&!g.styles}(o.view,i.viewItem)?s.match.name=!0:delete s.match.name,!r.consumable.test(i.viewItem,s.match)))return;const a=o.model.key,l=typeof o.model.value=="function"?o.model.value(i.viewItem,r):o.model.value;if(l===null)return;i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor)),function(d,u,g,f){let b=!1;for(const A of Array.from(d.getItems({shallow:g})))f.schema.checkAttribute(A,u.key)&&(b=!0,A.hasAttribute(u.key)||f.writer.setAttribute(u.key,u.value,A));return b}(i.modelRange,{key:a,value:l},e,r)&&(r.consumable.test(i.viewItem,{name:!0})&&(s.match.name=!0),r.consumable.consume(i.viewItem,s.match))}}function Ih(o,e){return{view:`${o.view}-${e}`,model:(t,n)=>{const i=t.getAttribute("name"),r=o.model(i,n);return n.writer.createElement("$marker",{"data-name":r})}}}function Hy(o){o.document.registerPostFixer(e=>function(t,n){const i=n.document.selection,r=n.schema,s=[];let a=!1;for(const l of i.getRanges()){const c=Ph(l,r);c&&!c.isEqual(l)?(s.push(c),a=!0):s.push(l)}return a&&t.setSelection(function(l){const c=[...l],d=new Set;let u=1;for(;u!d.has(f))}(s),{backward:i.isBackward}),!1}(e,o))}function Ph(o,e){return o.isCollapsed?function(t,n){const i=t.start,r=n.getNearestSelectionRange(i);if(!r){const a=i.getAncestors().reverse().find(l=>n.isObject(l));return a?V._createOn(a):null}if(!r.isCollapsed)return r;const s=r.start;return i.isEqual(s)?null:new V(s)}(o,e):function(t,n){const{start:i,end:r}=t,s=n.checkChild(i,"$text"),a=n.checkChild(r,"$text"),l=n.getLimitElement(i),c=n.getLimitElement(r);if(l===c){if(s&&a)return null;if(function(g,f,b){const A=g.nodeAfter&&!b.isLimit(g.nodeAfter)||b.checkChild(g,"$text"),E=f.nodeBefore&&!b.isLimit(f.nodeBefore)||b.checkChild(f,"$text");return A||E}(i,r,n)){const g=i.nodeAfter&&n.isSelectable(i.nodeAfter)?null:n.getNearestSelectionRange(i,"forward"),f=r.nodeBefore&&n.isSelectable(r.nodeBefore)?null:n.getNearestSelectionRange(r,"backward"),b=g?g.start:i,A=f?f.end:r;return new V(b,A)}}const d=l&&!l.is("rootElement"),u=c&&!c.is("rootElement");if(d||u){const g=i.nodeAfter&&r.nodeBefore&&i.nodeAfter.parent===r.nodeBefore.parent,f=d&&(!g||!Oh(i.nodeAfter,n)),b=u&&(!g||!Oh(r.nodeBefore,n));let A=i,E=r;return f&&(A=H._createBefore(Rh(l,n))),b&&(E=H._createAfter(Rh(c,n))),new V(A,E)}return null}(o,e)}function Rh(o,e){let t=o,n=t;for(;e.isLimit(n)&&n.parent;)t=n,n=n.parent;return t}function Oh(o,e){return o&&e.isSelectable(o)}class qy extends ge(){constructor(e,t){super(),this.model=e,this.view=new Ay(t),this.mapper=new sh,this.downcastDispatcher=new dh({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,r=this.model.markers;var s,a,l;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(c=>{this.downcastDispatcher.convertChanges(n.differ,r,c),this.downcastDispatcher.convertSelection(i,r,c)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(c,d){return(u,g)=>{const f=g.newSelection,b=[];for(const E of f.getRanges())b.push(d.toModelRange(E));const A=c.createSelection(b,{backward:f.isBackward});A.isEqual(c.document.selection)||c.change(E=>{E.setSelection(A)})}}(this.model,this.mapper)),this.listenTo(this.view.document,"beforeinput",(s=this.mapper,a=this.model.schema,l=this.view,(c,d)=>{if(!l.document.isComposing||k.isAndroid)for(let u=0;u{if(!u.consumable.consume(d.item,c.name))return;const g=u.writer,f=u.mapper.toViewPosition(d.range.start),b=g.createText(d.item.data);g.insert(f,b)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(c,d,u)=>{u.convertAttributes(d.item),d.reconversion||!d.item.is("element")||d.item.isEmpty||u.convertChildren(d.item)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(c,d,u)=>{const g=u.mapper.toViewPosition(d.position),f=d.position.getShiftedBy(d.length),b=u.mapper.toViewPosition(f,{isPhantom:!0}),A=u.writer.createRange(g,b),E=u.writer.remove(A.getTrimmed());for(const P of u.writer.createRangeIn(E).getItems())u.mapper.unbindViewElement(P,{defer:!0})},{priority:"low"}),this.downcastDispatcher.on("selection",(c,d,u)=>{const g=u.writer,f=g.document.selection;for(const b of f.getRanges())b.isCollapsed&&b.end.parent.isAttached()&&u.writer.mergeAttributes(b.start);g.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(c,d,u)=>{const g=d.selection;if(g.isCollapsed||!u.consumable.consume(g,"selection"))return;const f=[];for(const b of g.getRanges())f.push(u.mapper.toViewRange(b));u.writer.setSelection(f,{backward:g.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(c,d,u)=>{const g=d.selection;if(!g.isCollapsed||!u.consumable.consume(g,"selection"))return;const f=u.writer,b=g.getFirstPosition(),A=u.mapper.toViewPosition(b),E=f.breakAttributes(A);f.setSelection(E)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(c=>{if(c.rootName=="$graveyard")return null;const d=new xd(this.view.document,c.name);return d.rootName=c.rootName,this.mapper.bindElements(c,d),d})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t=typeof e=="string"?e:e.name,n=this.model.markers.get(t);if(!n)throw new I("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change(()=>{this.model.markers._refresh(n)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}}class So{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new Uy(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return n===void 0?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);n!==void 0&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const s of n)s!="style"&&s!="class"&&t.attributes.push(s);const i=e.getClassNames();for(const s of i)t.classes.push(s);const r=e.getStyleNames();for(const s of r)t.styles.push(s);return t}static createFrom(e,t){if(t||(t=new So),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,So.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=So.createFrom(n,t);return t}}const xi=["attributes","classes","styles"];class Uy{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t of xi)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t of xi)if(t in e){const n=this._test(t,e[t]);if(n!==!0)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t of xi)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t of xi)t in e&&this._revert(t,e[t])}_add(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n){if(e==="attributes"&&(r==="class"||r==="style"))throw new I("viewconsumable-invalid-attribute",this);if(i.set(r,!0),e==="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!0)}}_test(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){const s=i.get(r);if(s===void 0)return null;if(!s)return!1}else{const s=r=="class"?"classes":"styles",a=this._test(s,[...this._consumables[s].keys()]);if(a!==!0)return a}return!0}_consume(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){if(i.set(r,!1),e=="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!1)}else{const s=r=="class"?"classes":"styles";this._consume(s,[...this._consumables[s].keys()])}}_revert(e,t){const n=We(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style")i.get(r)===!1&&i.set(r,!0);else{const s=r=="class"?"classes":"styles";this._revert(s,[...this._consumables[s].keys()])}}}class Wy extends ge(){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new gn(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new gn(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new I("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new I("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t=typeof e=="string"?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof H){const n=e.nodeBefore,i=e.nodeAfter;if(!(n instanceof ke))throw new I("schema-check-merge-no-element-before",this);if(!(i instanceof ke))throw new I("schema-check-merge-no-element-after",this);return this.checkMerge(n,i)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const r=e(n,i);typeof r=="boolean"&&(t.stop(),t.return=r)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const r=e(n,i);typeof r=="boolean"&&(t.stop(),t.return=r)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(e instanceof H?t=e.parent:t=(e instanceof V?[e]:Array.from(e.getRanges())).reduce((n,i)=>{const r=i.getCommonAncestor();return n?n.getCommonAncestor(r,{includeSelf:!0}):r},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new fe("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const i of n)for(const r of i)if(this.checkAttribute(r.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(n){for(const i of n)yield*i.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new V(e);let n,i;const r=e.getAncestors().reverse().find(s=>this.isLimit(s))||e.root;t!="both"&&t!="backward"||(n=new vt({boundaries:V._createIn(r),startPosition:e,direction:"backward"})),t!="both"&&t!="forward"||(i=new vt({boundaries:V._createIn(r),startPosition:e}));for(const s of function*(a,l){let c=!1;for(;!c;){if(c=!0,a){const d=a.next();d.done||(c=!1,yield{walker:a,value:d.value})}if(l){const d=l.next();d.done||(c=!1,yield{walker:l,value:d.value})}}}(n,i)){const a=s.walker==n?"elementEnd":"elementStart",l=s.value;if(l.type==a&&this.isObject(l.item))return V._createOn(l.item);if(this.checkChild(l.nextPosition,"$text"))return new V(l.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}setAllowedAttributes(e,t,n){const i=n.model;for(const[r,s]of Object.entries(t))i.schema.checkAttribute(e,r)&&n.setAttribute(r,s,e)}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))Nh(this,n,t);else{const i=V._createIn(n).getPositions();for(const r of i)Nh(this,r.nodeBefore||r.parent,t)}}getAttributesWithProperty(e,t,n){const i={};for(const[r,s]of e.getAttributes()){const a=this.getAttributeProperties(r);a[t]!==void 0&&(n!==void 0&&n!==a[t]||(i[r]=s))}return i}createContext(e){return new gn(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=Ky(t[i],i);for(const i of n)Gy(e,i);for(const i of n)Zy(e,i);for(const i of n)Jy(e,i);for(const i of n)Yy(e,i),Qy(e,i);for(const i of n)Xy(e,i),e1(e,i),t1(e,i);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(n==0)return!0;{const r=this.getDefinition(i);return this._checkContextMatch(r,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const r of e.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(V._createIn(r),t)),this.checkAttribute(r,t)||(n.isEqual(i)||(yield new V(n,i)),n=H._createAfter(r)),i=H._createAfter(r);n.isEqual(i)||(yield new V(n,i))}}class gn{constructor(e){if(e instanceof gn)return e;let t;t=typeof e=="string"?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(o1)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new gn([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function Ky(o,e){const t={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,i){for(const r of n){const s=Object.keys(r).filter(a=>a.startsWith("is"));for(const a of s)i[a]=!!r[a]}}(o,t),pn(o,t,"allowIn"),pn(o,t,"allowContentOf"),pn(o,t,"allowWhere"),pn(o,t,"allowAttributes"),pn(o,t,"allowAttributesOf"),pn(o,t,"allowChildren"),pn(o,t,"inheritTypesFrom"),function(n,i){for(const r of n){const s=r.inheritAllFrom;s&&(i.allowContentOf.push(s),i.allowWhere.push(s),i.allowAttributesOf.push(s),i.inheritTypesFrom.push(s))}}(o,t),t}function Gy(o,e){const t=o[e];for(const n of t.allowChildren){const i=o[n];i&&i.allowIn.push(e)}t.allowChildren.length=0}function Zy(o,e){for(const t of o[e].allowContentOf)o[t]&&n1(o,t).forEach(n=>{n.allowIn.push(e)});delete o[e].allowContentOf}function Jy(o,e){for(const t of o[e].allowWhere){const n=o[t];if(n){const i=n.allowIn;o[e].allowIn.push(...i)}}delete o[e].allowWhere}function Yy(o,e){for(const t of o[e].allowAttributesOf){const n=o[t];if(n){const i=n.allowAttributes;o[e].allowAttributes.push(...i)}}delete o[e].allowAttributesOf}function Qy(o,e){const t=o[e];for(const n of t.inheritTypesFrom){const i=o[n];if(i){const r=Object.keys(i).filter(s=>s.startsWith("is"));for(const s of r)s in t||(t[s]=i[s])}}delete t.inheritTypesFrom}function Xy(o,e){const t=o[e],n=t.allowIn.filter(i=>o[i]);t.allowIn=Array.from(new Set(n))}function e1(o,e){const t=o[e];for(const n of t.allowIn)o[n].allowChildren.push(e)}function t1(o,e){const t=o[e];t.allowAttributes=Array.from(new Set(t.allowAttributes))}function pn(o,e,t){for(const n of o){const i=n[t];typeof i=="string"?e[t].push(i):Array.isArray(i)&&e[t].push(...i)}}function n1(o,e){const t=o[e];return(n=o,Object.keys(n).map(i=>n[i])).filter(i=>i.allowIn.includes(t.name));var n}function o1(o){return typeof o=="string"||o.is("documentFragment")?{name:typeof o=="string"?o:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:o.is("element")?o.name:"$text",*getAttributeKeys(){yield*o.getAttributeKeys()},getAttribute:e=>o.getAttribute(e)}}function Nh(o,e,t){for(const n of e.getAttributeKeys())o.checkAttribute(e,n)||t.removeAttribute(n,e)}var i1=Object.defineProperty,r1=Object.defineProperties,s1=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,a1=Object.prototype.hasOwnProperty,l1=Object.prototype.propertyIsEnumerable,Mh=(o,e,t)=>e in o?i1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class c1 extends me(){constructor(e){var t;super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi=(t=((n,i)=>{for(var r in i||(i={}))a1.call(i,r)&&Mh(n,r,i[r]);if(zh)for(var r of zh(i))l1.call(i,r)&&Mh(n,r,i[r]);return n})({},e),r1(t,s1({consumable:null,writer:null,store:null,convertItem:(n,i)=>this._convertItem(n,i),convertChildren:(n,i)=>this._convertChildren(n,i),safeInsert:(n,i)=>this._safeInsert(n,i),updateConversionResult:(n,i)=>this._updateConversionResult(n,i),splitToAllowedParent:(n,i)=>this._splitToAllowedParent(n,i),getSplitParts:n=>this._getSplitParts(n),keepEmptyElement:n=>this._keepEmptyElement(n)})))}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(s,a){let l;for(const c of new gn(s)){const d={};for(const g of c.getAttributeKeys())d[g]=c.getAttribute(g);const u=a.createElement(c.name,d);l&&a.insert(u,l),l=H._createAt(u,0)}return l}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=So.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),r=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const s of Array.from(this._modelCursor.parent.getChildren()))t.append(s,r);r.markers=function(s,a){const l=new Set,c=new Map,d=V._createIn(s).getItems();for(const u of d)u.is("element","$marker")&&l.add(u);for(const u of l){const g=u.getAttribute("data-name"),f=a.createPositionBefore(u);c.has(g)?c.get(g).end=f.clone():c.set(g,new V(f.clone())),a.remove(u)}return c}(r,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(e,t){const n={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof V))throw new I("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:H._createAt(t,0);const i=new V(n);for(const r of Array.from(e.getChildren())){const s=this._convertItem(r,n);s.modelRange instanceof V&&(i.end=s.modelRange.end,n=s.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const r=this._cursorParents.get(e);t.modelCursor=r?i.createPositionAt(r,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let r=n.findAllowedParent(t,e);if(r){if(r===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return yh(t,e,n)?{position:Eh(t,i)}:null;const s=this.conversionApi.writer.split(t,r),a=[];for(const c of s.range.getWalker())if(c.type=="elementEnd")a.push(c.item);else{const d=a.pop(),u=c.item;this._registerSplitPair(d,u)}const l=s.range.end.parent;return this._cursorParents.set(e,l),{position:s.position,cursorParent:l}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}class d1{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class h1{constructor(e){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new $d(e,{renderingMode:"data"}),this.htmlWriter=new d1}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){e.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),i=t.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class u1 extends me(){constructor(e,t){super(),this.model=e,this.mapper=new sh,this.downcastDispatcher=new dh({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewPosition(i.range.start),l=s.createText(i.item.data);s.insert(a,l)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(n,i,r)=>{r.convertAttributes(i.item),i.reconversion||!i.item.is("element")||i.item.isEmpty||r.convertChildren(i.item)},{priority:"lowest"}),this.upcastDispatcher=new c1({schema:e.schema}),this.viewDocument=new Dd(t),this.stylesProcessor=t,this.htmlProcessor=new h1(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Bd(this.viewDocument),this.upcastDispatcher.on("text",(n,i,{schema:r,consumable:s,writer:a})=>{let l=i.modelCursor;if(!s.test(i.viewItem))return;if(!r.checkChild(l,"$text")){if(!yh(l,"$text",r)||i.viewItem.data.trim().length==0)return;const d=l.nodeBefore;l=Eh(l,a),d&&d.is("element","$marker")&&(a.move(a.createRangeOn(d),l),l=a.createPositionAfter(d))}s.consume(i.viewItem);const c=a.createText(i.viewItem.data);a.insert(c,l),i.modelRange=a.createRange(l,l.getShiftedBy(c.offsetSize)),i.modelCursor=i.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),ge().prototype.decorate.call(this,"init"),ge().prototype.decorate.call(this,"set"),ge().prototype.decorate.call(this,"get"),ge().prototype.decorate.call(this,"toView"),ge().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},vh)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new I("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return i.isAttached()||Q("datacontroller-get-detached-root",this),n!=="empty"||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const r=V._createIn(e),s=new hn(n);this.mapper.bindElements(e,s);const a=e.is("documentFragment")?e.markers:function(l){const c=[],d=l.root.document;if(!d)return new Map;const u=V._createIn(l);for(const g of d.model.markers){const f=g.getRange(),b=f.isCollapsed,A=f.start.isEqual(u.start)||f.end.isEqual(u.end);if(b&&A)c.push([g.name,f]);else{const E=u.getIntersection(f);E&&c.push([g.name,E])}}return c.sort(([g,f],[b,A])=>{if(f.end.compareWith(A.start)!=="after")return 1;if(f.start.compareWith(A.end)!=="before")return-1;switch(f.start.compareWith(A.start)){case"before":return 1;case"after":return-1;default:switch(f.end.compareWith(A.end)){case"before":return 1;case"after":return-1;default:return b.localeCompare(g)}}}),new Map(c)}(e);return this.downcastDispatcher.convert(r,a,i,t),s}init(e){if(this.model.document.version)throw new I("datacontroller-init-document-not-empty",this);let t={};if(typeof e=="string"?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new I("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},n=>{for(const i of Object.keys(t)){const r=this.model.document.getRoot(i);n.insert(this.parse(t[i],r),r,0)}}),Promise.resolve()}set(e,t={}){let n={};if(typeof e=="string"?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new I("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},i=>{i.setSelection(null),i.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const r of Object.keys(n)){const s=this.model.document.getRoot(r);i.remove(i.createRangeIn(s)),i.insert(this.parse(n[r],s),s,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRoot(t))return!1;return!0}}class m1{constructor(e,t){this._helpers=new Map,this._downcast=Pe(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Pe(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new I("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new I("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of Bs(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of Bs(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of Bs(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new I("conversion-group-exists",this);const i=n?new Oy(t):new $y(t);this._helpers.set(e,i)}}function*Bs(o){if(o.model.values)for(const e of o.model.values){const t={key:o.model.key,value:e},n=o.view[e],i=o.upcastAlso?o.upcastAlso[e]:void 0;yield*Fh(t,n,i)}else yield*Fh(o.model,o.view,o.upcastAlso)}function*Fh(o,e,t){if(yield{model:o,view:e},t)for(const n of Pe(t))yield{model:o,view:n}}class it{constructor(e){this.baseVersion=e,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function Ts(o,e){const t=Lh(e),n=t.reduce((s,a)=>s+a.offsetSize,0),i=o.parent;To(o);const r=o.index;return i._insertChild(r,t),Bo(i,r+t.length),Bo(i,r),new V(o,o.getShiftedBy(n))}function Vh(o){if(!o.isFlat)throw new I("operation-utils-remove-range-not-flat",this);const e=o.start.parent;To(o.start),To(o.end);const t=e._removeChildren(o.start.index,o.end.index-o.start.index);return Bo(e,o.start.index),t}function Do(o,e){if(!o.isFlat)throw new I("operation-utils-move-range-not-flat",this);const t=Vh(o);return Ts(e=e._getTransformedByDeletion(o.start,o.end.offset-o.start.offset),t)}function Lh(o){const e=[];(function t(n){if(typeof n=="string")e.push(new fe(n));else if(n instanceof ut)e.push(new fe(n.data,n.getAttributes()));else if(n instanceof un)e.push(n);else if(et(n))for(const i of n)t(i)})(o);for(let t=1;te.maxOffset)throw new I("move-operation-nodes-do-not-exist",this);if(e===t&&n=n&&this.targetPosition.path[r]n._clone(!0))),t=new $e(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new H(e,[0]);return new ce(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsett._clone(!0))),Ts(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const r of e.nodes)r.name?n.push(ke.fromJSON(r)):n.push(fe.fromJSON(r));const i=new $e(H.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class be extends it{constructor(e,t,n,i,r){super(r),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new H(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new V(this.splitPosition,e)}get affectedSelectable(){const e=[V._createFromPositionAndShift(this.splitPosition,0),V._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(V._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new be(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new H(e,[0]);return new Re(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset{if(o.key===e.key&&o.range.start.hasSameParentAs(e.range.start)){const n=o.range.getDifference(e.range).map(r=>new Me(r,o.key,o.oldValue,o.newValue,0)),i=o.range.getIntersection(e.range);return i&&t.aIsStrong&&n.push(new Me(i,e.key,e.newValue,o.newValue,0)),n.length==0?[new je(0)]:n}return[o]}),ae(Me,$e,(o,e)=>{if(o.range.start.hasSameParentAs(e.position)&&o.range.containsPosition(e.position)){const t=o.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(n=>new Me(n,o.key,o.oldValue,o.newValue,o.baseVersion));if(e.shouldReceiveAttributes){const n=qh(e,o.key,o.oldValue);n&&t.unshift(n)}return t}return o.range=o.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[o]}),ae(Me,Re,(o,e)=>{const t=[];o.range.start.hasSameParentAs(e.deletionPosition)&&(o.range.containsPosition(e.deletionPosition)||o.range.start.isEqual(e.deletionPosition))&&t.push(V._createFromPositionAndShift(e.graveyardPosition,1));const n=o.range._getTransformedByMergeOperation(e);return n.isCollapsed||t.push(n),t.map(i=>new Me(i,o.key,o.oldValue,o.newValue,o.baseVersion))}),ae(Me,ce,(o,e)=>function(n,i){const r=V._createFromPositionAndShift(i.sourcePosition,i.howMany);let s=null,a=[];r.containsRange(n,!0)?s=n:n.start.hasSameParentAs(r.start)?(a=n.getDifference(r),s=n.getIntersection(r)):a=[n];const l=[];for(let c of a){c=c._getTransformedByDeletion(i.sourcePosition,i.howMany);const d=i.getMovedRangeStart(),u=c.start.hasSameParentAs(d),g=c._getTransformedByInsertion(d,i.howMany,u);l.push(...g)}return s&&l.push(s._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany,!1)[0]),l}(o.range,e).map(n=>new Me(n,o.key,o.oldValue,o.newValue,o.baseVersion))),ae(Me,be,(o,e)=>{if(o.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||o.range.end.offset++,[o];if(o.range.start.hasSameParentAs(e.splitPosition)&&o.range.containsPosition(e.splitPosition)){const t=o.clone();return t.range=new V(e.moveTargetPosition.clone(),o.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),o.range.end=e.splitPosition.clone(),o.range.end.stickiness="toPrevious",[o,t]}return o.range=o.range._getTransformedBySplitOperation(e),[o]}),ae($e,Me,(o,e)=>{const t=[o];if(o.shouldReceiveAttributes&&o.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(o.position)){const n=qh(o,e.key,e.newValue);n&&t.push(n)}return t}),ae($e,$e,(o,e,t)=>(o.position.isEqual(e.position)&&t.aIsStrong||(o.position=o.position._getTransformedByInsertOperation(e)),[o])),ae($e,ce,(o,e)=>(o.position=o.position._getTransformedByMoveOperation(e),[o])),ae($e,be,(o,e)=>(o.position=o.position._getTransformedBySplitOperation(e),[o])),ae($e,Re,(o,e)=>(o.position=o.position._getTransformedByMergeOperation(e),[o])),ae(Ze,$e,(o,e)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByInsertOperation(e)[0]),o.newRange&&(o.newRange=o.newRange._getTransformedByInsertOperation(e)[0]),[o])),ae(Ze,Ze,(o,e,t)=>{if(o.name==e.name){if(!t.aIsStrong)return[new je(0)];o.oldRange=e.newRange?e.newRange.clone():null}return[o]}),ae(Ze,Re,(o,e)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByMergeOperation(e)),o.newRange&&(o.newRange=o.newRange._getTransformedByMergeOperation(e)),[o])),ae(Ze,ce,(o,e,t)=>{if(o.oldRange&&(o.oldRange=V._createFromRanges(o.oldRange._getTransformedByMoveOperation(e))),o.newRange){if(t.abRelation){const n=V._createFromRanges(o.newRange._getTransformedByMoveOperation(e));if(t.abRelation.side=="left"&&e.targetPosition.isEqual(o.newRange.start))return o.newRange.end=n.end,o.newRange.start.path=t.abRelation.path,[o];if(t.abRelation.side=="right"&&e.targetPosition.isEqual(o.newRange.end))return o.newRange.start=n.start,o.newRange.end.path=t.abRelation.path,[o]}o.newRange=V._createFromRanges(o.newRange._getTransformedByMoveOperation(e))}return[o]}),ae(Ze,be,(o,e,t)=>{if(o.oldRange&&(o.oldRange=o.oldRange._getTransformedBySplitOperation(e)),o.newRange){if(t.abRelation){const n=o.newRange._getTransformedBySplitOperation(e);return o.newRange.start.isEqual(e.splitPosition)&&t.abRelation.wasStartBeforeMergedElement?o.newRange.start=H._createAt(e.insertionPosition):o.newRange.start.isEqual(e.splitPosition)&&!t.abRelation.wasInLeftElement&&(o.newRange.start=H._createAt(e.moveTargetPosition)),o.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasInRightElement?o.newRange.end=H._createAt(e.moveTargetPosition):o.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasEndBeforeMergedElement?o.newRange.end=H._createAt(e.insertionPosition):o.newRange.end=n.end,[o]}o.newRange=o.newRange._getTransformedBySplitOperation(e)}return[o]}),ae(Re,$e,(o,e)=>(o.sourcePosition.hasSameParentAs(e.position)&&(o.howMany+=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByInsertOperation(e),o.targetPosition=o.targetPosition._getTransformedByInsertOperation(e),[o])),ae(Re,Re,(o,e,t)=>{if(o.sourcePosition.isEqual(e.sourcePosition)&&o.targetPosition.isEqual(e.targetPosition)){if(t.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),o.sourcePosition=new H(e.graveyardPosition.root,n),o.howMany=0,[o]}return[new je(0)]}if(o.sourcePosition.isEqual(e.sourcePosition)&&!o.targetPosition.isEqual(e.targetPosition)&&!t.bWasUndone&&t.abRelation!="splitAtSource"){const n=o.targetPosition.root.rootName=="$graveyard",i=e.targetPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const r=e.targetPosition._getTransformedByMergeOperation(e),s=o.targetPosition._getTransformedByMergeOperation(e);return[new ce(r,o.howMany,s,0)]}return[new je(0)]}return o.sourcePosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMergeOperation(e),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),o.graveyardPosition.isEqual(e.graveyardPosition)&&t.aIsStrong||(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(e)),[o]}),ae(Re,ce,(o,e,t)=>{const n=V._createFromPositionAndShift(e.sourcePosition,e.howMany);return e.type=="remove"&&!t.bWasUndone&&!t.forceWeakRemove&&o.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(o.sourcePosition)?[new je(0)]:(o.sourcePosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.sourcePosition.hasSameParentAs(e.sourcePosition)&&(o.howMany-=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMoveOperation(e),o.targetPosition=o.targetPosition._getTransformedByMoveOperation(e),o.graveyardPosition.isEqual(e.targetPosition)||(o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(e)),[o])}),ae(Re,be,(o,e,t)=>{if(e.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),o.deletionPosition.isEqual(e.graveyardPosition)&&(o.howMany=e.howMany)),o.targetPosition.isEqual(e.splitPosition)){const n=e.howMany!=0,i=e.graveyardPosition&&o.deletionPosition.isEqual(e.graveyardPosition);if(n||i||t.abRelation=="mergeTargetNotMoved")return o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(e),[o]}if(o.sourcePosition.isEqual(e.splitPosition)){if(t.abRelation=="mergeSourceNotMoved")return o.howMany=0,o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o];if(t.abRelation=="mergeSameElement"||o.sourcePosition.offset>0)return o.sourcePosition=e.moveTargetPosition.clone(),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o]}return o.sourcePosition.hasSameParentAs(e.splitPosition)&&(o.howMany=e.splitPosition.offset),o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(e),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o]}),ae(ce,$e,(o,e)=>{const t=V._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByInsertOperation(e,!1)[0];return o.sourcePosition=t.start,o.howMany=t.end.offset-t.start.offset,o.targetPosition.isEqual(e.position)||(o.targetPosition=o.targetPosition._getTransformedByInsertOperation(e)),[o]}),ae(ce,ce,(o,e,t)=>{const n=V._createFromPositionAndShift(o.sourcePosition,o.howMany),i=V._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=t.aIsStrong,a=!t.aIsStrong;if(t.abRelation=="insertBefore"||t.baRelation=="insertAfter"?a=!0:t.abRelation!="insertAfter"&&t.baRelation!="insertBefore"||(a=!1),r=o.targetPosition.isEqual(e.targetPosition)&&a?o.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):o.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Uh(o,e)&&Uh(e,o))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(i,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),jn([n],r);if(i.containsPosition(o.targetPosition)&&i.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),jn([n],r);const l=Ue(o.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(l=="prefix"||l=="extension")return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),jn([n],r);o.type!="remove"||e.type=="remove"||t.aWasUndone||t.forceWeakRemove?o.type=="remove"||e.type!="remove"||t.bWasUndone||t.forceWeakRemove||(s=!1):s=!0;const c=[],d=n.getDifference(i);for(const g of d){g.start=g.start._getTransformedByDeletion(e.sourcePosition,e.howMany),g.end=g.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const f=Ue(g.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same",b=g._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,f);c.push(...b)}const u=n.getIntersection(i);return u!==null&&s&&(u.start=u.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),u.end=u.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),c.length===0?c.push(u):c.length==1?i.start.isBefore(n.start)||i.start.isEqual(n.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),c.length===0?[new je(o.baseVersion)]:jn(c,r)}),ae(ce,be,(o,e,t)=>{let n=o.targetPosition.clone();o.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&t.abRelation!="moveTargetAfter"||(n=o.targetPosition._getTransformedBySplitOperation(e));const i=V._createFromPositionAndShift(o.sourcePosition,o.howMany);if(i.end.isEqual(e.insertionPosition))return e.graveyardPosition||o.howMany++,o.targetPosition=n,[o];if(i.start.hasSameParentAs(e.splitPosition)&&i.containsPosition(e.splitPosition)){let s=new V(e.splitPosition,i.end);return s=s._getTransformedBySplitOperation(e),jn([new V(i.start,e.splitPosition),s],n)}o.targetPosition.isEqual(e.splitPosition)&&t.abRelation=="insertAtSource"&&(n=e.moveTargetPosition),o.targetPosition.isEqual(e.insertionPosition)&&t.abRelation=="insertBetween"&&(n=o.targetPosition);const r=[i._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const s=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);o.howMany>1&&s&&!t.aWasUndone&&r.push(V._createFromPositionAndShift(e.insertionPosition,1))}return jn(r,n)}),ae(ce,Re,(o,e,t)=>{const n=V._createFromPositionAndShift(o.sourcePosition,o.howMany);if(e.deletionPosition.hasSameParentAs(o.sourcePosition)&&n.containsPosition(e.sourcePosition)){if(o.type!="remove"||t.forceWeakRemove){if(o.howMany==1)return t.bWasUndone?(o.sourcePosition=e.graveyardPosition.clone(),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),[o]):[new je(0)]}else if(!t.aWasUndone){const r=[];let s=e.graveyardPosition.clone(),a=e.targetPosition._getTransformedByMergeOperation(e);o.howMany>1&&(r.push(new ce(o.sourcePosition,o.howMany-1,o.targetPosition,0)),s=s._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1),a=a._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1));const l=e.deletionPosition._getCombined(o.sourcePosition,o.targetPosition),c=new ce(s,1,l,0),d=c.getMovedRangeStart().path.slice();d.push(0);const u=new H(c.targetPosition.root,d);a=a._getTransformedByMove(s,l,1);const g=new ce(a,e.howMany,u,0);return r.push(c),r.push(g),r}}const i=V._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByMergeOperation(e);return o.sourcePosition=i.start,o.howMany=i.end.offset-i.start.offset,o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),[o]}),ae(Je,$e,(o,e)=>(o.position=o.position._getTransformedByInsertOperation(e),[o])),ae(Je,Re,(o,e)=>o.position.isEqual(e.deletionPosition)?(o.position=e.graveyardPosition.clone(),o.position.stickiness="toNext",[o]):(o.position=o.position._getTransformedByMergeOperation(e),[o])),ae(Je,ce,(o,e)=>(o.position=o.position._getTransformedByMoveOperation(e),[o])),ae(Je,Je,(o,e,t)=>{if(o.position.isEqual(e.position)){if(!t.aIsStrong)return[new je(0)];o.oldName=e.newName}return[o]}),ae(Je,be,(o,e)=>{if(Ue(o.position.path,e.splitPosition.getParentPath())=="same"&&!e.graveyardPosition){const t=new Je(o.position.getShiftedBy(1),o.oldName,o.newName,0);return[o,t]}return o.position=o.position._getTransformedBySplitOperation(e),[o]}),ae(Tt,Tt,(o,e,t)=>{if(o.root===e.root&&o.key===e.key){if(!t.aIsStrong||o.newValue===e.newValue)return[new je(0)];o.oldValue=e.newValue}return[o]}),ae(yt,yt,(o,e,t)=>o.rootName!==e.rootName||o.isAdd!==e.isAdd||t.bWasUndone?[o]:[new je(0)]),ae(be,$e,(o,e)=>(o.splitPosition.hasSameParentAs(e.position)&&o.splitPosition.offset{if(!o.graveyardPosition&&!t.bWasUndone&&o.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const i=new H(e.graveyardPosition.root,n),r=be.getInsertionPosition(new H(e.graveyardPosition.root,n)),s=new be(i,0,r,null,0);return o.splitPosition=o.splitPosition._getTransformedByMergeOperation(e),o.insertionPosition=be.getInsertionPosition(o.splitPosition),o.graveyardPosition=s.insertionPosition.clone(),o.graveyardPosition.stickiness="toNext",[s,o]}return o.splitPosition.hasSameParentAs(e.deletionPosition)&&!o.splitPosition.isAfter(e.deletionPosition)&&o.howMany--,o.splitPosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.splitPosition=o.splitPosition._getTransformedByMergeOperation(e),o.insertionPosition=be.getInsertionPosition(o.splitPosition),o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(e)),[o]}),ae(be,ce,(o,e,t)=>{const n=V._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.graveyardPosition){const r=n.start.isEqual(o.graveyardPosition)||n.containsPosition(o.graveyardPosition);if(!t.bWasUndone&&r){const s=o.splitPosition._getTransformedByMoveOperation(e),a=o.graveyardPosition._getTransformedByMoveOperation(e),l=a.path.slice();l.push(0);const c=new H(a.root,l);return[new ce(s,o.howMany,c,0)]}o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(e)}const i=o.splitPosition.isEqual(e.targetPosition);if(i&&(t.baRelation=="insertAtSource"||t.abRelation=="splitBefore"))return o.howMany+=e.howMany,o.splitPosition=o.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),o.insertionPosition=be.getInsertionPosition(o.splitPosition),[o];if(i&&t.abRelation&&t.abRelation.howMany){const{howMany:r,offset:s}=t.abRelation;return o.howMany+=r,o.splitPosition=o.splitPosition.getShiftedBy(s),[o]}if(o.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(o.splitPosition)){const r=e.howMany-(o.splitPosition.offset-e.sourcePosition.offset);return o.howMany-=r,o.splitPosition.hasSameParentAs(e.targetPosition)&&o.splitPosition.offset{if(o.splitPosition.isEqual(e.splitPosition)){if(!o.graveyardPosition&&!e.graveyardPosition)return[new je(0)];if(o.graveyardPosition&&e.graveyardPosition&&o.graveyardPosition.isEqual(e.graveyardPosition))return[new je(0)];if(t.abRelation=="splitBefore")return o.howMany=0,o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(e),[o]}if(o.graveyardPosition&&e.graveyardPosition&&o.graveyardPosition.isEqual(e.graveyardPosition)){const n=o.splitPosition.root.rootName=="$graveyard",i=e.splitPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const r=[];return e.howMany&&r.push(new ce(e.moveTargetPosition,e.howMany,e.splitPosition,0)),o.howMany&&r.push(new ce(o.splitPosition,o.howMany,o.moveTargetPosition,0)),r}return[new je(0)]}if(o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(e)),o.splitPosition.isEqual(e.insertionPosition)&&t.abRelation=="splitBefore")return o.howMany++,[o];if(e.splitPosition.isEqual(o.insertionPosition)&&t.baRelation=="splitBefore"){const n=e.insertionPosition.path.slice();n.push(0);const i=new H(e.insertionPosition.root,n);return[o,new ce(o.insertionPosition,1,i,0)]}return o.splitPosition.hasSameParentAs(e.splitPosition)&&o.splitPosition.offset{const t=e[0];t.isDocumentOperation&&w1.call(this,t)},{priority:"low"})}function w1(o){const e=this.getTransformedByOperation(o);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}Ye.prototype.is=function(o){return o==="livePosition"||o==="model:livePosition"||o=="position"||o==="model:position"};class $n{constructor(e={}){typeof e=="string"&&(e=e==="transparent"?{isUndoable:!1}:{},Q("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:n=!0,isUndo:i=!1,isTyping:r=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=n,this.isUndo=i,this.isTyping=r}get type(){return Q("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(e.baseVersion!==null)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}var A1=Object.defineProperty,Wh=Object.getOwnPropertySymbols,_1=Object.prototype.hasOwnProperty,C1=Object.prototype.propertyIsEnumerable,Kh=(o,e,t)=>e in o?A1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class v1{constructor(e){this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changedRoots=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set,this._markerCollection=e}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0&&this._changedRoots.size==0}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const n of t.range.getItems({shallow:!0}))this._isInInsertedElement(n.parent)||this._markAttribute(n);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const n=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);n||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const n=V._createFromPositionAndShift(t.position,1);for(const i of this._markerCollection.getMarkersIntersectingRange(n)){const r=i.getData();this.bufferMarkerChange(i.name,r,r)}break}case"split":{const n=t.splitPosition.parent;this._isInInsertedElement(n)||this._markRemove(n,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const n=t.sourcePosition.parent;this._isInInsertedElement(n.parent)||this._markRemove(n.parent,n.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const r=t.targetPosition.parent;this._isInInsertedElement(r)||this._markInsert(r,t.targetPosition.offset,n.maxOffset);break}case"detachRoot":case"addRoot":this._bufferRootStateChange(t.rootName,t.isAdd);break;case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{const n=t.root.rootName;this._bufferRootAttributeChange(n,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n){const i=this._changedMarkers.get(e);i?(i.newMarkerData=n,i.oldMarkerData.range==null&&n.range==null&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{newMarkerData:n,oldMarkerData:t})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)n.oldMarkerData.range!=null&&e.push({name:t,range:n.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)n.newMarkerData.range!=null&&e.push({name:t,range:n.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}}))}hasDataChanges(){if(this._changesInElement.size>0||this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const n=e.range&&!t.range,i=!e.range&&t.range,r=e.range&&t.range&&!e.range.isEqual(t.range);if(n||i||r)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const n of this._changesInElement.keys()){const i=this._changesInElement.get(n).sort((d,u)=>d.offset===u.offset?d.type!=u.type?d.type=="remove"?-1:1:0:d.offsetn.position.root!=i.position.root?n.position.root.rootNamen);for(const n of t)delete n.changeCount,n.type=="attribute"&&(delete n.position,delete n.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(E1),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(e=>{const t=((n,i)=>{for(var r in i||(i={}))_1.call(i,r)&&Kh(n,r,i[r]);if(Wh)for(var r of Wh(i))C1.call(i,r)&&Kh(n,r,i[r]);return n})({},e);return t.state!==void 0&&delete t.attributes,t})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const n=this._changedRoots.get(e);n.state!==void 0?(delete n.state,n.attributes===void 0&&this._changedRoots.delete(e)):n.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,n,i){const r=this._changedRoots.get(e)||{name:e},s=r.attributes||{};if(s[t]){const a=s[t];i===a.oldValue?delete s[t]:a.newValue=i}else s[t]={oldValue:n,newValue:i};Object.entries(s).length===0?(delete r.attributes,r.state===void 0&&this._changedRoots.delete(e)):(r.attributes=s,this._changedRoots.set(e,r))}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e);const t=V._createOn(e);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const i=n.getData();this.bufferMarkerChange(n.name,i,i)}this._cachedChanges=null}_markInsert(e,t,n){const i={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,n){const i={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let i=0;in.offset){if(i>r){const s={type:"attribute",offset:r,howMany:i-r,count:this._changeCount++};this._handleChange(s,t),t.push(s)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offsetr?(e.nodesToHandle=i-r,e.offset=r):e.nodesToHandle=0);if(n.type=="remove"&&e.offsetn.offset){const s={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(s,t),t.push(s),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}n.type=="attribute"&&(e.offset>=n.offset&&i<=r?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=r&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:H._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:H._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[r,s]of t){const a=n.has(r)?n.get(r):null;a!==s&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:s,attributeNewValue:a,changeCount:this._changeCount++}),n.delete(r)}for(const[r,s]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:s,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n){for(const r of n)if(r.type=="insert"&&i>=r.offset&&in){for(let s=0;sthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new I("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const n=this._operations[0];e===void 0&&(e=n.baseVersion);let i=t-1;for(const[a,l]of this._gaps)e>a&&ea&&ithis.lastOperation.baseVersion)return[];let r=this._baseVersionToOperationIndex.get(e);r===void 0&&(r=0);let s=this._baseVersionToOperationIndex.get(i);return s===void 0&&(s=this._operations.length-1),this._operations.slice(r,s+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(t!==void 0)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Di extends ke{constructor(e,t,n="main"){super(t),this._isAttached=!0,this._document=e,this.rootName=n}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Di.prototype.is=function(o,e){return e?e===this.name&&(o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"):o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"||o==="node"||o==="model:node"};var S1=Object.defineProperty,D1=Object.defineProperties,B1=Object.getOwnPropertyDescriptors,Zh=Object.getOwnPropertySymbols,T1=Object.prototype.hasOwnProperty,I1=Object.prototype.propertyIsEnumerable,Jh=(o,e,t)=>e in o?S1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Yh=(o,e)=>{for(var t in e||(e={}))T1.call(e,t)&&Jh(o,t,e[t]);if(Zh)for(var t of Zh(e))I1.call(e,t)&&Jh(o,t,e[t]);return o},Qh=(o,e)=>D1(o,B1(e));const Ps="$graveyard";class P1 extends me(){constructor(e){super(),this.model=e,this.history=new x1,this.selection=new mt(this),this.roots=new at({idProperty:"rootName"}),this.differ=new v1(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Ps),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&this.history.addOperation(i)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,n,i,r,s)=>{const a=Qh(Yh({},n.getData()),{range:r});this.differ.bufferMarkerChange(n.name,s,a),i===null&&n.on("change",(l,c)=>{const d=n.getData();this.differ.bufferMarkerChange(n.name,Qh(Yh({},d),{range:c}),d)})}),this.registerPostFixer(t=>{let n=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(t.remove(t.createRangeIn(i)),n=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(t.removeMarker(i),n=!0);return n})}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Ps)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new I("model-document-createroot-name-exists",this,{name:t});const n=new Di(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return Array.from(this.roots).filter(t=>t.rootName!=Ps&&(e||t.isAttached())).map(t=>t.rootName)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=md(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return Xh(e.start)&&Xh(e.end)}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break;while(t)}}function Xh(o){const e=o.textNode;if(e){const t=e.data,n=o.offset-e.startOffset;return!Wr(t,n)&&!Kr(t,n)}return!0}var R1=Object.defineProperty,O1=Object.defineProperties,N1=Object.getOwnPropertyDescriptors,eu=Object.getOwnPropertySymbols,z1=Object.prototype.hasOwnProperty,M1=Object.prototype.propertyIsEnumerable,tu=(o,e,t)=>e in o?R1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class F1 extends me(){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Hn?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const r=e instanceof Hn?e.name:e;if(r.includes(","))throw new I("markercollection-incorrect-marker-name",this);const s=this._markers.get(r);if(s){const d=s.getData(),u=s.getRange();let g=!1;return u.isEqual(t)||(s._attachLiveRange(Bt.fromRange(t)),g=!0),n!=s.managedUsingOperations&&(s._managedUsingOperations=n,g=!0),typeof i=="boolean"&&i!=s.affectsData&&(s._affectsData=i,g=!0),g&&this.fire(`update:${r}`,s,u,t,d),s}const a=Bt.fromRange(t),l=new Hn(r,a,n,i);var c;return this._markers.set(r,l),this.fire(`update:${r}`,l,null,t,(c=((d,u)=>{for(var g in u||(u={}))z1.call(u,g)&&tu(d,g,u[g]);if(eu)for(var g of eu(u))M1.call(u,g)&&tu(d,g,u[g]);return d})({},l.getData()),O1(c,N1({range:null})))),l}_remove(e){const t=e instanceof Hn?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire(`update:${t}`,n,n.getRange(),null,n.getData()),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof Hn?e.name:e,n=this._markers.get(t);if(!n)throw new I("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire(`update:${t}`,n,i,i,n.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)t.getRange().getIntersection(e)!==null&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Hn extends me(qt){constructor(e,t,n,i){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new I("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Hn.prototype.is=function(o){return o==="marker"||o==="model:marker"};class V1 extends it{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new I("detach-operation-on-document-node",this)}_execute(){Vh(V._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class It extends qt{constructor(e){super(),this.markers=new Map,this._children=new yo,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(ke.fromJSON(n)):t.push(fe.fromJSON(n));return new It(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new fe(i)]:(et(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new fe(r):r instanceof ut?new fe(r.data,r.getAttributes()):r))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}}It.prototype.is=function(o){return o==="documentFragment"||o==="model:documentFragment"};class L1{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new fe(e,t)}createElement(e,t){return new ke(e,t)}createDocumentFragment(){return new It}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof fe&&e.data=="")return;const i=H._createAt(t,n);if(e.parent){if(iu(e.root,i.root))return void this.move(V._createOn(e),i);if(e.root.document)throw new I("model-writer-insert-forbidden-move",this);this.remove(e)}const r=i.root.document?i.root.document.version:null,s=new $e(i,e,r);if(e instanceof fe&&(s.shouldReceiveAttributes=!0),this.batch.addOperation(s),this.model.applyOperation(s),e instanceof It)for(const[a,l]of e.markers){const c=H._createAt(l.root,0),d={range:new V(l.start._getCombined(c,i),l.end._getCombined(c,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(a)?this.updateMarker(a,d):this.addMarker(a,d)}}insertText(e,t,n,i){t instanceof It||t instanceof ke||t instanceof H?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,i)}insertElement(e,t,n,i){t instanceof It||t instanceof ke||t instanceof H?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,i)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof It||t instanceof ke?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof It||t instanceof ke?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof V){const i=n.getMinimalFlatRanges();for(const r of i)nu(this,e,t,r)}else ou(this,e,t,n)}setAttributes(e,t){for(const[n,i]of Dt(e))this.setAttribute(n,i,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof V){const n=t.getMinimalFlatRanges();for(const i of n)nu(this,e,null,i)}else ou(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=n=>{for(const i of n.getAttributeKeys())this.removeAttribute(i,n)};if(e instanceof V)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof V))throw new I("writer-move-invalid-range",this);if(!e.isFlat)throw new I("writer-move-range-not-flat",this);const i=H._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!iu(e.root,i.root))throw new I("writer-move-different-document",this);const r=e.root.document?e.root.document.version:null,s=new ce(e.start,e.end.offset-e.start.offset,i,r);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof V?e:V._createOn(e)).getMinimalFlatRanges().reverse();for(const n of t)this._addOperationForAffectedMarkers("move",n),j1(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof ke))throw new I("writer-merge-no-element-before",this);if(!(n instanceof ke))throw new I("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(V._createIn(n),H._createAt(t,"end")),this.remove(n)}_merge(e){const t=H._createAt(e.nodeBefore,"end"),n=H._createAt(e.nodeAfter,0),i=e.root.document.graveyard,r=new H(i,[0]),s=e.root.document.version,a=new Re(n,e.nodeAfter.maxOffset,t,r,s);this.batch.addOperation(a),this.model.applyOperation(a)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof ke))throw new I("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new Je(H._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,r=e.parent;if(!r.parent)throw new I("writer-split-element-no-parent",this);if(t||(t=r.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new I("writer-split-invalid-limit-element",this);do{const s=r.root.document?r.root.document.version:null,a=r.maxOffset-e.offset,l=be.getInsertionPosition(e),c=new be(e,a,l,null,s);this.batch.addOperation(c),this.model.applyOperation(c),n||i||(n=r,i=e.parent.nextSibling),r=(e=this.createPositionAfter(e.parent)).parent}while(r!==t);return{position:e,range:new V(H._createAt(n,"end"),H._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new I("writer-wrap-range-not-flat",this);const n=t instanceof ke?t:new ke(t);if(n.childCount>0)throw new I("writer-wrap-element-not-empty",this);if(n.parent!==null)throw new I("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new V(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,H._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new I("writer-unwrap-element-no-parent",this);this.move(V._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||typeof t.usingOperation!="boolean")throw new I("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,r=t.affectsData!==void 0&&t.affectsData;if(this.model.markers.has(e))throw new I("writer-addmarker-marker-exists",this);if(!i)throw new I("writer-addmarker-no-range",this);return n?(Io(this,e,null,i,r),this.model.markers.get(e)):this.model.markers._set(e,i,n,r)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e=="string"?e:e.name,i=this.model.markers.get(n);if(!i)throw new I("writer-updatemarker-marker-not-exists",this);if(!t)return Q("writer-updatemarker-reconvert-using-editingcontroller",{markerName:n}),void this.model.markers._refresh(i);const r=typeof t.usingOperation=="boolean",s=typeof t.affectsData=="boolean",a=s?t.affectsData:i.affectsData;if(!r&&!t.range&&!s)throw new I("writer-updatemarker-wrong-options",this);const l=i.getRange(),c=t.range?t.range:l;r&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?Io(this,n,null,c,a):(Io(this,n,l,null,a),this.model.markers._set(n,c,void 0,a)):i.managedUsingOperations?Io(this,n,l,c,a):this.model.markers._set(n,c,void 0,a)}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t))throw new I("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);if(!n.managedUsingOperations)return void this.model.markers._remove(t);Io(this,t,n.getRange(),null,n.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const n=this.model.document.getRoot(e);if(n&&n.isAttached())throw new I("writer-addroot-root-exists",this);const i=this.model.document,r=new yt(e,t,!0,i,i.version);return this.batch.addOperation(r),this.model.applyOperation(r),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new I("writer-detachroot-no-root",this);for(const r of this.model.markers)r.getRange().root===t&&this.removeMarker(r);for(const r of t.getAttributeKeys())this.removeAttribute(r,t);this.remove(this.createRangeIn(t));const n=this.model.document,i=new yt(t.rootName,t.name,!1,n,n.version);this.batch.addOperation(i),this.model.applyOperation(i)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,t);else for(const[n,i]of Dt(e))this._setSelectionAttribute(n,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=mt._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=mt._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new I("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let r=!1;if(e==="move"){const s=t;r=s.containsPosition(i.start)||s.start.isEqual(i.start)||s.containsPosition(i.end)||s.end.isEqual(i.end)}else{const s=t,a=s.nodeBefore,l=s.nodeAfter,c=i.start.parent==a&&i.start.isAtEnd,d=i.end.parent==l&&i.end.offset==0,u=i.end.nodeAfter==l,g=i.start.nodeAfter==l;r=c||d||u||g}r&&this.updateMarker(n.name,{range:i})}}}function nu(o,e,t,n){const i=o.model,r=i.document;let s,a,l,c=n.start;for(const u of n.getWalker({shallow:!0}))l=u.item.getAttribute(e),s&&a!=l&&(a!=t&&d(),c=s),s=u.nextPosition,a=l;function d(){const u=new V(c,s),g=u.root.document?r.version:null,f=new Me(u,e,a,t,g);o.batch.addOperation(f),i.applyOperation(f)}s instanceof H&&s!=c&&a!=t&&d()}function ou(o,e,t,n){const i=o.model,r=i.document,s=n.getAttribute(e);let a,l;if(s!=t){if(n.root===n){const c=n.document?r.version:null;l=new Tt(n,e,s,t,c)}else{a=new V(H._createBefore(n),o.createPositionAfter(n));const c=a.root.document?r.version:null;l=new Me(a,e,s,t,c)}o.batch.addOperation(l),i.applyOperation(l)}}function Io(o,e,t,n,i){const r=o.model,s=r.document,a=new Ze(e,t,n,r.markers,!!i,s.version);o.batch.addOperation(a),r.applyOperation(a)}function j1(o,e,t,n){let i;if(o.root.document){const r=n.document,s=new H(r.graveyard,[0]);i=new ce(o,e,s,r.version)}else i=new V1(o,e);t.addOperation(i),n.applyOperation(i)}function iu(o,e){return o===e||o instanceof Di&&e instanceof Di}function $1(o,e,t={}){if(e.isCollapsed)return;const n=e.getFirstRange();if(n.root.rootName=="$graveyard")return;const i=o.schema;o.change(r=>{if(!t.doNotResetEntireContent&&function(c,d){const u=c.getLimitElement(d);if(!d.containsEntireContent(u))return!1;const g=d.getFirstRange();return g.start.parent==g.end.parent?!1:c.checkChild(u,"paragraph")}(i,e))return void function(c,d){const u=c.model.schema.getLimitElement(d);c.remove(c.createRangeIn(u)),au(c,c.createPositionAt(u,0),d)}(r,e);const s={};if(!t.doNotAutoparagraph){const c=e.getSelectedElement();c&&Object.assign(s,i.getAttributesWithProperty(c,"copyOnReplace",!0))}const[a,l]=function(c){const d=c.root.document.model,u=c.start;let g=c.end;if(d.hasContent(c,{ignoreMarkers:!0})){const f=function(b){const A=b.parent,E=A.root.document.model.schema,P=A.getAncestors({parentFirst:!0,includeSelf:!0});for(const z of P){if(E.isLimit(z))return null;if(E.isBlock(z))return z}}(g);if(f&&g.isTouching(d.createPositionAt(f,0))){const b=d.createSelection(c);d.modifySelection(b,{direction:"backward"});const A=b.getLastPosition(),E=d.createRange(A,g);d.hasContent(E,{ignoreMarkers:!0})||(g=A)}}return[Ye.fromPosition(u,"toPrevious"),Ye.fromPosition(g,"toNext")]}(n);a.isTouching(l)||r.remove(r.createRange(a,l)),t.leaveUnmerged||(function(c,d,u){const g=c.model;if(!Rs(c.model.schema,d,u))return;const[f,b]=function(A,E){const P=A.getAncestors(),z=E.getAncestors();let j=0;for(;P[j]&&P[j]==z[j];)j++;return[P[j],z[j]]}(d,u);!f||!b||(!g.hasContent(f,{ignoreMarkers:!0})&&g.hasContent(b,{ignoreMarkers:!0})?su(c,d,u,f.parent):ru(c,d,u,f.parent))}(r,a,l),i.removeDisallowedAttributes(a.parent.getChildren(),r)),lu(r,e,a),!t.doNotAutoparagraph&&function(c,d){const u=c.checkChild(d,"$text"),g=c.checkChild(d,"paragraph");return!u&&g}(i,a)&&au(r,a,e,s),a.detach(),l.detach()})}function ru(o,e,t,n){const i=e.parent,r=t.parent;if(i!=n&&r!=n){for(e=o.createPositionAfter(i),(t=o.createPositionBefore(r)).isEqual(e)||o.insert(r,e),o.merge(e);t.parent.isEmpty;){const s=t.parent;t=o.createPositionBefore(s),o.remove(s)}Rs(o.model.schema,e,t)&&ru(o,e,t,n)}}function su(o,e,t,n){const i=e.parent,r=t.parent;if(i!=n&&r!=n){for(e=o.createPositionAfter(i),(t=o.createPositionBefore(r)).isEqual(e)||o.insert(i,t);e.parent.isEmpty;){const s=e.parent;e=o.createPositionBefore(s),o.remove(s)}t=o.createPositionBefore(r),function(s,a){const l=a.nodeBefore,c=a.nodeAfter;l.name!=c.name&&s.rename(l,c.name),s.clearAttributes(l),s.setAttributes(Object.fromEntries(c.getAttributes()),l),s.merge(a)}(o,t),Rs(o.model.schema,e,t)&&su(o,e,t,n)}}function Rs(o,e,t){const n=e.parent,i=t.parent;return n!=i&&!o.isLimit(n)&&!o.isLimit(i)&&function(r,s,a){const l=new V(r,s);for(const c of l.getWalker())if(a.isLimit(c.item))return!1;return!0}(e,t,o)}function au(o,e,t,n={}){const i=o.createElement("paragraph");o.model.schema.setAllowedAttributes(i,n,o),o.insert(i,e),lu(o,t,o.createPositionAt(i,0))}function lu(o,e,t){e instanceof mt?o.setSelection(t):e.setTo(t)}function cu(o,e){const t=[];Array.from(o.getItems({direction:"backward"})).map(n=>e.createRangeOn(n)).filter(n=>(n.start.isAfter(o.start)||n.start.isEqual(o.start))&&(n.end.isBefore(o.end)||n.end.isEqual(o.end))).forEach(n=>{t.push(n.start.parent),e.remove(n)}),t.forEach(n=>{let i=n;for(;i.parent&&i.isEmpty;){const r=e.createRangeOn(i);i=i.parent,e.remove(r)}})}class H1{constructor(e,t,n){this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null,this._nodeToSelect=null,this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(e);if(n.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new I("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?V._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new V(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Ye.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new I("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Ye.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Ye.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof ke)||!this._canMergeLeft(e))return;const t=Ye._createBefore(e);t.stickiness="toNext";const n=Ye.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Ye._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Ye._createAt(t.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof ke)||!this._canMergeRight(e))return;const t=Ye._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new I("insertcontent-invalid-insertion-position",this);this.position=H._createAt(t.nodeBefore,"end");const n=Ye.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Ye._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Ye._createAt(t.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof ke&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof ke&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const n=this.position.parent;this.position=this.writer.createPositionBefore(n),n.isEmpty&&n.parent===t&&this.writer.remove(n)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const n=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=n,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function du(o,e,t="auto"){const n=o.getSelectedElement();if(n&&e.schema.isObject(n)&&!e.schema.isInline(n))return t=="before"||t=="after"?e.createRange(e.createPositionAt(n,t)):e.createRangeOn(n);const i=ze(o.getSelectedBlocks());if(!i)return e.createRange(o.focus);if(i.isEmpty)return e.createRange(e.createPositionAt(i,0));const r=e.createPositionAfter(i);return o.focus.isTouching(r)?e.createRange(r):e.createRange(e.createPositionBefore(i))}function q1(o,e,t,n={}){if(!o.schema.isObject(e))throw new I("insertobject-element-not-an-object",o,{object:e});const i=t||o.document.selection;let r=i;n.findOptimalPosition&&o.schema.isBlock(e)&&(r=o.createSelection(du(i,o,n.findOptimalPosition)));const s=ze(i.getSelectedBlocks()),a={};return s&&Object.assign(a,o.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),o.change(l=>{r.isCollapsed||o.deleteContent(r,{doNotAutoparagraph:!0});let c=e;const d=r.anchor.parent;!o.schema.checkChild(d,e)&&o.schema.checkChild(d,"paragraph")&&o.schema.checkChild("paragraph",e)&&(c=l.createElement("paragraph"),l.insert(e,c)),o.schema.setAllowedAttributes(c,a,l);const u=o.insertContent(c,r);return u.isCollapsed||n.setSelection&&function(g,f,b,A){const E=g.model;if(b=="on")return void g.setSelection(f,"on");if(b!="after")throw new I("insertobject-invalid-place-parameter-value",E);let P=f.nextSibling;if(E.schema.isInline(f))return void g.setSelection(f,"after");!(P&&E.schema.checkChild(P,"$text"))&&E.schema.checkChild(f.parent,"paragraph")&&(P=g.createElement("paragraph"),E.schema.setAllowedAttributes(P,A,g),E.insertContent(P,g.createPositionAfter(f))),P&&g.setSelection(P,0)}(l,e,n.setSelection,a),u})}const U1=' ,.?!:;"-()';function W1(o,e){const{isForward:t,walker:n,unit:i,schema:r,treatEmojiAsSingleUnit:s}=o,{type:a,item:l,nextPosition:c}=e;if(a=="text")return o.unit==="word"?function(d,u){let g=d.position.textNode;for(g||(g=u?d.position.nodeAfter:d.position.nodeBefore);g&&g.is("$text");){const f=d.position.offset-g.startOffset;if(Z1(g,f,u))g=u?d.position.nodeAfter:d.position.nodeBefore;else{if(G1(g.data,f,u))break;d.next()}}return d.position}(n,t):function(d,u,g){const f=d.position.textNode;if(f){const b=f.data;let A=d.position.offset-f.startOffset;for(;Wr(b,A)||u=="character"&&Kr(b,A)||g&&Rc(b,A);)d.next(),A=d.position.offset-f.startOffset}return d.position}(n,i,s);if(a==(t?"elementStart":"elementEnd")){if(r.isSelectable(l))return H._createAt(l,t?"after":"before");if(r.checkChild(c,"$text"))return c}else{if(r.isLimit(l))return void n.skip(()=>!0);if(r.checkChild(c,"$text"))return c}}function K1(o,e){const t=o.root,n=H._createAt(t,e?"end":0);return e?new V(o,n):new V(n,o)}function G1(o,e,t){const n=e+(t?0:-1);return U1.includes(o.charAt(n))}function Z1(o,e,t){return e===(t?o.offsetSize:0)}class J1 extends ge(){constructor(){super(),this.markers=new F1,this.document=new P1(this),this.schema=new Wy,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if(t.name==="$marker")return!0}),Hy(this),this.document.registerPostFixer(vh),this.on("insertContent",(e,[t,n])=>{e.return=function(i,r,s){return i.change(a=>{const l=s||i.document.selection;l.isCollapsed||i.deleteContent(l,{doNotAutoparagraph:!0});const c=new H1(i,a,l.anchor),d=[];let u;if(r.is("documentFragment")){if(r.markers.size){const b=[];for(const[A,E]of r.markers){const{start:P,end:z}=E,j=P.isEqual(z);b.push({position:P,name:A,isCollapsed:j},{position:z,name:A,isCollapsed:j})}b.sort(({position:A},{position:E})=>A.isBefore(E)?1:-1);for(const{position:A,name:E,isCollapsed:P}of b){let z=null,j=null;const Y=A.parent===r&&A.isAtStart,ie=A.parent===r&&A.isAtEnd;Y||ie?P&&(j=Y?"start":"end"):(z=a.createElement("$marker"),a.insert(z,A)),d.push({name:E,element:z,collapsed:j})}}u=r.getChildren()}else u=[r];c.handleNodes(u);let g=c.getSelectionRange();if(r.is("documentFragment")&&d.length){const b=g?Bt.fromRange(g):null,A={};for(let E=d.length-1;E>=0;E--){const{name:P,element:z,collapsed:j}=d[E],Y=!A[P];if(Y&&(A[P]=[]),z){const ie=a.createPositionAt(z,"before");A[P].push(ie),a.remove(z)}else{const ie=c.getAffectedRange();if(!ie){j&&A[P].push(c.position);continue}j?A[P].push(ie[j]):A[P].push(Y?ie.start:ie.end)}}for(const[E,[P,z]]of Object.entries(A))P&&z&&P.root===z.root&&a.addMarker(E,{usingOperation:!0,affectsData:!0,range:new V(P,z)});b&&(g=b.toRange(),b.detach())}g&&(l instanceof mt?a.setSelection(g):l.setTo(g));const f=c.getAffectedRange()||i.createRange(l.anchor);return c.destroy(),f})}(this,t,n)}),this.on("insertObject",(e,[t,n,i])=>{e.return=q1(this,t,n,i)}),this.on("canEditAt",e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()})}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new $n,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){I.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{e?typeof e=="function"?(t=e,e=new $n):e instanceof $n||(e=new $n(e)):e=new $n,this._pendingChanges.push({batch:e,callback:t}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(n){I.rethrowUnexpectedError(n,this)}}applyOperation(e){e._execute()}insertContent(e,t,n,...i){const r=Os(t,n);return this.fire("insertContent",[e,r,n,...i])}insertObject(e,t,n,i,...r){const s=Os(t,n);return this.fire("insertObject",[e,s,i,i,...r])}deleteContent(e,t){$1(this,e,t)}modifySelection(e,t){(function(n,i,r={}){const s=n.schema,a=r.direction!="backward",l=r.unit?r.unit:"character",c=!!r.treatEmojiAsSingleUnit,d=i.focus,u=new vt({boundaries:K1(d,a),singleCharacters:!0,direction:a?"forward":"backward"}),g={walker:u,schema:s,isForward:a,unit:l,treatEmojiAsSingleUnit:c};let f;for(;f=u.next();){if(f.done)return;const b=W1(g,f.value);if(b)return void(i instanceof mt?n.change(A=>{A.setSelectionFocus(b)}):i.setFocus(b))}})(this,e,t)}getSelectedContent(e){return function(t,n){return t.change(i=>{const r=i.createDocumentFragment(),s=n.getFirstRange();if(!s||s.isCollapsed)return r;const a=s.start.root,l=s.start.getCommonPath(s.end),c=a.getNodeByPath(l);let d;d=s.start.parent==s.end.parent?s:i.createRange(i.createPositionAt(c,s.start.path[l.length]),i.createPositionAt(c,s.end.path[l.length]+1));const u=d.end.offset-d.start.offset;for(const g of d.getItems({shallow:!0}))g.is("$textProxy")?i.appendText(g.data,g.getAttributes(),r):i.append(i.cloneElement(g,!0),r);if(d!=s){const g=s._getTransformedByMove(d.start,i.createPositionAt(r,0),u)[0],f=i.createRange(i.createPositionAt(r,0),g.start);cu(i.createRange(g.end,i.createPositionAt(r,"end")),i),cu(f,i)}return r})}(this,e)}hasContent(e,t={}){const n=e instanceof V?e:V._createIn(e);if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:r=!1}=t;if(!r){for(const s of this.markers.getMarkersIntersectingRange(n))if(s.affectsData)return!0}for(const s of n.getItems())if(this.schema.isContent(s)&&(!s.is("$textProxy")||!i||s.data.search(/\S/)!==-1))return!0;return!1}canEditAt(e){const t=Os(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,n){return new H(e,t,n)}createPositionAt(e,t){return H._createAt(e,t)}createPositionAfter(e){return H._createAfter(e)}createPositionBefore(e){return H._createBefore(e)}createRange(e,t){return new V(e,t)}createRangeIn(e){return V._createIn(e)}createRangeOn(e){return V._createOn(e)}createSelection(...e){return new ot(...e)}createBatch(e){return new $n(e)}createOperationFromJSON(e){return g1.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new L1(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function Os(o,e){if(o)return o instanceof ot||o instanceof mt?o:o instanceof un?e||e===0?new ot(o,e):o.is("rootElement")?new ot(o,"in"):new ot(o,"on"):new ot(o)}class Y1 extends Ht{constructor(){super(...arguments),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Ns extends Ht{constructor(){super(...arguments),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Bi{constructor(e){this.document=e}createDocumentFragment(e){return new hn(this.document,e)}createElement(e,t,n){return new tt(this.document,e,t,n)}createText(e){return new pe(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const i=n.getChildIndex(e);return this.removeChildren(i,1,n),this.insertChild(i,t,n),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new tt(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Ge(e)&&n===void 0?t._setStyle(e):n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return U._createAt(e,t)}createPositionAfter(e){return U._createAfter(e)}createPositionBefore(e){return U._createBefore(e)}createRange(e,t){return new X(e,t)}createRangeOn(e){return X._createOn(e)}createRangeIn(e){return X._createIn(e)}createSelection(...e){return new At(...e)}}function Q1(o=""){if(o==="")return{top:void 0,right:void 0,bottom:void 0,left:void 0};const e=o.replace(/, /g,",").split(" ").map(r=>r.replace(/,/g,", ")),t=e[0],n=e[2]||t,i=e[1]||t;return{top:t,bottom:n,right:i,left:e[3]||i}}function X1({top:o,right:e,bottom:t,left:n}){const i=[];return n!==e?i.push(o,e,t,n):t!==o?i.push(o,e,t):e!==o?i.push(o,e):i.push(o),i.join(" ")}function eE(o){var e,t;o.setNormalizer("margin",(e="margin",n=>({path:e,value:Q1(n)}))),o.setNormalizer("margin-top",n=>({path:"margin.top",value:n})),o.setNormalizer("margin-right",n=>({path:"margin.right",value:n})),o.setNormalizer("margin-bottom",n=>({path:"margin.bottom",value:n})),o.setNormalizer("margin-left",n=>({path:"margin.left",value:n})),o.setReducer("margin",(t="margin",n=>{const{top:i,right:r,bottom:s,left:a}=n,l=[];return[i,r,a,s].every(c=>!!c)?l.push([t,X1(n)]):(i&&l.push([t+"-top",i]),r&&l.push([t+"-right",r]),s&&l.push([t+"-bottom",s]),a&&l.push([t+"-left",a])),l})),o.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}class tE{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new I("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class nE extends ge(){constructor(e={}){super();const t=this.constructor,n=e.language||t.defaultConfig&&t.defaultConfig.language;this._context=e.context||new dd({language:n}),this._context._addEditor(this,!e.context);const i=Array.from(t.builtinPlugins||[]);this.config=new hc(e,t.defaultConfig),this.config.define("plugins",i),this.config.define(this._context._getEditorConfig()),this.plugins=new cd(this,i,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new tE,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new J1,this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const r=new Sv;this.data=new u1(this.model,r),this.editing=new qy(this.model,r),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new m1([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 GC(this),this.keystrokes.listenTo(this.editing.view.document)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new I("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new I("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 I("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))}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[],r=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(i),n,r)}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(t=>this.once("ready",t))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(n){I.rethrowUnexpectedError(n,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}}function Ti(o){return class extends o{setData(e){this.data.set(e)}getData(e){return this.data.get(e)}}}{const o=Ti(Object);Ti.setData=o.prototype.setData,Ti.getData=o.prototype.getData}function zs(o){return class extends o{updateSourceElement(e=this.data.get()){if(!this.sourceElement)throw new I("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),n=this.sourceElement instanceof HTMLTextAreaElement;bC(this.sourceElement,t||n?e:"")}}}zs.updateSourceElement=zs(Object).prototype.updateSourceElement;class Ii extends ui{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new at({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new I("pendingactions-add-invalid-message",this);const t=new(ge());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const ve={bold:'',cancel:'',caption:'',check:'',cog:'',eraser:'',image:'',lowVision:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:''};var hu=D(5542),oE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(hu.Z,oE),hu.Z.locals;const{threeVerticalDots:uu}=ve,iE={alignLeft:ve.alignLeft,bold:ve.bold,importExport:ve.importExport,paragraph:ve.paragraph,plus:ve.plus,text:ve.text,threeVerticalDots:ve.threeVerticalDots};class Ms extends re{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new ht,this.keystrokes=new St,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new rE(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r=e.uiLanguageDirection==="rtl";this._focusCycler=new bo({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var a;this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(a=this,a.bindTemplate.to(l=>{l.target===a.element&&l.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new aE(this):new sE(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,n){this.items.addMany(this._buildItemsFromConfig(e,t,n))}_buildItemsFromConfig(e,t,n){const i=rd(e),r=n||i.removeItems;return this._cleanItemsConfiguration(i.items,t,r).map(s=>xe(s)?this._createNestedToolbarDropdown(s,t,r):s==="|"?new id:s==="-"?new KC:t.create(s)).filter(s=>!!s)}_cleanItemsConfiguration(e,t,n){const i=e.filter((r,s,a)=>r==="|"||n.indexOf(r)===-1&&(r==="-"?!this.options.shouldGroupWhenFull||(Q("toolbarview-line-break-ignored-when-grouping-items",a),!1):!(!xe(r)&&!t.has(r))||(Q("toolbarview-item-unavailable",{item:r}),!1)));return this._cleanSeparatorsAndLineBreaks(i)}_cleanSeparatorsAndLineBreaks(e){const t=s=>s!=="-"&&s!=="|",n=e.length,i=e.findIndex(t);if(i===-1)return[];const r=n-e.slice().reverse().findIndex(t);return e.slice(i,r).filter((s,a,l)=>t(s)?!0:!(a>0&&l[a-1]===s))}_createNestedToolbarDropdown(e,t,n){let{label:i,icon:r,items:s,tooltip:a=!0,withText:l=!1}=e;if(s=this._cleanItemsConfiguration(s,t,n),!s.length)return null;const c=Pt(this.locale);return i||Q("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:i,tooltip:a,withText:!!l}),r!==!1?c.buttonView.icon=iE[r]||r||uu:c.buttonView.withText=!0,Pi(c,()=>c.toolbarView._buildItemsFromConfig(s,t,n)),c}}class rE extends re{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class sE{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(n=>n),e.focusables.bindTo(e.items).using(n=>n),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class aE{constructor(e){this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCycleableItems.bind(this)),e.children.on("change",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(t,n)=>{const i=n.index,r=Array.from(n.added);for(const s of n.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(s):this.ungroupedItems.remove(s);for(let s=i;sthis.ungroupedItems.length?this.groupedItems.add(a,s-this.ungroupedItems.length):this.ungroupedItems.add(a,s)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!on(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new De(e.lastChild),i=new De(e);if(!this.cachedPadding){const r=oe.window.getComputedStyle(e),s=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[s])}return t==="ltr"?n.right>i.right-this.cachedPadding:n.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new id),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,n=Pt(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",Pi(n,this.groupedItems),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:uu}),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var mu=D(1046),lE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(mu.Z,lE),mu.Z.locals;class cE extends re{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new ht,this.keystrokes=new St,this._focusCycler=new bo({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",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")},children:this.items})}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)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class gu extends re{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",n=>!n)],role:"presentation"},children:this.children})}focus(){this.children.first.focus()}}class dE extends re{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var pu=D(7686),hE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(pu.Z,hE),pu.Z.locals;class Fs extends re{constructor(e){super(e);const t=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(),this.arrowView=this._createArrowView(),this.keystrokes=new St,this.focusTracker=new ht,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.to("class"),t.if("isVisible","ck-hidden",n=>!n),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(){const e=new Ae;return e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const e=new Ae,t=e.bindTemplate;return e.icon=nd,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",n=>String(n))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}var fu=D(7339),uE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(fu.Z,uE),fu.Z.locals;var ku=D(3949),mE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(ku.Z,mE),ku.Z.locals;function Pt(o,e=od){const t=new e(o),n=new UC(o),i=new Yr(o,t,n);return t.bind("isEnabled").to(i),t instanceof Fs?t.arrowView.bind("isOn").to(i,"isOpen"):t.bind("isOn").to(i,"isOpen"),function(r){(function(s){s.on("render",()=>{w({emitter:s,activator:()=>s.isOpen,callback:()=>{s.isOpen=!1},contextElements:[s.element]})})})(r),function(s){s.on("execute",a=>{a.source instanceof hi||(s.isOpen=!1)})}(r),function(s){s.focusTracker.on("change:isFocused",(a,l,c)=>{s.isOpen&&!c&&(s.isOpen=!1)})}(r),function(s){s.keystrokes.set("arrowdown",(a,l)=>{s.isOpen&&(s.panelView.focus(),l())}),s.keystrokes.set("arrowup",(a,l)=>{s.isOpen&&(s.panelView.focusLast(),l())})}(r),function(s){s.on("change:isOpen",(a,l,c)=>{if(c)return;const d=s.panelView.element;d&&d.contains(oe.document.activeElement)&&s.buttonView.focus()})}(r),function(s){s.on("change:isOpen",(a,l,c)=>{c&&s.panelView.focus()},{priority:"low"})}(r)}(i),i}function Pi(o,e,t={}){o.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),o.isOpen?bu(o,e,t):o.once("change:isOpen",()=>bu(o,e,t),{priority:"highest"}),t.enableActiveItemFocusOnDropdownOpen&&Au(o,()=>o.toolbarView.items.find(n=>n.isOn))}function bu(o,e,t){const n=o.locale,i=n.t,r=o.toolbarView=new Ms(n),s=typeof e=="function"?e():e;r.ariaLabel=t.ariaLabel||i("Dropdown toolbar"),t.maxWidth&&(r.maxWidth=t.maxWidth),t.class&&(r.class=t.class),t.isCompact&&(r.isCompact=t.isCompact),t.isVertical&&(r.isVertical=!0),s instanceof rn?r.items.bindTo(s).using(a=>a):r.items.addMany(s),o.panelView.children.add(r),r.items.delegate("execute").to(o)}function Vs(o,e,t={}){o.isOpen?wu(o,e,t):o.once("change:isOpen",()=>wu(o,e,t),{priority:"highest"}),Au(o,()=>o.listView.items.find(n=>n instanceof gu&&n.children.first.isOn))}function wu(o,e,t){const n=o.locale,i=o.listView=new cE(n),r=typeof e=="function"?e():e;i.ariaLabel=t.ariaLabel,i.role=t.role,i.items.bindTo(r).using(s=>{if(s.type==="separator")return new dE(n);if(s.type==="button"||s.type==="switchbutton"){const a=new gu(n);let l;return l=s.type==="button"?new Ae(n):new hi(n),l.bind(...Object.keys(s.model)).to(s.model),l.delegate("execute").to(a),a.children.add(l),a}return null}),o.panelView.children.add(i),i.items.delegate("execute").to(o)}function Au(o,e){o.on("change:isOpen",()=>{if(!o.isOpen)return;const t=e();t&&(typeof t.focus=="function"?t.focus():Q("ui-dropdown-focus-child-on-open-child-missing-focus",{view:t}))},{priority:te.low-10})}function _u(o,e,t){const n=new qC(o.locale);return n.set({id:e,ariaDescribedById:t}),n.bind("isReadOnly").to(o,"isEnabled",i=>!i),n.bind("hasError").to(o,"errorText",i=>!!i),n.on("input",()=>{o.errorText=null}),o.bind("isEmpty","isFocused","placeholder").to(n),n}const Po=(o,e=0,t=1)=>o>t?t:oMath.round(t*o)/t,Ls=o=>(o[0]==="#"&&(o=o.substring(1)),o.length<6?{r:parseInt(o[0]+o[0],16),g:parseInt(o[1]+o[1],16),b:parseInt(o[2]+o[2],16),a:o.length===4?He(parseInt(o[3]+o[3],16)/255,2):1}:{r:parseInt(o.substring(0,2),16),g:parseInt(o.substring(2,4),16),b:parseInt(o.substring(4,6),16),a:o.length===8?He(parseInt(o.substring(6,8),16)/255,2):1}),gE=({h:o,s:e,v:t,a:n})=>{const i=(200-e)*t/100;return{h:He(o),s:He(i>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0),l:He(i/2),a:He(n,2)}},js=o=>{const{h:e,s:t,l:n}=gE(o);return`hsl(${e}, ${t}%, ${n}%)`},pE=({h:o,s:e,v:t,a:n})=>{o=o/360*6,e/=100,t/=100;const i=Math.floor(o),r=t*(1-e),s=t*(1-(o-i)*e),a=t*(1-(1-o+i)*e),l=i%6;return{r:He(255*[t,s,r,r,a,t][l]),g:He(255*[a,t,t,s,r,r][l]),b:He(255*[r,r,a,t,t,s][l]),a:He(n,2)}},Ri=o=>{const e=o.toString(16);return e.length<2?"0"+e:e},fE=({r:o,g:e,b:t,a:n})=>{const i=n<1?Ri(He(255*n)):"";return"#"+Ri(o)+Ri(e)+Ri(t)+i},kE=({r:o,g:e,b:t,a:n})=>{const i=Math.max(o,e,t),r=i-Math.min(o,e,t),s=r?i===o?(e-t)/r:i===e?2+(t-o)/r:4+(o-e)/r:0;return{h:He(60*(s<0?s+6:s)),s:He(i?r/i*100:0),v:He(i/255*100),a:n}},Cu=(o,e)=>{if(o===e)return!0;for(const t in o)if(o[t]!==e[t])return!1;return!0},vu={},yu=o=>{let e=vu[o];return e||(e=document.createElement("template"),e.innerHTML=o,vu[o]=e),e},$s=(o,e,t)=>{o.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))};let qn=!1;const Hs=o=>"touches"in o,Eu=(o,e)=>{const t=Hs(e)?e.touches[0]:e,n=o.el.getBoundingClientRect();$s(o.el,"move",o.getMove({x:Po((t.pageX-(n.left+window.pageXOffset))/n.width),y:Po((t.pageY-(n.top+window.pageYOffset))/n.height)}))};class xu{constructor(e,t,n,i){const r=yu(`
`);e.appendChild(r.content.cloneNode(!0));const s=e.querySelector(`[part=${t}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(qn?"touchmove":"mousemove",this),t(qn?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!(t=>!(qn&&!Hs(t)||(qn||(qn=Hs(t)),0)))(e)||!qn&&e.button!=0)return;this.el.focus(),Eu(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),Eu(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((t,n)=>{const i=n.keyCode;i>40||t.xy&&i<37||i<33||(n.preventDefault(),$s(t.el,"move",t.getMove({x:i===39?.01:i===37?-.01:i===34?.05:i===33?-.05:i===35?1:i===36?-1:0,y:i===40?.01:i===38?-.01:0},!0)))})(this,e)}}style(e){e.forEach((t,n)=>{for(const i in t)this.nodes[n].style.setProperty(i,t[i])})}}class bE extends xu{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:e/360*100+"%",color:js({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${He(e)}`)}getMove(e,t){return{h:t?Po(this.h+360*e.x,0,360):360*e.x}}}class wE extends xu{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:100-e.v+"%",left:`${e.s}%`,color:js(e)},{"background-color":js({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${He(e.s)}%, Brightness ${He(e.v)}%`)}getMove(e,t){return{s:t?Po(this.hsva.s+100*e.x,0,100):100*e.x,v:t?Po(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const Oi=Symbol("same"),qs=Symbol("color"),Su=Symbol("hsva"),Us=Symbol("update"),Du=Symbol("parts"),Bu=Symbol("css"),Tu=Symbol("sliders");class AE extends HTMLElement{static get observedAttributes(){return["color"]}get[Bu](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[Tu](){return[wE,bE]}get color(){return this[qs]}set color(e){if(!this[Oi](e)){const t=this.colorModel.toHsva(e);this[Us](t),this[qs]=e}}constructor(){super();const e=yu(``),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[Du]=this[Tu].map(n=>new n(t))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,n){const i=this.colorModel.fromAttr(n);this[Oi](i)||(this.color=i)}handleEvent(e){const t=this[Su],n={...t,...e.detail};let i;this[Us](n),Cu(n,t)||this[Oi](i=this.colorModel.fromHsva(n))||(this[qs]=i,$s(this,"color-changed",{value:i}))}[Oi](e){return this.color&&this.colorModel.equal(e,this.color)}[Us](e){this[Su]=e,this[Du].forEach(t=>t.update(e))}}const _E={defaultColor:"#000",toHsva:o=>kE(Ls(o)),fromHsva:({h:o,s:e,v:t})=>fE(pE({h:o,s:e,v:t,a:1})),equal:(o,e)=>o.toLowerCase()===e.toLowerCase()||Cu(Ls(o),Ls(e)),fromAttr:o=>o};class CE extends AE{get colorModel(){return _E}}customElements.define("hex-color-picker",class extends CE{});var Iu=D(3398),vE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Iu.Z,vE),Iu.Z.locals;class yE{constructor(e){this._components=new Map,this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(Ws(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new I("componentfactory-item-missing",this,{name:e});return this._components.get(Ws(e)).callback(this.editor.locale)}has(e){return this._components.has(Ws(e))}}function Ws(o){return String(o).toLowerCase()}var Pu=D(8793),EE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Pu.Z,EE),Pu.Z.locals;var xE=Object.defineProperty,Ru=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,DE=Object.prototype.propertyIsEnumerable,Ou=(o,e,t)=>e in o?xE(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,le=(o,e)=>{for(var t in e||(e={}))SE.call(e,t)&&Ou(o,t,e[t]);if(Ru)for(var t of Ru(e))DE.call(e,t)&&Ou(o,t,e[t]);return o};const Nu=jr("px"),zu=oe.document.body,Ks=class extends re{constructor(o){super(o);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>`ck-balloon-panel_${t}`),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",Nu),left:e.to("left",Nu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(o){this.show();const e=Ks.defaultPositions,t=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast,e.viewportStickyNorth],limiter:zu,fitInViewport:!0},o),n=Ks._getOptimalPosition(t),i=parseInt(n.left),r=parseInt(n.top),s=n.name,a=n.config||{},{withArrow:l=!0}=a;this.top=r,this.left=i,this.position=s,this.withArrow=l}pin(o){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(o):this._stopPinning()},this._startPinning(o),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(o){this.attachTo(o);const e=Gs(o.target),t=o.limiter?Gs(o.limiter):zu;this.listenTo(oe.document,"scroll",(n,i)=>{const r=i.target,s=e&&r.contains(e),a=t&&r.contains(t);!s&&!a&&e&&t||this.attachTo(o)},{useCapture:!0}),this.listenTo(oe.window,"resize",()=>{this.attachTo(o)})}_stopPinning(){this.stopListening(oe.document,"scroll"),this.stopListening(oe.window,"resize")}};let Qe=Ks;function Gs(o){return Rn(o)?o:ii(o)?o.commonAncestorContainer:typeof o=="function"?Gs(o()):null}function Mu(o={}){const{sideOffset:e=Qe.arrowSideOffset,heightOffset:t=Qe.arrowHeightOffset,stickyVerticalOffset:n=Qe.stickyVerticalOffset,config:i}=o;return{northWestArrowSouthWest:(a,l)=>le({top:r(a,l),left:a.left-e,name:"arrow_sw"},i&&{config:i}),northWestArrowSouthMiddleWest:(a,l)=>le({top:r(a,l),left:a.left-.25*l.width-e,name:"arrow_smw"},i&&{config:i}),northWestArrowSouth:(a,l)=>le({top:r(a,l),left:a.left-l.width/2,name:"arrow_s"},i&&{config:i}),northWestArrowSouthMiddleEast:(a,l)=>le({top:r(a,l),left:a.left-.75*l.width+e,name:"arrow_sme"},i&&{config:i}),northWestArrowSouthEast:(a,l)=>le({top:r(a,l),left:a.left-l.width+e,name:"arrow_se"},i&&{config:i}),northArrowSouthWest:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-e,name:"arrow_sw"},i&&{config:i}),northArrowSouthMiddleWest:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-.25*l.width-e,name:"arrow_smw"},i&&{config:i}),northArrowSouth:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-l.width/2,name:"arrow_s"},i&&{config:i}),northArrowSouthMiddleEast:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-.75*l.width+e,name:"arrow_sme"},i&&{config:i}),northArrowSouthEast:(a,l)=>le({top:r(a,l),left:a.left+a.width/2-l.width+e,name:"arrow_se"},i&&{config:i}),northEastArrowSouthWest:(a,l)=>le({top:r(a,l),left:a.right-e,name:"arrow_sw"},i&&{config:i}),northEastArrowSouthMiddleWest:(a,l)=>le({top:r(a,l),left:a.right-.25*l.width-e,name:"arrow_smw"},i&&{config:i}),northEastArrowSouth:(a,l)=>le({top:r(a,l),left:a.right-l.width/2,name:"arrow_s"},i&&{config:i}),northEastArrowSouthMiddleEast:(a,l)=>le({top:r(a,l),left:a.right-.75*l.width+e,name:"arrow_sme"},i&&{config:i}),northEastArrowSouthEast:(a,l)=>le({top:r(a,l),left:a.right-l.width+e,name:"arrow_se"},i&&{config:i}),southWestArrowNorthWest:a=>le({top:s(a),left:a.left-e,name:"arrow_nw"},i&&{config:i}),southWestArrowNorthMiddleWest:(a,l)=>le({top:s(a),left:a.left-.25*l.width-e,name:"arrow_nmw"},i&&{config:i}),southWestArrowNorth:(a,l)=>le({top:s(a),left:a.left-l.width/2,name:"arrow_n"},i&&{config:i}),southWestArrowNorthMiddleEast:(a,l)=>le({top:s(a),left:a.left-.75*l.width+e,name:"arrow_nme"},i&&{config:i}),southWestArrowNorthEast:(a,l)=>le({top:s(a),left:a.left-l.width+e,name:"arrow_ne"},i&&{config:i}),southArrowNorthWest:a=>le({top:s(a),left:a.left+a.width/2-e,name:"arrow_nw"},i&&{config:i}),southArrowNorthMiddleWest:(a,l)=>le({top:s(a),left:a.left+a.width/2-.25*l.width-e,name:"arrow_nmw"},i&&{config:i}),southArrowNorth:(a,l)=>le({top:s(a),left:a.left+a.width/2-l.width/2,name:"arrow_n"},i&&{config:i}),southArrowNorthMiddleEast:(a,l)=>le({top:s(a),left:a.left+a.width/2-.75*l.width+e,name:"arrow_nme"},i&&{config:i}),southArrowNorthEast:(a,l)=>le({top:s(a),left:a.left+a.width/2-l.width+e,name:"arrow_ne"},i&&{config:i}),southEastArrowNorthWest:a=>le({top:s(a),left:a.right-e,name:"arrow_nw"},i&&{config:i}),southEastArrowNorthMiddleWest:(a,l)=>le({top:s(a),left:a.right-.25*l.width-e,name:"arrow_nmw"},i&&{config:i}),southEastArrowNorth:(a,l)=>le({top:s(a),left:a.right-l.width/2,name:"arrow_n"},i&&{config:i}),southEastArrowNorthMiddleEast:(a,l)=>le({top:s(a),left:a.right-.75*l.width+e,name:"arrow_nme"},i&&{config:i}),southEastArrowNorthEast:(a,l)=>le({top:s(a),left:a.right-l.width+e,name:"arrow_ne"},i&&{config:i}),westArrowEast:(a,l)=>le({top:a.top+a.height/2-l.height/2,left:a.left-l.width-t,name:"arrow_e"},i&&{config:i}),eastArrowWest:(a,l)=>le({top:a.top+a.height/2-l.height/2,left:a.right+t,name:"arrow_w"},i&&{config:i}),viewportStickyNorth:(a,l,c)=>a.getIntersection(c)?{top:c.top+n,left:a.left+a.width/2-l.width/2,name:"arrowless",config:le({withArrow:!1},i)}:null};function r(a,l){return a.top-l.height-t}function s(a){return a.bottom+t}}Qe.arrowSideOffset=25,Qe.arrowHeightOffset=10,Qe.stickyVerticalOffset=20,Qe._getOptimalPosition=vc,Qe.defaultPositions=Mu();var Fu=D(3332),BE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Fu.Z,BE),Fu.Z.locals;const Vu="ck-tooltip",Xe=class extends $t(){constructor(o){if(super(),this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver=null,Xe._editors.add(o),Xe._instance)return Xe._instance;Xe._instance=this,this.tooltipTextView=new re(o.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 Qe(o.locale),this.balloonPanelView.class=Vu,this.balloonPanelView.content.add(this.tooltipTextView),this._pinTooltipDebounced=vo(this._pinTooltip,600),this.listenTo(oe.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(oe.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(oe.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(oe.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(oe.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(o){const e=o.ui.view&&o.ui.view.body;Xe._editors.delete(o),this.stopListening(o.ui),e&&e.has(this.balloonPanelView)&&e.remove(this.balloonPanelView),Xe._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Xe._instance=null)}static getPositioningFunctions(o){const e=Xe.defaultBalloonPositions;return{s:[e.southArrowNorth,e.southArrowNorthEast,e.southArrowNorthWest],n:[e.northArrowSouth],e:[e.eastArrowWest],w:[e.westArrowEast],sw:[e.southArrowNorthEast],se:[e.southArrowNorthWest]}[o]}_onEnterOrFocus(o,{target:e}){const t=Zs(e);var n;t&&t!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(t,{text:(n=t).dataset.ckeTooltipText,position:n.dataset.ckeTooltipPosition||"s",cssClass:n.dataset.ckeTooltipClass||""}))}_onLeaveOrBlur(o,{target:e,relatedTarget:t}){if(o.name==="mouseleave"){if(!Rn(e)||this._currentElementWithTooltip&&e!==this._currentElementWithTooltip)return;const n=Zs(e),i=Zs(t);n&&n!==i&&this._unpinTooltip()}else{if(this._currentElementWithTooltip&&e!==this._currentElementWithTooltip)return;this._unpinTooltip()}}_onScroll(o,{target:e}){this._currentElementWithTooltip&&(e.contains(this.balloonPanelView.element)&&e.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(o,{text:e,position:t,cssClass:n}){const i=ze(Xe._editors.values()).ui.view.body;i.has(this.balloonPanelView)||i.add(this.balloonPanelView),this.tooltipTextView.text=e,this.balloonPanelView.pin({target:o,positions:Xe.getPositioningFunctions(t)}),this._resizeObserver=new si(o,()=>{on(o)||this._unpinTooltip()}),this.balloonPanelView.class=[Vu,n].filter(r=>r).join(" ");for(const r of Xe._editors)this.listenTo(r.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=o,this._currentTooltipPosition=t}_unpinTooltip(){this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const o of Xe._editors)this.stopListening(o.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver&&this._resizeObserver.destroy()}_updateTooltipPosition(){on(this._currentElementWithTooltip)?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Xe.getPositioningFunctions(this._currentTooltipPosition)}):this._unpinTooltip()}};let Ni=Xe;function Zs(o){return Rn(o)?o.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}Ni.defaultBalloonPositions=Mu({heightOffset:5,sideOffset:13}),Ni._editors=new Set,Ni._instance=null;const Js=function(o,e,t){var n=!0,i=!0;if(typeof o!="function")throw new TypeError("Expected a function");return xe(t)&&(n="leading"in t?!!t.leading:n,i="trailing"in t?!!t.trailing:i),vo(o,e,{leading:n,maxWait:e,trailing:i})};var TE=Object.defineProperty,Lu=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,PE=Object.prototype.propertyIsEnumerable,ju=(o,e,t)=>e in o?TE(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,RE=(o,e)=>{for(var t in e||(e={}))IE.call(e,t)&&ju(o,t,e[t]);if(Lu)for(var t of Lu(e))PE.call(e,t)&&ju(o,t,e[t]);return o};const OE=50,NE=350,zE="Powered by",zi={top:-99999,left:-99999,name:"invalid",config:{withArrow:!1}};class ME extends $t(){constructor(e){super(),this.editor=e,this._balloonView=null,this._lastFocusedEditableElement=null,this._showBalloonThrottled=Js(this._showBalloon.bind(this),50,{leading:!0}),e.on("ready",this._handleEditorReady.bind(this))}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;(function(t){function n(f){return f.match(/^[a-zA-Z0-9+/=$]+$/g)&&f.length>=40&&f.length<=255?"VALID":"INVALID"}let i="",r="";if(!t)return"INVALID";try{i=atob(t)}catch{return"INVALID"}const s=i.split("-"),a=s[0],l=s[1];if(!l)return n(t);try{atob(l)}catch{try{if(atob(a),!atob(a).length)return n(t)}catch{return n(t)}}if(a.length<40||a.length>255)return"INVALID";try{atob(a)}catch{return"INVALID"}try{r=atob(l)}catch{return"INVALID"}if(r.length!==8)return"INVALID";const c=Number(r.substring(0,4)),d=Number(r.substring(4,6))-1,u=Number(r.substring(6,8)),g=new Date(c,d,u);return g{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,n,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_createBalloonView(){const e=this.editor,t=this._balloonView=new Qe,n=Hu(e),i=new FE(e.locale,n.label);t.content.add(i),t.set({class:"ck-powered-by-balloon"}),e.ui.view.body.add(t),e.ui.focusTracker.add(t.element),this._balloonView=t}_showBalloon(){if(!this._lastFocusedEditableElement)return;const e=function(t,n){const i=Hu(t),r=i.side==="right"?function(s,a){return $u(s,a,(l,c)=>l.left+l.width-c.width-a.horizontalOffset)}(n,i):function(s,a){return $u(s,a,l=>l.left+a.horizontalOffset)}(n,i);return{target:n,positions:[r]}}(this.editor,this._lastFocusedEditableElement);e&&(this._balloonView||this._createBalloonView(),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,n=e.ui.focusTracker.focusedElement;if(!t||!n)return void(this._lastFocusedEditableElement=null);const i=Array.from(e.ui.getEditableElementsNames()).map(r=>e.ui.getEditableElement(r));i.includes(n)?this._lastFocusedEditableElement=n:this._lastFocusedEditableElement=i[0]}}class FE extends re{constructor(e,t){super(e);const n=new ko,i=this.bindTemplate;n.set({content:` +`,isColorInherited:!1}),n.extendTemplate({attributes:{style:{width:"53px",height:"10px"}}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],n],on:{dragstart:i.to(r=>r.preventDefault())}}]})}}function $u(o,e,t){return(n,i)=>{const r=n.getVisible();if(!r||n.widthc.bottom)return zi}}return{top:s,left:a,name:`position_${e.position}-side_${e.side}`,config:{withArrow:!1}}}}function Hu(o){const e=o.config.get("ui.poweredBy"),t=e&&e.position||"border";return RE({position:t,label:zE,verticalOffset:t==="inside"?5:0,horizontalOffset:5,side:o.locale.contentLanguageDirection==="ltr"?"right":"left"},e)}class VE extends ge(){constructor(e){super(),this.isReady=!1,this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this.editor=e,this.componentFactory=new yE(e),this.focusTracker=new ht,this.tooltipManager=new Ni(e),this.poweredBy=new ME(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",()=>{this.isReady=!0}),this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update()),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const n=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?n():this.once("ready",n)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const n=e.config.get("toolbar.viewportTopOffset");return n?(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:n}):{top:0}}_initFocusTracking(){const e=this.editor,t=e.editing.view;let n,i;e.keystrokes.set("Alt+F10",(r,s)=>{const a=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(a)&&!Array.from(t.domRoots.values()).includes(a)&&(n=a);const l=this._getCurrentFocusedToolbarDefinition();l&&i||(i=this._getFocusableCandidateToolbarDefinitions());for(let c=0;c{const a=this._getCurrentFocusedToolbarDefinition();a&&(n?(n.focus(),n=null):e.editing.view.focus(),a.options.afterBlur&&a.options.afterBlur(),s())})}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:n,options:i}=t;(on(n.element)||i.beforeFocus)&&e.push(t)}return e.sort((t,n)=>qu(t)-qu(n)),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:n}}=e;return n&&n(),!!on(t.element)&&(t.focus(),!0)}}function qu(o){const{toolbarView:e,options:t}=o;let n=10;return on(e.element)&&n--,t.isContextual&&n--,n}var Uu=D(9688),LE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Uu.Z,LE),Uu.Z.locals;class jE extends re{constructor(e){super(e),this.body=new NC(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class $E extends jE{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 Yc;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class HE extends re{constructor(e,t,n){super(e),this.name=null,this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(n){e.change(i=>{const r=e.document.getRoot(n.name);i.addClass(n.isFocused?"ck-focused":"ck-blurred",r),i.removeClass(n.isFocused?"ck-blurred":"ck-focused",r)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(r,s,a)=>{a?n(i):t(i)})}(this):t(this)}}class qE extends HE{constructor(e,t,n,i={}){super(e,t,n);const r=e.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=i.label||(()=>r("Editor editing area: %0",this.name))}render(){super.render();const e=this._editingView;e.change(t=>{const n=e.document.getRoot(this.name);t.setAttribute("aria-label",this._generateLabel(this),n)})}}var Wu=D(8847),UE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Wu.Z,UE),Wu.Z.locals;class Ku extends ui{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Ys extends ge(){constructor(e,t){super(),t&&Wd(this,t),e&&this.set(e)}}var Gu=D(4650),WE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Gu.Z,WE),Gu.Z.locals;var Zu=D(7676),KE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Zu.Z,KE),Zu.Z.locals;const Mi=jr("px");class Fi extends q{constructor(e){super(e),this._viewToStack=new Map,this._idToStack=new Map,this._view=null,this._rotatorView=null,this._fakePanelsView=null,this.positionLimiter=()=>{const t=this.editor.editing.view,n=t.document.selection.editableElement;return n?t.domConverter.mapViewToDom(n.root):null},this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}static get pluginName(){return"ContextualBalloon"}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 I("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new I("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._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new I("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new Qe(this.editor.locale),this.editor.ui.view.body.add(this._view),this.editor.ui.focusTracker.add(this._view.element),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new GE(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,i)=>!i&&n>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,i)=>{if(i<2)return"";const r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[r,i])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new ZE(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,n)=>!n&&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:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}}class GE extends re{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new ht,this.buttonPrevView=this._createButtonView(t("Previous"),''),this.buttonNextView=this._createButtonView(t("Next"),''),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",n.to("isNavigationVisible",i=>i?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.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 n=new Ae(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class ZE extends re{constructor(e,t){super(e);const n=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",n.to("numberOfPanels",i=>i?"":"ck-hidden")],style:{top:n.to("top",Mi),left:n.to("left",Mi),width:n.to("width",Mi),height:n.to("height",Mi)}},children:this.content}),this.on("change:numberOfPanels",(i,r,s,a)=>{s>a?this._addPanels(s-a):this._removePanels(a-s),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new re;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:n,height:i}=new De(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}var Ju=D(5868),JE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Ju.Z,JE),Ju.Z.locals;const Ro=jr("px");class YE extends re{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("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new bt({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",n=>n?"block":"none"),height:t.to("isSticky",n=>n?Ro(this._panelRect.height):null)}}}).render(),this._contentPanel=new bt({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",n=>n?Ro(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",n=>n?Ro(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",n=>n?Ro(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(oe.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.topt||0),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement;let r;const s=e.config.get("placeholder");s&&(r=typeof s=="string"?s:s[this.view.editable.name]),!r&&i&&i.tagName.toLowerCase()==="textarea"&&(r=i.getAttribute("placeholder")),r&&function({view:a,element:l,text:c,isDirectHost:d=!0,keepOnFocus:u=!1}){const g=a.document;mi.has(g)||(mi.set(g,new Map),g.registerPostFixer(f=>Xr(g,f)),g.on("change:isComposing",()=>{a.change(f=>Xr(g,f))},{priority:"high"})),mi.get(g).set(l,{text:c,isDirectHost:d,keepOnFocus:u,hostElement:d?l:null}),a.change(f=>Xr(g,f))}({view:t,element:n,text:r,isDirectHost:!1,keepOnFocus:!0})}}var Qu=D(3143),e2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Qu.Z,e2),Qu.Z.locals;class t2 extends $E{constructor(e,t,n={}){super(e),this.stickyPanel=new YE(e),this.toolbar=new Ms(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new qE(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Xu{constructor(e){if(this.crashes=[],this.state="initializing",this._now=Date.now,this.crashes=[],this._crashNumberLimit=typeof e.crashNumberLimit=="number"?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod=typeof e.minimumNonErrorTimePeriod=="number"?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=t=>{const n="error"in t?t.error:t.reason;n instanceof Error&&this._handleError(n,t)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter(n=>n!==t)}_fire(e,...t){const n=this._listeners[e]||[];for(const i of n)i.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const n=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:n}),n?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&e.context!==void 0&&e.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(e)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit?!0:(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function Qs(o,e=new Set){const t=[o],n=new Set;let i=0;for(;t.length>i;){const r=t[i++];if(!n.has(r)&&n2(r)&&!e.has(r))if(n.add(r),Symbol.iterator in r)try{for(const s of r)t.push(s)}catch{}else for(const s in r)s!=="defaultValue"&&t.push(r[s])}return n}function n2(o){const e=Object.prototype.toString.call(o),t=typeof o;return!(t==="number"||t==="boolean"||t==="string"||t==="symbol"||t==="function"||e==="[object Date]"||e==="[object RegExp]"||e==="[object Module]"||o==null||o._watchdogExcluded||o instanceof EventTarget||o instanceof Event)}function em(o,e,t=new Set){if(o===e&&typeof(n=o)=="object"&&n!==null)return!0;var n;const i=Qs(o,t),r=Qs(e,t);for(const s of i)if(r.has(s))return!0;return!1}class tm extends Xu{constructor(e,t={}){super(t),this._editor=null,this._throttledSave=Js(this._save.bind(this),typeof t.saveInterval=="number"?t.saveInterval:5e3),e&&(this._creator=(n,i)=>e.create(n,i)),this._destructor=n=>n.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(e=>{console.error("An error happened during the editor destroying.",e)}).then(()=>{if(typeof this._elementOrData=="string")return this.create(this._data,this._config,this._config.context);{const e=Object.assign({},this._config,{initialData:this._data});return this.create(this._elementOrData,e,e.context)}}).then(()=>{this._fire("restart")})}create(e=this._elementOrData,t=this._config,n){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=e,this._config=this._cloneEditorConfiguration(t)||{},this._config.context=n,this._creator(e,this._config))).then(i=>{this._editor=i,i.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=i.model.document.version,this._data=this._getData(),this.state="ready",this._fire("stateChange")})}destroy(){return Promise.resolve().then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.flush();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)})}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._lastDocumentVersion=e}catch(t){console.error(t,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e={};for(const t of this._editor.model.document.getRootNames())e[t]=this._editor.data.get({rootName:t});return e}_isErrorComingFromThisItem(e){return em(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return Vr(e,(t,n)=>Rn(t)||n==="context"?t:void 0)}}const Oo=Symbol("MainQueueId");class o2{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._activeActions=0}onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const n=e===Oo;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const i=(n?Promise.all(this._queues.values()):Promise.all([this._queues.get(Oo),this._queues.get(e)])).then(t),r=i.catch(()=>{});return this._queues.set(e,r),i.finally(()=>{this._activeActions--,this._queues.get(e)===r&&this._activeActions===0&&this._onEmptyCallbacks.forEach(s=>s())})}}function nm(o){return Array.isArray(o)?o:[o]}class Vi extends Ti(zs(nE)){constructor(e,t={}){if(!Li(e)&&t.initialData!==void 0)throw new I("editor-create-initial-data",null);super(t),this.config.get("initialData")===void 0&&this.config.set("initialData",function(r){return Li(r)?(s=r,s instanceof HTMLTextAreaElement?s.value:s.innerHTML):r;var s}(e)),Li(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new t2(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new XE(this,i),function(r){if(!Xt(r.updateSourceElement))throw new I("attachtoform-missing-elementapi-interface",r);const s=r.sourceElement;if(function(a){return!!a&&a.tagName.toLowerCase()==="textarea"}(s)&&s.form){let a;const l=s.form,c=()=>r.updateSourceElement();Xt(l.submit)&&(a=l.submit,l.submit=()=>{c(),a.apply(l)}),l.addEventListener("submit",c),r.on("destroy",()=>{l.removeEventListener("submit",c),a&&(l.submit=a)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(Li(e)?e:null)).then(()=>i.data.init(i.config.get("initialData"))).then(()=>i.fire("ready")).then(()=>i))})}}function Li(o){return Rn(o)}Vi.Context=dd,Vi.EditorWatchdog=tm,Vi.ContextWatchdog=class extends Xu{constructor(o,e={}){super(e),this._watchdogs=new Map,this._context=null,this._contextProps=new Set,this._actionQueues=new o2,this._watchdogConfig=e,this._creator=t=>o.create(t),this._destructor=t=>t.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(o){this._creator=o}setDestructor(o){this._destructor=o}get context(){return this._context}create(o={}){return this._actionQueues.enqueue(Oo,()=>(this._contextConfig=o,this._create()))}getItem(o){return this._getWatchdog(o)._item}getItemState(o){return this._getWatchdog(o).state}add(o){const e=nm(o);return Promise.all(e.map(t=>this._actionQueues.enqueue(t.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let n;if(this._watchdogs.has(t.id))throw new Error(`Item with the given id is already added: '${t.id}'.`);if(t.type==="editor")return n=new tm(null,this._watchdogConfig),n.setCreator(t.creator),n._setExcludedProperties(this._contextProps),t.destructor&&n.setDestructor(t.destructor),this._watchdogs.set(t.id,n),n.on("error",(i,{error:r,causesRestart:s})=>{this._fire("itemError",{itemId:t.id,error:r}),s&&this._actionQueues.enqueue(t.id,()=>new Promise(a=>{const l=()=>{n.off("restart",l),this._fire("itemRestart",{itemId:t.id}),a()};n.on("restart",l)}))}),n.create(t.sourceElementOrData,t.config,this._context);throw new Error(`Not supported item type: '${t.type}'.`)})))}remove(o){const e=nm(o);return Promise.all(e.map(t=>this._actionQueues.enqueue(t,()=>{const n=this._getWatchdog(t);return this._watchdogs.delete(t),n.destroy()})))}destroy(){return this._actionQueues.enqueue(Oo,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(Oo,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(o=>{console.error("An error happened during destroying the context or items.",o)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(o=>(this._context=o,this._contextProps=Qs(this._context),Promise.all(Array.from(this._watchdogs.values()).map(e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const o=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(e=>e.destroy())).then(()=>this._destructor(o))})}_getWatchdog(o){const e=this._watchdogs.get(o);if(!e)throw new Error(`Item with the given id was not registered: ${o}.`);return e}_isErrorComingFromThisItem(o){for(const e of this._watchdogs.values())if(e._isErrorComingFromThisItem(o))return!1;return em(this._context,o.context)}};class Xs extends Ht{constructor(e){super(e),this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];const t=this.document;function n(i){return(r,s)=>{s.preventDefault();const a=s.dropRange?[s.dropRange]:null,l=new $(t,i);t.fire(l,{dataTransfer:s.dataTransfer,method:r.name,targetRanges:a,target:s.target,domEvent:s.domEvent}),l.stop.called&&s.stopPropagation()}}this.listenTo(t,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",n("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,n=e.type=="drop"||e.type=="paste",i={dataTransfer:new th(t,{cacheFiles:n})};e.type!="drop"&&e.type!="dragover"||(i.dropRange=function(r,s){const a=s.target.ownerDocument,l=s.clientX,c=s.clientY;let d;return a.caretRangeFromPoint&&a.caretRangeFromPoint(l,c)?d=a.caretRangeFromPoint(l,c):s.rangeParent&&(d=a.createRange(),d.setStart(s.rangeParent,s.rangeOffset),d.collapse(!0)),d?r.domConverter.domRangeToView(d):null}(this.view,e)),this.fire(e.type,e,i)}}const om=["figcaption","li"];function im(o){let e="";if(o.is("$text")||o.is("$textProxy"))e=o.data;else if(o.is("element","img")&&o.hasAttribute("alt"))e=o.getAttribute("alt");else if(o.is("element","br"))e=` `;else{let t=null;for(const n of o.getChildren()){const i=im(n);t&&(t.is("containerElement")||n.is("containerElement"))&&(om.includes(t.name)||om.includes(n.name)?e+=` `:e+=` -`),e+=i,t=n}}return e}class Rt extends q{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(Qs),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document;this.listenTo(i,"clipboardInput",(r,s)=>{s.method!="paste"||e.model.canEditAt(e.model.document.selection)||r.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(r,s)=>{const a=s.dataTransfer;let l;if(s.content)l=s.content;else{let u="";a.getData("text/html")?u=function(g){return g.replace(/(\s+)<\/span>/g,(f,b)=>b.length==1?" ":b).replace(//g,"")}(a.getData("text/html")):a.getData("text/plain")&&(((c=(c=a.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

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

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

${c}

`),u=c),l=this.editor.data.htmlProcessor.toView(u)}var c;const d=new $(this,"inputTransformation");this.fire(d,{content:l,dataTransfer:a,targetRanges:s.targetRanges,method:s.method}),d.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,s)=>{if(s.content.isEmpty)return;const a=this.editor.data.toModel(s.content,"$clipboardHolder");a.childCount!=0&&(r.stop(),t.change(()=>{this.fire("contentInsertion",{content:a,method:s.method,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,s)=>{s.resultRange=t.insertContent(s.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document,i=(r,s)=>{const a=s.dataTransfer;s.preventDefault();const l=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:a,content:l,method:r.name})};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{e.model.canEditAt(e.model.document.selection)?i(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",im(s.content))),s.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}class rm{constructor(e,t=20){this._batch=null,this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(n,i)=>{i.isLocal&&i.isUndoable&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class i2 extends ne{constructor(e,t){super(e),this._buffer=new rm(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",r=i.length;let s=n.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;const a=e.resultRange;t.enqueueChange(this._buffer.batch,l=>{this._buffer.lock(),t.deleteContent(s),i&&t.insertContent(l.createText(i,n.selection.getAttributes()),s),a?l.setSelection(a):s.is("documentSelection")||l.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const sm=["insertText","insertReplacementText"];class r2 extends Ct{constructor(e){super(e),k.isAndroid&&sm.push("insertCompositionText");const t=e.document;t.on("beforeinput",(n,i)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:l}=i;if(!sm.includes(a))return;const c=new $(t,"insertText");t.fire(c,new Ln(e,l,{text:r,selection:e.createSelection(s)})),c.stop.called&&n.stop()}),t.on("compositionend",(n,{data:i,domEvent:r})=>{this.isEnabled&&!k.isAndroid&&i&&t.fire("insertText",new Ln(e,r,{text:i,selection:t.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class am extends q{static get pluginName(){return"Input"}init(){const e=this.editor,t=e.model,n=e.editing.view,i=t.document.selection;n.addObserver(r2);const r=new i2(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",r),e.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:l,selection:c,resultRange:d}=a,u=Array.from(c.getRanges()).map(b=>e.editing.mapper.toModelRange(b));let g=l;if(k.isAndroid){const b=Array.from(u[0].getItems()).reduce((A,E)=>A+(E.is("$textProxy")?E.data:""),"");b&&(b.length<=g.length?g.startsWith(b)&&(g=g.substring(b.length),u[0].start=u[0].start.getShiftedBy(b.length)):b.startsWith(g)&&(u[0].start=u[0].start.getShiftedBy(g.length),g=""))}const f={text:g,selection:t.createSelection(u)};d&&(f.resultRange=e.editing.mapper.toModelRange(d)),e.execute("insertText",f)}),k.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!i.isCollapsed&&a.keyCode==229&&n.document.isComposing&&lm(t,r)}):this.listenTo(n.document,"compositionstart",()=>{i.isCollapsed||lm(t,r)})}}function lm(o,e){if(!e.isEnabled)return;const t=e.buffer;t.lock(),o.enqueueChange(t.batch,()=>{o.deleteContent(o.document.selection)}),t.unlock()}class cm extends ne{constructor(e,t){super(e),this.direction=t,this._buffer=new rm(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const r=i.createSelection(e.selection||n.selection);if(!t.canEditAt(r))return;const s=e.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,s))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let l=0;r.getFirstRange().getMinimalFlatRanges().forEach(c=>{l+=fr(c.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(l),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!t.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n),r=e.createElement("paragraph");e.remove(e.createRangeIn(i)),e.insert(r,i),e.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const i=e.getFirstPosition(),r=n.schema.getLimitElement(i),s=r.getChild(0);return i.parent==s&&!!e.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const dm="word",Wt="selection",Un="backward",No="forward",hm={deleteContent:{unit:Wt,direction:Un},deleteContentBackward:{unit:"codePoint",direction:Un},deleteWordBackward:{unit:dm,direction:Un},deleteHardLineBackward:{unit:Wt,direction:Un},deleteSoftLineBackward:{unit:Wt,direction:Un},deleteContentForward:{unit:"character",direction:No},deleteWordForward:{unit:dm,direction:No},deleteHardLineForward:{unit:Wt,direction:No},deleteSoftLineForward:{unit:Wt,direction:No}};class s2 extends Ct{constructor(e){super(e);const t=e.document;let n=0;t.on("keydown",()=>{n++}),t.on("keyup",()=>{n=0}),t.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:l}=r,c=hm[l];if(!c)return;const d={direction:c.direction,unit:c.unit,sequence:n};d.unit==Wt&&(d.selectionToRemove=e.createSelection(s[0])),l==="deleteContentBackward"&&(k.isAndroid&&(d.sequence=1),function(g){if(g.length!=1||g[0].isCollapsed)return!1;const f=g[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let b=0;for(const{nextPosition:A}of f){if(A.parent.is("$text")){const E=A.parent.data,P=A.offset;if(Ur(E,P)||Wr(E,P)||Rc(E,P))continue;b++}else b++;if(b>1)return!0}return!1}(s)&&(d.unit=Wt,d.selectionToRemove=e.createSelection(s)));const u=new Fn(t,"delete",s[0]);t.fire(u,new Ln(e,a,d)),u.stop.called&&i.stop()}),k.isBlink&&function(i){const r=i.view,s=r.document;let a=null,l=!1;function c(u){return u==se.backspace||u==se.delete}function d(u){return u==se.backspace?Un:No}s.on("keydown",(u,{keyCode:g})=>{a=g,l=!1}),s.on("keyup",(u,{keyCode:g,domEvent:f})=>{const b=s.selection,A=i.isEnabled&&g==a&&c(g)&&!b.isCollapsed&&!l;if(a=null,A){const E=b.getFirstRange(),P=new Fn(s,"delete",E),z={unit:Wt,direction:d(g),selectionToRemove:b};s.fire(P,new Ln(r,f,z))}}),s.on("beforeinput",(u,{inputType:g})=>{const f=hm[g];c(a)&&f&&f.direction==d(a)&&(l=!0)},{priority:"high"}),s.on("beforeinput",(u,{inputType:g,data:f})=>{a==se.delete&&g=="insertText"&&f==""&&u.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class Wn extends q{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document,i=e.model.document;t.addObserver(s2),this._undoOnBackspace=!1;const r=new cm(e,"forward");e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new cm(e,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:l,sequence:c,selectionToRemove:d,unit:u}=a,g=l==="forward"?"deleteForward":"delete",f={sequence:c};if(u=="selection"){const b=Array.from(d.getRanges()).map(A=>e.editing.mapper.toModelRange(A));f.selection=e.model.createSelection(b)}else f.unit=u;e.execute(g,f),t.scrollToTheSelection()},{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(s,a)=>{this._undoOnBackspace&&a.direction=="backward"&&a.sequence==1&&a.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class a2 extends q{static get requires(){return[am,Wn]}static get pluginName(){return"Typing"}}function um(o,e){let t=o.start;return{text:Array.from(o.getItems()).reduce((n,i)=>i.is("$text")||i.is("$textProxy")?n+i.data:(t=e.createPositionAfter(i),""),""),range:e.createRange(t,o.end)}}class mm extends ge(){constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(e,"change:data",(t,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:s,range:a}=um(r,n),l=this.testCallback(s);if(!l&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!l,l){const c=Object.assign(t,{text:s,range:a});typeof l=="object"&&Object.assign(c,l),this.fire(`matched:${e}`,c)}}}class gm extends q{constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.locale,r=t.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const l=a.keyCode==se.arrowright,c=a.keyCode==se.arrowleft;if(!l&&!c)return;const d=i.contentLanguageDirection;let u=!1;u=d==="ltr"&&l||d==="rtl"&&c?this._handleForwardMovement(a):this._handleBackwardMovement(a),u===!0&&s.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&$i(r.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!Xs(n,t))&&!!$i(i,t)&&(ji(e),this._overrideGravity(),!0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(ji(e),this._restoreGravity(),ea(n,t,r),!0):r.isAtStart?!!Xs(i,t)&&(ji(e),ea(n,t,r),!0):!!function(s,a){const l=s.getShiftedBy(-1);return $i(l,a)}(r,t)&&(r.isAtEnd&&!Xs(i,t)&&$i(r,t)?(ji(e),ea(n,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Xs(o,e){for(const t of e)if(o.hasAttribute(t))return!0;return!1}function ea(o,e,t){const n=t.nodeBefore;o.change(i=>{n?i.setSelectionAttribute(n.getAttributes()):i.removeSelectionAttribute(e)})}function ji(o){o.preventDefault()}function $i(o,e){const{nodeBefore:t,nodeAfter:n}=o;for(const i of e){const r=t?t.getAttribute(i):void 0;if((n?n.getAttribute(i):void 0)!==r)return!0}return!1}var pm=/[\\^$.*+?()[\]{}|]/g,l2=RegExp(pm.source);const c2=function(o){return(o=ts(o))&&l2.test(o)?o.replace(pm,"\\$&"):o},fm={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Kn('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Kn("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Kn("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Kn('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Kn('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Kn("'"),to:[null,"‚",null,"’"]}},km={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},d2=["symbols","mathematical","typography","quotes"];function h2(o){return typeof o=="string"?new RegExp(`(${c2(o)})$`):o}function u2(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function m2(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function Kn(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function Gn(o,e,t,n){return n.createRange(bm(o,e,t,!0,n),bm(o,e,t,!1,n))}function bm(o,e,t,n,i){let r=o.textNode||(n?o.nodeBefore:o.nodeAfter),s=null;for(;r&&r.getAttribute(e)==t;)s=r,r=n?r.previousSibling:r.nextSibling;return s?i.createPositionAt(s,n?"before":"after"):o}function*wm(o,e){for(const t of e)t&&o.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class g2 extends ne{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const t=this.editor.model,n=t.document.selection,i=t.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,l=s.end.parent;if(i.isLimit(a)||i.isLimit(l))return r||a!=l||t.deleteContent(n),!1;if(r){const c=wm(e.model.schema,n.getAttributes());return Am(e,s.start),e.setSelectionAttribute(c),!0}{const c=!(s.start.isAtStart&&s.end.isAtEnd),d=a==l;if(t.deleteContent(n,{leaveUnmerged:c}),c){if(d)return Am(e,n.focus),!0;e.setSelection(l,0)}}return!1}}function Am(o,e){o.split(e),o.setSelection(e.parent.nextSibling,0)}const p2={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class _m extends Ct{constructor(e){super(e);const t=this.document;let n=!1;t.on("keydown",(i,r)=>{n=r.shiftKey}),t.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let s=r.inputType;k.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,l=p2[s];if(!l)return;const c=new Fn(t,"enter",r.targetRanges[0]);t.fire(c,new Ln(e,a,{isSoft:l.isSoft})),c.stop.called&&i.stop()})}observe(){}stopObserving(){}}class zo extends q{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(_m),e.commands.add("enter",new g2(e)),this.listenTo(n,"enter",(i,r)=>{n.isComposing||r.preventDefault(),r.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class f2 extends ne{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(i,r,s){const a=s.isCollapsed,l=s.getFirstRange(),c=l.start.parent,d=l.end.parent,u=c==d;if(a){const g=wm(i.schema,s.getAttributes());Cm(i,r,l.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(g)}else{const g=!(l.start.isAtStart&&l.end.isAtEnd);i.deleteContent(s,{leaveUnmerged:g}),u?Cm(i,r,s.focus):g&&r.setSelection(d,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const r=i.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=i.getFirstRange(),a=s.start.parent,l=s.end.parent;return!((ta(a,n)||ta(l,n))&&a!==l)}(e.schema,t.selection)}}function Cm(o,e,t){const n=e.createElement("softBreak");o.insertContent(n,t),e.setSelection(n,"after")}function ta(o,e){return!o.is("rootElement")&&(e.isLimit(o)||ta(o.parent,e))}class k2 extends q{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,r=i.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(s,{writer:a})=>a.createEmptyElement("br")}),i.addObserver(_m),e.commands.add("shiftEnter",new f2(e)),this.listenTo(r,"enter",(s,a)=>{r.isComposing||a.preventDefault(),a.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class b2 extends me(){constructor(){super(...arguments),this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const r=n[0];i===r||na(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const r=n[0];i===r||na(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(r=>r.id===e.id);if(na(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&w2(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(i=>i.id===e);n>-1&&t.splice(n,1)}}function na(o,e){return o&&e&&o.priority==e.priority&&Hi(o.classes)==Hi(e.classes)}function w2(o,e){return o.priority>e.priority||!(o.priorityHi(e.classes)}function Hi(o){return Array.isArray(o)?o.sort().join(","):o}const A2='',_2="ck-widget",vm="ck-widget_selected";function Be(o){return!!o.is("element")&&!!o.getCustomProperty("widget")}function oa(o,e,t={}){if(!o.is("containerElement"))throw new I("widget-to-widget-wrong-element-type",null,{element:o});return e.setAttribute("contenteditable","false",o),e.addClass(_2,o),e.setCustomProperty("widget",!0,o),o.getFillerOffset=E2,e.setCustomProperty("widgetLabel",[],o),t.label&&function(n,i){n.getCustomProperty("widgetLabel").push(i)}(o,t.label),t.hasSelectionHandle&&function(n,i){const r=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),l=new ko;return l.set("content",A2),l.render(),a.appendChild(l.element),a});i.insert(i.createPositionAt(n,0),r),i.addClass(["ck-widget_with-selection-handle"],n)}(o,e),ym(o,e),o}function C2(o,e,t){if(e.classes&&t.addClass(Pe(e.classes),o),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],o)}function v2(o,e,t){if(e.classes&&t.removeClass(Pe(e.classes),o),e.attributes)for(const n in e.attributes)t.removeAttribute(n,o)}function ym(o,e,t=C2,n=v2){const i=new b2;i.on("change:top",(r,s)=>{s.oldDescriptor&&n(o,s.oldDescriptor,s.writer),s.newDescriptor&&t(o,s.newDescriptor,s.writer)}),e.setCustomProperty("addHighlight",(r,s,a)=>i.add(s,a),o),e.setCustomProperty("removeHighlight",(r,s,a)=>i.remove(s,a),o)}function y2(o,e,t={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),e.setAttribute("role","textbox",o),t.label&&e.setAttribute("aria-label",t.label,o),e.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(n,i,r)=>{e.setAttribute("contenteditable",r?"false":"true",o)}),o.on("change:isFocused",(n,i,r)=>{r?e.addClass("ck-editor__nested-editable_focused",o):e.removeClass("ck-editor__nested-editable_focused",o)}),ym(o,e),o}function E2(){return null}const Ot="widget-type-around";function fn(o,e,t){return!!o&&Be(o)&&!t.isInline(e)}function Kt(o){return o.getAttribute(Ot)}var Em=D(4921),x2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Em.Z,x2),Em.Z.locals;const xm=["before","after"],S2=new DOMParser().parseFromString('',"image/svg+xml").firstChild,Sm="ck-widget__type-around_disabled";class D2 extends q{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[zo,Wn]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,r)=>{t.change(s=>{for(const a of t.document.roots)r?s.removeClass(Sm,a):s.addClass(Sm,a)}),r||e.model.change(s=>{s.removeSelectionAttribute(Ot)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view,r=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:r}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...r)=>{this.isEnabled&&n(...r)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Kt(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(r,s,a)=>{const l=a.mapper.toViewElement(s.item);l&&fn(l,s.item,t)&&(function(c,d,u){const g=c.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(f){const b=this.toDomElement(f);return function(A,E){for(const P of xm){const z=new bt({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${P}`],title:E[P],"aria-hidden":"true"},children:[A.ownerDocument.importNode(S2,!0)]});A.appendChild(z.render())}}(b,d),function(A){const E=new bt({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});A.appendChild(E.render())}(b),b});c.insert(c.createPositionAt(u,"end"),g)}(a.writer,i,l),l.getCustomProperty("widgetLabel").push(()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,r=e.editing.view;function s(a){return`ck-widget_type-around_show-fake-caret_${a}`}this._listenToIfEnabled(r.document,"arrowKey",(a,l)=>{this._handleArrowKeyPress(a,l)},{context:[Be,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,l)=>{l.directChange&&e.model.change(c=>{c.removeSelectionAttribute(Ot)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const a=n.getSelectedElement();a&&fn(e.editing.mapper.toViewElement(a),a,i)||e.model.change(l=>{l.removeSelectionAttribute(Ot)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(a,l,c)=>{const d=c.writer;if(this._currentFakeCaretModelElement){const b=c.mapper.toViewElement(this._currentFakeCaretModelElement);b&&(d.removeClass(xm.map(s),b),this._currentFakeCaretModelElement=null)}const u=l.selection.getSelectedElement();if(!u)return;const g=c.mapper.toViewElement(u);if(!fn(g,u,i))return;const f=Kt(l.selection);f&&(d.addClass(s(f),g),this._currentFakeCaretModelElement=u)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(a,l,c)=>{c||e.model.change(d=>{d.removeSelectionAttribute(Ot)})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,r=i.document.selection,s=i.schema,a=n.editing.view,l=function(u,g){const f=Hr(u,g);return f==="down"||f==="right"}(t.keyCode,n.locale.contentLanguageDirection),c=a.document.selection.getSelectedElement();let d;fn(c,n.editing.mapper.toModelElement(c),s)?d=this._handleArrowKeyPressOnSelectedWidget(l):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(l):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(l)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Kt(t.document.selection);return t.change(i=>n?n!==(e?"after":"before")?(i.removeSelectionAttribute(Ot),!0):!1:(i.setSelectionAttribute(Ot,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,r=t.plugins.get("Widget"),s=r._getObjectElementNextToSelection(e);return!!fn(t.editing.mapper.toViewElement(s),s,i)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(Ot,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,i=n.schema,r=t.editing.mapper,s=n.document.selection,a=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!fn(r.toViewElement(a),a,i)&&(n.change(l=>{l.setSelection(a,"on"),l.setSelectionAttribute(Ot,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const s=function(c){return c.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),a=function(c,d){const u=c.closest(".ck-widget");return d.mapDomToView(u)}(r,t.domConverter),l=e.editing.mapper.toModelElement(a);this._insertParagraph(l,s),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(i,r)=>{if(i.eventPhase!="atTarget")return;const s=t.getSelectedElement(),a=e.editing.mapper.toViewElement(s),l=e.model.schema;let c;this._insertParagraphAccordingToFakeCaretPosition()?c=!0:fn(a,s,l)&&(this._insertParagraph(s,r.isSoft?"before":"after"),c=!0),c&&(r.preventDefault(),i.stop())},{context:Be})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",(t,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=e.selection)},{priority:"high"}),k.isAndroid?this._listenToIfEnabled(e,"keydown",(t,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(e,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=Kt(n.document.selection);if(!a)return;const l=s.direction,c=n.document.selection.getSelectedElement(),d=l=="forward";if(a==="before"===d)e.execute("delete",{selection:n.createSelection(c,"on")});else{const u=i.getNearestSelectionRange(n.createPositionAt(c,a),l);if(u)if(u.isCollapsed){const g=n.createSelection(u.start);if(n.modifySelection(g,{direction:l}),g.focus.isEqual(u.start)){const f=function(b,A){let E=A;for(const P of A.getAncestors({parentFirst:!0})){if(P.childCount>1||b.isLimit(P))break;E=P}return E}(i,u.start.parent);n.deleteContent(n.createSelection(f,"on"),{doNotAutoparagraph:!0})}else n.change(f=>{f.setSelection(u),e.execute(d?"deleteForward":"delete")})}else n.change(g=>{g.setSelection(u),e.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:Be})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(i,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=Kt(n);return a?(i.stop(),t.change(l=>{const c=n.getSelectedElement(),d=t.createPositionAt(c,a),u=l.createSelection(d),g=t.insertContent(r,u);return l.setSelection(u),g})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(n,i)=>{const[,r,s={}]=i;if(r&&!r.is("documentSelection"))return;const a=Kt(t);a&&(s.findOptimalPosition=a,i[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||Kt(t)&&n.stop()},{priority:"high"})}}function B2(o){const e=o.model;return(t,n)=>{const i=n.keyCode==se.arrowup,r=n.keyCode==se.arrowdown,s=n.shiftKey,a=e.document.selection;if(!i&&!r)return;const l=r;if(s&&function(d,u){return!d.isCollapsed&&d.isBackward==u}(a,l))return;const c=function(d,u,g){const f=d.model;if(g){const b=u.isCollapsed?u.focus:u.getLastPosition(),A=Dm(f,b,"forward");if(!A)return null;const E=f.createRange(b,A),P=Bm(f.schema,E,"backward");return P?f.createRange(b,P):null}{const b=u.isCollapsed?u.focus:u.getFirstPosition(),A=Dm(f,b,"backward");if(!A)return null;const E=f.createRange(A,b),P=Bm(f.schema,E,"forward");return P?f.createRange(P,b):null}}(o,a,l);if(c){if(c.isCollapsed&&(a.isCollapsed||s))return;(c.isCollapsed||function(d,u,g){const f=d.model,b=d.view.domConverter;if(g){const j=f.createSelection(u.start);f.modifySelection(j),j.focus.isAtEnd||u.start.isEqual(j.focus)||(u=f.createRange(j.focus,u.end))}const A=d.mapper.toViewRange(u),E=b.viewRangeToDom(A),P=De.getDomRangeRects(E);let z;for(const j of P)if(z!==void 0){if(Math.round(j.top)>=z)return!1;z=Math.max(z,Math.round(j.bottom))}else z=Math.round(j.bottom);return!0}(o,c,l))&&(e.change(d=>{const u=l?c.end:c.start;if(s){const g=e.createSelection(a.anchor);g.setFocus(u),d.setSelection(g)}else d.setSelection(u)}),t.stop(),n.preventDefault(),n.stopPropagation())}}}function Dm(o,e,t){const n=o.schema,i=o.createRangeIn(e.root),r=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:l}of i.getWalker({startPosition:e,direction:t})){if(n.isLimit(a)&&!n.isInline(a))return s;if(l==r&&n.isBlock(a))return null}return null}function Bm(o,e,t){const n=t=="backward"?e.end:e.start;if(o.checkChild(n,"$text"))return n;for(const{nextPosition:i}of e.getWalker({direction:t}))if(o.checkChild(i,"$text"))return i;return null}var Tm=D(3488),T2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Tm.Z,T2),Tm.Z.locals;class Mo extends q{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[D2,Wn]}init(){const e=this.editor,t=e.editing.view,n=t.document;this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{const a=s.writer,l=r.selection;if(l.isCollapsed)return;const c=l.getSelectedElement();if(!c)return;const d=e.editing.mapper.toViewElement(c);var u;Be(d)&&s.consumable.consume(l,"selection")&&a.setSelection(a.createRangeOn(d),{fake:!0,label:(u=d,u.getCustomProperty("widgetLabel").reduce((g,f)=>typeof f=="function"?g?g+". "+f():f():g?g+". "+f:f,""))})}),this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{this._clearPreviouslySelectedWidgets(s.writer);const a=s.writer,l=a.document.selection;let c=null;for(const d of l.getRanges())for(const u of d){const g=u.item;Be(g)&&!I2(g,c)&&(a.addClass(vm,g),this._previouslySelected.add(g),c=g)}},{priority:"low"}),t.addObserver(Os),this.listenTo(n,"mousedown",(...i)=>this._onMousedown(...i)),this.listenTo(n,"arrowKey",(...i)=>{this._handleSelectionChangeOnArrowKeyPress(...i)},{context:[Be,"$text"]}),this.listenTo(n,"arrowKey",(...i)=>{this._preventDefaultOnArrowKeyPress(...i)},{context:"$root"}),this.listenTo(n,"arrowKey",B2(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(i,r)=>{this._handleDelete(r.direction=="forward")&&(r.preventDefault(),i.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,r=i.document;let s=t.target;if(function(l){let c=l;for(;c;){if(c.is("editableElement")&&!c.is("rootElement"))return!0;if(Be(c))return!1;c=c.parent}return!1}(s)){if((k.isSafari||k.isGecko)&&t.domEvent.detail>=3){const l=n.editing.mapper,c=s.is("attributeElement")?s.findAncestor(u=>!u.is("attributeElement")):s,d=l.toModelElement(c);t.preventDefault(),this.editor.model.change(u=>{u.setSelection(d,"in")})}return}if(!Be(s)&&(s=s.findAncestor(Be),!s))return;k.isAndroid&&t.preventDefault(),r.isFocused||i.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,r=i.schema,s=i.document.selection,a=s.getSelectedElement(),l=Hr(n,this.editor.locale.contentLanguageDirection),c=l=="down"||l=="right",d=l=="up"||l=="down";if(a&&r.isObject(a)){const g=c?s.getLastPosition():s.getFirstPosition(),f=r.getNearestSelectionRange(g,c?"forward":"backward");return void(f&&(i.change(b=>{b.setSelection(f)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed&&!t.shiftKey){const g=s.getFirstPosition(),f=s.getLastPosition(),b=g.nodeAfter,A=f.nodeBefore;return void((b&&r.isObject(b)||A&&r.isObject(A))&&(i.change(E=>{E.setSelection(c?f:g)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed)return;const u=this._getObjectElementNextToSelection(c);if(u&&r.isObject(u)){if(r.isInline(u)&&d)return;this._setSelectionOverElement(u),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t)||!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(i=>{let r=t.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,i.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,r=t.createSelection(i);if(t.modifySelection(r,{direction:e?"forward":"backward"}),r.isEqual(i))return null;const s=e?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(vm,t);this._previouslySelected.clear()}}function I2(o,e){return!!e&&Array.from(o.getAncestors()).includes(e)}class qi extends q{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[Fi]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",n=>{(function(i){const r=i.getSelectedElement();return!(!r||!Be(r))})(e.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void Q("widget-toolbar-no-items",{toolbarId:e});const s=this.editor,a=s.t,l=new zs(s.locale);if(l.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new I("widget-toolbar-duplicated",this,{toolbarId:e});const c={view:l,getRelatedElement:i,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{const d=i(s.editing.view.document.selection);d&&this._showToolbar(c,d)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>e&&(e=s,t=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?Im(this.editor,t):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Pm(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);Im(this.editor,i)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function Im(o,e){const t=o.plugins.get("ContextualBalloon"),n=Pm(o,e);t.updatePosition(n)}function Pm(o,e){const t=o.editing.view,n=Qe.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var Rm=D(8506),P2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Rm.Z,P2),Rm.Z.locals;var Om=D(903),R2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Om.Z,R2),Om.Z.locals;class O2 extends q{static get pluginName(){return"DragDrop"}static get requires(){return[Rt,Mo]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Zs(n=>this._updateDropMarker(n),40),this._removeDropMarkerDelayed=qr(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=qr(()=>this._clearDraggableAttributes(),40),e.plugins.has("DragDropExperimental")?this.forceDisabled("DragDropExperimental"):(t.addObserver(Qs),t.addObserver(Os),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,i,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,r)=>{r||this._finalizeDragging(!1)}),k.isAndroid&&this.forceDisabled("noAndroidSupport"))}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,i=e.editing.view,r=i.document;this.listenTo(r,"dragstart",(s,a)=>{const l=n.selection;if(a.target&&a.target.is("editableElement"))return void a.preventDefault();const c=a.target?Mm(a.target):null;if(c){const f=e.editing.mapper.toModelElement(c);this._draggedRange=Bt.fromRange(t.createRangeOn(f)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const f=r.selection.getSelectedElement();f&&Be(f)||(this._draggedRange=Bt.fromRange(l.getFirstRange()))}if(!this._draggedRange)return void a.preventDefault();this._draggingUid=J();const d=this.isEnabled&&e.model.canEditAt(this._draggedRange);a.dataTransfer.effectAllowed=d?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const u=t.createSelection(this._draggedRange.toRange()),g=e.data.toView(t.getSelectedContent(u));r.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:g,method:"dragstart"}),d||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(r,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this.listenTo(r,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(r,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(r,"dragging",(s,a)=>{if(!this.isEnabled)return void(a.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const l=Nm(e,a.targetRanges,a.target);e.model.canEditAt(l)?(this._draggedRange||(a.dataTransfer.dropEffect="copy"),k.isGecko||(a.dataTransfer.effectAllowed=="copy"?a.dataTransfer.dropEffect="copy":["all","copyMove"].includes(a.dataTransfer.effectAllowed)&&(a.dataTransfer.dropEffect="move")),l&&this._updateDropMarkerThrottled(l)):a.dataTransfer.dropEffect="none"},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(n,i)=>{if(i.method!="drop")return;const r=Nm(e,i.targetRanges,i.target);if(this._removeDropMarker(),!r||!e.model.canEditAt(r))return this._finalizeDragging(!1),void n.stop();if(this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),zm(i.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(r,!0))return this._finalizeDragging(!1),void n.stop();i.targetRanges=[e.editing.mapper.toViewRange(r)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(Rt);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(i))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=zm(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,r)=>{if(k.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Mm(r.target);if(k.isBlink&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();if(!a||!Be(a)){const l=n.selection.editableElement;l&&!l.isReadOnly&&(s=l)}}s&&(t.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{k.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(i){const r=this.toDomElement(i);return r.append("⁠",i.createElement("span"),"⁠"),r})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||i.updateMarker("drop-target",{range:e}):i.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function Nm(o,e,t){const n=o.model,i=o.editing.mapper;let r=null;const s=e?e[0].start:null;if(t.is("uiElement")&&(t=t.parent),r=function(c,d){const u=c.model,g=c.editing.mapper;if(Be(d))return u.createRangeOn(g.toModelElement(d));if(!d.is("editableElement")){const f=d.findAncestor(b=>Be(b)||b.is("editableElement"));if(Be(f))return u.createRangeOn(g.toModelElement(f))}return null}(o,t),r)return r;const a=function(c,d){const u=c.editing.mapper,g=c.editing.view,f=u.toModelElement(d);if(f)return f;const b=g.createPositionBefore(d),A=u.findMappedViewAncestor(b);return u.toModelElement(A)}(o,t),l=s?i.toModelPosition(s):null;return l?(r=function(c,d,u){const g=c.model;if(!g.schema.checkChild(u,"$block"))return null;const f=g.createPositionAt(u,0),b=d.path.slice(0,f.path.length),A=g.createPositionFromPath(d.root,b),E=A.nodeAfter;return E&&g.schema.isObject(E)?g.createRangeOn(E):null}(o,l,a),r||(r=n.schema.getNearestSelectionRange(l,k.isGecko?"forward":"backward"),r||function(c,d){const u=c.model;let g=d;for(;g;){if(u.schema.isObject(g))return u.createRangeOn(g);g=g.parent}return null}(o,l.parent))):function(c,d){const u=c.model,g=u.schema,f=u.createPositionAt(d,0);return g.getNearestSelectionRange(f,"forward")}(o,a)}function zm(o){return k.isGecko?o.dropEffect:["all","copyMove"].includes(o.effectAllowed)?"move":"copy"}function Mm(o){if(o.is("editableElement"))return null;if(o.hasClass("ck-widget__selection-handle"))return o.findAncestor(Be);if(Be(o))return o;const e=o.findAncestor(t=>Be(t)||t.is("editableElement"));return Be(e)?e:null}class N2 extends q{static get pluginName(){return"PastePlainText"}static get requires(){return[Rt]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,r=t.document.selection;let s=!1;n.addObserver(Qs),this.listenTo(i,"keydown",(a,l)=>{s=l.shiftKey}),e.plugins.get(Rt).on("contentInsertion",(a,l)=>{(s||function(c,d){if(c.childCount>1)return!1;const u=c.getChild(0);return d.isObject(u)?!1:Array.from(u.getAttributeKeys()).length==0}(l.content,t.schema))&&t.change(c=>{const d=Array.from(r.getAttributes()).filter(([g])=>t.schema.getAttributeProperties(g).isFormatting);r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const u=c.createRangeIn(l.content);for(const g of u.getItems())g.is("$textProxy")&&c.setAttributes(d,g)})})}}class z2 extends q{static get pluginName(){return"Clipboard"}static get requires(){return[Rt,O2,N2]}}class M2 extends ne{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!Fm(e.schema,n))do if(n=n.parent,!n)return;while(!Fm(e.schema,n));e.change(i=>{i.setSelection(n,"in")})}}function Fm(o,e){return o.isLimit(e)&&(o.checkChild(e,"$text")||o.checkChild(e,"paragraph"))}const F2=li("Ctrl+A");class V2 extends q{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new M2(e)),this.listenTo(t,"keydown",(n,i)=>{Nn(i)===F2&&(e.execute("selectAll"),i.preventDefault())})}}class L2 extends q{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new Ae(t),r=t.t;return i.set({label:r("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class j2 extends q{static get requires(){return[V2,L2]}static get pluginName(){return"SelectAll"}}var $2=Object.defineProperty,Vm=Object.getOwnPropertySymbols,H2=Object.prototype.hasOwnProperty,q2=Object.prototype.propertyIsEnumerable,Lm=(o,e,t)=>e in o?$2(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class jm extends ne{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(t,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))H2.call(s,a)&&Lm(r,a,s[a]);if(Vm)for(var a of Vm(s))q2.call(s,a)&&Lm(r,a,s[a]);return r})({},n[1]);const i=n[1];i.batchType||(i.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(t,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,r=i.document,s=[],a=e.map(c=>c.getTransformedByOperations(n)),l=a.flat();for(const c of a){const d=c.filter(u=>u.root!=r.graveyard).filter(u=>!W2(u,l));d.length&&(U2(d),s.push(d[0]))}s.length&&i.change(c=>{c.setSelection(s,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const r=e.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,l=Array.from(i.history.getOperations(a)),c=f1([s.getReversed()],l,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of c){const u=d.affectedSelectable;u&&!n.canEditAt(u)&&(d=new je(d.baseVersion)),t.addOperation(d),n.applyOperation(d),i.history.setOperationAsUndone(s,d)}}}}function U2(o){o.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;et!==o&&t.containsRange(o,!0))}class K2 extends jm{execute(e=null){const t=e?this._stack.findIndex(r=>r.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r),this.fire("revert",n.batch,i)}),this.refresh()}}class G2 extends jm{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class Z2 extends q{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const e=this.editor;this._undoCommand=new K2(e),this._redoCommand=new G2(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(t,n)=>{const i=n[0];if(!i.isDocumentOperation)return;const r=i.batch,s=this._redoCommand.createdBatches.has(r),a=this._undoCommand.createdBatches.has(r);this._batchRegistry.has(r)||(this._batchRegistry.add(r),r.isUndoable&&(s?this._undoCommand.addBatch(r):a||(this._undoCommand.addBatch(r),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,n,i)=>{this._redoCommand.addBatch(i)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}const $m='',Hm='';class J2 extends q{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?$m:Hm,r=t.uiLanguageDirection=="ltr"?Hm:$m;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(e,t,n,i){const r=this.editor;r.ui.componentFactory.add(e,s=>{const a=r.commands.get(e),l=new Ae(s);return l.set({label:t,icon:i,keystroke:n,tooltip:!0}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",()=>{r.execute(e),r.editing.view.focus()}),l})}}class Y2 extends q{static get requires(){return[Z2,J2]}static get pluginName(){return"Undo"}}class Q2 extends ge(){constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const r=t.result;this._data=r,n(r)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class Nt extends q{constructor(){super(...arguments),this.loaders=new at,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[Ii]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return Q("filerepository-no-upload-adapter"),null;const t=new qm(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(n=>{this._loadersMap.set(n,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof qm?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,i)=>{n===t&&this._loadersMap.delete(i)})}_updatePendingAction(){const e=this.editor.plugins.get(Ii);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=i=>`${t("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}class qm extends ge(){constructor(e,t){super(),this.id=J(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Q2,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new I("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new I("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(r=>{t.isFulfilled=!0,n(r)}).catch(r=>{t.isFulfilled=!0,i(r)})}),t}}class X2 extends re{constructor(e){super(e),this.buttonView=new Ae(e),this._fileInputView=new ex(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class ex extends re{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}const Um="ckCsrfToken",Wm="abcdefghijklmnopqrstuvwxyz0123456789";function tx(){let o=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const r of i){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(Um);var e,t;return o&&o.length==40||(o=function(n){let i="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return i}(40),e=Um,t=o,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),o}class nx{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>t(s)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const a=i.response;if(!a||!a.uploaded)return t(a&&a.error&&a.error.message?a.error.message:s);e({default:a.url})}),i.upload&&i.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",tx()),this.xhr.send(t)}}class ia extends ne{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.forceValue===void 0?!this.value:e.forceValue;t.change(r=>{if(n.isCollapsed)i?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)i?r.setAttribute(this.attributeKey,i,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const r of i.getItems())if(t.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const Zn="bold";class ox extends q{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Zn}),e.model.schema.setAttributeProperties(Zn,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Zn,view:"strong",upcastAlso:["b",t=>{const n=t.getStyle("font-weight");return n&&(n=="bold"||Number(n)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(Zn,new ia(e,Zn)),e.keystrokes.set("CTRL+B",Zn)}}const ra="bold";class ix extends q{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(ra,n=>{const i=e.commands.get(ra),r=new Ae(n);return r.set({label:t("Bold"),icon:ve.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(ra),e.editing.view.focus()}),r})}}var Km=D(8603),rx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Km.Z,rx),Km.Z.locals;const Jn="italic";class sx extends q{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Jn}),e.model.schema.setAttributeProperties(Jn,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Jn,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Jn,new ia(e,Jn)),e.keystrokes.set("CTRL+I",Jn)}}const sa="italic";class ax extends q{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(sa,n=>{const i=e.commands.get(sa),r=new Ae(n);return r.set({label:t("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(sa),e.editing.view.focus()}),r})}}const Fo="underline";class lx extends q{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Fo}),e.model.schema.setAttributeProperties(Fo,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Fo,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(Fo,new ia(e,Fo)),e.keystrokes.set("CTRL+U","underline")}}const aa="underline";class cx extends q{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(aa,n=>{const i=e.commands.get(aa),r=new Ae(n);return r.set({label:t("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(aa),e.editing.view.focus()}),r})}}class dx extends ne{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,i=t.document.selection,r=Array.from(i.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;t.change(a=>{if(s){const l=r.filter(c=>Ui(c)||Zm(n,c));this._applyQuote(a,l)}else this._removeQuote(a,r.filter(Ui))})}_getValue(){const e=ze(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Ui(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=ze(e.getSelectedBlocks());return!!n&&Zm(t,n)}_removeQuote(e,t){Gm(e,t).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void e.unwrap(n.start.parent);if(n.start.isAtStart){const r=e.createPositionBefore(n.start.parent);return void e.move(n,r)}n.end.isAtEnd||e.split(n.end);const i=e.createPositionAfter(n.end.parent);e.move(n,i)})}_applyQuote(e,t){const n=[];Gm(e,t).reverse().forEach(i=>{let r=Ui(i.start);r||(r=e.createElement("blockQuote"),e.wrap(i,r)),n.push(r)}),n.reverse().reduce((i,r)=>i.nextSibling==r?(e.merge(e.createPositionAfter(i)),i):r)}}function Ui(o){return o.parent.name=="blockQuote"?o.parent:null}function Gm(o,e){let t,n=0;const i=[];for(;n{const a=e.model.document.differ.getChanges();for(const l of a)if(l.type=="insert"){const c=l.position.nodeAfter;if(!c)continue;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0;if(c.is("element","blockQuote")&&!t.checkChild(l.position,c))return s.unwrap(c),!0;if(c.is("element")){const d=s.createRangeIn(c);for(const u of d.getItems())if(u.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(u),u))return s.unwrap(u),!0}}else if(l.type=="remove"){const c=l.position.parent;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0}return!1});const n=this.editor.editing.view.document,i=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!i.isCollapsed||!r.value||i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!i.isCollapsed||!r.value)return;const l=i.getLastPosition().parent;l.isEmpty&&!l.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var Jm=D(3062),ux={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Jm.Z,ux),Jm.Z.locals;class mx extends q{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const i=e.commands.get("blockQuote"),r=new Ae(n);return r.set({label:t("Block quote"),icon:ve.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),r})}}class gx extends q{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",Nt]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,i=t.uploadUrl;if(!n)return;const r=e.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,i),e.plugins.get(Nt).createUploadAdapter=s=>new px(this._uploadGateway,s)}}class px{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(t,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class fx extends ne{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=ze(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Ym(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document,i=e.selection||n.selection;t.canEditAt(i)&&t.change(r=>{const s=i.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Ym(a,t.schema)&&r.rename(a,"paragraph")})}}function Ym(o,e){return e.checkChild(o.parent,"paragraph")&&!e.isObject(o)}class kx extends ne{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,n=e.attributes;let i=e.position;t.canEditAt(i)&&t.change(r=>{const s=r.createElement("paragraph");if(n&&t.schema.setAllowedAttributes(s,n,r),!t.schema.checkChild(i.parent,s)){const a=t.schema.findAllowedParent(i,s);if(!a)return;i=r.split(i,a).position}t.insertContent(s,i),r.setSelection(s,"in")})}}const Qm=class extends q{static get pluginName(){return"Paragraph"}init(){const o=this.editor,e=o.model;o.commands.add("paragraph",new fx(o)),o.commands.add("insertParagraph",new kx(o)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),o.conversion.elementToElement({model:"paragraph",view:"p"}),o.conversion.for("upcast").elementToElement({model:(t,{writer:n})=>Qm.paragraphLikeElements.has(t.name)?t.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let la=Qm;la.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class bx extends ne{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ze(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Xm(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>Xm(a,i,t.schema));for(const a of s)a.is("element",i)||r.rename(a,i)})}}function Xm(o,e,t){return t.checkChild(o.parent,e)&&!t.isObject(o)}const eg="paragraph";class wx extends q{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[la]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!=="paragraph"&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new bx(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(i,r)=>{const s=e.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",eg)&&s.childCount===0&&r.writer.rename(s,eg)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:te.get("low")+1})}}var tg=D(8733),Ax={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(tg.Z,Ax),tg.Z.locals;class _x extends q{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(s){const a=s.t,l={Paragraph:a("Paragraph"),"Heading 1":a("Heading 1"),"Heading 2":a("Heading 2"),"Heading 3":a("Heading 3"),"Heading 4":a("Heading 4"),"Heading 5":a("Heading 5"),"Heading 6":a("Heading 6")};return s.config.get("heading.options").map(c=>{const d=l[c.title];return d&&d!=c.title&&(c.title=d),c})}(e),i=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",s=>{const a={},l=new at,c=e.commands.get("heading"),d=e.commands.get("paragraph"),u=[c];for(const f of n){const b={type:"button",model:new Js({label:f.title,class:f.class,role:"menuitemradio",withText:!0})};f.model==="paragraph"?(b.model.bind("isOn").to(d,"value"),b.model.set("commandName","paragraph"),u.push(d)):(b.model.bind("isOn").to(c,"value",A=>A===f.model),b.model.set({commandName:"heading",commandValue:f.model})),l.add(b),a[f.model]=f.title}const g=Pt(s);return Fs(g,l,{ariaLabel:r,role:"menu"}),g.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),g.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),g.bind("isEnabled").toMany(u,"isEnabled",(...f)=>f.some(b=>b)),g.buttonView.bind("label").to(c,"value",d,"value",(f,b)=>{const A=f||b&&"paragraph";return typeof A=="boolean"?i:a[A]?a[A]:i}),this.listenTo(g,"execute",f=>{const{commandName:b,commandValue:A}=f.source;e.execute(b,A?{value:A}:void 0),e.editing.view.focus()}),g})}}function ng(o){return o.createContainerElement("figure",{class:"image"},[o.createEmptyElement("img"),o.createSlot("children")])}function og(o,e){const t=o.plugins.get("ImageUtils"),n=o.plugins.has("ImageInlineEditing")&&o.plugins.has("ImageBlockEditing");return r=>t.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:i(r):null;function i(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function ca(o,e){const t=ze(e.getSelectedBlocks());return!t||o.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}var Cx=Object.defineProperty,ig=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,yx=Object.prototype.propertyIsEnumerable,rg=(o,e,t)=>e in o?Cx(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,sg=(o,e)=>{for(var t in e||(e={}))vx.call(e,t)&&rg(o,t,e[t]);if(ig)for(var t of ig(e))yx.call(e,t)&&rg(o,t,e[t]);return o};class zt extends q{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null){const i=this.editor,r=i.model,s=r.document.selection;n=ag(i,t||s,n),e=sg(sg({},Object.fromEntries(s.getAttributes())),e);for(const a in e)r.schema.checkAttribute(n,a)||delete e[a];return r.change(a=>{const l=a.createElement(n,e);return r.insertObject(l,t,null,{setSelection:"on",findOptimalPosition:t||n=="imageInline"?void 0:"auto"}),l.parent?l:null})}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const n=e.getSelectedElement();if(n&&this.isImageWidget(n))return n;let i=t.parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(t,n){if(ag(t,n,null)=="imageBlock"){const r=function(s,a){const l=function(d,u){const g=d.getSelectedElement();if(g){const f=Kt(d);if(f)return u.createRange(u.createPositionAt(g,f))}return du(d,u)}(s,a),c=l.start.parent;return c.isEmpty&&!c.is("element","$root")?c.parent:c}(n,t.model);if(t.model.schema.checkChild(r,"imageBlock"))return!0}else if(t.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(t){return[...t.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),oa(e,t,{label:()=>{const i=this.findViewImgElement(e).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&Be(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function ag(o,e,t){const n=o.model.schema,i=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?t||(i==="inline"?"imageInline":i==="block"?"imageBlock":e.is("selection")?ca(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class Ex extends ne{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,r=n.getClosestSelectedImageElement(i.document.selection);i.change(s=>{s.setAttribute("alt",e.newValue,r)})}}class xx extends q{static get requires(){return[zt]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Ex(this.editor))}}var lg=D(1905),Sx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(lg.Z,Sx),lg.Z.locals;var cg=D(6764),Dx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(cg.Z,Dx),cg.Z.locals;class Bx extends re{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new ht,this.keystrokes=new St,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),ve.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),ve.cancel,"ck-button-cancel","cancel"),this._focusables=new rn,this._focusCycler=new bo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),p({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,i){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const e=this.locale.t,t=new Xc(this.locale,_u);return t.label=e("Text alternative"),t}}function dg(o){const e=o.editing.view,t=Qe.defaultPositions,n=o.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(e.document.selection)),positions:[t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast,t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.viewportStickyNorth]}}class Tx extends q{static get requires(){return[Fi]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),r=new Ae(n);return r.set({label:t("Change image text alternative"),icon:ve.lowVision,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(S(Bx))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,r)=>{this._hideForm(!0),r()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(i){const r=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const s=dg(i);r.updatePosition(s)}}(e):this._hideForm(!0)}),w({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:dg(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class hg extends q{static get requires(){return[xx,Tx]}static get pluginName(){return"ImageTextAlternative"}}function ug(o,e){const t=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(i.item),l=o.findViewImgElement(a);if(i.attributeNewValue===null){const c=i.attributeOldValue;c&&c.data&&(s.removeAttribute("srcset",l),s.removeAttribute("sizes",l),c.width&&s.removeAttribute("width",l))}else{const c=i.attributeNewValue;c&&c.data&&(s.setAttribute("srcset",c.data,l),s.setAttribute("sizes","100vw",l),c.width&&s.setAttribute("width",c.width,l))}};return n=>{n.on(`attribute:srcset:${e}`,t)}}function Wi(o,e,t){const n=(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,l=s.mapper.toViewElement(r.item),c=o.findViewImgElement(l);a.setAttribute(r.attributeKey,r.attributeNewValue||"",c)};return i=>{i.on(`attribute:${t}:${e}`,n)}}class Ix extends Ct{observe(e){this.listenTo(e,"load",(t,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}var Px=Object.defineProperty,mg=Object.getOwnPropertySymbols,Rx=Object.prototype.hasOwnProperty,Ox=Object.prototype.propertyIsEnumerable,gg=(o,e,t)=>e in o?Px(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Ki=(o,e)=>{for(var t in e||(e={}))Rx.call(e,t)&&gg(o,t,e[t]);if(mg)for(var t of mg(e))Ox.call(e,t)&&gg(o,t,e[t]);return o};class Nx extends ne{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&Q("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&Q("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Pe(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const l=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&l&&i.isImage(l)){const c=this.editor.model.createPositionAfter(l);i.insertImage(Ki(Ki({},s),r),c)}else i.insertImage(Ki(Ki({},s),r))})}}class zx extends ne{refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement();this.editor.model.change(n=>{n.setAttribute("src",e.source,t),n.removeAttribute("srcset",t),n.removeAttribute("sizes",t)})}}class pg extends q{static get requires(){return[zt]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(Ix),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:r=>{const s={data:r.getAttribute("srcset")};return r.hasAttribute("width")&&(s.width=r.getAttribute("width")),s}}});const n=new Nx(e),i=new zx(e);e.commands.add("insertImage",n),e.commands.add("replaceImageSource",i),e.commands.add("imageInsert",n)}}class fg extends ne{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),r=Object.fromEntries(i.getAttributes());return r.src||r.uploadId?t.change(s=>{const a=Array.from(t.markers).filter(d=>d.getRange().containsItem(i)),l=n.insertImage(r,t.createSelection(i,"on"),this._modelElementName);if(!l)return null;const c=s.createRangeOn(l);for(const d of a){const u=d.getRange(),g=u.root.rootName!="$graveyard"?u.getJoined(c,!0):c;s.updateMarker(d,{range:g})}return{oldElement:i,newElement:l}}):null}}class Mx extends q{static get requires(){return[pg,zt,Rt]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new fg(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>ng(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>i.toImageWidget(ng(s),s,t("image widget"))}),n.for("downcast").add(Wi(i,"imageBlock","src")).add(Wi(i,"imageBlock","alt")).add(ug(i,"imageBlock")),n.for("upcast").elementToElement({view:og(e,"imageBlock"),model:(r,{writer:s})=>s.createElement("imageBlock",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)}).add(function(r){const s=(a,l,c)=>{if(!c.consumable.test(l.viewItem,{name:!0,classes:"image"}))return;const d=r.findViewImgElement(l.viewItem);if(!d||!c.consumable.test(d,{name:!0}))return;c.consumable.consume(l.viewItem,{name:!0,classes:"image"});const u=ze(c.convertItem(d,l.modelCursor).modelRange.getItems());u?(c.convertChildren(l.viewItem,u),c.updateConversionResult(u,l)):c.consumable.revert(l.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(i))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const l=Array.from(a.content.getChildren());let c;if(!l.every(i.isInlineImageView))return;c=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(c);if(ca(t.schema,d)==="imageBlock"){const u=new Bi(n.document),g=l.map(f=>u.createElement("figure",{class:"image"},f));a.content=u.createDocumentFragment(g)}})}}var kg=D(3508),Fx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(kg.Z,Fx),kg.Z.locals;class Vx extends q{static get requires(){return[Mx,Mo,hg]}static get pluginName(){return"ImageBlock"}}class Lx extends q{static get requires(){return[pg,zt,Rt]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new fg(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:s})=>s.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(r,{writer:s})=>i.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,t("image widget"))}),n.for("downcast").add(Wi(i,"imageInline","src")).add(Wi(i,"imageInline","alt")).add(ug(i,"imageInline")),n.for("upcast").elementToElement({view:og(e,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const l=Array.from(a.content.getChildren());let c;if(!l.every(i.isBlockImageView))return;c=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(c);if(ca(t.schema,d)==="imageInline"){const u=new Bi(n.document),g=l.map(f=>f.childCount===1?(Array.from(f.getAttributes()).forEach(b=>u.setAttribute(...b,i.findViewImgElement(f))),f.getChild(0)):f);a.content=u.createDocumentFragment(g)}})}}class jx extends q{static get requires(){return[Lx,Mo,hg]}static get pluginName(){return"ImageInline"}}var bg=D(2640),$x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(bg.Z,$x),bg.Z.locals;function wg(o){const e=o.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function Hx(o){return new Promise((e,t)=>{const n=o.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const r=Ag(i,n),s=r.replace("image/",""),a=new File([i],`image.${s}`,{type:r});e(a)}).catch(i=>i&&i.name==="TypeError"?function(r){return function(s){return new Promise((a,l)=>{const c=oe.document.createElement("img");c.addEventListener("load",()=>{const d=oe.document.createElement("canvas");d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0),d.toBlob(u=>u?a(u):l())}),c.addEventListener("error",()=>l()),c.src=s})}(r).then(s=>{const a=Ag(s,r),l=a.replace("image/","");return new File([s],`image.${l}`,{type:a})})}(n).then(e).catch(t):t(i))})}function Ag(o,e){return o.type?o.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class qx extends q{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=i=>{const r=new X2(i),s=e.commands.get("uploadImage"),a=e.config.get("image.upload.types"),l=wg(a);return r.set({acceptedType:a.map(c=>`image/${c}`).join(","),allowMultipleFiles:!0}),r.buttonView.set({label:t("Insert image"),icon:ve.image,tooltip:!0}),r.buttonView.bind("isEnabled").to(s),r.on("done",(c,d)=>{const u=Array.from(d).filter(g=>l.test(g.type));u.length&&(e.execute("uploadImage",{file:u}),e.editing.view.focus())}),r};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}var _g=D(3689),Ux={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(_g.Z,Ux),_g.Z.locals;var Cg=D(4036),Wx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Cg.Z,Wx),Cg.Z.locals;var vg=D(3773),Kx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(vg.Z,Kx),vg.Z.locals;class Gx extends q{constructor(e){super(e),this.uploadStatusChange=(t,n,i)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!i.consumable.consume(n.item,t.name))return;const l=r.plugins.get("ImageUtils"),c=r.plugins.get(Nt),d=a?n.attributeNewValue:null,u=this.placeholder,g=r.editing.mapper.toViewElement(s),f=i.writer;if(d=="reading")return yg(g,f),void Eg(l,u,g,f);if(d=="uploading"){const b=c.loaders.get(a);return yg(g,f),void(b?(xg(g,f),function(A,E,P,z){const j=function(Y){const ie=Y.createUIElement("div",{class:"ck-progress-bar"});return Y.setCustomProperty("progressBar",!0,ie),ie}(E);E.insert(E.createPositionAt(A,"end"),j),P.on("change:uploadedPercent",(Y,ie,Ee)=>{z.change(he=>{he.setStyle("width",Ee+"%",j)})})}(g,f,b,r.editing.view),function(A,E,P,z){if(z.data){const j=A.findViewImgElement(E);P.setAttribute("src",z.data,j)}}(l,g,f,b)):Eg(l,u,g,f))}d=="complete"&&c.loaders.get(a)&&function(b,A,E){const P=A.createUIElement("div",{class:"ck-image-upload-complete-icon"});A.insert(A.createPositionAt(b,"end"),P),setTimeout(()=>{E.change(z=>z.remove(z.createRangeOn(P)))},3e3)}(g,f,r.editing.view),function(b,A){Dg(b,A,"progressBar")}(g,f),xg(g,f),function(b,A){A.removeClass("ck-appear",b)}(g,f)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function yg(o,e){o.hasClass("ck-appear")||e.addClass("ck-appear",o)}function Eg(o,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const i=o.findViewImgElement(t);i.getAttribute("src")!==e&&n.setAttribute("src",e,i),Sg(t,"placeholder")||n.insert(n.createPositionAfter(i),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function xg(o,e){o.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",o),Dg(o,e,"placeholder")}function Sg(o,e){for(const t of o.getChildren())if(t.getCustomProperty(e))return t}function Dg(o,e,t){const n=Sg(o,t);n&&e.remove(e.createRangeOn(n))}var Zx=Object.defineProperty,Jx=Object.defineProperties,Yx=Object.getOwnPropertyDescriptors,Bg=Object.getOwnPropertySymbols,Qx=Object.prototype.hasOwnProperty,Xx=Object.prototype.propertyIsEnumerable,Tg=(o,e,t)=>e in o?Zx(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class e5 extends ne{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Pe(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const l=n.getSelectedElement();if(a&&l&&i.isImage(l)){const c=this.editor.model.createPositionAfter(l);this._uploadImage(s,r,c)}else this._uploadImage(s,r)})}_uploadImage(e,t,n){const i=this.editor,r=i.plugins.get(Nt).createLoader(e),s=i.plugins.get("ImageUtils");var a,l;r&&s.insertImage((a=((c,d)=>{for(var u in d||(d={}))Qx.call(d,u)&&Tg(c,u,d[u]);if(Bg)for(var u of Bg(d))Xx.call(d,u)&&Tg(c,u,d[u]);return c})({},t),l={uploadId:r.id},Jx(a,Yx(l))),n)}}class t5 extends q{constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[Nt,Ku,Rt,zt]}static get pluginName(){return"ImageUploadEditing"}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(Nt),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),a=wg(e.config.get("image.upload.types")),l=new e5(e);e.commands.add("uploadImage",l),e.commands.add("imageUpload",l),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(c,d)=>{if(u=d.dataTransfer,Array.from(u.types).includes("text/html")&&u.getData("text/html")!=="")return;var u;const g=Array.from(d.dataTransfer.files).filter(f=>!!f&&a.test(f.type));g.length&&(c.stop(),e.model.change(f=>{d.targetRanges&&f.setSelection(d.targetRanges.map(b=>e.editing.mapper.toModelRange(b))),e.model.enqueueChange(()=>{e.execute("uploadImage",{file:g})})}))}),this.listenTo(s,"inputTransformation",(c,d)=>{const u=Array.from(e.editing.view.createRangeIn(d.content)).map(f=>f.item).filter(f=>function(b,A){return!(!b.isInlineImageView(A)||!A.getAttribute("src")||!A.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!A.getAttribute("src").match(/^blob:/g))}(r,f)&&!f.getAttribute("uploadProcessed")).map(f=>({promise:Hx(f),imageElement:f}));if(!u.length)return;const g=new Bi(e.editing.view.document);for(const f of u){g.setAttribute("uploadProcessed",!0,f.imageElement);const b=i.createLoader(f.promise);b&&(g.setAttribute("src","",f.imageElement),g.setAttribute("uploadId",b.id,f.imageElement))}}),e.editing.view.document.on("dragover",(c,d)=>{d.preventDefault()}),t.on("change",()=>{const c=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const u of c)if(u.type=="insert"&&u.name!="$text"){const g=u.position.nodeAfter,f=u.position.root.rootName=="$graveyard";for(const b of n5(e,g)){const A=b.getAttribute("uploadId");if(!A)continue;const E=i.loaders.get(A);E&&(f?d.has(A)||E.abort():(d.add(A),this._uploadImageElements.set(A,b),E.status=="idle"&&this._readAndUpload(E)))}}}),this.on("uploadComplete",(c,{imageElement:d,data:u})=>{const g=u.urls?u.urls:u;this.editor.model.change(f=>{f.setAttribute("src",g.default,d),this._parseAndSetSrcsetAttributeOnImage(g,d,f)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,i=t.locale.t,r=t.plugins.get(Nt),s=t.plugins.get(Ku),a=t.plugins.get("ImageUtils"),l=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",l.get(e.id))}),e.read().then(()=>{const d=e.upload(),u=l.get(e.id);if(k.isSafari){const g=t.editing.mapper.toViewElement(u),f=a.findViewImgElement(g);t.editing.view.once("render",()=>{if(!f.parent)return;const b=t.editing.view.domConverter.mapViewToDom(f.parent);if(!b)return;const A=b.style.display;b.style.display="none",b._ckHack=b.offsetHeight,b.style.display=A})}return n.enqueueChange({isUndoable:!1},g=>{g.setAttribute("uploadStatus","uploading",u)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},u=>{const g=l.get(e.id);u.setAttribute("uploadStatus","complete",g),this.fire("uploadComplete",{data:d,imageElement:g})}),c()}).catch(d=>{if(e.status!=="error"&&e.status!=="aborted")throw d;e.status=="error"&&d&&s.showWarning(d,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},u=>{u.remove(l.get(e.id))}),c()});function c(){n.enqueueChange({isUndoable:!1},d=>{const u=l.get(e.id);d.removeAttribute("uploadId",u),d.removeAttribute("uploadStatus",u),l.delete(e.id)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const r=Object.keys(e).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return i=Math.max(i,a),!0}).map(s=>`${e[s]} ${s}w`).join(", ");r!=""&&n.setAttribute("srcset",{data:r,width:i},t)}}function n5(o,e){const t=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}var Ig=D(1568),o5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Ig.Z,o5),Ig.Z.locals;var Pg=D(3535),i5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Pg.Z,i5),Pg.Z.locals;class r5 extends ne{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(n.document.selection);this.value={width:e.width,height:null},i&&n.change(r=>{r.setAttribute("width",e.width,i)})}}class s5 extends q{static get requires(){return[zt]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new r5(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add(n=>n.on(`attribute:width:${e}`,(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,l=s.mapper.toViewElement(r.item);r.attributeNewValue!==null?(a.setStyle("width",r.attributeNewValue,l),a.addClass("image_resized",l)):(a.removeStyle("width",l),a.removeClass("image_resized",l))})),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:n=>n.getStyle("width")}})}}const da={small:ve.objectSizeSmall,medium:ve.objectSizeMedium,large:ve.objectSizeLarge,original:ve.objectSizeFull};function Rg(o){return e=>o===null&&e===o||e!==null&&e.width===o}var Og=D(6270),a5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Og.Z,a5),Og.Z.locals;class l5 extends ne{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils");n.change(r=>{const s=e.value;let a=i.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,a)&&(this.editor.execute(i.isBlockImage(a)?"imageTypeInline":"imageTypeBlock"),a=i.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",a):r.setAttribute("imageStyle",s,a)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}var c5=Object.defineProperty,Ng=Object.getOwnPropertySymbols,d5=Object.prototype.hasOwnProperty,h5=Object.prototype.propertyIsEnumerable,zg=(o,e,t)=>e in o?c5(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Mg=(o,e)=>{for(var t in e||(e={}))d5.call(e,t)&&zg(o,t,e[t]);if(Ng)for(var t of Ng(e))h5.call(e,t)&&zg(o,t,e[t]);return o};const{objectFullWidth:u5,objectInline:Fg,objectLeft:Vg,objectRight:ha,objectCenter:ua,objectBlockLeft:Lg,objectBlockRight:jg}=ve,Gi={get inline(){return{name:"inline",title:"In line",icon:Fg,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Vg,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Lg,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:ua,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:ha,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:jg,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:ua,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:ha,modelElements:["imageBlock"],className:"image-style-side"}}},$g={full:u5,left:Lg,right:jg,center:ua,inlineLeft:Vg,inlineRight:ha,inline:Fg},Hg=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function qg(o){Q("image-style-configuration-definition-invalid",o)}const ma={normalizeStyles:function(o){return(o.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?Gi[t]?Mg({},Gi[t]):{name:t}:function(n,i){const r=Mg({},i);for(const s in n)Object.prototype.hasOwnProperty.call(i,s)||(r[s]=n[s]);return r}(Gi[t.name],t),typeof t.icon=="string"&&(t.icon=$g[t.icon]||t.icon),t}(e)).filter(e=>function(t,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:r,name:s}=t;if(!(r&&r.length&&s))return qg({style:t}),!1;{const a=[n?"imageBlock":null,i?"imageInline":null];if(!r.some(l=>a.includes(l)))return Q("image-style-missing-dependency",{style:t,missingPlugins:r.map(l=>l==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(e,o))},getDefaultStylesConfiguration:function(o,e){return o&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...Hg]:[]},warnInvalidStyle:qg,DEFAULT_OPTIONS:Gi,DEFAULT_ICONS:$g,DEFAULT_DROPDOWN_DEFINITIONS:Hg};function Ug(o,e){for(const t of e)if(t.name===o)return t}class Wg extends q{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[zt]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=ma,n=this.editor,i=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(i,r)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:r}),this._setupConversion(i,r),this._setupPostFixer(),n.commands.add("imageStyle",new l5(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,i=n.model.schema,r=(s=this.normalizedStyles,(l,c,d)=>{if(!d.consumable.consume(c.item,l.name))return;const u=Ug(c.attributeNewValue,s),g=Ug(c.attributeOldValue,s),f=d.mapper.toViewElement(c.item),b=d.writer;g&&b.removeClass(g.className,f),u&&b.addClass(u.className,f)});var s;const a=function(l){const c={imageInline:l.filter(d=>!d.isDefault&&d.modelElements.includes("imageInline")),imageBlock:l.filter(d=>!d.isDefault&&d.modelElements.includes("imageBlock"))};return(d,u,g)=>{if(!u.modelRange)return;const f=u.viewItem,b=ze(u.modelRange.getItems());if(b&&g.schema.checkAttribute(b,"imageStyle"))for(const A of c[b.name])g.consumable.consume(f,{classes:A.className})&&g.writer.setAttribute("imageStyle",A.name,b)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),t&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(zt),i=new Map(this.normalizedStyles.map(r=>[r.name,r]));t.registerPostFixer(r=>{let s=!1;for(const a of t.differ.getChanges())if(a.type=="insert"||a.type=="attribute"&&a.attributeKey=="imageStyle"){let l=a.type=="insert"?a.position.nodeAfter:a.range.start.nodeAfter;if(l&&l.is("element","paragraph")&&l.childCount>0&&(l=l.getChild(0)),!n.isImage(l))continue;const c=l.getAttribute("imageStyle");if(!c)continue;const d=i.get(c);d&&d.modelElements.includes(l.name)||(r.removeAttribute("imageStyle",l),s=!0)}return s})}}var Kg=D(5083),m5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Kg.Z,m5),Kg.Z.locals;class g5 extends q{static get requires(){return[Wg]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],n=Gg(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const i=Gg([...t.filter(xe),...ma.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const r of i)this._createDropdown(r,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,i=>{let r;const{defaultItem:s,items:a,title:l}=e,c=a.filter(f=>t.find(({name:b})=>Zg(b)===f)).map(f=>{const b=n.create(f);return f===s&&(r=b),b});a.length!==c.length&&ma.warnInvalidStyle({dropdown:e});const d=Pt(i,Ms),u=d.buttonView,g=u.arrowView;return Pi(d,c,{enableActiveItemFocusOnDropdownOpen:!0}),u.set({label:Jg(l,r.label),class:null,tooltip:!0}),g.unbind("label"),g.set({label:l}),u.bind("icon").toMany(c,"isOn",(...f)=>{const b=f.findIndex(ln);return b<0?r.icon:c[b].icon}),u.bind("label").toMany(c,"isOn",(...f)=>{const b=f.findIndex(ln);return Jg(l,b<0?r.label:c[b].label)}),u.bind("isOn").toMany(c,"isOn",(...f)=>f.some(ln)),u.bind("class").toMany(c,"isOn",(...f)=>f.some(ln)?"ck-splitbutton_flatten":void 0),u.on("execute",()=>{c.some(({isOn:f})=>f)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(c,"isEnabled",(...f)=>f.some(ln)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(Zg(t),n=>{const i=this.editor.commands.get("imageStyle"),r=new Ae(n);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>s===t),r.on("execute",this._executeCommand.bind(this,t)),r})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function Gg(o,e){for(const t of o)e[t.title]&&(t.title=e[t.title]);return o}function Zg(o){return`imageStyle:${o}`}function Jg(o,e){return(o?o+": ":"")+e}class p5 extends q{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new ld(e)),e.commands.add("outdent",new ld(e))}}const Yg='',Qg='';class f5 extends q{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?Yg:Qg,r=t.uiLanguageDirection=="ltr"?Qg:Yg;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(e,t,n){const i=this.editor;i.ui.componentFactory.add(e,r=>{const s=i.commands.get(e),a=new Ae(r);return a.set({label:t,icon:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{i.execute(e),i.editing.view.focus()}),a})}}class Zi extends ne{constructor(e,t){super(e),this._indentBehavior=t}refresh(){const e=this.editor.model,t=ze(e.document.selection.getSelectedBlocks());t&&e.schema.checkAttribute(t,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(t.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const e=this.editor.model,t=function(n){const i=n.document.selection,r=n.schema;return Array.from(i.getSelectedBlocks()).filter(s=>r.checkAttribute(s,"blockIndent"))}(e);e.change(n=>{for(const i of t){const r=i.getAttribute("blockIndent"),s=this._indentBehavior.getNextIndent(r);s?n.setAttribute("blockIndent",s,i):n.removeAttribute("blockIndent",i)}})}}class Xg{constructor(e){this.isForward=e.direction==="forward",this.offset=e.offset,this.unit=e.unit}checkEnabled(e){const t=parseFloat(e||"0");return this.isForward||t>0}getNextIndent(e){const t=parseFloat(e||"0");if(!(!e||e.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const n=t+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class ep{constructor(e){this.isForward=e.direction==="forward",this.classes=e.classes}checkEnabled(e){const t=this.classes.indexOf(e);return this.isForward?t=0}getNextIndent(e){const t=this.classes.indexOf(e),n=this.isForward?1:-1;return this.classes[t+n]}}const k5=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class b5{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!i.schema.isInline(n.item))return;const r=i.writer,s=r.document.selection;for(const a of this._definitions){const l=r.createAttributeElement("a",a.attributes,{priority:5});a.classes&&r.addClass(a.classes,l);for(const c in a.styles)r.setStyle(c,a.styles[c],l);r.setCustomProperty("link",!0,l),a.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(s.getFirstRange(),l):r.wrap(i.mapper.toViewRange(n.range),l):r.unwrap(i.mapper.toViewRange(n.range),l)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:i,mapper:r})=>{const s=r.toViewElement(n.item),a=Array.from(s.getChildren()).find(l=>l.is("element","a"));for(const l of this._definitions){const c=Dt(l.attributes);if(l.callback(n.attributeNewValue)){for(const[d,u]of c)d==="class"?i.addClass(u,a):i.setAttribute(d,u,a);l.classes&&i.addClass(l.classes,a);for(const d in l.styles)i.setStyle(d,l.styles[d],a)}else{for(const[d,u]of c)d==="class"?i.removeClass(u,a):i.removeAttribute(d,a);l.classes&&i.removeClass(l.classes,a);for(const d in l.styles)i.removeStyle(d,a)}}})}}}const w5=function(o,e,t){var n=o.length;return t=t===void 0?n:t,!e&&t>=n?o:bd(o,e,t)};var A5=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const tp=function(o){return A5.test(o)},_5=function(o){return o.split("")};var np="\\ud800-\\udfff",C5="["+np+"]",ga="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",pa="\\ud83c[\\udffb-\\udfff]",op="[^"+np+"]",ip="(?:\\ud83c[\\udde6-\\uddff]){2}",rp="[\\ud800-\\udbff][\\udc00-\\udfff]",sp="(?:"+ga+"|"+pa+")?",ap="[\\ufe0e\\ufe0f]?",v5=ap+sp+("(?:\\u200d(?:"+[op,ip,rp].join("|")+")"+ap+sp+")*"),y5="(?:"+[op+ga+"?",ga,ip,rp,C5].join("|")+")",E5=RegExp(pa+"(?="+pa+")|"+y5+v5,"g");const x5=function(o){return o.match(E5)||[]},S5=function(o){return tp(o)?x5(o):_5(o)},D5=function(o){return function(e){e=ts(e);var t=tp(e)?S5(e):void 0,n=t?t[0]:e.charAt(0),i=t?w5(t,1).join(""):e.slice(1);return n[o]()+i}}("toUpperCase"),B5=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,T5=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,I5=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,P5=/^((\w+:(\/{2,})?)|(\W))/i,fa="Ctrl+K";function lp(o,{writer:e}){const t=e.createAttributeElement("a",{href:o},{priority:5});return e.setCustomProperty("link",!0,t),t}function cp(o){const e=String(o);return function(t){return!!t.replace(B5,"").match(T5)}(e)?e:"#"}function ka(o,e){return!!o&&e.checkAttribute(o.name,"linkHref")}function ba(o,e){const t=(n=o,I5.test(n)?"mailto:":e);var n;const i=!!t&&!dp(o);return o&&i?t+o:o}function dp(o){return P5.test(o)}function hp(o){window.open(o,"_blank","noopener")}class R5 extends ne{constructor(){super(...arguments),this.manualDecorators=new at,this.automaticDecorators=new b5}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||ze(t.getSelectedBlocks());ka(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,r=[],s=[];for(const a in t)t[a]?r.push(a):s.push(a);n.change(a=>{if(i.isCollapsed){const l=i.getFirstPosition();if(i.hasAttribute("linkHref")){const c=up(i);let d=Gn(l,"linkHref",i.getAttribute("linkHref"),n);i.getAttribute("linkHref")===c&&(d=this._updateLinkContent(n,a,d,e)),a.setAttribute("linkHref",e,d),r.forEach(u=>{a.setAttribute(u,!0,d)}),s.forEach(u=>{a.removeAttribute(u,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(e!==""){const c=Dt(i.getAttributes());c.set("linkHref",e),r.forEach(u=>{c.set(u,!0)});const{end:d}=n.insertContent(a.createText(e,c),l);a.setSelection(d)}["linkHref",...r,...s].forEach(c=>{a.removeSelectionAttribute(c)})}else{const l=n.schema.getValidRanges(i.getRanges(),"linkHref"),c=[];for(const u of i.getSelectedBlocks())n.schema.checkAttribute(u,"linkHref")&&c.push(a.createRangeOn(u));const d=c.slice();for(const u of l)this._isRangeToUpdate(u,c)&&d.push(u);for(const u of d){let g=u;if(d.length===1){const f=up(i);i.getAttribute("linkHref")===f&&(g=this._updateLinkContent(n,a,u,e),a.setSelection(a.createSelection(g)))}a.setAttribute("linkHref",e,g),r.forEach(f=>{a.setAttribute(f,!0,g)}),s.forEach(f=>{a.removeAttribute(f,g)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return ka(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}_updateLinkContent(e,t,n,i){const r=t.createText(i,{linkHref:i});return e.insertContent(r,n)}}function up(o){if(o.isCollapsed){const e=o.getFirstPosition();return e.textNode&&e.textNode.data}{const e=Array.from(o.getFirstRange().getItems());if(e.length>1)return null;const t=e[0];return t.is("$text")||t.is("$textProxy")?t.data:null}}class O5 extends ne{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();ka(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(r=>{const s=n.isCollapsed?[Gn(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),i)for(const l of i.manualDecorators)r.removeAttribute(l.id,a)})}}class N5 extends ge(){constructor({id:e,label:t,attributes:n,classes:i,styles:r,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var mp=D(9773),z5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(mp.Z,z5),mp.Z.locals;var M5=Object.defineProperty,gp=Object.getOwnPropertySymbols,F5=Object.prototype.hasOwnProperty,V5=Object.prototype.propertyIsEnumerable,pp=(o,e,t)=>e in o?M5(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,L5=(o,e)=>{for(var t in e||(e={}))F5.call(e,t)&&pp(o,t,e[t]);if(gp)for(var t of gp(e))V5.call(e,t)&&pp(o,t,e[t]);return o};const fp="automatic",j5=/^(https?:)?\/\//;class $5 extends q{static get pluginName(){return"LinkEditing"}static get requires(){return[gm,am,Rt]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:lp}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,i)=>lp(cp(n),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),e.commands.add("link",new R5(e)),e.commands.add("unlink",new O5(e));const t=function(n,i){const r={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return i.forEach(s=>("label"in s&&r[s.label]&&(s.label=r[s.label]),s)),i}(e.t,function(n){const i=[];if(n)for(const[r,s]of Object.entries(n)){const a=Object.assign({},s,{id:`link${D5(r)}`});i.push(a)}return i}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(n=>n.mode===fp)),this._enableManualDecorators(t.filter(n=>n.mode==="manual")),e.plugins.get(gm).registerAttribute("linkHref"),function(n,i,r,s){const a=n.editing.view,l=new Set;a.document.registerPostFixer(c=>{const d=n.model.document.selection;let u=!1;if(d.hasAttribute(i)){const g=Gn(d.getFirstPosition(),i,d.getAttribute(i),n.model),f=n.editing.mapper.toViewRange(g);for(const b of f.getItems())b.is("element",r)&&!b.hasClass(s)&&(c.addClass(s,b),l.add(b),u=!0)}return u}),n.conversion.for("editingDowncast").add(c=>{function d(){a.change(u=>{for(const g of l.values())u.removeClass(s,g),l.delete(g)})}c.on("insert",d,{priority:"highest"}),c.on("remove",d,{priority:"highest"}),c.on("attribute",d,{priority:"highest"}),c.on("selection",d,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:fp,callback:i=>!!i&&j5.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(i=>{t.model.schema.extend("$text",{allowAttributes:i.id});const r=new N5(i);n.add(r),t.conversion.for("downcast").attributeToElement({model:r.id,view:(s,{writer:a,schema:l},{item:c})=>{if((c.is("selection")||l.isInline(c))&&s){const d=a.createAttributeElement("a",r.attributes,{priority:5});r.classes&&a.addClass(r.classes,d);for(const u in r.styles)a.setStyle(u,r.styles[u],d);return a.setCustomProperty("link",!0,d),d}}}),t.conversion.for("upcast").elementToAttribute({view:L5({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(n,i)=>{if(!(k.isMac?i.domEvent.metaKey:i.domEvent.ctrlKey))return;let r=i.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),i.preventDefault(),hp(s))},{context:"$capture"}),this.listenTo(t,"keydown",(n,i)=>{const r=e.commands.get("link").value;r&&i.keyCode===se.enter&&i.altKey&&(n.stop(),hp(r))})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,i=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||e.change(r=>{wa(r,Aa(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(Os);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const i=t.document.selection;if(!i.isCollapsed||!i.hasAttribute("linkHref"))return;const r=i.getFirstPosition(),s=Gn(r,"linkHref",i.getAttribute("linkHref"),t);(r.isTouching(s.start)||r.isTouching(s.end))&&t.change(a=>{wa(a,Aa(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n=null,i=!1;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const r=e.model.document.selection;r.isCollapsed||(i?i=!1:kp(e)&&function(s){const a=s.document.selection,l=a.getFirstPosition(),c=a.getLastPosition(),d=l.nodeAfter;if(!d||!d.is("$text")||!d.hasAttribute("linkHref"))return!1;const u=c.textNode||c.nodeBefore;return d===u?!0:Gn(l,"linkHref",d.getAttribute("linkHref"),s).containsRange(s.createRange(l,c),!0)}(e.model)&&(n=r.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(r,[s])=>{i=!1,kp(e)&&n&&(e.model.change(a=>{for(const[l,c]of n)a.setAttribute(l,c,s)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let r=!1,s=!1;this.listenTo(i.document,"delete",(a,l)=>{s=l.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r=!1;const a=n.getFirstPosition(),l=n.getAttribute("linkHref");if(!l)return;const c=Gn(a,"linkHref",l,t);r=c.containsPosition(a)||c.end.isEqual(a)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s&&(s=!1,r||e.model.enqueueChange(a=>{wa(a,Aa(t.schema))}))},{priority:"low"})}_enableClipboardIntegration(){const e=this.editor,t=e.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(i,r)=>{t.change(s=>{const a=s.createRangeIn(r.content);for(const l of a.getItems())if(l.hasAttribute("linkHref")){const c=ba(l.getAttribute("linkHref"),n);s.setAttribute("linkHref",c,l)}})})}}function wa(o,e){o.removeSelectionAttribute("linkHref");for(const t of e)o.removeSelectionAttribute(t)}function kp(o){return o.model.change(e=>e.batch).isTyping}function Aa(o){return o.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}var bp=D(7754),H5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(bp.Z,H5),bp.Z.locals;class q5 extends re{constructor(e,t){super(e),this.focusTracker=new ht,this.keystrokes=new St,this._focusables=new rn;const n=e.t;this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),ve.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),ve.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new bo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),p({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Xc(this.locale,_u);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new hi(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new re;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var wp=D(2347),U5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(wp.Z,U5),wp.Z.locals;class W5 extends re{constructor(e){super(e),this.focusTracker=new ht,this.keystrokes=new St,this._focusables=new rn;const t=e.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),'',"unlink"),this.editButtonView=this._createButton(t("Edit link"),ve.pencil,"edit"),this.set("href",void 0),this._focusCycler=new bo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new Ae(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new Ae(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",i=>i&&cp(i)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",i=>i||n("This link has no URL")),e.bind("isEnabled").to(this,"href",i=>!!i),e.template.tag="a",e.template.eventListeners={},e}}const Et="link-ui";class K5 extends q{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[Fi]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Y1),this._balloon=e.plugins.get(Fi),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:Et,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Et,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new W5(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),t.keystrokes.set(fa,(r,s)=>{this._addFormView(),s()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new(S(q5))(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isEnabled").to(t,"isEnabled"),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:r}=i.urlInputView.fieldView.element,s=ba(r,n);e.execute("link",s,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(r,s)=>{this._closeFormView(),s()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.ui.componentFactory.add("link",i=>{const r=new Ae(i);return r.isEnabled=!0,r.label=n("Link"),r.icon='',r.keystroke=fa,r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(t,"isEnabled"),r.bind("isOn").to(t,"value",s=>!!s),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(fa,(n,i)=>{i(),e.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),w({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=s();const r=()=>{const a=this._getSelectedLinkElement(),l=s();n&&!a||!n&&l!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,i=l};function s(){return t.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(e.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i;if(t.markers.has(Et)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(Et)),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));i=e.domConverter.viewRangeToDom(s)}else i=()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&Be(n))return _a(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),r=_a(i.start),s=_a(i.end);return r&&r==s&&e.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(Et))t.updateMarker(Et,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:r})=>!e.schema.isContent(r),{boundaries:n});t.addMarker(Et,{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker(Et,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Et)&&e.change(t=>{t.removeMarker(Et)})}}function _a(o){return o.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})||null}const G5=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Z5 extends q{static get requires(){return[Wn]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new mm(e.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const i=Ap(n.substr(0,n.length-1));return i?{url:i}:void 0});t.on("matched:data",(n,i)=>{const{batch:r,range:s,url:a}=i;if(!r.isTyping)return;const l=s.end.getShiftedBy(-1),c=l.getShiftedBy(-a.length),d=e.model.createRange(c,l);this._applyAutoLink(a,d)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const r=t.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition(),r=t.createRange(t.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=um(e,t),r=Ap(n);if(r){const s=t.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,s)}}_applyAutoLink(e,t){const n=this.editor.model,i=ba(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(t,n)&&dp(i)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(t)&&this._persistAutoLink(i,t)}_persistAutoLink(e,t){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",e,t),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function Ap(o){const e=G5.exec(o);return e?e[2]:null}var _p=D(111),J5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(_p.Z,J5),_p.Z.locals;var Cp=D(5730),Y5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Cp.Z,Y5),Cp.Z.locals;var vp=D(4564),Q5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(vp.Z,Q5),vp.Z.locals;function X5(o,e){const t=e.mapper,n=e.writer,i=o.getAttribute("listType")=="numbered"?"ol":"ul",r=function(a){const l=a.createContainerElement("li");return l.getFillerOffset=nS,l}(n),s=n.createContainerElement(i,null);return n.insert(n.createPositionAt(s,0),r),t.bindElements(o,r),r}function yp(o,e,t,n){const i=e.parent,r=t.mapper,s=t.writer;let a=r.toViewPosition(n.createPositionBefore(o));const l=xp(o.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:o.getAttribute("listIndent")}),c=o.previousSibling;if(l&&l.getAttribute("listIndent")==o.getAttribute("listIndent")){const d=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(d))}else if(c&&c.name=="listItem"){a=r.toViewPosition(n.createPositionAt(c,"end"));const d=r.findMappedViewAncestor(a),u=function(g){for(const f of g.getChildren())if(f.name=="ul"||f.name=="ol")return f;return null}(d);a=u?s.createPositionBefore(u):s.createPositionAt(d,"end")}else a=r.toViewPosition(n.createPositionBefore(o));if(a=Ep(a),s.insert(a,i),c&&c.name=="listItem"){const d=r.toViewElement(c),u=s.createRange(s.createPositionAt(d,0),a).getWalker({ignoreElementEnd:!0});for(const g of u)if(g.item.is("element","li")){const f=s.breakContainer(s.createPositionBefore(g.item)),b=g.item.parent,A=s.createPositionAt(e,"end");ct(s,A.nodeBefore,A.nodeAfter),s.move(s.createRangeOn(b),A),u._position=f}}else{const d=i.nextSibling;if(d&&(d.is("element","ul")||d.is("element","ol"))){let u=null;for(const g of d.getChildren()){const f=r.toModelElement(g);if(!(f&&f.getAttribute("listIndent")>o.getAttribute("listIndent")))break;u=g}u&&(s.breakContainer(s.createPositionAfter(u)),s.move(s.createRangeOn(u.parent),s.createPositionAt(e,"end")))}}ct(s,i,i.nextSibling),ct(s,i.previousSibling,i)}function ct(o,e,t){return!e||!t||e.name!="ul"&&e.name!="ol"||e.name!=t.name||e.getAttribute("class")!==t.getAttribute("class")?null:o.mergeContainers(o.createPositionAfter(e))}function Ep(o){return o.getLastMatchingPosition(e=>e.item.is("uiElement"))}function xp(o,e){const t=!!e.sameIndent,n=!!e.smallerIndent,i=e.listIndent;let r=o;for(;r&&r.name=="listItem";){const s=r.getAttribute("listIndent");if(t&&i==s||n&&i>s)return r;r=e.direction==="forward"?r.nextSibling:r.previousSibling}return null}function Sp(o,e,t,n){o.ui.componentFactory.add(e,i=>{const r=o.commands.get(e),s=new Ae(i);return s.set({label:t,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{o.execute(e),o.editing.view.focus()}),s})}function Ca(o,e){const t=[],n=o.parent,i={ignoreElementEnd:!1,startPosition:o,shallow:!0,direction:e},r=n.getAttribute("listIndent"),s=[...new vt(i)].filter(a=>a.item.is("element")).map(a=>a.item);for(const a of s){if(!a.is("element","listItem")||a.getAttribute("listIndent")r)){if(a.getAttribute("listType")!==n.getAttribute("listType")||a.getAttribute("listStyle")!==n.getAttribute("listStyle")||a.getAttribute("listReversed")!==n.getAttribute("listReversed")||a.getAttribute("listStart")!==n.getAttribute("listStart"))break;e==="backward"?t.unshift(a):t.push(a)}}return t}const eS=["disc","circle","square"],tS=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function nS(){const o=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||o?0:yd.call(this)}class oS extends q{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;Sp(this.editor,"numberedList",e("Numbered List"),''),Sp(this.editor,"bulletedList",e("Bulleted List"),'')}}const iS=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:o,typeAttribute:e,listType:t}of iS);var Dp=D(4721),rS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Dp.Z,rS),Dp.Z.locals;var Bp=D(6082),sS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Bp.Z,sS),Bp.Z.locals;var Tp=D(2417),aS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Tp.Z,aS),Tp.Z.locals;class Ip extends ne{constructor(e,t){super(e),this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(i=>{const r=n[n.length-1];let s=r.nextSibling;for(;s&&s.name=="listItem"&&s.getAttribute("listIndent")>r.getAttribute("listIndent");)n.push(s),s=s.nextSibling;this._indentBy<0&&(n=n.reverse());for(const a of n){const l=a.getAttribute("listIndent")+this._indentBy;l<0?i.rename(a,"paragraph"):i.setAttribute("listIndent",l,a)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=ze(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}class Pp extends ne{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(s=>Op(s,t.schema)),r=e.forceValue!==void 0?!e.forceValue:this.value;t.change(s=>{if(r){let a=i[i.length-1].nextSibling,l=Number.POSITIVE_INFINITY,c=[];for(;a&&a.name=="listItem"&&a.getAttribute("listIndent")!==0;){const d=a.getAttribute("listIndent");d=t;)r>i.getAttribute("listIndent")&&(r=i.getAttribute("listIndent")),i.getAttribute("listIndent")==r&&o[e?"unshift":"push"](i),i=i[e?"previousSibling":"nextSibling"]}}function Op(o,e){return e.checkChild(o.parent,"listItem")&&!e.isObject(o)}class lS extends q{static get pluginName(){return"ListUtils"}getListTypeFromListStyleType(e){return function(t){return eS.includes(t)?"bulleted":tS.includes(t)?"numbered":null}(e)}getSelectedListItems(e){return function(t){let n=[...t.document.selection.getSelectedBlocks()].filter(i=>i.is("element","listItem")).map(i=>{const r=t.change(s=>s.createPositionAt(i,0));return[...Ca(r,"backward"),...Ca(r,"forward")]}).flat();return n=[...new Set(n)],n}(e)}getSiblingNodes(e,t){return Ca(e,t)}}function Np(o){return(e,t,n)=>{const i=n.consumable;if(!i.test(t.item,"insert")||!i.test(t.item,"attribute:listType")||!i.test(t.item,"attribute:listIndent"))return;i.consume(t.item,"insert"),i.consume(t.item,"attribute:listType"),i.consume(t.item,"attribute:listIndent");const r=t.item;yp(r,X5(r,n),n,o)}}const cS=(o,e,t)=>{if(!t.consumable.test(e.item,o.name))return;const n=t.mapper.toViewElement(e.item),i=t.writer;i.breakContainer(i.createPositionBefore(n)),i.breakContainer(i.createPositionAfter(n));const r=n.parent,s=e.attributeNewValue=="numbered"?"ol":"ul";i.rename(s,r)},dS=(o,e,t)=>{t.consumable.consume(e.item,o.name);const n=t.mapper.toViewElement(e.item).parent,i=t.writer;ct(i,n,n.nextSibling),ct(i,n.previousSibling,n)},zp=(o,e,t)=>{if(t.consumable.test(e.item,o.name)&&e.item.name!="listItem"){let n=t.mapper.toViewPosition(e.range.start);const i=t.writer,r=[];for(;(n.parent.name=="ul"||n.parent.name=="ol")&&(n=i.breakContainer(n),n.parent.name=="li");){const s=n,a=i.createPositionAt(n.parent,"end");if(!s.isEqual(a)){const l=i.remove(i.createRange(s,a));r.push(l)}n=i.createPositionAfter(n.parent)}if(r.length>0){for(let s=0;s0){const l=ct(i,a,a.nextSibling);l&&l.parent==a&&n.offset--}}ct(i,n.nodeBefore,n.nodeAfter)}}},hS=(o,e,t)=>{const n=t.mapper.toViewPosition(e.position),i=n.nodeBefore,r=n.nodeAfter;ct(t.writer,i,r)},uS=(o,e,t)=>{if(t.consumable.consume(e.viewItem,{name:!0})){const n=t.writer,i=n.createElement("listItem"),r=function(l){let c=0,d=l.parent;for(;d;){if(d.is("element","li"))c++;else{const u=d.previousSibling;u&&u.is("element","li")&&c++}d=d.parent}return c}(e.viewItem);n.setAttribute("listIndent",r,i);const s=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";if(n.setAttribute("listType",s,i),!t.safeInsert(i,e.modelCursor))return;const a=function(l,c,d){const{writer:u,schema:g}=d;let f=u.createPositionAfter(l);for(const b of c)if(b.name=="ul"||b.name=="ol")f=d.convertItem(b,f).modelCursor;else{const A=d.convertItem(b,u.createPositionAt(l,"end")),E=A.modelRange.start.nodeAfter;E&&E.is("element")&&!g.checkChild(l,E.name)&&(l=A.modelCursor.parent.is("element","listItem")?A.modelCursor.parent:pS(A.modelCursor),f=u.createPositionAfter(l))}return f}(i,e.viewItem.getChildren(),t);e.modelRange=n.createRange(e.modelCursor,a),t.updateConversionResult(i,e)}},Mp=(o,e,t)=>{if(t.consumable.test(e.viewItem,{name:!0})){const n=Array.from(e.viewItem.getChildren());for(const i of n)!(i.is("element","li")||Yn(i))&&i._remove()}},mS=(o,e,t)=>{if(t.consumable.test(e.viewItem,{name:!0})){if(e.viewItem.childCount===0)return;const n=[...e.viewItem.getChildren()];let i=!1;for(const r of n)i&&!Yn(r)&&r._remove(),Yn(r)&&(i=!0)}};function Fp(o){return(e,t)=>{if(t.isPhantom)return;const n=t.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const i=t.mapper.toViewElement(n),r=i.getAncestors().find(Yn),s=o.createPositionAt(i,0).getWalker();for(const a of s){if(a.type=="elementStart"&&a.item.is("element","li")){t.viewPosition=a.previousPosition;break}if(a.type=="elementEnd"&&a.item==r){t.viewPosition=a.nextPosition;break}}}}}const gS=function(o,[e,t]){const n=this;let i,r=e.is("documentFragment")?e.getChild(0):e;if(i=t?n.createSelection(t):n.document.selection,r&&r.is("element","listItem")){const s=i.getFirstPosition();let a=null;if(s.parent.is("element","listItem")?a=s.parent:s.nodeBefore&&s.nodeBefore.is("element","listItem")&&(a=s.nodeBefore),a){const l=a.getAttribute("listIndent");if(l>0)for(;r&&r.is("element","listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+l),r=r.nextSibling}}};function pS(o){const e=new vt({startPosition:o});let t;do t=e.next();while(!t.value.item.is("element","listItem"));return t.value.item}function Vp(o,e,t,n,i,r){const s=xp(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:o}),a=i.mapper,l=i.writer,c=s?s.getAttribute("listIndent"):null;let d;if(s)if(c==o){const u=a.toViewElement(s).parent;d=l.createPositionAfter(u)}else{const u=r.createPositionAt(s,"end");d=a.toViewPosition(u)}else d=t;d=Ep(d);for(const u of[...n.getChildren()])Yn(u)&&(d=l.move(l.createRangeOn(u),d).end,ct(l,u,u.nextSibling),ct(l,u.previousSibling,u))}function Yn(o){return o.is("element","ol")||o.is("element","ul")}class fS extends q{static get pluginName(){return"ListEditing"}static get requires(){return[zo,Wn,lS]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;var i;e.model.document.registerPostFixer(s=>function(a,l){const c=a.document.differ.getChanges(),d=new Map;let u=!1;for(const A of c)if(A.type=="insert"&&A.name=="listItem")g(A.position);else if(A.type=="insert"&&A.name!="listItem"){if(A.name!="$text"){const E=A.position.nodeAfter;E.hasAttribute("listIndent")&&(l.removeAttribute("listIndent",E),u=!0),E.hasAttribute("listType")&&(l.removeAttribute("listType",E),u=!0),E.hasAttribute("listStyle")&&(l.removeAttribute("listStyle",E),u=!0),E.hasAttribute("listReversed")&&(l.removeAttribute("listReversed",E),u=!0),E.hasAttribute("listStart")&&(l.removeAttribute("listStart",E),u=!0);for(const P of Array.from(a.createRangeIn(E)).filter(z=>z.item.is("element","listItem")))g(P.previousPosition)}g(A.position.getShiftedBy(A.length))}else A.type=="remove"&&A.name=="listItem"?g(A.position):(A.type=="attribute"&&A.attributeKey=="listIndent"||A.type=="attribute"&&A.attributeKey=="listType")&&g(A.range.start);for(const A of d.values())f(A),b(A);return u;function g(A){const E=A.nodeBefore;if(E&&E.is("element","listItem")){let P=E;if(d.has(P))return;for(let z=P.previousSibling;z&&z.is("element","listItem");z=P.previousSibling)if(P=z,d.has(P))return;d.set(E,P)}else{const P=A.nodeAfter;P&&P.is("element","listItem")&&d.set(P,P)}}function f(A){let E=0,P=null;for(;A&&A.is("element","listItem");){const z=A.getAttribute("listIndent");if(z>E){let j;P===null?(P=z-E,j=E):(P>z&&(P=z),j=z-P),l.setAttribute("listIndent",j,A),u=!0}else P=null,E=A.getAttribute("listIndent")+1;A=A.nextSibling}}function b(A){let E=[],P=null;for(;A&&A.is("element","listItem");){const z=A.getAttribute("listIndent");if(P&&P.getAttribute("listIndent")>z&&(E=E.slice(0,z+1)),z!=0)if(E[z]){const j=E[z];A.getAttribute("listType")!=j&&(l.setAttribute("listType",j,A),u=!0)}else E[z]=A.getAttribute("listType");P=A,A=A.nextSibling}}}(e.model,s)),n.mapper.registerViewToModelLength("li",va),t.mapper.registerViewToModelLength("li",va),n.mapper.on("modelToViewPosition",Fp(n.view)),n.mapper.on("viewToModelPosition",(i=e.model,(s,a)=>{const l=a.viewPosition,c=l.parent,d=a.mapper;if(c.name=="ul"||c.name=="ol"){if(l.isAtEnd){const u=d.toModelElement(l.nodeBefore),g=d.getModelLength(l.nodeBefore);a.modelPosition=i.createPositionBefore(u).getShiftedBy(g)}else{const u=d.toModelElement(l.nodeAfter);a.modelPosition=i.createPositionBefore(u)}s.stop()}else if(c.name=="li"&&l.nodeBefore&&(l.nodeBefore.name=="ul"||l.nodeBefore.name=="ol")){const u=d.toModelElement(c);let g=1,f=l.nodeBefore;for(;f&&Yn(f);)g+=d.getModelLength(f),f=f.previousSibling;a.modelPosition=i.createPositionBefore(u).getShiftedBy(g),s.stop()}})),t.mapper.on("modelToViewPosition",Fp(n.view)),e.conversion.for("editingDowncast").add(s=>{s.on("insert",zp,{priority:"high"}),s.on("insert:listItem",Np(e.model)),s.on("attribute:listType:listItem",cS,{priority:"high"}),s.on("attribute:listType:listItem",dS,{priority:"low"}),s.on("attribute:listIndent:listItem",function(a){return(l,c,d)=>{if(!d.consumable.consume(c.item,"attribute:listIndent"))return;const u=d.mapper.toViewElement(c.item),g=d.writer;g.breakContainer(g.createPositionBefore(u)),g.breakContainer(g.createPositionAfter(u));const f=u.parent,b=f.previousSibling,A=g.createRangeOn(f);g.remove(A),b&&b.nextSibling&&ct(g,b,b.nextSibling),Vp(c.attributeOldValue+1,c.range.start,A.start,u,d,a),yp(c.item,u,d,a);for(const E of c.item.getChildren())d.consumable.consume(E,"insert")}}(e.model)),s.on("remove:listItem",function(a){return(l,c,d)=>{const u=d.mapper.toViewPosition(c.position).getLastMatchingPosition(P=>!P.item.is("element","li")).nodeAfter,g=d.writer;g.breakContainer(g.createPositionBefore(u)),g.breakContainer(g.createPositionAfter(u));const f=u.parent,b=f.previousSibling,A=g.createRangeOn(f),E=g.remove(A);b&&b.nextSibling&&ct(g,b,b.nextSibling),Vp(d.mapper.toModelElement(u).getAttribute("listIndent")+1,c.position,A.start,u,d,a);for(const P of g.createRangeIn(E).getItems())d.mapper.unbindViewElement(P);l.stop()}}(e.model)),s.on("remove",hS,{priority:"low"})}),e.conversion.for("dataDowncast").add(s=>{s.on("insert",zp,{priority:"high"}),s.on("insert:listItem",Np(e.model))}),e.conversion.for("upcast").add(s=>{s.on("element:ul",Mp,{priority:"high"}),s.on("element:ol",Mp,{priority:"high"}),s.on("element:li",mS,{priority:"high"}),s.on("element:li",uS)}),e.model.on("insertContent",gS,{priority:"high"}),e.commands.add("numberedList",new Pp(e,"numbered")),e.commands.add("bulletedList",new Pp(e,"bulleted")),e.commands.add("indentList",new Ip(e,"forward")),e.commands.add("outdentList",new Ip(e,"backward"));const r=n.view.document;this.listenTo(r,"enter",(s,a)=>{const l=this.editor.model.document,c=l.selection.getLastPosition().parent;l.selection.isCollapsed&&c.name=="listItem"&&c.isEmpty&&(this.editor.execute("outdentList"),a.preventDefault(),s.stop())},{context:"li"}),this.listenTo(r,"delete",(s,a)=>{if(a.direction!=="backward")return;const l=this.editor.model.document.selection;if(!l.isCollapsed)return;const c=l.getFirstPosition();if(!c.isAtStart)return;const d=c.parent;d.name==="listItem"&&(d.previousSibling&&d.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),a.preventDefault(),s.stop()))},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(s,a)=>{const l=a.shiftKey?"outdentList":"indentList";this.editor.commands.get(l).isEnabled&&(e.execute(l),a.stopPropagation(),a.preventDefault(),s.stop())},{context:"li"})}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function va(o){let e=1;for(const t of o.getChildren())if(t.name=="ul"||t.name=="ol")for(const n of t.getChildren())e+=va(n);return e}li("Ctrl+Enter");var Lp=D(1199),kS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Lp.Z,kS),Lp.Z.locals;function Oe(o,e,t,n,i=1){e!=null&&i!=null&&e>i?n.setAttribute(o,e,t):n.removeAttribute(o,t)}function kn(o,e,t={}){const n=o.createElement("tableCell",t);return o.insertElement("paragraph",n),o.insert(n,e),n}function ya(o,e){const t=e.parent.parent,n=parseInt(t.getAttribute("headingColumns")||"0"),{column:i}=o.getCellLocation(e);return!!n&&i{o.on("element:table",(e,t,n)=>{const i=t.viewItem;if(!n.consumable.test(i,{name:!0}))return;const{rows:r,headingRows:s,headingColumns:a}=function(d){let u,g=0;const f=[],b=[];let A;for(const E of Array.from(d.getChildren())){if(E.name!=="tbody"&&E.name!=="thead"&&E.name!=="tfoot")continue;E.name!=="thead"||A||(A=E);const P=Array.from(E.getChildren()).filter(z=>z.is("element","tr"));for(const z of P)if(A&&E===A||E.name==="tbody"&&Array.from(z.getChildren()).length&&Array.from(z.getChildren()).every(j=>j.is("element","th")))g++,f.push(z);else{b.push(z);const j=wS(z);(!u||jn.convertItem(d,n.writer.createPositionAt(c,"end"))),n.convertChildren(i,n.writer.createPositionAt(c,"end")),c.isEmpty){const d=n.writer.createElement("tableRow");n.writer.insert(d,n.writer.createPositionAt(c,"end")),kn(n.writer,n.writer.createPositionAt(d,"end"))}n.updateConversionResult(c,t)}})}}function jp(o){return e=>{e.on(`element:${o}`,(t,n,{writer:i})=>{if(!n.modelRange)return;const r=n.modelRange.start.nodeAfter,s=i.createPositionAt(r,0);if(n.viewItem.isEmpty)return void i.insertElement("paragraph",s);const a=Array.from(r.getChildren());if(a.every(l=>l.is("element","$marker"))){const l=i.createElement("paragraph");i.insert(l,i.createPositionAt(r,0));for(const c of a)i.move(i.createRangeOn(c),i.createPositionAt(l,"end"))}},{priority:"low"})}}function wS(o){let e=0,t=0;const n=Array.from(o.getChildren()).filter(i=>i.name==="th"||i.name==="td");for(;t1||s>1)&&this._recordSpans(i,s,r),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+r}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new AS(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||n||i}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const i={cell:e,row:this._row,column:this._column};for(let r=this._row;r{const i=t.getAttribute("headingRows")||0,r=n.createContainerElement("table",null,[]),s=n.createContainerElement("figure",{class:"table"},r);i>0&&n.insert(n.createPositionAt(r,"end"),n.createContainerElement("thead",null,n.createSlot(a=>a.is("element","tableRow")&&a.indexa.is("element","tableRow")&&a.index>=i)));for(const{positionOffset:a,filter:l}of e.additionalSlots)n.insert(n.createPositionAt(r,a),n.createSlot(l));return n.insert(n.createPositionAt(r,"after"),n.createSlot(a=>!a.is("element","tableRow")&&!e.additionalSlots.some(({filter:l})=>l(a)))),e.asWidget?function(a,l){return l.setCustomProperty("table",!0,a),oa(a,l,{hasSelectionHandle:!0})}(s,n):s}}function Hp(o={}){return(e,{writer:t})=>{const n=e.parent,i=n.parent,r=i.getChildIndex(n),s=new ue(i,{row:r}),a=i.getAttribute("headingRows")||0,l=i.getAttribute("headingColumns")||0;let c=null;for(const d of s)if(d.cell==e){const u=d.row{if(!e.parent.is("element","tableCell")||!Up(e))return null;if(o.asWidget)return t.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const n=t.createContainerElement("p");return t.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}}function Up(o){return o.parent.childCount==1&&!!o.getAttributeKeys().next().done}class _S extends ne{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(i,r){const s=i.getFirstPosition().parent,a=s===s.root?s:s.parent;return r.checkChild(a,"table")}(t,n)}execute(e={}){const t=this.editor,n=t.model,i=t.plugins.get("TableUtils"),r=t.config.get("table.defaultHeadings.rows"),s=t.config.get("table.defaultHeadings.columns");e.headingRows===void 0&&r&&(e.headingRows=r),e.headingColumns===void 0&&s&&(e.headingColumns=s),n.change(a=>{const l=i.createTable(a,e);n.insertObject(l,null,null,{findOptimalPosition:"auto"}),a.setSelection(a.createPositionAt(l.getNodeByPath([0,0,0]),0))})}}class Wp extends ne{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="above",r=n.getSelectionAffectedTableCells(t),s=n.getRowIndexes(r),a=i?s.first:s.last,l=r[0].findAncestor("table");n.insertRows(l,{at:i?a:a+1,copyStructureFromAbove:!i})}}class Kp extends ne{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="left",r=n.getSelectionAffectedTableCells(t),s=n.getColumnIndexes(r),a=i?s.first:s.last,l=r[0].findAncestor("table");n.insertColumns(l,{columns:1,at:i?a:a+1})}}class Gp extends ne{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length===1}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];this.direction==="horizontally"?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}function Zp(o,e,t){const{startRow:n,startColumn:i,endRow:r,endColumn:s}=e,a=t.createElement("table"),l=r-n+1;for(let d=0;d0&&Oe("headingRows",A-g,d,b,0);const E=parseInt(u.getAttribute("headingColumns")||"0");E>0&&Oe("headingColumns",E-f,d,b,0)}(a,o,n,i,t),a}function Jp(o,e,t=0){const n=[],i=new ue(o,{startRow:t,endRow:e-1});for(const r of i){const{row:s,cellHeight:a}=r;s1&&(a.rowspan=l);const c=parseInt(o.getAttribute("colspan")||"1");c>1&&(a.colspan=c);const d=r+s,u=[...new ue(i,{startRow:r,endRow:d,includeAllSlots:!0})];let g,f=null;for(const b of u){const{row:A,column:E,cell:P}=b;P===o&&g===void 0&&(g=E),g!==void 0&&g===E&&A===d&&(f=kn(t,b.getPositionBefore(),a))}return Oe("rowspan",s,o,t),f}function Qp(o,e){const t=[],n=new ue(o);for(const i of n){const{column:r,cellWidth:s}=i;r1&&(r.colspan=s);const a=parseInt(o.getAttribute("rowspan")||"1");a>1&&(r.rowspan=a);const l=kn(n,n.createPositionAfter(o),r);return Oe("colspan",i,o,n),l}function ef(o,e,t,n,i,r){const s=parseInt(o.getAttribute("colspan")||"1"),a=parseInt(o.getAttribute("rowspan")||"1");t+s-1>i&&Oe("colspan",i-t+1,o,r,1),e+a-1>n&&Oe("rowspan",n-e+1,o,r,1)}function Ea(o,e){const t=e.getColumns(o),n=new Array(t).fill(0);for(const{column:r}of new ue(o))n[r]++;const i=n.reduce((r,s,a)=>s?r:[...r,a],[]);if(i.length>0){const r=i[i.length-1];return e.removeColumns(o,{at:r}),!0}return!1}function xa(o,e){const t=[],n=e.getRows(o);for(let i=0;i0){const i=t[t.length-1];return e.removeRows(o,{at:i}),!0}return!1}function Sa(o,e){Ea(o,e)||xa(o,e)}function tf(o,e){const t=Array.from(new ue(o,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(t.every(({cellHeight:i})=>i===1))return e.lastRow;const n=t[0].cellHeight-1;return e.lastRow+n}function nf(o,e){const t=Array.from(new ue(o,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(t.every(({cellWidth:i})=>i===1))return e.lastColumn;const n=t[0].cellWidth-1;return e.lastColumn+n}class Ji extends ne{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal=this.direction=="right"||this.direction=="left"}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,n=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],i=this.value,r=this.direction;e.change(s=>{const a=r=="right"||r=="down",l=a?n:i,c=a?i:n,d=c.parent;(function(A,E,P){of(A)||(of(E)&&P.remove(P.createRangeIn(E)),P.move(P.createRangeIn(A),P.createPositionAt(E,"end"))),P.remove(A)})(c,l,s);const u=this.isHorizontal?"colspan":"rowspan",g=parseInt(n.getAttribute(u)||"1"),f=parseInt(i.getAttribute(u)||"1");s.setAttribute(u,g+f,l),s.setSelection(s.createRangeIn(l));const b=this.editor.plugins.get("TableUtils");Sa(d.findAncestor("table"),b)})}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),n=t.getTableCellsContainingSelection(e.selection)[0];if(!n)return;const i=this.isHorizontal?function(a,l,c){const d=a.parent,u=d.parent,g=l=="right"?a.nextSibling:a.previousSibling,f=(u.getAttribute("headingColumns")||0)>0;if(!g)return;const b=l=="right"?a:g,A=l=="right"?g:a,{column:E}=c.getCellLocation(b),{column:P}=c.getCellLocation(A),z=parseInt(b.getAttribute("colspan")||"1"),j=ya(c,b),Y=ya(c,A);if(!(f&&j!=Y))return E+z===P?g:void 0}(n,this.direction,t):function(a,l,c){const d=a.parent,u=d.parent,g=u.getChildIndex(d);if(l=="down"&&g===c.getRows(u)-1||l=="up"&&g===0)return null;const f=parseInt(a.getAttribute("rowspan")||"1"),b=u.getAttribute("headingRows")||0,A=l=="down"&&g+f===b,E=l=="up"&&g===b;if(b&&(A||E))return null;const P=parseInt(a.getAttribute("rowspan")||"1"),z=l=="down"?g+P:g,j=[...new ue(u,{endRow:z})],Y=j.find(he=>he.cell===a),ie=Y.column,Ee=j.find(({row:he,cellHeight:Mt,column:rt})=>rt===ie&&(l=="down"?he===z:z===he+Mt));return Ee&&Ee.cell?Ee.cell:null}(n,this.direction,t);if(!i)return;const r=this.isHorizontal?"rowspan":"colspan",s=parseInt(n.getAttribute(r)||"1");return parseInt(i.getAttribute(r)||"1")===s?i:void 0}}function of(o){const e=o.getChild(0);return o.childCount==1&&e.is("element","paragraph")&&e.isEmpty}class CS extends ne{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const i=n.findAncestor("table"),r=e.getRows(i)-1,s=e.getRowIndexes(t),a=s.first===0&&s.last===r;this.isEnabled=!a}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),i=t.getRowIndexes(n),r=n[0],s=r.findAncestor("table"),a=t.getCellLocation(r).column;e.change(l=>{const c=i.last-i.first+1;t.removeRows(s,{at:i.first,rows:c});const d=function(u,g,f,b){const A=u.getChild(Math.min(g,b-1));let E=A.getChild(0),P=0;for(const z of A.getChildren()){if(P>f)return E;E=z,P+=parseInt(z.getAttribute("colspan")||"1")}return E}(s,i.first,a,t.getRows(s));l.setSelection(l.createPositionAt(d,0))})}}class vS extends ne{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const i=n.findAncestor("table"),r=e.getColumns(i),{first:s,last:a}=e.getColumnIndexes(t);this.isEnabled=a-sl.cell===t).column,last:r.find(l=>l.cell===n).column},a=function(l,c,d,u){return parseInt(d.getAttribute("colspan")||"1")>1?d:c.previousSibling||d.nextSibling?d.nextSibling||c.previousSibling:u.first?l.reverse().find(({column:f})=>ff>u.last).cell}(r,t,n,s);this.editor.model.change(l=>{const c=s.last-s.first+1;e.removeColumns(i,{at:s.first,columns:c}),l.setSelection(l.createPositionAt(a,0))})}}class yS extends ne{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),i=n.length>0;this.isEnabled=i,this.value=i&&n.every(r=>this._isInHeading(r,r.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,i=t.getSelectionAffectedTableCells(n.document.selection),r=i[0].findAncestor("table"),{first:s,last:a}=t.getRowIndexes(i),l=this.value?s:a+1,c=r.getAttribute("headingRows")||0;n.change(d=>{if(l){const u=Jp(r,l,l>c?c:0);for(const{cell:g}of u)Yp(g,l,d)}Oe("headingRows",l,r,d,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||"0");return!!n&&e.parent.index0;this.isEnabled=i,this.value=i&&n.every(r=>ya(t,r))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,i=t.getSelectionAffectedTableCells(n.document.selection),r=i[0].findAncestor("table"),{first:s,last:a}=t.getColumnIndexes(i),l=this.value?s:a+1;n.change(c=>{if(l){const d=Qp(r,l);for(const{cell:u,column:g}of d)Xp(u,g,l,c)}Oe("headingColumns",l,r,c,0)})}}class qe extends q{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,i=n.getChildIndex(t),r=new ue(n,{row:i});for(const{cell:s,row:a,column:l}of r)if(s===e)return{row:a,column:l}}createTable(e,t){const n=e.createElement("table"),i=t.rows||2,r=t.columns||2;return Da(e,n,0,i,r),t.headingRows&&Oe("headingRows",Math.min(t.headingRows,i),n,e,0),t.headingColumns&&Oe("headingColumns",Math.min(t.headingColumns,r),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,i=t.at||0,r=t.rows||1,s=t.copyStructureFromAbove!==void 0,a=t.copyStructureFromAbove?i-1:i,l=this.getRows(e),c=this.getColumns(e);if(i>l)throw new I("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change(d=>{const u=e.getAttribute("headingRows")||0;if(u>i&&Oe("headingRows",u+r,e,d,0),!s&&(i===0||i===l))return void Da(d,e,i,r,c);const g=s?Math.max(i,a):i,f=new ue(e,{endRow:g}),b=new Array(c).fill(1);for(const{row:A,column:E,cellHeight:P,cellWidth:z,cell:j}of f){const Y=A+P-1,ie=A<=a&&a<=Y;A0&&kn(d,j,z>1?{colspan:z}:void 0),P+=Math.abs(z)-1}}})}insertColumns(e,t={}){const n=this.editor.model,i=t.at||0,r=t.columns||1;n.change(s=>{const a=e.getAttribute("headingColumns");ir-1)throw new I("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});n.change(l=>{const c={first:s,last:a},{cellsToMove:d,cellsToTrim:u}=function(g,{first:f,last:b}){const A=new Map,E=[];for(const{row:P,column:z,cellHeight:j,cell:Y}of new ue(g,{endRow:b})){const ie=P+j-1;if(P>=f&&P<=b&&ie>b){const Ee=j-(b-P+1);A.set(z,{cell:Y,rowspan:Ee})}if(P=f){let Ee;Ee=ie>=b?b-f+1:ie-f+1,E.push({cell:Y,rowspan:j-Ee})}}return{cellsToMove:A,cellsToTrim:E}}(e,c);d.size&&function(g,f,b,A){const E=new ue(g,{includeAllSlots:!0,row:f}),P=[...E],z=g.getChild(f);let j;for(const{column:Y,cell:ie,isAnchor:Ee}of P)if(b.has(Y)){const{cell:he,rowspan:Mt}=b.get(Y),rt=j?A.createPositionAfter(j):A.createPositionAt(z,0);A.move(A.createRangeOn(he),rt),Oe("rowspan",Mt,he,A),j=he}else Ee&&(j=ie)}(e,a+1,d,l);for(let g=a;g>=s;g--)l.remove(e.getChild(g));for(const{rowspan:g,cell:f}of u)Oe("rowspan",g,f,l);(function(g,{first:f,last:b},A){const E=g.getAttribute("headingRows")||0;f{(function(l,c,d){const u=l.getAttribute("headingColumns")||0;if(u&&c.first=i;l--)for(const{cell:c,column:d,cellWidth:u}of[...new ue(e)])d<=l&&u>1&&d+u>l?Oe("colspan",u-1,c,a):d===l&&a.remove(c);xa(e,this)||Ea(e,this)})}splitCellVertically(e,t=2){const n=this.editor.model,i=e.parent.parent,r=parseInt(e.getAttribute("rowspan")||"1"),s=parseInt(e.getAttribute("colspan")||"1");n.change(a=>{if(s>1){const{newCellsSpan:l,updatedSpan:c}=rf(s,t);Oe("colspan",c,e,a);const d={};l>1&&(d.colspan=l),r>1&&(d.rowspan=r),Qn(s>t?t-1:s-1,a,a.createPositionAfter(e),d)}if(sb===e),u=c.filter(({cell:b,cellWidth:A,column:E})=>b!==e&&E===d||Ed);for(const{cell:b,cellWidth:A}of u)a.setAttribute("colspan",A+l,b);const g={};r>1&&(g.rowspan=r),Qn(l,a,a.createPositionAfter(e),g);const f=i.getAttribute("headingColumns")||0;f>d&&Oe("headingColumns",f+l,i,a)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,i=e.parent,r=i.parent,s=r.getChildIndex(i),a=parseInt(e.getAttribute("rowspan")||"1"),l=parseInt(e.getAttribute("colspan")||"1");n.change(c=>{if(a>1){const d=[...new ue(r,{startRow:s,endRow:s+a-1,includeAllSlots:!0})],{newCellsSpan:u,updatedSpan:g}=rf(a,t);Oe("rowspan",g,e,c);const{column:f}=d.find(({cell:A})=>A===e),b={};u>1&&(b.rowspan=u),l>1&&(b.colspan=l);for(const A of d){const{column:E,row:P}=A;P>=s+g&&E===f&&(P+s+g)%u==0&&Qn(1,c,A.getPositionBefore(),b)}}if(as){const P=A+d;c.setAttribute("rowspan",P,b)}const g={};l>1&&(g.colspan=l),Da(c,r,s+1,d,1,g);const f=r.getAttribute("headingRows")||0;f>s&&Oe("headingRows",f+d,r,c)}})}getColumns(e){return[...e.getChild(0).getChildren()].reduce((t,n)=>t+parseInt(n.getAttribute("colspan")||"1"),0)}getRows(e){return Array.from(e.getChildren()).reduce((t,n)=>n.is("element","tableRow")?t+1:t,0)}createTableWalker(e,t={}){return new ue(e,t)}getSelectedTableCells(e){const t=[];for(const n of this.sortRanges(e.getRanges())){const i=n.getContainedElement();i&&i.is("element","tableCell")&&t.push(i)}return t}getTableCellsContainingSelection(e){const t=[];for(const n of e.getRanges()){const i=n.start.findAncestor("tableCell");i&&t.push(i)}return t}getSelectionAffectedTableCells(e){const t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){const t=e.map(n=>n.parent.index);return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),n=[...new ue(t)].filter(i=>e.includes(i.cell)).map(i=>i.column);return this._getFirstLastIndexesObject(n)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,n=new Set;let i=0;for(const s of e){const{row:a,column:l}=this.getCellLocation(s),c=parseInt(s.getAttribute("rowspan"))||1,d=parseInt(s.getAttribute("colspan"))||1;t.add(a),n.add(l),c>1&&t.add(a+c-1),d>1&&n.add(l+d-1),i+=c*d}return function(s,a){const l=Array.from(s.values()),c=Array.from(a.values()),d=Math.max(...l),u=Math.min(...l),g=Math.max(...c),f=Math.min(...c);return(d-u+1)*(g-f+1)}(t,n)==i}sortRanges(e){return Array.from(e).sort(xS)}_getFirstLastIndexesObject(e){const t=e.sort((n,i)=>n-i);return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),n=this.getRowIndexes(e),i=parseInt(t.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(n,i))return!1;const r=this.getColumnIndexes(e),s=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(r,s)}_areIndexesInSameSection({first:e,last:t},n){return e{const i=t.getSelectedTableCells(e.document.selection),r=i.shift(),{mergeWidth:s,mergeHeight:a}=function(l,c,d){let u=0,g=0;for(const P of c){const{row:z,column:j}=d.getCellLocation(P);u=af(P,j,u,"colspan"),g=af(P,z,g,"rowspan")}const{row:f,column:b}=d.getCellLocation(l),A=u-b,E=g-f;return{mergeWidth:A,mergeHeight:E}}(r,i,t);Oe("colspan",s,r,n),Oe("rowspan",a,r,n);for(const l of i)DS(l,r,n);Sa(r.findAncestor("table"),t),n.setSelection(r,"in")})}}function DS(o,e,t){sf(o)||(sf(e)&&t.remove(t.createRangeIn(e)),t.move(t.createRangeIn(o),t.createPositionAt(e,"end"))),t.remove(o)}function sf(o){const e=o.getChild(0);return o.childCount==1&&e.is("element","paragraph")&&e.isEmpty}function af(o,e,t,n){const i=parseInt(o.getAttribute(n)||"1");return Math.max(t,e+i)}class BS extends ne{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),i=t.getRowIndexes(n),r=n[0].findAncestor("table"),s=[];for(let a=i.first;a<=i.last;a++)for(const l of r.getChild(a).getChildren())s.push(e.createRangeOn(l));e.change(a=>{a.setSelection(s)})}}class TS extends ne{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),i=n[0],r=n.pop(),s=i.findAncestor("table"),a=e.getCellLocation(i),l=e.getCellLocation(r),c=Math.min(a.column,l.column),d=Math.max(a.column,l.column),u=[];for(const g of new ue(s,{startColumn:c,endColumn:d}))u.push(t.createRangeOn(g.cell));t.change(g=>{g.setSelection(u)})}}function IS(o){o.document.registerPostFixer(e=>function(t,n){const i=n.document.differ.getChanges();let r=!1;const s=new Set;for(const a of i){let l=null;a.type=="insert"&&a.name=="table"&&(l=a.position.nodeAfter),a.type!="insert"&&a.type!="remove"||a.name!="tableRow"&&a.name!="tableCell"||(l=a.position.findAncestor("table")),OS(a)&&(l=a.range.start.findAncestor("table")),l&&!s.has(l)&&(r=PS(l,t)||r,r=RS(l,t)||r,s.add(l))}return r}(e,o))}function PS(o,e){let t=!1;const n=function(i){const r=parseInt(i.getAttribute("headingRows")||"0"),s=Array.from(i.getChildren()).reduce((l,c)=>c.is("element","tableRow")?l+1:l,0),a=[];for(const{row:l,cell:c,cellHeight:d}of new ue(i)){if(d<2)continue;const u=lu){const g=u-l;a.push({cell:c,rowspan:g})}}return a}(o);if(n.length){t=!0;for(const i of n)Oe("rowspan",i.rowspan,i.cell,e,1)}return t}function RS(o,e){let t=!1;const n=function(a){const l=new Array(a.childCount).fill(0);for(const{rowIndex:c}of new ue(a,{includeAllSlots:!0}))l[c]++;return l}(o),i=[];for(const[a,l]of n.entries())!l&&o.getChild(a).is("element","tableRow")&&i.push(a);if(i.length){t=!0;for(const a of i.reverse())e.remove(o.getChild(a)),n.splice(a,1)}const r=n.filter((a,l)=>o.getChild(l).is("element","tableRow")),s=r[0];if(!r.every(a=>a===s)){const a=r.reduce((l,c)=>c>l?c:l,0);for(const[l,c]of r.entries()){const d=a-c;if(d){for(let u=0;ufunction(t,n){const i=n.document.differ.getChanges();let r=!1;for(const s of i)s.type=="insert"&&s.name=="table"&&(r=zS(s.position.nodeAfter,t)||r),s.type=="insert"&&s.name=="tableRow"&&(r=lf(s.position.nodeAfter,t)||r),s.type=="insert"&&s.name=="tableCell"&&(r=Ba(s.position.nodeAfter,t)||r),s.type!="remove"&&s.type!="insert"||!MS(s)||(r=Ba(s.position.parent,t)||r);return r}(e,o))}function zS(o,e){let t=!1;for(const n of o.getChildren())n.is("element","tableRow")&&(t=lf(n,e)||t);return t}function lf(o,e){let t=!1;for(const n of o.getChildren())t=Ba(n,e)||t;return t}function Ba(o,e){if(o.childCount==0)return e.insertElement("paragraph",o),!0;const t=Array.from(o.getChildren()).filter(n=>n.is("$text"));for(const n of t)e.wrap(e.createRangeOn(n),"paragraph");return!!t.length}function MS(o){return!!o.position.parent.is("element","tableCell")&&(o.type=="insert"&&o.name=="$text"||o.type=="remove")}function FS(o,e){if(!o.is("element","paragraph"))return!1;const t=e.toViewElement(o);return!!t&&Up(o)!==t.is("element","span")}var cf=D(3881),VS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(cf.Z,VS),cf.Z.locals;class LS extends q{constructor(e){super(e),this._additionalSlots=[]}static get pluginName(){return"TableEditing"}static get requires(){return[qe]}init(){const e=this.editor,t=e.model,n=t.schema,i=e.conversion,r=e.plugins.get(qe);n.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),i.for("upcast").add(s=>{s.on("element:figure",(a,l,c)=>{if(!c.consumable.test(l.viewItem,{name:!0,classes:"table"}))return;const d=function(g){for(const f of g.getChildren())if(f.is("element","table"))return f}(l.viewItem);if(!d||!c.consumable.test(d,{name:!0}))return;c.consumable.consume(l.viewItem,{name:!0,classes:"table"});const u=ze(c.convertItem(d,l.modelCursor).modelRange.getItems());u?(c.convertChildren(l.viewItem,c.writer.createPositionAt(u,"end")),c.updateConversionResult(u,l)):c.consumable.revert(l.viewItem,{name:!0,classes:"table"})})}),i.for("upcast").add(bS()),i.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:$p(r,{asWidget:!0,additionalSlots:this._additionalSlots})}),i.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:$p(r,{additionalSlots:this._additionalSlots})}),i.for("upcast").elementToElement({model:"tableRow",view:"tr"}),i.for("upcast").add(s=>{s.on("element:tr",(a,l)=>{l.viewItem.isEmpty&&l.modelCursor.index==0&&a.stop()},{priority:"high"})}),i.for("downcast").elementToElement({model:"tableRow",view:(s,{writer:a})=>s.isEmpty?a.createEmptyElement("tr"):a.createContainerElement("tr")}),i.for("upcast").elementToElement({model:"tableCell",view:"td"}),i.for("upcast").elementToElement({model:"tableCell",view:"th"}),i.for("upcast").add(jp("td")),i.for("upcast").add(jp("th")),i.for("editingDowncast").elementToElement({model:"tableCell",view:Hp({asWidget:!0})}),i.for("dataDowncast").elementToElement({model:"tableCell",view:Hp()}),i.for("editingDowncast").elementToElement({model:"paragraph",view:qp({asWidget:!0}),converterPriority:"high"}),i.for("dataDowncast").elementToElement({model:"paragraph",view:qp(),converterPriority:"high"}),i.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),i.for("upcast").attributeToAttribute({model:{key:"colspan",value:df("colspan")},view:"colspan"}),i.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),i.for("upcast").attributeToAttribute({model:{key:"rowspan",value:df("rowspan")},view:"rowspan"}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new _S(e)),e.commands.add("insertTableRowAbove",new Wp(e,{order:"above"})),e.commands.add("insertTableRowBelow",new Wp(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Kp(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Kp(e,{order:"right"})),e.commands.add("removeTableRow",new CS(e)),e.commands.add("removeTableColumn",new vS(e)),e.commands.add("splitTableCellVertically",new Gp(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new Gp(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new SS(e)),e.commands.add("mergeTableCellRight",new Ji(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Ji(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Ji(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Ji(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new ES(e)),e.commands.add("setTableRowHeader",new yS(e)),e.commands.add("selectTableRow",new BS(e)),e.commands.add("selectTableColumn",new TS(e)),IS(t),NS(t),this.listenTo(t.document,"change:data",()=>{(function(s,a){const l=s.document.differ;for(const c of l.getChanges()){let d,u=!1;if(c.type=="attribute"){const A=c.range.start.nodeAfter;if(!A||!A.is("element","table")||c.attributeKey!="headingRows"&&c.attributeKey!="headingColumns")continue;d=A,u=c.attributeKey=="headingRows"}else c.name!="tableRow"&&c.name!="tableCell"||(d=c.position.findAncestor("table"),u=c.name=="tableRow");if(!d)continue;const g=d.getAttribute("headingRows")||0,f=d.getAttribute("headingColumns")||0,b=new ue(d);for(const A of b){const E=A.rowFS(g,a.mapper));for(const g of u)a.reconvertItem(g)}}(t,e.editing)})}registerAdditionalSlot(e){this._additionalSlots.push(e)}}function df(o){return e=>{const t=parseInt(e.getAttribute(o));return Number.isNaN(t)||t<=0?null:t}}var hf=D(1613),jS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(hf.Z,jS),hf.Z.locals;class $S extends re{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new St,this.focusTracker=new ht,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(n,i)=>`${i} × ${n}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to(n=>{n.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(n,i)=>{const{row:r,column:s}=i.target.dataset;this.items.get(10*(parseInt(r,10)-1)+(parseInt(s,10)-1)).focus()}),this.focusTracker.on("change:focusedElement",(n,i,r)=>{if(!r)return;const{row:s,column:a}=r.dataset;this.set({rows:parseInt(s),columns:parseInt(a)})}),this.on("change:columns",()=>this._highlightGridBoxes()),this.on("change:rows",()=>this._highlightGridBoxes())}render(){super.render(),function({keystrokeHandler:e,focusTracker:t,gridItems:n,numberOfColumns:i,uiLanguageDirection:r}){const s=typeof i=="number"?()=>i:i;function a(d){return u=>{const g=n.find(A=>A.element===t.focusedElement),f=n.getIndex(g),b=d(f,n);n.get(b).focus(),u.stopPropagation(),u.preventDefault()}}function l(d,u){return d===u-1?0:d+1}function c(d,u){return d===0?u-1:d-1}e.set("arrowright",a((d,u)=>r==="rtl"?c(d,u.length):l(d,u.length))),e.set("arrowleft",a((d,u)=>r==="rtl"?l(d,u.length):c(d,u.length))),e.set("arrowup",a((d,u)=>{let g=d-s();return g<0&&(g=d+s()*Math.floor(u.length/s()),g>u.length-1&&(g-=s())),g})),e.set("arrowdown",a((d,u)=>{let g=d+s();return g>u.length-1&&(g=d%s()),g}))}({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,i)=>{const r=Math.floor(i/10){const r=e.commands.get("insertTable"),s=Pt(i);let a;return s.bind("isEnabled").to(r),s.buttonView.set({icon:'',label:t("Insert table"),tooltip:!0}),s.on("change:isOpen",()=>{a||(a=new $S(i),s.panelView.children.add(a),a.delegate("execute").to(s),s.on("execute",()=>{e.execute("insertTable",{rows:a.rows,columns:a.columns}),e.editing.view.focus()}))}),s}),e.ui.componentFactory.add("tableColumn",i=>{const r=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'',r,i)}),e.ui.componentFactory.add("tableRow",i=>{const r=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'',r,i)}),e.ui.componentFactory.add("mergeTableCells",i=>{const r=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'',r,i)})}_prepareDropdown(e,t,n,i){const r=this.editor,s=Pt(i),a=this._fillDropdownWithListOptions(s,n);return s.buttonView.set({label:e,icon:t,tooltip:!0}),s.bind("isEnabled").toMany(a,"isEnabled",(...l)=>l.some(c=>c)),this.listenTo(s,"execute",l=>{r.execute(l.source.commandName),l.source instanceof hi||r.editing.view.focus()}),s}_prepareMergeSplitButtonDropdown(e,t,n,i){const r=this.editor,s=Pt(i,Ms),a="mergeTableCells",l=r.commands.get(a),c=this._fillDropdownWithListOptions(s,n);return s.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),s.bind("isEnabled").toMany([l,...c],"isEnabled",(...d)=>d.some(u=>u)),this.listenTo(s.buttonView,"execute",()=>{r.execute(a),r.editing.view.focus()}),this.listenTo(s,"execute",d=>{r.execute(d.source.commandName),r.editing.view.focus()}),s}_fillDropdownWithListOptions(e,t){const n=this.editor,i=[],r=new at;for(const s of t)qS(s,n,i,r);return Fs(e,r),i}}function qS(o,e,t,n){if(o.type==="button"||o.type==="switchbutton"){const i=o.model=new Js(o.model),{commandName:r,bindIsOn:s}=o.model,a=e.commands.get(r);t.push(a),i.set({commandName:r}),i.bind("isEnabled").to(a),s&&i.bind("isOn").to(a,"value"),i.set({withText:!0})}n.add(o)}var uf=D(6945),US={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(uf.Z,US),uf.Z.locals;class bn extends q{static get pluginName(){return"TableSelection"}static get requires(){return[qe,qe]}init(){const e=this.editor,t=e.model,n=e.editing.view;this.listenTo(t,"deleteContent",(i,r)=>this._handleDeleteContent(i,r),{priority:"high"}),this.listenTo(n.document,"insertText",(i,r)=>this._handleInsertTextEvent(i,r),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(qe),t=this.editor.model.document.selection,n=e.getSelectedTableCells(t);return n.length==0?null:n}getSelectionAsFragment(){const e=this.editor.plugins.get(qe),t=this.getSelectedTableCells();return t?this.editor.model.change(n=>{const i=n.createDocumentFragment(),{first:r,last:s}=e.getColumnIndexes(t),{first:a,last:l}=e.getRowIndexes(t),c=t[0].findAncestor("table");let d=l,u=s;if(e.isSelectionRectangular(t)){const f={firstColumn:r,lastColumn:s,firstRow:a,lastRow:l};d=tf(c,f),u=nf(c,f)}const g=Zp(c,{startRow:a,startColumn:r,endRow:d,endColumn:u},n);return n.insert(g,i,0),i}):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change(i=>{i.setSelection(n.cells.map(r=>i.createRangeOn(r)),{backward:n.backward})})}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=ze(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(n=>n.on("selection",(i,r,s)=>{const a=s.writer;(function(d){for(const u of t)d.removeClass("ck-editor__editable_selected",u);t.clear()})(a);const l=this.getSelectedTableCells();if(!l)return;for(const d of l){const u=s.mapper.toViewElement(d);a.addClass("ck-editor__editable_selected",u),t.add(u)}const c=s.mapper.toViewElement(l[l.length-1]);a.setSelection(c,0)},{priority:"lowest"}))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change(n=>{const i=n.createPositionAt(t[0],0),r=e.model.schema.getNearestSelectionRange(i);n.setSelection(r)})}})}_handleDeleteContent(e,t){const n=this.editor.plugins.get(qe),i=t[0],r=t[1],s=this.editor.model,a=!r||r.direction=="backward",l=n.getSelectedTableCells(i);l.length&&(e.stop(),s.change(c=>{const d=l[a?l.length-1:0];s.change(g=>{for(const f of l)s.deleteContent(g.createSelection(f,"in"))});const u=s.schema.getNearestSelectionRange(c.createPositionAt(d,0));i.is("documentSelection")?c.setSelection(u):i.setTo(u)}))}_handleInsertTextEvent(e,t){const n=this.editor,i=this.getSelectedTableCells();if(!i)return;const r=n.editing.view,s=n.editing.mapper,a=i.map(l=>r.createRangeOn(s.toViewElement(l)));t.selection=r.createSelection(a)}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),i=n.getCellLocation(e),r=n.getCellLocation(t),s=Math.min(i.row,r.row),a=Math.max(i.row,r.row),l=Math.min(i.column,r.column),c=Math.max(i.column,r.column),d=new Array(a-s+1).fill(null).map(()=>[]),u={startRow:s,endRow:a,startColumn:l,endColumn:c};for(const{row:b,cell:A}of new ue(e.findAncestor("table"),u))d[b-s].push(A);const g=r.rowb.reverse()),{cells:d.flat(),backward:g||f}}}class WS extends q{static get pluginName(){return"TableClipboard"}static get requires(){return[bn,qe]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(n,i)=>this._onCopyCut(n,i)),this.listenTo(t,"cut",(n,i)=>this._onCopyCut(n,i)),this.listenTo(e.model,"insertContent",(n,[i,r])=>this._onInsertContent(n,i,r),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(bn);if(!n.getSelectedTableCells()||e.name=="cut"&&!this.editor.model.canEditAt(this.editor.model.document.selection))return;t.preventDefault(),e.stop();const i=this.editor.data,r=this.editor.editing.view.document,s=i.toView(n.getSelectionAsFragment());r.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:s,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const i=this.editor.model,r=this.editor.plugins.get(qe);let s=this.getTableIfOnlyTableInContent(t,i);if(!s)return;const a=r.getSelectionAffectedTableCells(i.document.selection);a.length?(e.stop(),i.change(l=>{const c={width:r.getColumns(s),height:r.getRows(s)},d=function(E,P,z,j){const Y=E[0].findAncestor("table"),ie=j.getColumnIndexes(E),Ee=j.getRowIndexes(E),he={firstColumn:ie.first,lastColumn:ie.last,firstRow:Ee.first,lastRow:Ee.last},Mt=E.length===1;return Mt&&(he.lastRow+=P.height-1,he.lastColumn+=P.width-1,function(rt,nr,Cn,Zt){const no=Zt.getColumns(rt),oo=Zt.getRows(rt);Cn>no&&Zt.insertColumns(rt,{at:no,columns:Cn-no}),nr>oo&&Zt.insertRows(rt,{at:oo,rows:nr-oo})}(Y,he.lastRow+1,he.lastColumn+1,j)),Mt||!j.isSelectionRectangular(E)?function(rt,nr,Cn){const{firstRow:Zt,lastRow:no,firstColumn:oo,lastColumn:Kf}=nr,Gf={first:Zt,last:no},Zf={first:oo,last:Kf};Ia(rt,oo,Gf,Cn),Ia(rt,Kf+1,Gf,Cn),Ta(rt,Zt,Zf,Cn),Ta(rt,no+1,Zf,Cn,Zt)}(Y,he,z):(he.lastRow=tf(Y,he),he.lastColumn=nf(Y,he)),he}(a,c,l,r),u=d.lastRow-d.firstRow+1,g=d.lastColumn-d.firstColumn+1,f={startRow:0,startColumn:0,endRow:Math.min(u,c.height)-1,endColumn:Math.min(g,c.width)-1};s=Zp(s,f,l);const b=a[0].findAncestor("table"),A=this._replaceSelectedCellsWithPasted(s,c,b,d,l);if(this.editor.plugins.get("TableSelection").isEnabled){const E=r.sortRanges(A.map(P=>l.createRangeOn(P)));l.setSelection(E)}else l.setSelection(A[0],0)})):Sa(s,r)}_replaceSelectedCellsWithPasted(e,t,n,i,r){const{width:s,height:a}=t,l=function(E,P,z){const j=new Array(z).fill(null).map(()=>new Array(P).fill(null));for(const{column:Y,row:ie,cell:Ee}of new ue(E))j[ie][Y]=Ee;return j}(e,s,a),c=[...new ue(n,{startRow:i.firstRow,endRow:i.lastRow,startColumn:i.firstColumn,endColumn:i.lastColumn,includeAllSlots:!0})],d=[];let u;for(const E of c){const{row:P,column:z}=E;z===i.firstColumn&&(u=E.getPositionBefore());const j=P-i.firstRow,Y=z-i.firstColumn,ie=l[j%a][Y%s],Ee=ie?r.cloneElement(ie):null,he=this._replaceTableSlotCell(E,Ee,u,r);he&&(ef(he,P,z,i.lastRow,i.lastColumn,r),d.push(he),u=r.createPositionAfter(he))}const g=parseInt(n.getAttribute("headingRows")||"0"),f=parseInt(n.getAttribute("headingColumns")||"0"),b=i.firstRowmf(r,s,t)).map(({cell:r})=>Yp(r,e,n))}function Ia(o,e,t,n){if(!(e<1))return Qp(o,e).filter(({row:i,cellHeight:r})=>mf(i,r,t)).map(({cell:i,column:r})=>Xp(i,r,e,n))}function mf(o,e,t){const n=o+e-1,{first:i,last:r}=t;return o>=i&&o<=r||o=i}class KS extends q{static get pluginName(){return"TableKeyboard"}static get requires(){return[bn,qe]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"arrowKey",(...t)=>this._onArrowKey(...t),{context:"table"}),this.listenTo(e,"tab",(...t)=>this._handleTabOnSelectedTable(...t),{context:"figure"}),this.listenTo(e,"tab",(...t)=>this._handleTab(...t),{context:["th","td"]})}_handleTabOnSelectedTable(e,t){const n=this.editor,i=n.model.document.selection.getSelectedElement();i&&i.is("element","table")&&(t.preventDefault(),t.stopPropagation(),e.stop(),n.model.change(r=>{r.setSelection(r.createRangeIn(i.getChild(0).getChild(0)))}))}_handleTab(e,t){const n=this.editor,i=this.editor.plugins.get(qe),r=this.editor.plugins.get("TableSelection"),s=n.model.document.selection,a=!t.shiftKey;let l=i.getTableCellsContainingSelection(s)[0];if(l||(l=r.getFocusCell()),!l)return;t.preventDefault(),t.stopPropagation(),e.stop();const c=l.parent,d=c.parent,u=d.getChildIndex(c),g=c.getChildIndex(l),f=g===0;if(!a&&f&&u===0)return void n.model.change(P=>{P.setSelection(P.createRangeOn(d))});const b=g===c.childCount-1,A=u===i.getRows(d)-1;if(a&&A&&b&&(n.execute("insertTableRowBelow"),u===i.getRows(d)-1))return void n.model.change(P=>{P.setSelection(P.createRangeOn(d))});let E;if(a&&b)E=d.getChild(u+1).getChild(0);else if(!a&&f){const P=d.getChild(u-1);E=P.getChild(P.childCount-1)}else E=c.getChild(g+(a?1:-1));n.model.change(P=>{P.setSelection(P.createRangeIn(E))})}_onArrowKey(e,t){const n=this.editor,i=Hr(t.keyCode,n.locale.contentLanguageDirection);this._handleArrowKeys(i,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.plugins.get(qe),i=this.editor.plugins.get("TableSelection"),r=this.editor.model,s=r.document.selection,a=["right","down"].includes(e),l=n.getSelectedTableCells(s);if(l.length){let d;return d=t?i.getFocusCell():a?l[l.length-1]:l[0],this._navigateFromCellInDirection(d,e,t),!0}const c=s.focus.findAncestor("tableCell");if(!c)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==a&&!s.containsEntireContent(c))return!1}else{const d=s.getSelectedElement();if(!d||!r.schema.isObject(d))return!1}return!!this._isSelectionAtCellEdge(s,c,a)&&(this._navigateFromCellInDirection(c,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const i=this.editor.model,r=this.editor.model.schema,s=n?e.getLastPosition():e.getFirstPosition();if(!r.getLimitElement(s).is("element","tableCell"))return i.createPositionAt(t,n?"end":0).isTouching(s);const a=i.createSelection(s);return i.modifySelection(a,{direction:n?"forward":"backward"}),s.isEqual(a.focus)}_navigateFromCellInDirection(e,t,n=!1){const i=this.editor.model,r=e.findAncestor("table"),s=[...new ue(r,{includeAllSlots:!0})],{row:a,column:l}=s[s.length-1],c=s.find(({cell:A})=>A==e);let{row:d,column:u}=c;switch(t){case"left":u--;break;case"up":d--;break;case"right":u+=c.cellWidth;break;case"down":d+=c.cellHeight}if(d<0||d>a||u<0&&d<=0||u>l&&d>=a)return void i.change(A=>{A.setSelection(A.createRangeOn(r))});u<0?(u=n?0:l,d--):u>l&&(u=n?l:0,d++);const g=s.find(A=>A.row==d&&A.column==u).cell,f=["right","down"].includes(t),b=this.editor.plugins.get("TableSelection");if(n&&b.isEnabled){const A=b.getAnchorCell()||e;b.setCellSelection(A,g)}else{const A=i.createPositionAt(g,f?0:"end");i.change(E=>{E.setSelection(A)})}}}class GS extends Ht{constructor(){super(...arguments),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class ZS extends q{static get pluginName(){return"TableMouse"}static get requires(){return[bn,qe]}init(){this.editor.editing.view.addObserver(GS),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(qe);let n=!1;const i=e.plugins.get(bn);this.listenTo(e.editing.view.document,"mousedown",(r,s)=>{const a=e.model.document.selection;if(!this.isEnabled||!i.isEnabled||!s.domEvent.shiftKey)return;const l=i.getAnchorCell()||t.getTableCellsContainingSelection(a)[0];if(!l)return;const c=this._getModelTableCellFromDomEvent(s);c&&gf(l,c)&&(n=!0,i.setCellSelection(l,c),s.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{n=!1}),this.listenTo(e.editing.view.document,"selectionChange",r=>{n&&r.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,i=!1,r=!1;const s=e.plugins.get(bn);this.listenTo(e.editing.view.document,"mousedown",(a,l)=>{this.isEnabled&&s.isEnabled&&(l.domEvent.shiftKey||l.domEvent.ctrlKey||l.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(l)))}),this.listenTo(e.editing.view.document,"mousemove",(a,l)=>{if(!l.domEvent.buttons||!t)return;const c=this._getModelTableCellFromDomEvent(l);c&&gf(t,c)&&(n=c,i||n==t||(i=!0)),i&&(r=!0,s.setCellSelection(t,n),l.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1,r=!1,t=null,n=null}),this.listenTo(e.editing.view.document,"selectionChange",a=>{r&&a.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,n=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}function gf(o,e){return o.parent.parent==e.parent.parent}var pf=D(6306),JS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(pf.Z,JS),pf.Z.locals;function YS(o){const e=o.getSelectedElement();return e&&ff(e)?e:null}function QS(o){const e=o.getFirstPosition();if(!e)return null;let t=e.parent;for(;t;){if(t.is("element")&&ff(t))return t;t=t.parent}return null}function ff(o){return!!o.getCustomProperty("table")&&Be(o)}var kf=D(7368),XS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(kf.Z,XS),kf.Z.locals;var bf=D(9247),eD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(bf.Z,eD),bf.Z.locals;var wf=D(4070),tD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(wf.Z,tD),wf.Z.locals;var Af=D(6237),nD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Af.Z,nD),Af.Z.locals;var _f=D(5087),oD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(_f.Z,oD),_f.Z.locals;const wn=Qe.defaultPositions;wn.northArrowSouth,wn.northArrowSouthWest,wn.northArrowSouthEast,wn.southArrowNorth,wn.southArrowNorthWest,wn.southArrowNorthEast,wn.viewportStickyNorth;var Cf=D(7341),iD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Cf.Z,iD),Cf.Z.locals;var vf=D(2128),rD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(vf.Z,rD),vf.Z.locals;var yf=D(4101),sD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(yf.Z,sD),yf.Z.locals;var aD=Object.defineProperty,Ef=Object.getOwnPropertySymbols,lD=Object.prototype.hasOwnProperty,cD=Object.prototype.propertyIsEnumerable,xf=(o,e,t)=>e in o?aD(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Sf=(o,e)=>{for(var t in e||(e={}))lD.call(e,t)&&xf(o,t,e[t]);if(Ef)for(var t of Ef(e))cD.call(e,t)&&xf(o,t,e[t]);return o};const dD={autoRefresh:!0},Df=36e5;class Pa extends ge(){constructor(e,t={}){if(super(),!e)throw new I("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh=typeof e=="function"?e:()=>{return n=e,new Promise((i,r)=>{const s=new XMLHttpRequest;s.open("GET",n),s.addEventListener("load",()=>{const a=s.status,l=s.response;return a<200||a>299?r(new I("token-cannot-download-new-token",null)):i(l)}),s.addEventListener("error",()=>r(new Error("Network Error"))),s.addEventListener("abort",()=>r(new Error("Abort"))),s.send()});var n},this._options=Sf(Sf({},dD),t)}init(){return new Promise((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)})}refreshToken(){return this._refresh().then(e=>(this._validateTokenValue(e),this.set("value",e),this._options.autoRefresh&&this._registerRefreshTokenTimeout(),this))}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t=typeof e=="string",n=!/^".*"$/.test(e),i=t&&e.split(".").length===3;if(!n||!i)throw new I("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(){const e=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout),this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},e)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?Math.floor((1e3*t-Date.now())/2):Df}catch{return Df}}static create(e,t={}){return new Pa(e,t).init()}}const Ra=/^data:(\S*?);base64,/;class hD extends me(){constructor(e,t,n){if(super(),!e)throw new I("fileuploader-missing-file",null);if(!t)throw new I("fileuploader-missing-token",null);if(!n)throw new I("fileuploader-missing-api-address",null);this.file=function(i){if(typeof i!="string")return!1;const r=i.match(Ra);return!(!r||!r.length)}(e)?function(i,r=512){try{const s=i.match(Ra)[1],a=atob(i.replace(Ra,"")),l=[];for(let c=0;ce(n)),this}onError(e){return this.once("error",(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this.xhr,t=n=>()=>this.fire("error",n);e.addEventListener("error",t("Network Error")),e.addEventListener("abort",t("Abort")),e.upload&&e.upload.addEventListener("progress",n=>{n.lengthComputable&&this.fire("progress",{total:n.total,uploaded:n.loaded})}),e.addEventListener("load",()=>{const n=e.status,i=e.response;if(n<200||n>299)return this.fire("error",i.message||i.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((n,i)=>{t.addEventListener("load",()=>{const r=t.status,s=t.response;return r<200||r>299?s.message?i(new I("fileuploader-uploading-data-failed",this,{message:s.message})):i(s.error):n(s)}),t.addEventListener("error",()=>i(new Error("Network Error"))),t.addEventListener("abort",()=>i(new Error("Abort"))),t.send(e)})}}class uD{constructor(e,t){if(!e)throw new I("uploadgateway-missing-token",null);if(!t)throw new I("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new hD(e,this._token,this._apiAddress)}}class mD extends ui{static get pluginName(){return"CloudServicesCore"}createToken(e,t){return new Pa(e,t)}createUploadGateway(e,t){return new uD(e,t)}}var Bf=(o,e,t)=>new Promise((n,i)=>{var r=l=>{try{a(t.next(l))}catch(c){i(c)}},s=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,s);a((t=t.apply(o,e)).next())});const Oa=["left","right","center","justify"];function Tf(o){return Oa.includes(o)}function If(o,e){return e.contentLanguageDirection=="rtl"?o==="right":o==="left"}function Pf(o){const e=o.map(n=>{let i;return i=typeof n=="string"?{name:n}:n,i}).filter(n=>{const i=Oa.includes(n.name);return i||Q("alignment-config-name-not-recognized",{option:n}),i}),t=e.filter(n=>!!n.className).length;if(t&&t{const s=r.slice(i+1);if(s.some(a=>a.name==n.name))throw new I("alignment-config-name-already-defined",{option:n,configuredOptions:o});if(n.className&&s.some(a=>a.className==n.className))throw new I("alignment-config-classname-already-defined",{option:n,configuredOptions:o})}),e}const Na="alignment";class gD extends ne{refresh(){const e=this.editor.locale,t=ze(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value=e.contentLanguageDirection==="rtl"?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,r=i.document,s=e.value;i.change(a=>{const l=Array.from(r.selection.getSelectedBlocks()).filter(d=>this._canBeAligned(d)),c=l[0].getAttribute("alignment");If(s,n)||c===s||!s?function(d,u){for(const g of d)u.removeAttribute(Na,g)}(l,a):function(d,u,g){for(const f of d)u.setAttribute(Na,g,f)}(l,a,s)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,Na)}}class pD extends q{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:Oa.map(t=>({name:t}))})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=Pf(e.config.get("alignment.options")).filter(l=>Tf(l.name)&&!If(l.name,t)),r=i.some(l=>!!l.className);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),r?e.conversion.attributeToAttribute(function(l){const c={};for(const u of l)c[u.name]={key:"class",value:u.className};return{model:{key:"alignment",values:l.map(u=>u.name)},view:c}}(i)):e.conversion.for("downcast").attributeToAttribute(function(l){const c={};for(const{name:u}of l)c[u]={key:"style",value:{"text-align":u}};return{model:{key:"alignment",values:l.map(u=>u.name)},view:c}}(i));const s=function(l){const c=[];for(const{name:d}of l)c.push({view:{key:"style",value:{"text-align":d}},model:{key:"alignment",value:d}});return c}(i);for(const l of s)e.conversion.for("upcast").attributeToAttribute(l);const a=function(l){const c=[];for(const{name:d}of l)c.push({view:{key:"align",value:d},model:{key:"alignment",value:d}});return c}(i);for(const l of a)e.conversion.for("upcast").attributeToAttribute(l);e.commands.add("alignment",new gD(e))}}const Yi=new Map([["left",ve.alignLeft],["right",ve.alignRight],["center",ve.alignCenter],["justify",ve.alignJustify]]);class fD extends q{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t,i=Pf(e.config.get("alignment.options"));i.map(r=>r.name).filter(Tf).forEach(r=>this._addButton(r)),t.add("alignment",r=>{const s=Pt(r);Pi(s,()=>i.map(c=>t.create(`alignment:${c.name}`)),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:n("Text alignment toolbar")}),s.buttonView.set({label:n("Text alignment"),tooltip:!0}),s.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const a=r.contentLanguageDirection==="rtl"?Yi.get("right"):Yi.get("left"),l=e.commands.get("alignment");return s.buttonView.bind("icon").to(l,"value",c=>Yi.get(c)||a),s.bind("isEnabled").to(l,"isEnabled"),this.listenTo(s,"execute",()=>{e.editing.view.focus()}),s})}_addButton(e){const t=this.editor;t.ui.componentFactory.add(`alignment:${e}`,n=>{const i=t.commands.get("alignment"),r=new Ae(n);return r.set({label:this.localizedOptionTitles[e],icon:Yi.get(e),tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i),r.bind("isOn").to(i,"value",s=>s===e),this.listenTo(r,"execute",()=>{t.execute("alignment",{value:e}),t.editing.view.focus()}),r})}}function kD(o){const e=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"br",isVoid:!0},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"input",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"textarea",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],t=e.map(r=>r.name).join("|"),n=o.replace(new RegExp(``,"g"),` +`),e+=i,t=n}}return e}class Rt extends q{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(Xs),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document;this.listenTo(i,"clipboardInput",(r,s)=>{s.method!="paste"||e.model.canEditAt(e.model.document.selection)||r.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(r,s)=>{const a=s.dataTransfer;let l;if(s.content)l=s.content;else{let u="";a.getData("text/html")?u=function(g){return g.replace(/(\s+)<\/span>/g,(f,b)=>b.length==1?" ":b).replace(//g,"")}(a.getData("text/html")):a.getData("text/plain")&&(((c=(c=a.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

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

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

${c}

`),u=c),l=this.editor.data.htmlProcessor.toView(u)}var c;const d=new $(this,"inputTransformation");this.fire(d,{content:l,dataTransfer:a,targetRanges:s.targetRanges,method:s.method}),d.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,s)=>{if(s.content.isEmpty)return;const a=this.editor.data.toModel(s.content,"$clipboardHolder");a.childCount!=0&&(r.stop(),t.change(()=>{this.fire("contentInsertion",{content:a,method:s.method,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,s)=>{s.resultRange=t.insertContent(s.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document,i=(r,s)=>{const a=s.dataTransfer;s.preventDefault();const l=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:a,content:l,method:r.name})};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{e.model.canEditAt(e.model.document.selection)?i(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",im(s.content))),s.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}class rm{constructor(e,t=20){this._batch=null,this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(n,i)=>{i.isLocal&&i.isUndoable&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class i2 extends ne{constructor(e,t){super(e),this._buffer=new rm(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",r=i.length;let s=n.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;const a=e.resultRange;t.enqueueChange(this._buffer.batch,l=>{this._buffer.lock(),t.deleteContent(s),i&&t.insertContent(l.createText(i,n.selection.getAttributes()),s),a?l.setSelection(a):s.is("documentSelection")||l.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const sm=["insertText","insertReplacementText"];class r2 extends Ct{constructor(e){super(e),k.isAndroid&&sm.push("insertCompositionText");const t=e.document;t.on("beforeinput",(n,i)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:l}=i;if(!sm.includes(a))return;const c=new $(t,"insertText");t.fire(c,new Ln(e,l,{text:r,selection:e.createSelection(s)})),c.stop.called&&n.stop()}),t.on("compositionend",(n,{data:i,domEvent:r})=>{this.isEnabled&&!k.isAndroid&&i&&t.fire("insertText",new Ln(e,r,{text:i,selection:t.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class am extends q{static get pluginName(){return"Input"}init(){const e=this.editor,t=e.model,n=e.editing.view,i=t.document.selection;n.addObserver(r2);const r=new i2(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",r),e.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:l,selection:c,resultRange:d}=a,u=Array.from(c.getRanges()).map(b=>e.editing.mapper.toModelRange(b));let g=l;if(k.isAndroid){const b=Array.from(u[0].getItems()).reduce((A,E)=>A+(E.is("$textProxy")?E.data:""),"");b&&(b.length<=g.length?g.startsWith(b)&&(g=g.substring(b.length),u[0].start=u[0].start.getShiftedBy(b.length)):b.startsWith(g)&&(u[0].start=u[0].start.getShiftedBy(g.length),g=""))}const f={text:g,selection:t.createSelection(u)};d&&(f.resultRange=e.editing.mapper.toModelRange(d)),e.execute("insertText",f)}),k.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!i.isCollapsed&&a.keyCode==229&&n.document.isComposing&&lm(t,r)}):this.listenTo(n.document,"compositionstart",()=>{i.isCollapsed||lm(t,r)})}}function lm(o,e){if(!e.isEnabled)return;const t=e.buffer;t.lock(),o.enqueueChange(t.batch,()=>{o.deleteContent(o.document.selection)}),t.unlock()}class cm extends ne{constructor(e,t){super(e),this.direction=t,this._buffer=new rm(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const r=i.createSelection(e.selection||n.selection);if(!t.canEditAt(r))return;const s=e.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,s))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let l=0;r.getFirstRange().getMinimalFlatRanges().forEach(c=>{l+=kr(c.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(l),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!t.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n),r=e.createElement("paragraph");e.remove(e.createRangeIn(i)),e.insert(r,i),e.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const i=e.getFirstPosition(),r=n.schema.getLimitElement(i),s=r.getChild(0);return i.parent==s&&!!e.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const dm="word",Wt="selection",Un="backward",No="forward",hm={deleteContent:{unit:Wt,direction:Un},deleteContentBackward:{unit:"codePoint",direction:Un},deleteWordBackward:{unit:dm,direction:Un},deleteHardLineBackward:{unit:Wt,direction:Un},deleteSoftLineBackward:{unit:Wt,direction:Un},deleteContentForward:{unit:"character",direction:No},deleteWordForward:{unit:dm,direction:No},deleteHardLineForward:{unit:Wt,direction:No},deleteSoftLineForward:{unit:Wt,direction:No}};class s2 extends Ct{constructor(e){super(e);const t=e.document;let n=0;t.on("keydown",()=>{n++}),t.on("keyup",()=>{n=0}),t.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:l}=r,c=hm[l];if(!c)return;const d={direction:c.direction,unit:c.unit,sequence:n};d.unit==Wt&&(d.selectionToRemove=e.createSelection(s[0])),l==="deleteContentBackward"&&(k.isAndroid&&(d.sequence=1),function(g){if(g.length!=1||g[0].isCollapsed)return!1;const f=g[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let b=0;for(const{nextPosition:A}of f){if(A.parent.is("$text")){const E=A.parent.data,P=A.offset;if(Wr(E,P)||Kr(E,P)||Rc(E,P))continue;b++}else b++;if(b>1)return!0}return!1}(s)&&(d.unit=Wt,d.selectionToRemove=e.createSelection(s)));const u=new Fn(t,"delete",s[0]);t.fire(u,new Ln(e,a,d)),u.stop.called&&i.stop()}),k.isBlink&&function(i){const r=i.view,s=r.document;let a=null,l=!1;function c(u){return u==se.backspace||u==se.delete}function d(u){return u==se.backspace?Un:No}s.on("keydown",(u,{keyCode:g})=>{a=g,l=!1}),s.on("keyup",(u,{keyCode:g,domEvent:f})=>{const b=s.selection,A=i.isEnabled&&g==a&&c(g)&&!b.isCollapsed&&!l;if(a=null,A){const E=b.getFirstRange(),P=new Fn(s,"delete",E),z={unit:Wt,direction:d(g),selectionToRemove:b};s.fire(P,new Ln(r,f,z))}}),s.on("beforeinput",(u,{inputType:g})=>{const f=hm[g];c(a)&&f&&f.direction==d(a)&&(l=!0)},{priority:"high"}),s.on("beforeinput",(u,{inputType:g,data:f})=>{a==se.delete&&g=="insertText"&&f==""&&u.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class Wn extends q{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document,i=e.model.document;t.addObserver(s2),this._undoOnBackspace=!1;const r=new cm(e,"forward");e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new cm(e,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:l,sequence:c,selectionToRemove:d,unit:u}=a,g=l==="forward"?"deleteForward":"delete",f={sequence:c};if(u=="selection"){const b=Array.from(d.getRanges()).map(A=>e.editing.mapper.toModelRange(A));f.selection=e.model.createSelection(b)}else f.unit=u;e.execute(g,f),t.scrollToTheSelection()},{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(s,a)=>{this._undoOnBackspace&&a.direction=="backward"&&a.sequence==1&&a.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class a2 extends q{static get requires(){return[am,Wn]}static get pluginName(){return"Typing"}}function um(o,e){let t=o.start;return{text:Array.from(o.getItems()).reduce((n,i)=>i.is("$text")||i.is("$textProxy")?n+i.data:(t=e.createPositionAfter(i),""),""),range:e.createRange(t,o.end)}}class mm extends ge(){constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(e,"change:data",(t,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:s,range:a}=um(r,n),l=this.testCallback(s);if(!l&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!l,l){const c=Object.assign(t,{text:s,range:a});typeof l=="object"&&Object.assign(c,l),this.fire(`matched:${e}`,c)}}}class gm extends q{constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.locale,r=t.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const l=a.keyCode==se.arrowright,c=a.keyCode==se.arrowleft;if(!l&&!c)return;const d=i.contentLanguageDirection;let u=!1;u=d==="ltr"&&l||d==="rtl"&&c?this._handleForwardMovement(a):this._handleBackwardMovement(a),u===!0&&s.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&$i(r.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!ea(n,t))&&!!$i(i,t)&&(ji(e),this._overrideGravity(),!0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(ji(e),this._restoreGravity(),ta(n,t,r),!0):r.isAtStart?!!ea(i,t)&&(ji(e),ta(n,t,r),!0):!!function(s,a){const l=s.getShiftedBy(-1);return $i(l,a)}(r,t)&&(r.isAtEnd&&!ea(i,t)&&$i(r,t)?(ji(e),ta(n,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function ea(o,e){for(const t of e)if(o.hasAttribute(t))return!0;return!1}function ta(o,e,t){const n=t.nodeBefore;o.change(i=>{n?i.setSelectionAttribute(n.getAttributes()):i.removeSelectionAttribute(e)})}function ji(o){o.preventDefault()}function $i(o,e){const{nodeBefore:t,nodeAfter:n}=o;for(const i of e){const r=t?t.getAttribute(i):void 0;if((n?n.getAttribute(i):void 0)!==r)return!0}return!1}var pm=/[\\^$.*+?()[\]{}|]/g,l2=RegExp(pm.source);const c2=function(o){return(o=ns(o))&&l2.test(o)?o.replace(pm,"\\$&"):o},fm={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Kn('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Kn("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Kn("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Kn('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Kn('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Kn("'"),to:[null,"‚",null,"’"]}},km={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},d2=["symbols","mathematical","typography","quotes"];function h2(o){return typeof o=="string"?new RegExp(`(${c2(o)})$`):o}function u2(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function m2(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function Kn(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function Gn(o,e,t,n){return n.createRange(bm(o,e,t,!0,n),bm(o,e,t,!1,n))}function bm(o,e,t,n,i){let r=o.textNode||(n?o.nodeBefore:o.nodeAfter),s=null;for(;r&&r.getAttribute(e)==t;)s=r,r=n?r.previousSibling:r.nextSibling;return s?i.createPositionAt(s,n?"before":"after"):o}function*wm(o,e){for(const t of e)t&&o.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class g2 extends ne{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const t=this.editor.model,n=t.document.selection,i=t.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,l=s.end.parent;if(i.isLimit(a)||i.isLimit(l))return r||a!=l||t.deleteContent(n),!1;if(r){const c=wm(e.model.schema,n.getAttributes());return Am(e,s.start),e.setSelectionAttribute(c),!0}{const c=!(s.start.isAtStart&&s.end.isAtEnd),d=a==l;if(t.deleteContent(n,{leaveUnmerged:c}),c){if(d)return Am(e,n.focus),!0;e.setSelection(l,0)}}return!1}}function Am(o,e){o.split(e),o.setSelection(e.parent.nextSibling,0)}const p2={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class _m extends Ct{constructor(e){super(e);const t=this.document;let n=!1;t.on("keydown",(i,r)=>{n=r.shiftKey}),t.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let s=r.inputType;k.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,l=p2[s];if(!l)return;const c=new Fn(t,"enter",r.targetRanges[0]);t.fire(c,new Ln(e,a,{isSoft:l.isSoft})),c.stop.called&&i.stop()})}observe(){}stopObserving(){}}class zo extends q{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(_m),e.commands.add("enter",new g2(e)),this.listenTo(n,"enter",(i,r)=>{n.isComposing||r.preventDefault(),r.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class f2 extends ne{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(i,r,s){const a=s.isCollapsed,l=s.getFirstRange(),c=l.start.parent,d=l.end.parent,u=c==d;if(a){const g=wm(i.schema,s.getAttributes());Cm(i,r,l.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(g)}else{const g=!(l.start.isAtStart&&l.end.isAtEnd);i.deleteContent(s,{leaveUnmerged:g}),u?Cm(i,r,s.focus):g&&r.setSelection(d,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const r=i.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=i.getFirstRange(),a=s.start.parent,l=s.end.parent;return!((na(a,n)||na(l,n))&&a!==l)}(e.schema,t.selection)}}function Cm(o,e,t){const n=e.createElement("softBreak");o.insertContent(n,t),e.setSelection(n,"after")}function na(o,e){return!o.is("rootElement")&&(e.isLimit(o)||na(o.parent,e))}class k2 extends q{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,r=i.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(s,{writer:a})=>a.createEmptyElement("br")}),i.addObserver(_m),e.commands.add("shiftEnter",new f2(e)),this.listenTo(r,"enter",(s,a)=>{r.isComposing||a.preventDefault(),a.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class b2 extends me(){constructor(){super(...arguments),this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const r=n[0];i===r||oa(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const r=n[0];i===r||oa(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(r=>r.id===e.id);if(oa(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&w2(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(i=>i.id===e);n>-1&&t.splice(n,1)}}function oa(o,e){return o&&e&&o.priority==e.priority&&Hi(o.classes)==Hi(e.classes)}function w2(o,e){return o.priority>e.priority||!(o.priorityHi(e.classes)}function Hi(o){return Array.isArray(o)?o.sort().join(","):o}const A2='',_2="ck-widget",vm="ck-widget_selected";function Be(o){return!!o.is("element")&&!!o.getCustomProperty("widget")}function ia(o,e,t={}){if(!o.is("containerElement"))throw new I("widget-to-widget-wrong-element-type",null,{element:o});return e.setAttribute("contenteditable","false",o),e.addClass(_2,o),e.setCustomProperty("widget",!0,o),o.getFillerOffset=E2,e.setCustomProperty("widgetLabel",[],o),t.label&&function(n,i){n.getCustomProperty("widgetLabel").push(i)}(o,t.label),t.hasSelectionHandle&&function(n,i){const r=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),l=new ko;return l.set("content",A2),l.render(),a.appendChild(l.element),a});i.insert(i.createPositionAt(n,0),r),i.addClass(["ck-widget_with-selection-handle"],n)}(o,e),ym(o,e),o}function C2(o,e,t){if(e.classes&&t.addClass(Pe(e.classes),o),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],o)}function v2(o,e,t){if(e.classes&&t.removeClass(Pe(e.classes),o),e.attributes)for(const n in e.attributes)t.removeAttribute(n,o)}function ym(o,e,t=C2,n=v2){const i=new b2;i.on("change:top",(r,s)=>{s.oldDescriptor&&n(o,s.oldDescriptor,s.writer),s.newDescriptor&&t(o,s.newDescriptor,s.writer)}),e.setCustomProperty("addHighlight",(r,s,a)=>i.add(s,a),o),e.setCustomProperty("removeHighlight",(r,s,a)=>i.remove(s,a),o)}function y2(o,e,t={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),e.setAttribute("role","textbox",o),t.label&&e.setAttribute("aria-label",t.label,o),e.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(n,i,r)=>{e.setAttribute("contenteditable",r?"false":"true",o)}),o.on("change:isFocused",(n,i,r)=>{r?e.addClass("ck-editor__nested-editable_focused",o):e.removeClass("ck-editor__nested-editable_focused",o)}),ym(o,e),o}function E2(){return null}const Ot="widget-type-around";function fn(o,e,t){return!!o&&Be(o)&&!t.isInline(e)}function Kt(o){return o.getAttribute(Ot)}var Em=D(4921),x2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Em.Z,x2),Em.Z.locals;const xm=["before","after"],S2=new DOMParser().parseFromString('',"image/svg+xml").firstChild,Sm="ck-widget__type-around_disabled";class D2 extends q{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[zo,Wn]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,r)=>{t.change(s=>{for(const a of t.document.roots)r?s.removeClass(Sm,a):s.addClass(Sm,a)}),r||e.model.change(s=>{s.removeSelectionAttribute(Ot)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view,r=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:r}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...r)=>{this.isEnabled&&n(...r)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Kt(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(r,s,a)=>{const l=a.mapper.toViewElement(s.item);l&&fn(l,s.item,t)&&(function(c,d,u){const g=c.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(f){const b=this.toDomElement(f);return function(A,E){for(const P of xm){const z=new bt({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${P}`],title:E[P],"aria-hidden":"true"},children:[A.ownerDocument.importNode(S2,!0)]});A.appendChild(z.render())}}(b,d),function(A){const E=new bt({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});A.appendChild(E.render())}(b),b});c.insert(c.createPositionAt(u,"end"),g)}(a.writer,i,l),l.getCustomProperty("widgetLabel").push(()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,r=e.editing.view;function s(a){return`ck-widget_type-around_show-fake-caret_${a}`}this._listenToIfEnabled(r.document,"arrowKey",(a,l)=>{this._handleArrowKeyPress(a,l)},{context:[Be,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,l)=>{l.directChange&&e.model.change(c=>{c.removeSelectionAttribute(Ot)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const a=n.getSelectedElement();a&&fn(e.editing.mapper.toViewElement(a),a,i)||e.model.change(l=>{l.removeSelectionAttribute(Ot)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(a,l,c)=>{const d=c.writer;if(this._currentFakeCaretModelElement){const b=c.mapper.toViewElement(this._currentFakeCaretModelElement);b&&(d.removeClass(xm.map(s),b),this._currentFakeCaretModelElement=null)}const u=l.selection.getSelectedElement();if(!u)return;const g=c.mapper.toViewElement(u);if(!fn(g,u,i))return;const f=Kt(l.selection);f&&(d.addClass(s(f),g),this._currentFakeCaretModelElement=u)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(a,l,c)=>{c||e.model.change(d=>{d.removeSelectionAttribute(Ot)})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,r=i.document.selection,s=i.schema,a=n.editing.view,l=function(u,g){const f=qr(u,g);return f==="down"||f==="right"}(t.keyCode,n.locale.contentLanguageDirection),c=a.document.selection.getSelectedElement();let d;fn(c,n.editing.mapper.toModelElement(c),s)?d=this._handleArrowKeyPressOnSelectedWidget(l):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(l):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(l)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Kt(t.document.selection);return t.change(i=>n?n!==(e?"after":"before")?(i.removeSelectionAttribute(Ot),!0):!1:(i.setSelectionAttribute(Ot,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,r=t.plugins.get("Widget"),s=r._getObjectElementNextToSelection(e);return!!fn(t.editing.mapper.toViewElement(s),s,i)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(Ot,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,i=n.schema,r=t.editing.mapper,s=n.document.selection,a=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!fn(r.toViewElement(a),a,i)&&(n.change(l=>{l.setSelection(a,"on"),l.setSelectionAttribute(Ot,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const s=function(c){return c.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),a=function(c,d){const u=c.closest(".ck-widget");return d.mapDomToView(u)}(r,t.domConverter),l=e.editing.mapper.toModelElement(a);this._insertParagraph(l,s),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(i,r)=>{if(i.eventPhase!="atTarget")return;const s=t.getSelectedElement(),a=e.editing.mapper.toViewElement(s),l=e.model.schema;let c;this._insertParagraphAccordingToFakeCaretPosition()?c=!0:fn(a,s,l)&&(this._insertParagraph(s,r.isSoft?"before":"after"),c=!0),c&&(r.preventDefault(),i.stop())},{context:Be})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",(t,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=e.selection)},{priority:"high"}),k.isAndroid?this._listenToIfEnabled(e,"keydown",(t,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(e,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=Kt(n.document.selection);if(!a)return;const l=s.direction,c=n.document.selection.getSelectedElement(),d=l=="forward";if(a==="before"===d)e.execute("delete",{selection:n.createSelection(c,"on")});else{const u=i.getNearestSelectionRange(n.createPositionAt(c,a),l);if(u)if(u.isCollapsed){const g=n.createSelection(u.start);if(n.modifySelection(g,{direction:l}),g.focus.isEqual(u.start)){const f=function(b,A){let E=A;for(const P of A.getAncestors({parentFirst:!0})){if(P.childCount>1||b.isLimit(P))break;E=P}return E}(i,u.start.parent);n.deleteContent(n.createSelection(f,"on"),{doNotAutoparagraph:!0})}else n.change(f=>{f.setSelection(u),e.execute(d?"deleteForward":"delete")})}else n.change(g=>{g.setSelection(u),e.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:Be})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(i,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=Kt(n);return a?(i.stop(),t.change(l=>{const c=n.getSelectedElement(),d=t.createPositionAt(c,a),u=l.createSelection(d),g=t.insertContent(r,u);return l.setSelection(u),g})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(n,i)=>{const[,r,s={}]=i;if(r&&!r.is("documentSelection"))return;const a=Kt(t);a&&(s.findOptimalPosition=a,i[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||Kt(t)&&n.stop()},{priority:"high"})}}function B2(o){const e=o.model;return(t,n)=>{const i=n.keyCode==se.arrowup,r=n.keyCode==se.arrowdown,s=n.shiftKey,a=e.document.selection;if(!i&&!r)return;const l=r;if(s&&function(d,u){return!d.isCollapsed&&d.isBackward==u}(a,l))return;const c=function(d,u,g){const f=d.model;if(g){const b=u.isCollapsed?u.focus:u.getLastPosition(),A=Dm(f,b,"forward");if(!A)return null;const E=f.createRange(b,A),P=Bm(f.schema,E,"backward");return P?f.createRange(b,P):null}{const b=u.isCollapsed?u.focus:u.getFirstPosition(),A=Dm(f,b,"backward");if(!A)return null;const E=f.createRange(A,b),P=Bm(f.schema,E,"forward");return P?f.createRange(P,b):null}}(o,a,l);if(c){if(c.isCollapsed&&(a.isCollapsed||s))return;(c.isCollapsed||function(d,u,g){const f=d.model,b=d.view.domConverter;if(g){const j=f.createSelection(u.start);f.modifySelection(j),j.focus.isAtEnd||u.start.isEqual(j.focus)||(u=f.createRange(j.focus,u.end))}const A=d.mapper.toViewRange(u),E=b.viewRangeToDom(A),P=De.getDomRangeRects(E);let z;for(const j of P)if(z!==void 0){if(Math.round(j.top)>=z)return!1;z=Math.max(z,Math.round(j.bottom))}else z=Math.round(j.bottom);return!0}(o,c,l))&&(e.change(d=>{const u=l?c.end:c.start;if(s){const g=e.createSelection(a.anchor);g.setFocus(u),d.setSelection(g)}else d.setSelection(u)}),t.stop(),n.preventDefault(),n.stopPropagation())}}}function Dm(o,e,t){const n=o.schema,i=o.createRangeIn(e.root),r=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:l}of i.getWalker({startPosition:e,direction:t})){if(n.isLimit(a)&&!n.isInline(a))return s;if(l==r&&n.isBlock(a))return null}return null}function Bm(o,e,t){const n=t=="backward"?e.end:e.start;if(o.checkChild(n,"$text"))return n;for(const{nextPosition:i}of e.getWalker({direction:t}))if(o.checkChild(i,"$text"))return i;return null}var Tm=D(3488),T2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Tm.Z,T2),Tm.Z.locals;class Mo extends q{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[D2,Wn]}init(){const e=this.editor,t=e.editing.view,n=t.document;this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{const a=s.writer,l=r.selection;if(l.isCollapsed)return;const c=l.getSelectedElement();if(!c)return;const d=e.editing.mapper.toViewElement(c);var u;Be(d)&&s.consumable.consume(l,"selection")&&a.setSelection(a.createRangeOn(d),{fake:!0,label:(u=d,u.getCustomProperty("widgetLabel").reduce((g,f)=>typeof f=="function"?g?g+". "+f():f():g?g+". "+f:f,""))})}),this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{this._clearPreviouslySelectedWidgets(s.writer);const a=s.writer,l=a.document.selection;let c=null;for(const d of l.getRanges())for(const u of d){const g=u.item;Be(g)&&!I2(g,c)&&(a.addClass(vm,g),this._previouslySelected.add(g),c=g)}},{priority:"low"}),t.addObserver(Ns),this.listenTo(n,"mousedown",(...i)=>this._onMousedown(...i)),this.listenTo(n,"arrowKey",(...i)=>{this._handleSelectionChangeOnArrowKeyPress(...i)},{context:[Be,"$text"]}),this.listenTo(n,"arrowKey",(...i)=>{this._preventDefaultOnArrowKeyPress(...i)},{context:"$root"}),this.listenTo(n,"arrowKey",B2(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(i,r)=>{this._handleDelete(r.direction=="forward")&&(r.preventDefault(),i.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,r=i.document;let s=t.target;if(function(l){let c=l;for(;c;){if(c.is("editableElement")&&!c.is("rootElement"))return!0;if(Be(c))return!1;c=c.parent}return!1}(s)){if((k.isSafari||k.isGecko)&&t.domEvent.detail>=3){const l=n.editing.mapper,c=s.is("attributeElement")?s.findAncestor(u=>!u.is("attributeElement")):s,d=l.toModelElement(c);t.preventDefault(),this.editor.model.change(u=>{u.setSelection(d,"in")})}return}if(!Be(s)&&(s=s.findAncestor(Be),!s))return;k.isAndroid&&t.preventDefault(),r.isFocused||i.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,r=i.schema,s=i.document.selection,a=s.getSelectedElement(),l=qr(n,this.editor.locale.contentLanguageDirection),c=l=="down"||l=="right",d=l=="up"||l=="down";if(a&&r.isObject(a)){const g=c?s.getLastPosition():s.getFirstPosition(),f=r.getNearestSelectionRange(g,c?"forward":"backward");return void(f&&(i.change(b=>{b.setSelection(f)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed&&!t.shiftKey){const g=s.getFirstPosition(),f=s.getLastPosition(),b=g.nodeAfter,A=f.nodeBefore;return void((b&&r.isObject(b)||A&&r.isObject(A))&&(i.change(E=>{E.setSelection(c?f:g)}),t.preventDefault(),e.stop()))}if(!s.isCollapsed)return;const u=this._getObjectElementNextToSelection(c);if(u&&r.isObject(u)){if(r.isInline(u)&&d)return;this._setSelectionOverElement(u),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t)||!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(i=>{let r=t.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,i.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,r=t.createSelection(i);if(t.modifySelection(r,{direction:e?"forward":"backward"}),r.isEqual(i))return null;const s=e?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(vm,t);this._previouslySelected.clear()}}function I2(o,e){return!!e&&Array.from(o.getAncestors()).includes(e)}class qi extends q{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[Fi]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",n=>{(function(i){const r=i.getSelectedElement();return!(!r||!Be(r))})(e.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void Q("widget-toolbar-no-items",{toolbarId:e});const s=this.editor,a=s.t,l=new Ms(s.locale);if(l.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new I("widget-toolbar-duplicated",this,{toolbarId:e});const c={view:l,getRelatedElement:i,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{const d=i(s.editing.view.document.selection);d&&this._showToolbar(c,d)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>e&&(e=s,t=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?Im(this.editor,t):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Pm(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);Im(this.editor,i)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function Im(o,e){const t=o.plugins.get("ContextualBalloon"),n=Pm(o,e);t.updatePosition(n)}function Pm(o,e){const t=o.editing.view,n=Qe.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var Rm=D(8506),P2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Rm.Z,P2),Rm.Z.locals;var Om=D(903),R2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Om.Z,R2),Om.Z.locals;class O2 extends q{static get pluginName(){return"DragDrop"}static get requires(){return[Rt,Mo]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Js(n=>this._updateDropMarker(n),40),this._removeDropMarkerDelayed=Ur(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Ur(()=>this._clearDraggableAttributes(),40),e.plugins.has("DragDropExperimental")?this.forceDisabled("DragDropExperimental"):(t.addObserver(Xs),t.addObserver(Ns),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,i,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,r)=>{r||this._finalizeDragging(!1)}),k.isAndroid&&this.forceDisabled("noAndroidSupport"))}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,i=e.editing.view,r=i.document;this.listenTo(r,"dragstart",(s,a)=>{const l=n.selection;if(a.target&&a.target.is("editableElement"))return void a.preventDefault();const c=a.target?Mm(a.target):null;if(c){const f=e.editing.mapper.toModelElement(c);this._draggedRange=Bt.fromRange(t.createRangeOn(f)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const f=r.selection.getSelectedElement();f&&Be(f)||(this._draggedRange=Bt.fromRange(l.getFirstRange()))}if(!this._draggedRange)return void a.preventDefault();this._draggingUid=J();const d=this.isEnabled&&e.model.canEditAt(this._draggedRange);a.dataTransfer.effectAllowed=d?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const u=t.createSelection(this._draggedRange.toRange()),g=e.data.toView(t.getSelectedContent(u));r.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:g,method:"dragstart"}),d||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(r,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this.listenTo(r,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(r,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(r,"dragging",(s,a)=>{if(!this.isEnabled)return void(a.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const l=Nm(e,a.targetRanges,a.target);e.model.canEditAt(l)?(this._draggedRange||(a.dataTransfer.dropEffect="copy"),k.isGecko||(a.dataTransfer.effectAllowed=="copy"?a.dataTransfer.dropEffect="copy":["all","copyMove"].includes(a.dataTransfer.effectAllowed)&&(a.dataTransfer.dropEffect="move")),l&&this._updateDropMarkerThrottled(l)):a.dataTransfer.dropEffect="none"},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(n,i)=>{if(i.method!="drop")return;const r=Nm(e,i.targetRanges,i.target);if(this._removeDropMarker(),!r||!e.model.canEditAt(r))return this._finalizeDragging(!1),void n.stop();if(this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),zm(i.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(r,!0))return this._finalizeDragging(!1),void n.stop();i.targetRanges=[e.editing.mapper.toViewRange(r)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(Rt);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(i))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=zm(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,r)=>{if(k.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Mm(r.target);if(k.isBlink&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();if(!a||!Be(a)){const l=n.selection.editableElement;l&&!l.isReadOnly&&(s=l)}}s&&(t.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{k.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(i){const r=this.toDomElement(i);return r.append("⁠",i.createElement("span"),"⁠"),r})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||i.updateMarker("drop-target",{range:e}):i.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function Nm(o,e,t){const n=o.model,i=o.editing.mapper;let r=null;const s=e?e[0].start:null;if(t.is("uiElement")&&(t=t.parent),r=function(c,d){const u=c.model,g=c.editing.mapper;if(Be(d))return u.createRangeOn(g.toModelElement(d));if(!d.is("editableElement")){const f=d.findAncestor(b=>Be(b)||b.is("editableElement"));if(Be(f))return u.createRangeOn(g.toModelElement(f))}return null}(o,t),r)return r;const a=function(c,d){const u=c.editing.mapper,g=c.editing.view,f=u.toModelElement(d);if(f)return f;const b=g.createPositionBefore(d),A=u.findMappedViewAncestor(b);return u.toModelElement(A)}(o,t),l=s?i.toModelPosition(s):null;return l?(r=function(c,d,u){const g=c.model;if(!g.schema.checkChild(u,"$block"))return null;const f=g.createPositionAt(u,0),b=d.path.slice(0,f.path.length),A=g.createPositionFromPath(d.root,b),E=A.nodeAfter;return E&&g.schema.isObject(E)?g.createRangeOn(E):null}(o,l,a),r||(r=n.schema.getNearestSelectionRange(l,k.isGecko?"forward":"backward"),r||function(c,d){const u=c.model;let g=d;for(;g;){if(u.schema.isObject(g))return u.createRangeOn(g);g=g.parent}return null}(o,l.parent))):function(c,d){const u=c.model,g=u.schema,f=u.createPositionAt(d,0);return g.getNearestSelectionRange(f,"forward")}(o,a)}function zm(o){return k.isGecko?o.dropEffect:["all","copyMove"].includes(o.effectAllowed)?"move":"copy"}function Mm(o){if(o.is("editableElement"))return null;if(o.hasClass("ck-widget__selection-handle"))return o.findAncestor(Be);if(Be(o))return o;const e=o.findAncestor(t=>Be(t)||t.is("editableElement"));return Be(e)?e:null}class N2 extends q{static get pluginName(){return"PastePlainText"}static get requires(){return[Rt]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,r=t.document.selection;let s=!1;n.addObserver(Xs),this.listenTo(i,"keydown",(a,l)=>{s=l.shiftKey}),e.plugins.get(Rt).on("contentInsertion",(a,l)=>{(s||function(c,d){if(c.childCount>1)return!1;const u=c.getChild(0);return d.isObject(u)?!1:Array.from(u.getAttributeKeys()).length==0}(l.content,t.schema))&&t.change(c=>{const d=Array.from(r.getAttributes()).filter(([g])=>t.schema.getAttributeProperties(g).isFormatting);r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const u=c.createRangeIn(l.content);for(const g of u.getItems())g.is("$textProxy")&&c.setAttributes(d,g)})})}}class z2 extends q{static get pluginName(){return"Clipboard"}static get requires(){return[Rt,O2,N2]}}class M2 extends ne{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!Fm(e.schema,n))do if(n=n.parent,!n)return;while(!Fm(e.schema,n));e.change(i=>{i.setSelection(n,"in")})}}function Fm(o,e){return o.isLimit(e)&&(o.checkChild(e,"$text")||o.checkChild(e,"paragraph"))}const F2=li("Ctrl+A");class V2 extends q{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new M2(e)),this.listenTo(t,"keydown",(n,i)=>{Nn(i)===F2&&(e.execute("selectAll"),i.preventDefault())})}}class L2 extends q{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new Ae(t),r=t.t;return i.set({label:r("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class j2 extends q{static get requires(){return[V2,L2]}static get pluginName(){return"SelectAll"}}var $2=Object.defineProperty,Vm=Object.getOwnPropertySymbols,H2=Object.prototype.hasOwnProperty,q2=Object.prototype.propertyIsEnumerable,Lm=(o,e,t)=>e in o?$2(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class jm extends ne{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(t,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))H2.call(s,a)&&Lm(r,a,s[a]);if(Vm)for(var a of Vm(s))q2.call(s,a)&&Lm(r,a,s[a]);return r})({},n[1]);const i=n[1];i.batchType||(i.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(t,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,r=i.document,s=[],a=e.map(c=>c.getTransformedByOperations(n)),l=a.flat();for(const c of a){const d=c.filter(u=>u.root!=r.graveyard).filter(u=>!W2(u,l));d.length&&(U2(d),s.push(d[0]))}s.length&&i.change(c=>{c.setSelection(s,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const r=e.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,l=Array.from(i.history.getOperations(a)),c=f1([s.getReversed()],l,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of c){const u=d.affectedSelectable;u&&!n.canEditAt(u)&&(d=new je(d.baseVersion)),t.addOperation(d),n.applyOperation(d),i.history.setOperationAsUndone(s,d)}}}}function U2(o){o.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;et!==o&&t.containsRange(o,!0))}class K2 extends jm{execute(e=null){const t=e?this._stack.findIndex(r=>r.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r),this.fire("revert",n.batch,i)}),this.refresh()}}class G2 extends jm{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class Z2 extends q{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const e=this.editor;this._undoCommand=new K2(e),this._redoCommand=new G2(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(t,n)=>{const i=n[0];if(!i.isDocumentOperation)return;const r=i.batch,s=this._redoCommand.createdBatches.has(r),a=this._undoCommand.createdBatches.has(r);this._batchRegistry.has(r)||(this._batchRegistry.add(r),r.isUndoable&&(s?this._undoCommand.addBatch(r):a||(this._undoCommand.addBatch(r),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,n,i)=>{this._redoCommand.addBatch(i)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}const $m='',Hm='';class J2 extends q{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?$m:Hm,r=t.uiLanguageDirection=="ltr"?Hm:$m;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(e,t,n,i){const r=this.editor;r.ui.componentFactory.add(e,s=>{const a=r.commands.get(e),l=new Ae(s);return l.set({label:t,icon:i,keystroke:n,tooltip:!0}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",()=>{r.execute(e),r.editing.view.focus()}),l})}}class Y2 extends q{static get requires(){return[Z2,J2]}static get pluginName(){return"Undo"}}class Q2 extends ge(){constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const r=t.result;this._data=r,n(r)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class Nt extends q{constructor(){super(...arguments),this.loaders=new at,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[Ii]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return Q("filerepository-no-upload-adapter"),null;const t=new qm(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(n=>{this._loadersMap.set(n,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof qm?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,i)=>{n===t&&this._loadersMap.delete(i)})}_updatePendingAction(){const e=this.editor.plugins.get(Ii);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=i=>`${t("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}class qm extends ge(){constructor(e,t){super(),this.id=J(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Q2,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new I("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new I("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(r=>{t.isFulfilled=!0,n(r)}).catch(r=>{t.isFulfilled=!0,i(r)})}),t}}class X2 extends re{constructor(e){super(e),this.buttonView=new Ae(e),this._fileInputView=new ex(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class ex extends re{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}const Um="ckCsrfToken",Wm="abcdefghijklmnopqrstuvwxyz0123456789";function tx(){let o=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const r of i){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(Um);var e,t;return o&&o.length==40||(o=function(n){let i="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return i}(40),e=Um,t=o,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),o}class nx{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>t(s)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const a=i.response;if(!a||!a.uploaded)return t(a&&a.error&&a.error.message?a.error.message:s);e({default:a.url})}),i.upload&&i.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",tx()),this.xhr.send(t)}}class ra extends ne{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.forceValue===void 0?!this.value:e.forceValue;t.change(r=>{if(n.isCollapsed)i?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)i?r.setAttribute(this.attributeKey,i,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const r of i.getItems())if(t.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const Zn="bold";class ox extends q{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Zn}),e.model.schema.setAttributeProperties(Zn,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Zn,view:"strong",upcastAlso:["b",t=>{const n=t.getStyle("font-weight");return n&&(n=="bold"||Number(n)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(Zn,new ra(e,Zn)),e.keystrokes.set("CTRL+B",Zn)}}const sa="bold";class ix extends q{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(sa,n=>{const i=e.commands.get(sa),r=new Ae(n);return r.set({label:t("Bold"),icon:ve.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(sa),e.editing.view.focus()}),r})}}var Km=D(8603),rx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Km.Z,rx),Km.Z.locals;const Jn="italic";class sx extends q{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Jn}),e.model.schema.setAttributeProperties(Jn,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Jn,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Jn,new ra(e,Jn)),e.keystrokes.set("CTRL+I",Jn)}}const aa="italic";class ax extends q{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(aa,n=>{const i=e.commands.get(aa),r=new Ae(n);return r.set({label:t("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(aa),e.editing.view.focus()}),r})}}const Fo="underline";class lx extends q{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Fo}),e.model.schema.setAttributeProperties(Fo,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Fo,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(Fo,new ra(e,Fo)),e.keystrokes.set("CTRL+U","underline")}}const la="underline";class cx extends q{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(la,n=>{const i=e.commands.get(la),r=new Ae(n);return r.set({label:t("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(la),e.editing.view.focus()}),r})}}class dx extends ne{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,i=t.document.selection,r=Array.from(i.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;t.change(a=>{if(s){const l=r.filter(c=>Ui(c)||Zm(n,c));this._applyQuote(a,l)}else this._removeQuote(a,r.filter(Ui))})}_getValue(){const e=ze(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Ui(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=ze(e.getSelectedBlocks());return!!n&&Zm(t,n)}_removeQuote(e,t){Gm(e,t).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void e.unwrap(n.start.parent);if(n.start.isAtStart){const r=e.createPositionBefore(n.start.parent);return void e.move(n,r)}n.end.isAtEnd||e.split(n.end);const i=e.createPositionAfter(n.end.parent);e.move(n,i)})}_applyQuote(e,t){const n=[];Gm(e,t).reverse().forEach(i=>{let r=Ui(i.start);r||(r=e.createElement("blockQuote"),e.wrap(i,r)),n.push(r)}),n.reverse().reduce((i,r)=>i.nextSibling==r?(e.merge(e.createPositionAfter(i)),i):r)}}function Ui(o){return o.parent.name=="blockQuote"?o.parent:null}function Gm(o,e){let t,n=0;const i=[];for(;n{const a=e.model.document.differ.getChanges();for(const l of a)if(l.type=="insert"){const c=l.position.nodeAfter;if(!c)continue;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0;if(c.is("element","blockQuote")&&!t.checkChild(l.position,c))return s.unwrap(c),!0;if(c.is("element")){const d=s.createRangeIn(c);for(const u of d.getItems())if(u.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(u),u))return s.unwrap(u),!0}}else if(l.type=="remove"){const c=l.position.parent;if(c.is("element","blockQuote")&&c.isEmpty)return s.remove(c),!0}return!1});const n=this.editor.editing.view.document,i=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!i.isCollapsed||!r.value||i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!i.isCollapsed||!r.value)return;const l=i.getLastPosition().parent;l.isEmpty&&!l.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var Jm=D(3062),ux={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Jm.Z,ux),Jm.Z.locals;class mx extends q{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const i=e.commands.get("blockQuote"),r=new Ae(n);return r.set({label:t("Block quote"),icon:ve.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),r})}}class gx extends q{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",Nt]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,i=t.uploadUrl;if(!n)return;const r=e.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,i),e.plugins.get(Nt).createUploadAdapter=s=>new px(this._uploadGateway,s)}}class px{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(t,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class fx extends ne{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=ze(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Ym(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document,i=e.selection||n.selection;t.canEditAt(i)&&t.change(r=>{const s=i.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Ym(a,t.schema)&&r.rename(a,"paragraph")})}}function Ym(o,e){return e.checkChild(o.parent,"paragraph")&&!e.isObject(o)}class kx extends ne{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,n=e.attributes;let i=e.position;t.canEditAt(i)&&t.change(r=>{const s=r.createElement("paragraph");if(n&&t.schema.setAllowedAttributes(s,n,r),!t.schema.checkChild(i.parent,s)){const a=t.schema.findAllowedParent(i,s);if(!a)return;i=r.split(i,a).position}t.insertContent(s,i),r.setSelection(s,"in")})}}const Qm=class extends q{static get pluginName(){return"Paragraph"}init(){const o=this.editor,e=o.model;o.commands.add("paragraph",new fx(o)),o.commands.add("insertParagraph",new kx(o)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),o.conversion.elementToElement({model:"paragraph",view:"p"}),o.conversion.for("upcast").elementToElement({model:(t,{writer:n})=>Qm.paragraphLikeElements.has(t.name)?t.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let ca=Qm;ca.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class bx extends ne{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ze(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Xm(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>Xm(a,i,t.schema));for(const a of s)a.is("element",i)||r.rename(a,i)})}}function Xm(o,e,t){return t.checkChild(o.parent,e)&&!t.isObject(o)}const eg="paragraph";class wx extends q{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[ca]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!=="paragraph"&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new bx(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(i,r)=>{const s=e.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",eg)&&s.childCount===0&&r.writer.rename(s,eg)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:te.get("low")+1})}}var tg=D(8733),Ax={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(tg.Z,Ax),tg.Z.locals;class _x extends q{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(s){const a=s.t,l={Paragraph:a("Paragraph"),"Heading 1":a("Heading 1"),"Heading 2":a("Heading 2"),"Heading 3":a("Heading 3"),"Heading 4":a("Heading 4"),"Heading 5":a("Heading 5"),"Heading 6":a("Heading 6")};return s.config.get("heading.options").map(c=>{const d=l[c.title];return d&&d!=c.title&&(c.title=d),c})}(e),i=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",s=>{const a={},l=new at,c=e.commands.get("heading"),d=e.commands.get("paragraph"),u=[c];for(const f of n){const b={type:"button",model:new Ys({label:f.title,class:f.class,role:"menuitemradio",withText:!0})};f.model==="paragraph"?(b.model.bind("isOn").to(d,"value"),b.model.set("commandName","paragraph"),u.push(d)):(b.model.bind("isOn").to(c,"value",A=>A===f.model),b.model.set({commandName:"heading",commandValue:f.model})),l.add(b),a[f.model]=f.title}const g=Pt(s);return Vs(g,l,{ariaLabel:r,role:"menu"}),g.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),g.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),g.bind("isEnabled").toMany(u,"isEnabled",(...f)=>f.some(b=>b)),g.buttonView.bind("label").to(c,"value",d,"value",(f,b)=>{const A=f||b&&"paragraph";return typeof A=="boolean"?i:a[A]?a[A]:i}),this.listenTo(g,"execute",f=>{const{commandName:b,commandValue:A}=f.source;e.execute(b,A?{value:A}:void 0),e.editing.view.focus()}),g})}}function ng(o){return o.createContainerElement("figure",{class:"image"},[o.createEmptyElement("img"),o.createSlot("children")])}function og(o,e){const t=o.plugins.get("ImageUtils"),n=o.plugins.has("ImageInlineEditing")&&o.plugins.has("ImageBlockEditing");return r=>t.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:i(r):null;function i(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function da(o,e){const t=ze(e.getSelectedBlocks());return!t||o.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}var Cx=Object.defineProperty,ig=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,yx=Object.prototype.propertyIsEnumerable,rg=(o,e,t)=>e in o?Cx(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,sg=(o,e)=>{for(var t in e||(e={}))vx.call(e,t)&&rg(o,t,e[t]);if(ig)for(var t of ig(e))yx.call(e,t)&&rg(o,t,e[t]);return o};class zt extends q{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null){const i=this.editor,r=i.model,s=r.document.selection;n=ag(i,t||s,n),e=sg(sg({},Object.fromEntries(s.getAttributes())),e);for(const a in e)r.schema.checkAttribute(n,a)||delete e[a];return r.change(a=>{const l=a.createElement(n,e);return r.insertObject(l,t,null,{setSelection:"on",findOptimalPosition:t||n=="imageInline"?void 0:"auto"}),l.parent?l:null})}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const n=e.getSelectedElement();if(n&&this.isImageWidget(n))return n;let i=t.parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(t,n){if(ag(t,n,null)=="imageBlock"){const r=function(s,a){const l=function(d,u){const g=d.getSelectedElement();if(g){const f=Kt(d);if(f)return u.createRange(u.createPositionAt(g,f))}return du(d,u)}(s,a),c=l.start.parent;return c.isEmpty&&!c.is("element","$root")?c.parent:c}(n,t.model);if(t.model.schema.checkChild(r,"imageBlock"))return!0}else if(t.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(t){return[...t.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),ia(e,t,{label:()=>{const i=this.findViewImgElement(e).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&Be(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function ag(o,e,t){const n=o.model.schema,i=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?t||(i==="inline"?"imageInline":i==="block"?"imageBlock":e.is("selection")?da(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class Ex extends ne{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,r=n.getClosestSelectedImageElement(i.document.selection);i.change(s=>{s.setAttribute("alt",e.newValue,r)})}}class xx extends q{static get requires(){return[zt]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Ex(this.editor))}}var lg=D(1905),Sx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(lg.Z,Sx),lg.Z.locals;var cg=D(6764),Dx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(cg.Z,Dx),cg.Z.locals;class Bx extends re{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new ht,this.keystrokes=new St,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),ve.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),ve.cancel,"ck-button-cancel","cancel"),this._focusables=new rn,this._focusCycler=new bo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),p({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,i){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const e=this.locale.t,t=new Xc(this.locale,_u);return t.label=e("Text alternative"),t}}function dg(o){const e=o.editing.view,t=Qe.defaultPositions,n=o.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(e.document.selection)),positions:[t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast,t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.viewportStickyNorth]}}class Tx extends q{static get requires(){return[Fi]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),r=new Ae(n);return r.set({label:t("Change image text alternative"),icon:ve.lowVision,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(S(Bx))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,r)=>{this._hideForm(!0),r()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(i){const r=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const s=dg(i);r.updatePosition(s)}}(e):this._hideForm(!0)}),w({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:dg(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class hg extends q{static get requires(){return[xx,Tx]}static get pluginName(){return"ImageTextAlternative"}}function ug(o,e){const t=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(i.item),l=o.findViewImgElement(a);if(i.attributeNewValue===null){const c=i.attributeOldValue;c&&c.data&&(s.removeAttribute("srcset",l),s.removeAttribute("sizes",l),c.width&&s.removeAttribute("width",l))}else{const c=i.attributeNewValue;c&&c.data&&(s.setAttribute("srcset",c.data,l),s.setAttribute("sizes","100vw",l),c.width&&s.setAttribute("width",c.width,l))}};return n=>{n.on(`attribute:srcset:${e}`,t)}}function Wi(o,e,t){const n=(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,l=s.mapper.toViewElement(r.item),c=o.findViewImgElement(l);a.setAttribute(r.attributeKey,r.attributeNewValue||"",c)};return i=>{i.on(`attribute:${t}:${e}`,n)}}class Ix extends Ct{observe(e){this.listenTo(e,"load",(t,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}var Px=Object.defineProperty,mg=Object.getOwnPropertySymbols,Rx=Object.prototype.hasOwnProperty,Ox=Object.prototype.propertyIsEnumerable,gg=(o,e,t)=>e in o?Px(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Ki=(o,e)=>{for(var t in e||(e={}))Rx.call(e,t)&&gg(o,t,e[t]);if(mg)for(var t of mg(e))Ox.call(e,t)&&gg(o,t,e[t]);return o};class Nx extends ne{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&Q("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&Q("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Pe(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const l=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&l&&i.isImage(l)){const c=this.editor.model.createPositionAfter(l);i.insertImage(Ki(Ki({},s),r),c)}else i.insertImage(Ki(Ki({},s),r))})}}class zx extends ne{refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement();this.editor.model.change(n=>{n.setAttribute("src",e.source,t),n.removeAttribute("srcset",t),n.removeAttribute("sizes",t)})}}class pg extends q{static get requires(){return[zt]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(Ix),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:r=>{const s={data:r.getAttribute("srcset")};return r.hasAttribute("width")&&(s.width=r.getAttribute("width")),s}}});const n=new Nx(e),i=new zx(e);e.commands.add("insertImage",n),e.commands.add("replaceImageSource",i),e.commands.add("imageInsert",n)}}class fg extends ne{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),r=Object.fromEntries(i.getAttributes());return r.src||r.uploadId?t.change(s=>{const a=Array.from(t.markers).filter(d=>d.getRange().containsItem(i)),l=n.insertImage(r,t.createSelection(i,"on"),this._modelElementName);if(!l)return null;const c=s.createRangeOn(l);for(const d of a){const u=d.getRange(),g=u.root.rootName!="$graveyard"?u.getJoined(c,!0):c;s.updateMarker(d,{range:g})}return{oldElement:i,newElement:l}}):null}}class Mx extends q{static get requires(){return[pg,zt,Rt]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new fg(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>ng(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>i.toImageWidget(ng(s),s,t("image widget"))}),n.for("downcast").add(Wi(i,"imageBlock","src")).add(Wi(i,"imageBlock","alt")).add(ug(i,"imageBlock")),n.for("upcast").elementToElement({view:og(e,"imageBlock"),model:(r,{writer:s})=>s.createElement("imageBlock",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)}).add(function(r){const s=(a,l,c)=>{if(!c.consumable.test(l.viewItem,{name:!0,classes:"image"}))return;const d=r.findViewImgElement(l.viewItem);if(!d||!c.consumable.test(d,{name:!0}))return;c.consumable.consume(l.viewItem,{name:!0,classes:"image"});const u=ze(c.convertItem(d,l.modelCursor).modelRange.getItems());u?(c.convertChildren(l.viewItem,u),c.updateConversionResult(u,l)):c.consumable.revert(l.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(i))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const l=Array.from(a.content.getChildren());let c;if(!l.every(i.isInlineImageView))return;c=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(c);if(da(t.schema,d)==="imageBlock"){const u=new Bi(n.document),g=l.map(f=>u.createElement("figure",{class:"image"},f));a.content=u.createDocumentFragment(g)}})}}var kg=D(3508),Fx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(kg.Z,Fx),kg.Z.locals;class Vx extends q{static get requires(){return[Mx,Mo,hg]}static get pluginName(){return"ImageBlock"}}class Lx extends q{static get requires(){return[pg,zt,Rt]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new fg(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:s})=>s.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(r,{writer:s})=>i.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,t("image widget"))}),n.for("downcast").add(Wi(i,"imageInline","src")).add(Wi(i,"imageInline","alt")).add(ug(i,"imageInline")),n.for("upcast").elementToElement({view:og(e,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const l=Array.from(a.content.getChildren());let c;if(!l.every(i.isBlockImageView))return;c=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const d=t.createSelection(c);if(da(t.schema,d)==="imageInline"){const u=new Bi(n.document),g=l.map(f=>f.childCount===1?(Array.from(f.getAttributes()).forEach(b=>u.setAttribute(...b,i.findViewImgElement(f))),f.getChild(0)):f);a.content=u.createDocumentFragment(g)}})}}class jx extends q{static get requires(){return[Lx,Mo,hg]}static get pluginName(){return"ImageInline"}}var bg=D(2640),$x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(bg.Z,$x),bg.Z.locals;function wg(o){const e=o.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function Hx(o){return new Promise((e,t)=>{const n=o.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const r=Ag(i,n),s=r.replace("image/",""),a=new File([i],`image.${s}`,{type:r});e(a)}).catch(i=>i&&i.name==="TypeError"?function(r){return function(s){return new Promise((a,l)=>{const c=oe.document.createElement("img");c.addEventListener("load",()=>{const d=oe.document.createElement("canvas");d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0),d.toBlob(u=>u?a(u):l())}),c.addEventListener("error",()=>l()),c.src=s})}(r).then(s=>{const a=Ag(s,r),l=a.replace("image/","");return new File([s],`image.${l}`,{type:a})})}(n).then(e).catch(t):t(i))})}function Ag(o,e){return o.type?o.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class qx extends q{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=i=>{const r=new X2(i),s=e.commands.get("uploadImage"),a=e.config.get("image.upload.types"),l=wg(a);return r.set({acceptedType:a.map(c=>`image/${c}`).join(","),allowMultipleFiles:!0}),r.buttonView.set({label:t("Insert image"),icon:ve.image,tooltip:!0}),r.buttonView.bind("isEnabled").to(s),r.on("done",(c,d)=>{const u=Array.from(d).filter(g=>l.test(g.type));u.length&&(e.execute("uploadImage",{file:u}),e.editing.view.focus())}),r};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}var _g=D(3689),Ux={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(_g.Z,Ux),_g.Z.locals;var Cg=D(4036),Wx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Cg.Z,Wx),Cg.Z.locals;var vg=D(3773),Kx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(vg.Z,Kx),vg.Z.locals;class Gx extends q{constructor(e){super(e),this.uploadStatusChange=(t,n,i)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!i.consumable.consume(n.item,t.name))return;const l=r.plugins.get("ImageUtils"),c=r.plugins.get(Nt),d=a?n.attributeNewValue:null,u=this.placeholder,g=r.editing.mapper.toViewElement(s),f=i.writer;if(d=="reading")return yg(g,f),void Eg(l,u,g,f);if(d=="uploading"){const b=c.loaders.get(a);return yg(g,f),void(b?(xg(g,f),function(A,E,P,z){const j=function(Y){const ie=Y.createUIElement("div",{class:"ck-progress-bar"});return Y.setCustomProperty("progressBar",!0,ie),ie}(E);E.insert(E.createPositionAt(A,"end"),j),P.on("change:uploadedPercent",(Y,ie,Ee)=>{z.change(he=>{he.setStyle("width",Ee+"%",j)})})}(g,f,b,r.editing.view),function(A,E,P,z){if(z.data){const j=A.findViewImgElement(E);P.setAttribute("src",z.data,j)}}(l,g,f,b)):Eg(l,u,g,f))}d=="complete"&&c.loaders.get(a)&&function(b,A,E){const P=A.createUIElement("div",{class:"ck-image-upload-complete-icon"});A.insert(A.createPositionAt(b,"end"),P),setTimeout(()=>{E.change(z=>z.remove(z.createRangeOn(P)))},3e3)}(g,f,r.editing.view),function(b,A){Dg(b,A,"progressBar")}(g,f),xg(g,f),function(b,A){A.removeClass("ck-appear",b)}(g,f)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function yg(o,e){o.hasClass("ck-appear")||e.addClass("ck-appear",o)}function Eg(o,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const i=o.findViewImgElement(t);i.getAttribute("src")!==e&&n.setAttribute("src",e,i),Sg(t,"placeholder")||n.insert(n.createPositionAfter(i),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function xg(o,e){o.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",o),Dg(o,e,"placeholder")}function Sg(o,e){for(const t of o.getChildren())if(t.getCustomProperty(e))return t}function Dg(o,e,t){const n=Sg(o,t);n&&e.remove(e.createRangeOn(n))}var Zx=Object.defineProperty,Jx=Object.defineProperties,Yx=Object.getOwnPropertyDescriptors,Bg=Object.getOwnPropertySymbols,Qx=Object.prototype.hasOwnProperty,Xx=Object.prototype.propertyIsEnumerable,Tg=(o,e,t)=>e in o?Zx(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;class e5 extends ne{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Pe(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((s,a)=>{const l=n.getSelectedElement();if(a&&l&&i.isImage(l)){const c=this.editor.model.createPositionAfter(l);this._uploadImage(s,r,c)}else this._uploadImage(s,r)})}_uploadImage(e,t,n){const i=this.editor,r=i.plugins.get(Nt).createLoader(e),s=i.plugins.get("ImageUtils");var a,l;r&&s.insertImage((a=((c,d)=>{for(var u in d||(d={}))Qx.call(d,u)&&Tg(c,u,d[u]);if(Bg)for(var u of Bg(d))Xx.call(d,u)&&Tg(c,u,d[u]);return c})({},t),l={uploadId:r.id},Jx(a,Yx(l))),n)}}class t5 extends q{constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[Nt,Ku,Rt,zt]}static get pluginName(){return"ImageUploadEditing"}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(Nt),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),a=wg(e.config.get("image.upload.types")),l=new e5(e);e.commands.add("uploadImage",l),e.commands.add("imageUpload",l),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(c,d)=>{if(u=d.dataTransfer,Array.from(u.types).includes("text/html")&&u.getData("text/html")!=="")return;var u;const g=Array.from(d.dataTransfer.files).filter(f=>!!f&&a.test(f.type));g.length&&(c.stop(),e.model.change(f=>{d.targetRanges&&f.setSelection(d.targetRanges.map(b=>e.editing.mapper.toModelRange(b))),e.model.enqueueChange(()=>{e.execute("uploadImage",{file:g})})}))}),this.listenTo(s,"inputTransformation",(c,d)=>{const u=Array.from(e.editing.view.createRangeIn(d.content)).map(f=>f.item).filter(f=>function(b,A){return!(!b.isInlineImageView(A)||!A.getAttribute("src")||!A.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!A.getAttribute("src").match(/^blob:/g))}(r,f)&&!f.getAttribute("uploadProcessed")).map(f=>({promise:Hx(f),imageElement:f}));if(!u.length)return;const g=new Bi(e.editing.view.document);for(const f of u){g.setAttribute("uploadProcessed",!0,f.imageElement);const b=i.createLoader(f.promise);b&&(g.setAttribute("src","",f.imageElement),g.setAttribute("uploadId",b.id,f.imageElement))}}),e.editing.view.document.on("dragover",(c,d)=>{d.preventDefault()}),t.on("change",()=>{const c=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const u of c)if(u.type=="insert"&&u.name!="$text"){const g=u.position.nodeAfter,f=u.position.root.rootName=="$graveyard";for(const b of n5(e,g)){const A=b.getAttribute("uploadId");if(!A)continue;const E=i.loaders.get(A);E&&(f?d.has(A)||E.abort():(d.add(A),this._uploadImageElements.set(A,b),E.status=="idle"&&this._readAndUpload(E)))}}}),this.on("uploadComplete",(c,{imageElement:d,data:u})=>{const g=u.urls?u.urls:u;this.editor.model.change(f=>{f.setAttribute("src",g.default,d),this._parseAndSetSrcsetAttributeOnImage(g,d,f)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,i=t.locale.t,r=t.plugins.get(Nt),s=t.plugins.get(Ku),a=t.plugins.get("ImageUtils"),l=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",l.get(e.id))}),e.read().then(()=>{const d=e.upload(),u=l.get(e.id);if(k.isSafari){const g=t.editing.mapper.toViewElement(u),f=a.findViewImgElement(g);t.editing.view.once("render",()=>{if(!f.parent)return;const b=t.editing.view.domConverter.mapViewToDom(f.parent);if(!b)return;const A=b.style.display;b.style.display="none",b._ckHack=b.offsetHeight,b.style.display=A})}return n.enqueueChange({isUndoable:!1},g=>{g.setAttribute("uploadStatus","uploading",u)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},u=>{const g=l.get(e.id);u.setAttribute("uploadStatus","complete",g),this.fire("uploadComplete",{data:d,imageElement:g})}),c()}).catch(d=>{if(e.status!=="error"&&e.status!=="aborted")throw d;e.status=="error"&&d&&s.showWarning(d,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},u=>{u.remove(l.get(e.id))}),c()});function c(){n.enqueueChange({isUndoable:!1},d=>{const u=l.get(e.id);d.removeAttribute("uploadId",u),d.removeAttribute("uploadStatus",u),l.delete(e.id)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const r=Object.keys(e).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return i=Math.max(i,a),!0}).map(s=>`${e[s]} ${s}w`).join(", ");r!=""&&n.setAttribute("srcset",{data:r,width:i},t)}}function n5(o,e){const t=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}var Ig=D(1568),o5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Ig.Z,o5),Ig.Z.locals;var Pg=D(3535),i5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Pg.Z,i5),Pg.Z.locals;class r5 extends ne{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(n.document.selection);this.value={width:e.width,height:null},i&&n.change(r=>{r.setAttribute("width",e.width,i)})}}class s5 extends q{static get requires(){return[zt]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new r5(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add(n=>n.on(`attribute:width:${e}`,(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,l=s.mapper.toViewElement(r.item);r.attributeNewValue!==null?(a.setStyle("width",r.attributeNewValue,l),a.addClass("image_resized",l)):(a.removeStyle("width",l),a.removeClass("image_resized",l))})),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:n=>n.getStyle("width")}})}}const ha={small:ve.objectSizeSmall,medium:ve.objectSizeMedium,large:ve.objectSizeLarge,original:ve.objectSizeFull};function Rg(o){return e=>o===null&&e===o||e!==null&&e.width===o}var Og=D(6270),a5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Og.Z,a5),Og.Z.locals;class l5 extends ne{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils");n.change(r=>{const s=e.value;let a=i.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,a)&&(this.editor.execute(i.isBlockImage(a)?"imageTypeInline":"imageTypeBlock"),a=i.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",a):r.setAttribute("imageStyle",s,a)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}var c5=Object.defineProperty,Ng=Object.getOwnPropertySymbols,d5=Object.prototype.hasOwnProperty,h5=Object.prototype.propertyIsEnumerable,zg=(o,e,t)=>e in o?c5(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Mg=(o,e)=>{for(var t in e||(e={}))d5.call(e,t)&&zg(o,t,e[t]);if(Ng)for(var t of Ng(e))h5.call(e,t)&&zg(o,t,e[t]);return o};const{objectFullWidth:u5,objectInline:Fg,objectLeft:Vg,objectRight:ua,objectCenter:ma,objectBlockLeft:Lg,objectBlockRight:jg}=ve,Gi={get inline(){return{name:"inline",title:"In line",icon:Fg,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Vg,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Lg,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:ma,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:ua,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:jg,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:ma,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:ua,modelElements:["imageBlock"],className:"image-style-side"}}},$g={full:u5,left:Lg,right:jg,center:ma,inlineLeft:Vg,inlineRight:ua,inline:Fg},Hg=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function qg(o){Q("image-style-configuration-definition-invalid",o)}const ga={normalizeStyles:function(o){return(o.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?Gi[t]?Mg({},Gi[t]):{name:t}:function(n,i){const r=Mg({},i);for(const s in n)Object.prototype.hasOwnProperty.call(i,s)||(r[s]=n[s]);return r}(Gi[t.name],t),typeof t.icon=="string"&&(t.icon=$g[t.icon]||t.icon),t}(e)).filter(e=>function(t,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:r,name:s}=t;if(!(r&&r.length&&s))return qg({style:t}),!1;{const a=[n?"imageBlock":null,i?"imageInline":null];if(!r.some(l=>a.includes(l)))return Q("image-style-missing-dependency",{style:t,missingPlugins:r.map(l=>l==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(e,o))},getDefaultStylesConfiguration:function(o,e){return o&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...Hg]:[]},warnInvalidStyle:qg,DEFAULT_OPTIONS:Gi,DEFAULT_ICONS:$g,DEFAULT_DROPDOWN_DEFINITIONS:Hg};function Ug(o,e){for(const t of e)if(t.name===o)return t}class Wg extends q{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[zt]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=ga,n=this.editor,i=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(i,r)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:r}),this._setupConversion(i,r),this._setupPostFixer(),n.commands.add("imageStyle",new l5(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,i=n.model.schema,r=(s=this.normalizedStyles,(l,c,d)=>{if(!d.consumable.consume(c.item,l.name))return;const u=Ug(c.attributeNewValue,s),g=Ug(c.attributeOldValue,s),f=d.mapper.toViewElement(c.item),b=d.writer;g&&b.removeClass(g.className,f),u&&b.addClass(u.className,f)});var s;const a=function(l){const c={imageInline:l.filter(d=>!d.isDefault&&d.modelElements.includes("imageInline")),imageBlock:l.filter(d=>!d.isDefault&&d.modelElements.includes("imageBlock"))};return(d,u,g)=>{if(!u.modelRange)return;const f=u.viewItem,b=ze(u.modelRange.getItems());if(b&&g.schema.checkAttribute(b,"imageStyle"))for(const A of c[b.name])g.consumable.consume(f,{classes:A.className})&&g.writer.setAttribute("imageStyle",A.name,b)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),t&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(zt),i=new Map(this.normalizedStyles.map(r=>[r.name,r]));t.registerPostFixer(r=>{let s=!1;for(const a of t.differ.getChanges())if(a.type=="insert"||a.type=="attribute"&&a.attributeKey=="imageStyle"){let l=a.type=="insert"?a.position.nodeAfter:a.range.start.nodeAfter;if(l&&l.is("element","paragraph")&&l.childCount>0&&(l=l.getChild(0)),!n.isImage(l))continue;const c=l.getAttribute("imageStyle");if(!c)continue;const d=i.get(c);d&&d.modelElements.includes(l.name)||(r.removeAttribute("imageStyle",l),s=!0)}return s})}}var Kg=D(5083),m5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Kg.Z,m5),Kg.Z.locals;class g5 extends q{static get requires(){return[Wg]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],n=Gg(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const i=Gg([...t.filter(xe),...ga.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const r of i)this._createDropdown(r,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,i=>{let r;const{defaultItem:s,items:a,title:l}=e,c=a.filter(f=>t.find(({name:b})=>Zg(b)===f)).map(f=>{const b=n.create(f);return f===s&&(r=b),b});a.length!==c.length&&ga.warnInvalidStyle({dropdown:e});const d=Pt(i,Fs),u=d.buttonView,g=u.arrowView;return Pi(d,c,{enableActiveItemFocusOnDropdownOpen:!0}),u.set({label:Jg(l,r.label),class:null,tooltip:!0}),g.unbind("label"),g.set({label:l}),u.bind("icon").toMany(c,"isOn",(...f)=>{const b=f.findIndex(ln);return b<0?r.icon:c[b].icon}),u.bind("label").toMany(c,"isOn",(...f)=>{const b=f.findIndex(ln);return Jg(l,b<0?r.label:c[b].label)}),u.bind("isOn").toMany(c,"isOn",(...f)=>f.some(ln)),u.bind("class").toMany(c,"isOn",(...f)=>f.some(ln)?"ck-splitbutton_flatten":void 0),u.on("execute",()=>{c.some(({isOn:f})=>f)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(c,"isEnabled",(...f)=>f.some(ln)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(Zg(t),n=>{const i=this.editor.commands.get("imageStyle"),r=new Ae(n);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>s===t),r.on("execute",this._executeCommand.bind(this,t)),r})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function Gg(o,e){for(const t of o)e[t.title]&&(t.title=e[t.title]);return o}function Zg(o){return`imageStyle:${o}`}function Jg(o,e){return(o?o+": ":"")+e}class p5 extends q{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new ld(e)),e.commands.add("outdent",new ld(e))}}const Yg='',Qg='';class f5 extends q{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?Yg:Qg,r=t.uiLanguageDirection=="ltr"?Qg:Yg;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(e,t,n){const i=this.editor;i.ui.componentFactory.add(e,r=>{const s=i.commands.get(e),a=new Ae(r);return a.set({label:t,icon:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{i.execute(e),i.editing.view.focus()}),a})}}class Zi extends ne{constructor(e,t){super(e),this._indentBehavior=t}refresh(){const e=this.editor.model,t=ze(e.document.selection.getSelectedBlocks());t&&e.schema.checkAttribute(t,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(t.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const e=this.editor.model,t=function(n){const i=n.document.selection,r=n.schema;return Array.from(i.getSelectedBlocks()).filter(s=>r.checkAttribute(s,"blockIndent"))}(e);e.change(n=>{for(const i of t){const r=i.getAttribute("blockIndent"),s=this._indentBehavior.getNextIndent(r);s?n.setAttribute("blockIndent",s,i):n.removeAttribute("blockIndent",i)}})}}class Xg{constructor(e){this.isForward=e.direction==="forward",this.offset=e.offset,this.unit=e.unit}checkEnabled(e){const t=parseFloat(e||"0");return this.isForward||t>0}getNextIndent(e){const t=parseFloat(e||"0");if(!(!e||e.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const n=t+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class ep{constructor(e){this.isForward=e.direction==="forward",this.classes=e.classes}checkEnabled(e){const t=this.classes.indexOf(e);return this.isForward?t=0}getNextIndent(e){const t=this.classes.indexOf(e),n=this.isForward?1:-1;return this.classes[t+n]}}const k5=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class b5{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!i.schema.isInline(n.item))return;const r=i.writer,s=r.document.selection;for(const a of this._definitions){const l=r.createAttributeElement("a",a.attributes,{priority:5});a.classes&&r.addClass(a.classes,l);for(const c in a.styles)r.setStyle(c,a.styles[c],l);r.setCustomProperty("link",!0,l),a.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(s.getFirstRange(),l):r.wrap(i.mapper.toViewRange(n.range),l):r.unwrap(i.mapper.toViewRange(n.range),l)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:i,mapper:r})=>{const s=r.toViewElement(n.item),a=Array.from(s.getChildren()).find(l=>l.is("element","a"));for(const l of this._definitions){const c=Dt(l.attributes);if(l.callback(n.attributeNewValue)){for(const[d,u]of c)d==="class"?i.addClass(u,a):i.setAttribute(d,u,a);l.classes&&i.addClass(l.classes,a);for(const d in l.styles)i.setStyle(d,l.styles[d],a)}else{for(const[d,u]of c)d==="class"?i.removeClass(u,a):i.removeAttribute(d,a);l.classes&&i.removeClass(l.classes,a);for(const d in l.styles)i.removeStyle(d,a)}}})}}}const w5=function(o,e,t){var n=o.length;return t=t===void 0?n:t,!e&&t>=n?o:bd(o,e,t)};var A5=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const tp=function(o){return A5.test(o)},_5=function(o){return o.split("")};var np="\\ud800-\\udfff",C5="["+np+"]",pa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",fa="\\ud83c[\\udffb-\\udfff]",op="[^"+np+"]",ip="(?:\\ud83c[\\udde6-\\uddff]){2}",rp="[\\ud800-\\udbff][\\udc00-\\udfff]",sp="(?:"+pa+"|"+fa+")?",ap="[\\ufe0e\\ufe0f]?",v5=ap+sp+("(?:\\u200d(?:"+[op,ip,rp].join("|")+")"+ap+sp+")*"),y5="(?:"+[op+pa+"?",pa,ip,rp,C5].join("|")+")",E5=RegExp(fa+"(?="+fa+")|"+y5+v5,"g");const x5=function(o){return o.match(E5)||[]},S5=function(o){return tp(o)?x5(o):_5(o)},D5=function(o){return function(e){e=ns(e);var t=tp(e)?S5(e):void 0,n=t?t[0]:e.charAt(0),i=t?w5(t,1).join(""):e.slice(1);return n[o]()+i}}("toUpperCase"),B5=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,T5=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,I5=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,P5=/^((\w+:(\/{2,})?)|(\W))/i,ka="Ctrl+K";function lp(o,{writer:e}){const t=e.createAttributeElement("a",{href:o},{priority:5});return e.setCustomProperty("link",!0,t),t}function cp(o){const e=String(o);return function(t){return!!t.replace(B5,"").match(T5)}(e)?e:"#"}function ba(o,e){return!!o&&e.checkAttribute(o.name,"linkHref")}function wa(o,e){const t=(n=o,I5.test(n)?"mailto:":e);var n;const i=!!t&&!dp(o);return o&&i?t+o:o}function dp(o){return P5.test(o)}function hp(o){window.open(o,"_blank","noopener")}class R5 extends ne{constructor(){super(...arguments),this.manualDecorators=new at,this.automaticDecorators=new b5}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||ze(t.getSelectedBlocks());ba(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,r=[],s=[];for(const a in t)t[a]?r.push(a):s.push(a);n.change(a=>{if(i.isCollapsed){const l=i.getFirstPosition();if(i.hasAttribute("linkHref")){const c=up(i);let d=Gn(l,"linkHref",i.getAttribute("linkHref"),n);i.getAttribute("linkHref")===c&&(d=this._updateLinkContent(n,a,d,e)),a.setAttribute("linkHref",e,d),r.forEach(u=>{a.setAttribute(u,!0,d)}),s.forEach(u=>{a.removeAttribute(u,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(e!==""){const c=Dt(i.getAttributes());c.set("linkHref",e),r.forEach(u=>{c.set(u,!0)});const{end:d}=n.insertContent(a.createText(e,c),l);a.setSelection(d)}["linkHref",...r,...s].forEach(c=>{a.removeSelectionAttribute(c)})}else{const l=n.schema.getValidRanges(i.getRanges(),"linkHref"),c=[];for(const u of i.getSelectedBlocks())n.schema.checkAttribute(u,"linkHref")&&c.push(a.createRangeOn(u));const d=c.slice();for(const u of l)this._isRangeToUpdate(u,c)&&d.push(u);for(const u of d){let g=u;if(d.length===1){const f=up(i);i.getAttribute("linkHref")===f&&(g=this._updateLinkContent(n,a,u,e),a.setSelection(a.createSelection(g)))}a.setAttribute("linkHref",e,g),r.forEach(f=>{a.setAttribute(f,!0,g)}),s.forEach(f=>{a.removeAttribute(f,g)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return ba(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}_updateLinkContent(e,t,n,i){const r=t.createText(i,{linkHref:i});return e.insertContent(r,n)}}function up(o){if(o.isCollapsed){const e=o.getFirstPosition();return e.textNode&&e.textNode.data}{const e=Array.from(o.getFirstRange().getItems());if(e.length>1)return null;const t=e[0];return t.is("$text")||t.is("$textProxy")?t.data:null}}class O5 extends ne{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();ba(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(r=>{const s=n.isCollapsed?[Gn(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),i)for(const l of i.manualDecorators)r.removeAttribute(l.id,a)})}}class N5 extends ge(){constructor({id:e,label:t,attributes:n,classes:i,styles:r,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var mp=D(9773),z5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(mp.Z,z5),mp.Z.locals;var M5=Object.defineProperty,gp=Object.getOwnPropertySymbols,F5=Object.prototype.hasOwnProperty,V5=Object.prototype.propertyIsEnumerable,pp=(o,e,t)=>e in o?M5(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,L5=(o,e)=>{for(var t in e||(e={}))F5.call(e,t)&&pp(o,t,e[t]);if(gp)for(var t of gp(e))V5.call(e,t)&&pp(o,t,e[t]);return o};const fp="automatic",j5=/^(https?:)?\/\//;class $5 extends q{static get pluginName(){return"LinkEditing"}static get requires(){return[gm,am,Rt]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:lp}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,i)=>lp(cp(n),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),e.commands.add("link",new R5(e)),e.commands.add("unlink",new O5(e));const t=function(n,i){const r={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return i.forEach(s=>("label"in s&&r[s.label]&&(s.label=r[s.label]),s)),i}(e.t,function(n){const i=[];if(n)for(const[r,s]of Object.entries(n)){const a=Object.assign({},s,{id:`link${D5(r)}`});i.push(a)}return i}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(n=>n.mode===fp)),this._enableManualDecorators(t.filter(n=>n.mode==="manual")),e.plugins.get(gm).registerAttribute("linkHref"),function(n,i,r,s){const a=n.editing.view,l=new Set;a.document.registerPostFixer(c=>{const d=n.model.document.selection;let u=!1;if(d.hasAttribute(i)){const g=Gn(d.getFirstPosition(),i,d.getAttribute(i),n.model),f=n.editing.mapper.toViewRange(g);for(const b of f.getItems())b.is("element",r)&&!b.hasClass(s)&&(c.addClass(s,b),l.add(b),u=!0)}return u}),n.conversion.for("editingDowncast").add(c=>{function d(){a.change(u=>{for(const g of l.values())u.removeClass(s,g),l.delete(g)})}c.on("insert",d,{priority:"highest"}),c.on("remove",d,{priority:"highest"}),c.on("attribute",d,{priority:"highest"}),c.on("selection",d,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:fp,callback:i=>!!i&&j5.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(i=>{t.model.schema.extend("$text",{allowAttributes:i.id});const r=new N5(i);n.add(r),t.conversion.for("downcast").attributeToElement({model:r.id,view:(s,{writer:a,schema:l},{item:c})=>{if((c.is("selection")||l.isInline(c))&&s){const d=a.createAttributeElement("a",r.attributes,{priority:5});r.classes&&a.addClass(r.classes,d);for(const u in r.styles)a.setStyle(u,r.styles[u],d);return a.setCustomProperty("link",!0,d),d}}}),t.conversion.for("upcast").elementToAttribute({view:L5({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(n,i)=>{if(!(k.isMac?i.domEvent.metaKey:i.domEvent.ctrlKey))return;let r=i.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),i.preventDefault(),hp(s))},{context:"$capture"}),this.listenTo(t,"keydown",(n,i)=>{const r=e.commands.get("link").value;r&&i.keyCode===se.enter&&i.altKey&&(n.stop(),hp(r))})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,i=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||e.change(r=>{Aa(r,_a(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(Ns);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const i=t.document.selection;if(!i.isCollapsed||!i.hasAttribute("linkHref"))return;const r=i.getFirstPosition(),s=Gn(r,"linkHref",i.getAttribute("linkHref"),t);(r.isTouching(s.start)||r.isTouching(s.end))&&t.change(a=>{Aa(a,_a(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n=null,i=!1;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const r=e.model.document.selection;r.isCollapsed||(i?i=!1:kp(e)&&function(s){const a=s.document.selection,l=a.getFirstPosition(),c=a.getLastPosition(),d=l.nodeAfter;if(!d||!d.is("$text")||!d.hasAttribute("linkHref"))return!1;const u=c.textNode||c.nodeBefore;return d===u?!0:Gn(l,"linkHref",d.getAttribute("linkHref"),s).containsRange(s.createRange(l,c),!0)}(e.model)&&(n=r.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(r,[s])=>{i=!1,kp(e)&&n&&(e.model.change(a=>{for(const[l,c]of n)a.setAttribute(l,c,s)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let r=!1,s=!1;this.listenTo(i.document,"delete",(a,l)=>{s=l.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r=!1;const a=n.getFirstPosition(),l=n.getAttribute("linkHref");if(!l)return;const c=Gn(a,"linkHref",l,t);r=c.containsPosition(a)||c.end.isEqual(a)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s&&(s=!1,r||e.model.enqueueChange(a=>{Aa(a,_a(t.schema))}))},{priority:"low"})}_enableClipboardIntegration(){const e=this.editor,t=e.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(i,r)=>{t.change(s=>{const a=s.createRangeIn(r.content);for(const l of a.getItems())if(l.hasAttribute("linkHref")){const c=wa(l.getAttribute("linkHref"),n);s.setAttribute("linkHref",c,l)}})})}}function Aa(o,e){o.removeSelectionAttribute("linkHref");for(const t of e)o.removeSelectionAttribute(t)}function kp(o){return o.model.change(e=>e.batch).isTyping}function _a(o){return o.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}var bp=D(7754),H5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(bp.Z,H5),bp.Z.locals;class q5 extends re{constructor(e,t){super(e),this.focusTracker=new ht,this.keystrokes=new St,this._focusables=new rn;const n=e.t;this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),ve.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),ve.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new bo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),p({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Xc(this.locale,_u);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const r=new Ae(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new hi(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new re;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var wp=D(2347),U5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(wp.Z,U5),wp.Z.locals;class W5 extends re{constructor(e){super(e),this.focusTracker=new ht,this.keystrokes=new St,this._focusables=new rn;const t=e.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),'',"unlink"),this.editButtonView=this._createButton(t("Edit link"),ve.pencil,"edit"),this.set("href",void 0),this._focusCycler=new bo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new Ae(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new Ae(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",i=>i&&cp(i)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",i=>i||n("This link has no URL")),e.bind("isEnabled").to(this,"href",i=>!!i),e.template.tag="a",e.template.eventListeners={},e}}const Et="link-ui";class K5 extends q{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[Fi]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Y1),this._balloon=e.plugins.get(Fi),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:Et,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Et,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new W5(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),t.keystrokes.set(ka,(r,s)=>{this._addFormView(),s()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new(S(q5))(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isEnabled").to(t,"isEnabled"),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:r}=i.urlInputView.fieldView.element,s=wa(r,n);e.execute("link",s,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(r,s)=>{this._closeFormView(),s()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.ui.componentFactory.add("link",i=>{const r=new Ae(i);return r.isEnabled=!0,r.label=n("Link"),r.icon='',r.keystroke=ka,r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(t,"isEnabled"),r.bind("isOn").to(t,"value",s=>!!s),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(ka,(n,i)=>{i(),e.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),w({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=s();const r=()=>{const a=this._getSelectedLinkElement(),l=s();n&&!a||!n&&l!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,i=l};function s(){return t.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(e.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i;if(t.markers.has(Et)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(Et)),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));i=e.domConverter.viewRangeToDom(s)}else i=()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&Be(n))return Ca(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),r=Ca(i.start),s=Ca(i.end);return r&&r==s&&e.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(Et))t.updateMarker(Et,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:r})=>!e.schema.isContent(r),{boundaries:n});t.addMarker(Et,{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker(Et,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Et)&&e.change(t=>{t.removeMarker(Et)})}}function Ca(o){return o.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})||null}const G5=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Z5 extends q{static get requires(){return[Wn]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new mm(e.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const i=Ap(n.substr(0,n.length-1));return i?{url:i}:void 0});t.on("matched:data",(n,i)=>{const{batch:r,range:s,url:a}=i;if(!r.isTyping)return;const l=s.end.getShiftedBy(-1),c=l.getShiftedBy(-a.length),d=e.model.createRange(c,l);this._applyAutoLink(a,d)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const r=t.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition(),r=t.createRange(t.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=um(e,t),r=Ap(n);if(r){const s=t.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,s)}}_applyAutoLink(e,t){const n=this.editor.model,i=wa(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(t,n)&&dp(i)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(t)&&this._persistAutoLink(i,t)}_persistAutoLink(e,t){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",e,t),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function Ap(o){const e=G5.exec(o);return e?e[2]:null}var _p=D(111),J5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(_p.Z,J5),_p.Z.locals;var Cp=D(5730),Y5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Cp.Z,Y5),Cp.Z.locals;var vp=D(4564),Q5={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(vp.Z,Q5),vp.Z.locals;function X5(o,e){const t=e.mapper,n=e.writer,i=o.getAttribute("listType")=="numbered"?"ol":"ul",r=function(a){const l=a.createContainerElement("li");return l.getFillerOffset=nS,l}(n),s=n.createContainerElement(i,null);return n.insert(n.createPositionAt(s,0),r),t.bindElements(o,r),r}function yp(o,e,t,n){const i=e.parent,r=t.mapper,s=t.writer;let a=r.toViewPosition(n.createPositionBefore(o));const l=xp(o.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:o.getAttribute("listIndent")}),c=o.previousSibling;if(l&&l.getAttribute("listIndent")==o.getAttribute("listIndent")){const d=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(d))}else if(c&&c.name=="listItem"){a=r.toViewPosition(n.createPositionAt(c,"end"));const d=r.findMappedViewAncestor(a),u=function(g){for(const f of g.getChildren())if(f.name=="ul"||f.name=="ol")return f;return null}(d);a=u?s.createPositionBefore(u):s.createPositionAt(d,"end")}else a=r.toViewPosition(n.createPositionBefore(o));if(a=Ep(a),s.insert(a,i),c&&c.name=="listItem"){const d=r.toViewElement(c),u=s.createRange(s.createPositionAt(d,0),a).getWalker({ignoreElementEnd:!0});for(const g of u)if(g.item.is("element","li")){const f=s.breakContainer(s.createPositionBefore(g.item)),b=g.item.parent,A=s.createPositionAt(e,"end");ct(s,A.nodeBefore,A.nodeAfter),s.move(s.createRangeOn(b),A),u._position=f}}else{const d=i.nextSibling;if(d&&(d.is("element","ul")||d.is("element","ol"))){let u=null;for(const g of d.getChildren()){const f=r.toModelElement(g);if(!(f&&f.getAttribute("listIndent")>o.getAttribute("listIndent")))break;u=g}u&&(s.breakContainer(s.createPositionAfter(u)),s.move(s.createRangeOn(u.parent),s.createPositionAt(e,"end")))}}ct(s,i,i.nextSibling),ct(s,i.previousSibling,i)}function ct(o,e,t){return!e||!t||e.name!="ul"&&e.name!="ol"||e.name!=t.name||e.getAttribute("class")!==t.getAttribute("class")?null:o.mergeContainers(o.createPositionAfter(e))}function Ep(o){return o.getLastMatchingPosition(e=>e.item.is("uiElement"))}function xp(o,e){const t=!!e.sameIndent,n=!!e.smallerIndent,i=e.listIndent;let r=o;for(;r&&r.name=="listItem";){const s=r.getAttribute("listIndent");if(t&&i==s||n&&i>s)return r;r=e.direction==="forward"?r.nextSibling:r.previousSibling}return null}function Sp(o,e,t,n){o.ui.componentFactory.add(e,i=>{const r=o.commands.get(e),s=new Ae(i);return s.set({label:t,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{o.execute(e),o.editing.view.focus()}),s})}function va(o,e){const t=[],n=o.parent,i={ignoreElementEnd:!1,startPosition:o,shallow:!0,direction:e},r=n.getAttribute("listIndent"),s=[...new vt(i)].filter(a=>a.item.is("element")).map(a=>a.item);for(const a of s){if(!a.is("element","listItem")||a.getAttribute("listIndent")r)){if(a.getAttribute("listType")!==n.getAttribute("listType")||a.getAttribute("listStyle")!==n.getAttribute("listStyle")||a.getAttribute("listReversed")!==n.getAttribute("listReversed")||a.getAttribute("listStart")!==n.getAttribute("listStart"))break;e==="backward"?t.unshift(a):t.push(a)}}return t}const eS=["disc","circle","square"],tS=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function nS(){const o=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||o?0:yd.call(this)}class oS extends q{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;Sp(this.editor,"numberedList",e("Numbered List"),''),Sp(this.editor,"bulletedList",e("Bulleted List"),'')}}const iS=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:o,typeAttribute:e,listType:t}of iS);var Dp=D(4721),rS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Dp.Z,rS),Dp.Z.locals;var Bp=D(6082),sS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Bp.Z,sS),Bp.Z.locals;var Tp=D(2417),aS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Tp.Z,aS),Tp.Z.locals;class Ip extends ne{constructor(e,t){super(e),this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(i=>{const r=n[n.length-1];let s=r.nextSibling;for(;s&&s.name=="listItem"&&s.getAttribute("listIndent")>r.getAttribute("listIndent");)n.push(s),s=s.nextSibling;this._indentBy<0&&(n=n.reverse());for(const a of n){const l=a.getAttribute("listIndent")+this._indentBy;l<0?i.rename(a,"paragraph"):i.setAttribute("listIndent",l,a)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=ze(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}class Pp extends ne{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(s=>Op(s,t.schema)),r=e.forceValue!==void 0?!e.forceValue:this.value;t.change(s=>{if(r){let a=i[i.length-1].nextSibling,l=Number.POSITIVE_INFINITY,c=[];for(;a&&a.name=="listItem"&&a.getAttribute("listIndent")!==0;){const d=a.getAttribute("listIndent");d=t;)r>i.getAttribute("listIndent")&&(r=i.getAttribute("listIndent")),i.getAttribute("listIndent")==r&&o[e?"unshift":"push"](i),i=i[e?"previousSibling":"nextSibling"]}}function Op(o,e){return e.checkChild(o.parent,"listItem")&&!e.isObject(o)}class lS extends q{static get pluginName(){return"ListUtils"}getListTypeFromListStyleType(e){return function(t){return eS.includes(t)?"bulleted":tS.includes(t)?"numbered":null}(e)}getSelectedListItems(e){return function(t){let n=[...t.document.selection.getSelectedBlocks()].filter(i=>i.is("element","listItem")).map(i=>{const r=t.change(s=>s.createPositionAt(i,0));return[...va(r,"backward"),...va(r,"forward")]}).flat();return n=[...new Set(n)],n}(e)}getSiblingNodes(e,t){return va(e,t)}}function Np(o){return(e,t,n)=>{const i=n.consumable;if(!i.test(t.item,"insert")||!i.test(t.item,"attribute:listType")||!i.test(t.item,"attribute:listIndent"))return;i.consume(t.item,"insert"),i.consume(t.item,"attribute:listType"),i.consume(t.item,"attribute:listIndent");const r=t.item;yp(r,X5(r,n),n,o)}}const cS=(o,e,t)=>{if(!t.consumable.test(e.item,o.name))return;const n=t.mapper.toViewElement(e.item),i=t.writer;i.breakContainer(i.createPositionBefore(n)),i.breakContainer(i.createPositionAfter(n));const r=n.parent,s=e.attributeNewValue=="numbered"?"ol":"ul";i.rename(s,r)},dS=(o,e,t)=>{t.consumable.consume(e.item,o.name);const n=t.mapper.toViewElement(e.item).parent,i=t.writer;ct(i,n,n.nextSibling),ct(i,n.previousSibling,n)},zp=(o,e,t)=>{if(t.consumable.test(e.item,o.name)&&e.item.name!="listItem"){let n=t.mapper.toViewPosition(e.range.start);const i=t.writer,r=[];for(;(n.parent.name=="ul"||n.parent.name=="ol")&&(n=i.breakContainer(n),n.parent.name=="li");){const s=n,a=i.createPositionAt(n.parent,"end");if(!s.isEqual(a)){const l=i.remove(i.createRange(s,a));r.push(l)}n=i.createPositionAfter(n.parent)}if(r.length>0){for(let s=0;s0){const l=ct(i,a,a.nextSibling);l&&l.parent==a&&n.offset--}}ct(i,n.nodeBefore,n.nodeAfter)}}},hS=(o,e,t)=>{const n=t.mapper.toViewPosition(e.position),i=n.nodeBefore,r=n.nodeAfter;ct(t.writer,i,r)},uS=(o,e,t)=>{if(t.consumable.consume(e.viewItem,{name:!0})){const n=t.writer,i=n.createElement("listItem"),r=function(l){let c=0,d=l.parent;for(;d;){if(d.is("element","li"))c++;else{const u=d.previousSibling;u&&u.is("element","li")&&c++}d=d.parent}return c}(e.viewItem);n.setAttribute("listIndent",r,i);const s=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";if(n.setAttribute("listType",s,i),!t.safeInsert(i,e.modelCursor))return;const a=function(l,c,d){const{writer:u,schema:g}=d;let f=u.createPositionAfter(l);for(const b of c)if(b.name=="ul"||b.name=="ol")f=d.convertItem(b,f).modelCursor;else{const A=d.convertItem(b,u.createPositionAt(l,"end")),E=A.modelRange.start.nodeAfter;E&&E.is("element")&&!g.checkChild(l,E.name)&&(l=A.modelCursor.parent.is("element","listItem")?A.modelCursor.parent:pS(A.modelCursor),f=u.createPositionAfter(l))}return f}(i,e.viewItem.getChildren(),t);e.modelRange=n.createRange(e.modelCursor,a),t.updateConversionResult(i,e)}},Mp=(o,e,t)=>{if(t.consumable.test(e.viewItem,{name:!0})){const n=Array.from(e.viewItem.getChildren());for(const i of n)!(i.is("element","li")||Yn(i))&&i._remove()}},mS=(o,e,t)=>{if(t.consumable.test(e.viewItem,{name:!0})){if(e.viewItem.childCount===0)return;const n=[...e.viewItem.getChildren()];let i=!1;for(const r of n)i&&!Yn(r)&&r._remove(),Yn(r)&&(i=!0)}};function Fp(o){return(e,t)=>{if(t.isPhantom)return;const n=t.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const i=t.mapper.toViewElement(n),r=i.getAncestors().find(Yn),s=o.createPositionAt(i,0).getWalker();for(const a of s){if(a.type=="elementStart"&&a.item.is("element","li")){t.viewPosition=a.previousPosition;break}if(a.type=="elementEnd"&&a.item==r){t.viewPosition=a.nextPosition;break}}}}}const gS=function(o,[e,t]){const n=this;let i,r=e.is("documentFragment")?e.getChild(0):e;if(i=t?n.createSelection(t):n.document.selection,r&&r.is("element","listItem")){const s=i.getFirstPosition();let a=null;if(s.parent.is("element","listItem")?a=s.parent:s.nodeBefore&&s.nodeBefore.is("element","listItem")&&(a=s.nodeBefore),a){const l=a.getAttribute("listIndent");if(l>0)for(;r&&r.is("element","listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+l),r=r.nextSibling}}};function pS(o){const e=new vt({startPosition:o});let t;do t=e.next();while(!t.value.item.is("element","listItem"));return t.value.item}function Vp(o,e,t,n,i,r){const s=xp(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:o}),a=i.mapper,l=i.writer,c=s?s.getAttribute("listIndent"):null;let d;if(s)if(c==o){const u=a.toViewElement(s).parent;d=l.createPositionAfter(u)}else{const u=r.createPositionAt(s,"end");d=a.toViewPosition(u)}else d=t;d=Ep(d);for(const u of[...n.getChildren()])Yn(u)&&(d=l.move(l.createRangeOn(u),d).end,ct(l,u,u.nextSibling),ct(l,u.previousSibling,u))}function Yn(o){return o.is("element","ol")||o.is("element","ul")}class fS extends q{static get pluginName(){return"ListEditing"}static get requires(){return[zo,Wn,lS]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;var i;e.model.document.registerPostFixer(s=>function(a,l){const c=a.document.differ.getChanges(),d=new Map;let u=!1;for(const A of c)if(A.type=="insert"&&A.name=="listItem")g(A.position);else if(A.type=="insert"&&A.name!="listItem"){if(A.name!="$text"){const E=A.position.nodeAfter;E.hasAttribute("listIndent")&&(l.removeAttribute("listIndent",E),u=!0),E.hasAttribute("listType")&&(l.removeAttribute("listType",E),u=!0),E.hasAttribute("listStyle")&&(l.removeAttribute("listStyle",E),u=!0),E.hasAttribute("listReversed")&&(l.removeAttribute("listReversed",E),u=!0),E.hasAttribute("listStart")&&(l.removeAttribute("listStart",E),u=!0);for(const P of Array.from(a.createRangeIn(E)).filter(z=>z.item.is("element","listItem")))g(P.previousPosition)}g(A.position.getShiftedBy(A.length))}else A.type=="remove"&&A.name=="listItem"?g(A.position):(A.type=="attribute"&&A.attributeKey=="listIndent"||A.type=="attribute"&&A.attributeKey=="listType")&&g(A.range.start);for(const A of d.values())f(A),b(A);return u;function g(A){const E=A.nodeBefore;if(E&&E.is("element","listItem")){let P=E;if(d.has(P))return;for(let z=P.previousSibling;z&&z.is("element","listItem");z=P.previousSibling)if(P=z,d.has(P))return;d.set(E,P)}else{const P=A.nodeAfter;P&&P.is("element","listItem")&&d.set(P,P)}}function f(A){let E=0,P=null;for(;A&&A.is("element","listItem");){const z=A.getAttribute("listIndent");if(z>E){let j;P===null?(P=z-E,j=E):(P>z&&(P=z),j=z-P),l.setAttribute("listIndent",j,A),u=!0}else P=null,E=A.getAttribute("listIndent")+1;A=A.nextSibling}}function b(A){let E=[],P=null;for(;A&&A.is("element","listItem");){const z=A.getAttribute("listIndent");if(P&&P.getAttribute("listIndent")>z&&(E=E.slice(0,z+1)),z!=0)if(E[z]){const j=E[z];A.getAttribute("listType")!=j&&(l.setAttribute("listType",j,A),u=!0)}else E[z]=A.getAttribute("listType");P=A,A=A.nextSibling}}}(e.model,s)),n.mapper.registerViewToModelLength("li",ya),t.mapper.registerViewToModelLength("li",ya),n.mapper.on("modelToViewPosition",Fp(n.view)),n.mapper.on("viewToModelPosition",(i=e.model,(s,a)=>{const l=a.viewPosition,c=l.parent,d=a.mapper;if(c.name=="ul"||c.name=="ol"){if(l.isAtEnd){const u=d.toModelElement(l.nodeBefore),g=d.getModelLength(l.nodeBefore);a.modelPosition=i.createPositionBefore(u).getShiftedBy(g)}else{const u=d.toModelElement(l.nodeAfter);a.modelPosition=i.createPositionBefore(u)}s.stop()}else if(c.name=="li"&&l.nodeBefore&&(l.nodeBefore.name=="ul"||l.nodeBefore.name=="ol")){const u=d.toModelElement(c);let g=1,f=l.nodeBefore;for(;f&&Yn(f);)g+=d.getModelLength(f),f=f.previousSibling;a.modelPosition=i.createPositionBefore(u).getShiftedBy(g),s.stop()}})),t.mapper.on("modelToViewPosition",Fp(n.view)),e.conversion.for("editingDowncast").add(s=>{s.on("insert",zp,{priority:"high"}),s.on("insert:listItem",Np(e.model)),s.on("attribute:listType:listItem",cS,{priority:"high"}),s.on("attribute:listType:listItem",dS,{priority:"low"}),s.on("attribute:listIndent:listItem",function(a){return(l,c,d)=>{if(!d.consumable.consume(c.item,"attribute:listIndent"))return;const u=d.mapper.toViewElement(c.item),g=d.writer;g.breakContainer(g.createPositionBefore(u)),g.breakContainer(g.createPositionAfter(u));const f=u.parent,b=f.previousSibling,A=g.createRangeOn(f);g.remove(A),b&&b.nextSibling&&ct(g,b,b.nextSibling),Vp(c.attributeOldValue+1,c.range.start,A.start,u,d,a),yp(c.item,u,d,a);for(const E of c.item.getChildren())d.consumable.consume(E,"insert")}}(e.model)),s.on("remove:listItem",function(a){return(l,c,d)=>{const u=d.mapper.toViewPosition(c.position).getLastMatchingPosition(P=>!P.item.is("element","li")).nodeAfter,g=d.writer;g.breakContainer(g.createPositionBefore(u)),g.breakContainer(g.createPositionAfter(u));const f=u.parent,b=f.previousSibling,A=g.createRangeOn(f),E=g.remove(A);b&&b.nextSibling&&ct(g,b,b.nextSibling),Vp(d.mapper.toModelElement(u).getAttribute("listIndent")+1,c.position,A.start,u,d,a);for(const P of g.createRangeIn(E).getItems())d.mapper.unbindViewElement(P);l.stop()}}(e.model)),s.on("remove",hS,{priority:"low"})}),e.conversion.for("dataDowncast").add(s=>{s.on("insert",zp,{priority:"high"}),s.on("insert:listItem",Np(e.model))}),e.conversion.for("upcast").add(s=>{s.on("element:ul",Mp,{priority:"high"}),s.on("element:ol",Mp,{priority:"high"}),s.on("element:li",mS,{priority:"high"}),s.on("element:li",uS)}),e.model.on("insertContent",gS,{priority:"high"}),e.commands.add("numberedList",new Pp(e,"numbered")),e.commands.add("bulletedList",new Pp(e,"bulleted")),e.commands.add("indentList",new Ip(e,"forward")),e.commands.add("outdentList",new Ip(e,"backward"));const r=n.view.document;this.listenTo(r,"enter",(s,a)=>{const l=this.editor.model.document,c=l.selection.getLastPosition().parent;l.selection.isCollapsed&&c.name=="listItem"&&c.isEmpty&&(this.editor.execute("outdentList"),a.preventDefault(),s.stop())},{context:"li"}),this.listenTo(r,"delete",(s,a)=>{if(a.direction!=="backward")return;const l=this.editor.model.document.selection;if(!l.isCollapsed)return;const c=l.getFirstPosition();if(!c.isAtStart)return;const d=c.parent;d.name==="listItem"&&(d.previousSibling&&d.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),a.preventDefault(),s.stop()))},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(s,a)=>{const l=a.shiftKey?"outdentList":"indentList";this.editor.commands.get(l).isEnabled&&(e.execute(l),a.stopPropagation(),a.preventDefault(),s.stop())},{context:"li"})}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function ya(o){let e=1;for(const t of o.getChildren())if(t.name=="ul"||t.name=="ol")for(const n of t.getChildren())e+=ya(n);return e}li("Ctrl+Enter");var Lp=D(1199),kS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Lp.Z,kS),Lp.Z.locals;function Oe(o,e,t,n,i=1){e!=null&&i!=null&&e>i?n.setAttribute(o,e,t):n.removeAttribute(o,t)}function kn(o,e,t={}){const n=o.createElement("tableCell",t);return o.insertElement("paragraph",n),o.insert(n,e),n}function Ea(o,e){const t=e.parent.parent,n=parseInt(t.getAttribute("headingColumns")||"0"),{column:i}=o.getCellLocation(e);return!!n&&i{o.on("element:table",(e,t,n)=>{const i=t.viewItem;if(!n.consumable.test(i,{name:!0}))return;const{rows:r,headingRows:s,headingColumns:a}=function(d){let u,g=0;const f=[],b=[];let A;for(const E of Array.from(d.getChildren())){if(E.name!=="tbody"&&E.name!=="thead"&&E.name!=="tfoot")continue;E.name!=="thead"||A||(A=E);const P=Array.from(E.getChildren()).filter(z=>z.is("element","tr"));for(const z of P)if(A&&E===A||E.name==="tbody"&&Array.from(z.getChildren()).length&&Array.from(z.getChildren()).every(j=>j.is("element","th")))g++,f.push(z);else{b.push(z);const j=wS(z);(!u||jn.convertItem(d,n.writer.createPositionAt(c,"end"))),n.convertChildren(i,n.writer.createPositionAt(c,"end")),c.isEmpty){const d=n.writer.createElement("tableRow");n.writer.insert(d,n.writer.createPositionAt(c,"end")),kn(n.writer,n.writer.createPositionAt(d,"end"))}n.updateConversionResult(c,t)}})}}function jp(o){return e=>{e.on(`element:${o}`,(t,n,{writer:i})=>{if(!n.modelRange)return;const r=n.modelRange.start.nodeAfter,s=i.createPositionAt(r,0);if(n.viewItem.isEmpty)return void i.insertElement("paragraph",s);const a=Array.from(r.getChildren());if(a.every(l=>l.is("element","$marker"))){const l=i.createElement("paragraph");i.insert(l,i.createPositionAt(r,0));for(const c of a)i.move(i.createRangeOn(c),i.createPositionAt(l,"end"))}},{priority:"low"})}}function wS(o){let e=0,t=0;const n=Array.from(o.getChildren()).filter(i=>i.name==="th"||i.name==="td");for(;t1||s>1)&&this._recordSpans(i,s,r),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+r}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new AS(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||n||i}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const i={cell:e,row:this._row,column:this._column};for(let r=this._row;r{const i=t.getAttribute("headingRows")||0,r=n.createContainerElement("table",null,[]),s=n.createContainerElement("figure",{class:"table"},r);i>0&&n.insert(n.createPositionAt(r,"end"),n.createContainerElement("thead",null,n.createSlot(a=>a.is("element","tableRow")&&a.indexa.is("element","tableRow")&&a.index>=i)));for(const{positionOffset:a,filter:l}of e.additionalSlots)n.insert(n.createPositionAt(r,a),n.createSlot(l));return n.insert(n.createPositionAt(r,"after"),n.createSlot(a=>!a.is("element","tableRow")&&!e.additionalSlots.some(({filter:l})=>l(a)))),e.asWidget?function(a,l){return l.setCustomProperty("table",!0,a),ia(a,l,{hasSelectionHandle:!0})}(s,n):s}}function Hp(o={}){return(e,{writer:t})=>{const n=e.parent,i=n.parent,r=i.getChildIndex(n),s=new ue(i,{row:r}),a=i.getAttribute("headingRows")||0,l=i.getAttribute("headingColumns")||0;let c=null;for(const d of s)if(d.cell==e){const u=d.row{if(!e.parent.is("element","tableCell")||!Up(e))return null;if(o.asWidget)return t.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const n=t.createContainerElement("p");return t.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}}function Up(o){return o.parent.childCount==1&&!!o.getAttributeKeys().next().done}class _S extends ne{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(i,r){const s=i.getFirstPosition().parent,a=s===s.root?s:s.parent;return r.checkChild(a,"table")}(t,n)}execute(e={}){const t=this.editor,n=t.model,i=t.plugins.get("TableUtils"),r=t.config.get("table.defaultHeadings.rows"),s=t.config.get("table.defaultHeadings.columns");e.headingRows===void 0&&r&&(e.headingRows=r),e.headingColumns===void 0&&s&&(e.headingColumns=s),n.change(a=>{const l=i.createTable(a,e);n.insertObject(l,null,null,{findOptimalPosition:"auto"}),a.setSelection(a.createPositionAt(l.getNodeByPath([0,0,0]),0))})}}class Wp extends ne{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="above",r=n.getSelectionAffectedTableCells(t),s=n.getRowIndexes(r),a=i?s.first:s.last,l=r[0].findAncestor("table");n.insertRows(l,{at:i?a:a+1,copyStructureFromAbove:!i})}}class Kp extends ne{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="left",r=n.getSelectionAffectedTableCells(t),s=n.getColumnIndexes(r),a=i?s.first:s.last,l=r[0].findAncestor("table");n.insertColumns(l,{columns:1,at:i?a:a+1})}}class Gp extends ne{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length===1}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];this.direction==="horizontally"?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}function Zp(o,e,t){const{startRow:n,startColumn:i,endRow:r,endColumn:s}=e,a=t.createElement("table"),l=r-n+1;for(let d=0;d0&&Oe("headingRows",A-g,d,b,0);const E=parseInt(u.getAttribute("headingColumns")||"0");E>0&&Oe("headingColumns",E-f,d,b,0)}(a,o,n,i,t),a}function Jp(o,e,t=0){const n=[],i=new ue(o,{startRow:t,endRow:e-1});for(const r of i){const{row:s,cellHeight:a}=r;s1&&(a.rowspan=l);const c=parseInt(o.getAttribute("colspan")||"1");c>1&&(a.colspan=c);const d=r+s,u=[...new ue(i,{startRow:r,endRow:d,includeAllSlots:!0})];let g,f=null;for(const b of u){const{row:A,column:E,cell:P}=b;P===o&&g===void 0&&(g=E),g!==void 0&&g===E&&A===d&&(f=kn(t,b.getPositionBefore(),a))}return Oe("rowspan",s,o,t),f}function Qp(o,e){const t=[],n=new ue(o);for(const i of n){const{column:r,cellWidth:s}=i;r1&&(r.colspan=s);const a=parseInt(o.getAttribute("rowspan")||"1");a>1&&(r.rowspan=a);const l=kn(n,n.createPositionAfter(o),r);return Oe("colspan",i,o,n),l}function ef(o,e,t,n,i,r){const s=parseInt(o.getAttribute("colspan")||"1"),a=parseInt(o.getAttribute("rowspan")||"1");t+s-1>i&&Oe("colspan",i-t+1,o,r,1),e+a-1>n&&Oe("rowspan",n-e+1,o,r,1)}function xa(o,e){const t=e.getColumns(o),n=new Array(t).fill(0);for(const{column:r}of new ue(o))n[r]++;const i=n.reduce((r,s,a)=>s?r:[...r,a],[]);if(i.length>0){const r=i[i.length-1];return e.removeColumns(o,{at:r}),!0}return!1}function Sa(o,e){const t=[],n=e.getRows(o);for(let i=0;i0){const i=t[t.length-1];return e.removeRows(o,{at:i}),!0}return!1}function Da(o,e){xa(o,e)||Sa(o,e)}function tf(o,e){const t=Array.from(new ue(o,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(t.every(({cellHeight:i})=>i===1))return e.lastRow;const n=t[0].cellHeight-1;return e.lastRow+n}function nf(o,e){const t=Array.from(new ue(o,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(t.every(({cellWidth:i})=>i===1))return e.lastColumn;const n=t[0].cellWidth-1;return e.lastColumn+n}class Ji extends ne{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal=this.direction=="right"||this.direction=="left"}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,n=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],i=this.value,r=this.direction;e.change(s=>{const a=r=="right"||r=="down",l=a?n:i,c=a?i:n,d=c.parent;(function(A,E,P){of(A)||(of(E)&&P.remove(P.createRangeIn(E)),P.move(P.createRangeIn(A),P.createPositionAt(E,"end"))),P.remove(A)})(c,l,s);const u=this.isHorizontal?"colspan":"rowspan",g=parseInt(n.getAttribute(u)||"1"),f=parseInt(i.getAttribute(u)||"1");s.setAttribute(u,g+f,l),s.setSelection(s.createRangeIn(l));const b=this.editor.plugins.get("TableUtils");Da(d.findAncestor("table"),b)})}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),n=t.getTableCellsContainingSelection(e.selection)[0];if(!n)return;const i=this.isHorizontal?function(a,l,c){const d=a.parent,u=d.parent,g=l=="right"?a.nextSibling:a.previousSibling,f=(u.getAttribute("headingColumns")||0)>0;if(!g)return;const b=l=="right"?a:g,A=l=="right"?g:a,{column:E}=c.getCellLocation(b),{column:P}=c.getCellLocation(A),z=parseInt(b.getAttribute("colspan")||"1"),j=Ea(c,b),Y=Ea(c,A);if(!(f&&j!=Y))return E+z===P?g:void 0}(n,this.direction,t):function(a,l,c){const d=a.parent,u=d.parent,g=u.getChildIndex(d);if(l=="down"&&g===c.getRows(u)-1||l=="up"&&g===0)return null;const f=parseInt(a.getAttribute("rowspan")||"1"),b=u.getAttribute("headingRows")||0,A=l=="down"&&g+f===b,E=l=="up"&&g===b;if(b&&(A||E))return null;const P=parseInt(a.getAttribute("rowspan")||"1"),z=l=="down"?g+P:g,j=[...new ue(u,{endRow:z})],Y=j.find(he=>he.cell===a),ie=Y.column,Ee=j.find(({row:he,cellHeight:Mt,column:rt})=>rt===ie&&(l=="down"?he===z:z===he+Mt));return Ee&&Ee.cell?Ee.cell:null}(n,this.direction,t);if(!i)return;const r=this.isHorizontal?"rowspan":"colspan",s=parseInt(n.getAttribute(r)||"1");return parseInt(i.getAttribute(r)||"1")===s?i:void 0}}function of(o){const e=o.getChild(0);return o.childCount==1&&e.is("element","paragraph")&&e.isEmpty}class CS extends ne{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const i=n.findAncestor("table"),r=e.getRows(i)-1,s=e.getRowIndexes(t),a=s.first===0&&s.last===r;this.isEnabled=!a}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),i=t.getRowIndexes(n),r=n[0],s=r.findAncestor("table"),a=t.getCellLocation(r).column;e.change(l=>{const c=i.last-i.first+1;t.removeRows(s,{at:i.first,rows:c});const d=function(u,g,f,b){const A=u.getChild(Math.min(g,b-1));let E=A.getChild(0),P=0;for(const z of A.getChildren()){if(P>f)return E;E=z,P+=parseInt(z.getAttribute("colspan")||"1")}return E}(s,i.first,a,t.getRows(s));l.setSelection(l.createPositionAt(d,0))})}}class vS extends ne{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const i=n.findAncestor("table"),r=e.getColumns(i),{first:s,last:a}=e.getColumnIndexes(t);this.isEnabled=a-sl.cell===t).column,last:r.find(l=>l.cell===n).column},a=function(l,c,d,u){return parseInt(d.getAttribute("colspan")||"1")>1?d:c.previousSibling||d.nextSibling?d.nextSibling||c.previousSibling:u.first?l.reverse().find(({column:f})=>ff>u.last).cell}(r,t,n,s);this.editor.model.change(l=>{const c=s.last-s.first+1;e.removeColumns(i,{at:s.first,columns:c}),l.setSelection(l.createPositionAt(a,0))})}}class yS extends ne{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),i=n.length>0;this.isEnabled=i,this.value=i&&n.every(r=>this._isInHeading(r,r.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,i=t.getSelectionAffectedTableCells(n.document.selection),r=i[0].findAncestor("table"),{first:s,last:a}=t.getRowIndexes(i),l=this.value?s:a+1,c=r.getAttribute("headingRows")||0;n.change(d=>{if(l){const u=Jp(r,l,l>c?c:0);for(const{cell:g}of u)Yp(g,l,d)}Oe("headingRows",l,r,d,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||"0");return!!n&&e.parent.index0;this.isEnabled=i,this.value=i&&n.every(r=>Ea(t,r))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,i=t.getSelectionAffectedTableCells(n.document.selection),r=i[0].findAncestor("table"),{first:s,last:a}=t.getColumnIndexes(i),l=this.value?s:a+1;n.change(c=>{if(l){const d=Qp(r,l);for(const{cell:u,column:g}of d)Xp(u,g,l,c)}Oe("headingColumns",l,r,c,0)})}}class qe extends q{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,i=n.getChildIndex(t),r=new ue(n,{row:i});for(const{cell:s,row:a,column:l}of r)if(s===e)return{row:a,column:l}}createTable(e,t){const n=e.createElement("table"),i=t.rows||2,r=t.columns||2;return Ba(e,n,0,i,r),t.headingRows&&Oe("headingRows",Math.min(t.headingRows,i),n,e,0),t.headingColumns&&Oe("headingColumns",Math.min(t.headingColumns,r),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,i=t.at||0,r=t.rows||1,s=t.copyStructureFromAbove!==void 0,a=t.copyStructureFromAbove?i-1:i,l=this.getRows(e),c=this.getColumns(e);if(i>l)throw new I("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change(d=>{const u=e.getAttribute("headingRows")||0;if(u>i&&Oe("headingRows",u+r,e,d,0),!s&&(i===0||i===l))return void Ba(d,e,i,r,c);const g=s?Math.max(i,a):i,f=new ue(e,{endRow:g}),b=new Array(c).fill(1);for(const{row:A,column:E,cellHeight:P,cellWidth:z,cell:j}of f){const Y=A+P-1,ie=A<=a&&a<=Y;A0&&kn(d,j,z>1?{colspan:z}:void 0),P+=Math.abs(z)-1}}})}insertColumns(e,t={}){const n=this.editor.model,i=t.at||0,r=t.columns||1;n.change(s=>{const a=e.getAttribute("headingColumns");ir-1)throw new I("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});n.change(l=>{const c={first:s,last:a},{cellsToMove:d,cellsToTrim:u}=function(g,{first:f,last:b}){const A=new Map,E=[];for(const{row:P,column:z,cellHeight:j,cell:Y}of new ue(g,{endRow:b})){const ie=P+j-1;if(P>=f&&P<=b&&ie>b){const Ee=j-(b-P+1);A.set(z,{cell:Y,rowspan:Ee})}if(P=f){let Ee;Ee=ie>=b?b-f+1:ie-f+1,E.push({cell:Y,rowspan:j-Ee})}}return{cellsToMove:A,cellsToTrim:E}}(e,c);d.size&&function(g,f,b,A){const E=new ue(g,{includeAllSlots:!0,row:f}),P=[...E],z=g.getChild(f);let j;for(const{column:Y,cell:ie,isAnchor:Ee}of P)if(b.has(Y)){const{cell:he,rowspan:Mt}=b.get(Y),rt=j?A.createPositionAfter(j):A.createPositionAt(z,0);A.move(A.createRangeOn(he),rt),Oe("rowspan",Mt,he,A),j=he}else Ee&&(j=ie)}(e,a+1,d,l);for(let g=a;g>=s;g--)l.remove(e.getChild(g));for(const{rowspan:g,cell:f}of u)Oe("rowspan",g,f,l);(function(g,{first:f,last:b},A){const E=g.getAttribute("headingRows")||0;f{(function(l,c,d){const u=l.getAttribute("headingColumns")||0;if(u&&c.first=i;l--)for(const{cell:c,column:d,cellWidth:u}of[...new ue(e)])d<=l&&u>1&&d+u>l?Oe("colspan",u-1,c,a):d===l&&a.remove(c);Sa(e,this)||xa(e,this)})}splitCellVertically(e,t=2){const n=this.editor.model,i=e.parent.parent,r=parseInt(e.getAttribute("rowspan")||"1"),s=parseInt(e.getAttribute("colspan")||"1");n.change(a=>{if(s>1){const{newCellsSpan:l,updatedSpan:c}=rf(s,t);Oe("colspan",c,e,a);const d={};l>1&&(d.colspan=l),r>1&&(d.rowspan=r),Qn(s>t?t-1:s-1,a,a.createPositionAfter(e),d)}if(sb===e),u=c.filter(({cell:b,cellWidth:A,column:E})=>b!==e&&E===d||Ed);for(const{cell:b,cellWidth:A}of u)a.setAttribute("colspan",A+l,b);const g={};r>1&&(g.rowspan=r),Qn(l,a,a.createPositionAfter(e),g);const f=i.getAttribute("headingColumns")||0;f>d&&Oe("headingColumns",f+l,i,a)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,i=e.parent,r=i.parent,s=r.getChildIndex(i),a=parseInt(e.getAttribute("rowspan")||"1"),l=parseInt(e.getAttribute("colspan")||"1");n.change(c=>{if(a>1){const d=[...new ue(r,{startRow:s,endRow:s+a-1,includeAllSlots:!0})],{newCellsSpan:u,updatedSpan:g}=rf(a,t);Oe("rowspan",g,e,c);const{column:f}=d.find(({cell:A})=>A===e),b={};u>1&&(b.rowspan=u),l>1&&(b.colspan=l);for(const A of d){const{column:E,row:P}=A;P>=s+g&&E===f&&(P+s+g)%u==0&&Qn(1,c,A.getPositionBefore(),b)}}if(as){const P=A+d;c.setAttribute("rowspan",P,b)}const g={};l>1&&(g.colspan=l),Ba(c,r,s+1,d,1,g);const f=r.getAttribute("headingRows")||0;f>s&&Oe("headingRows",f+d,r,c)}})}getColumns(e){return[...e.getChild(0).getChildren()].reduce((t,n)=>t+parseInt(n.getAttribute("colspan")||"1"),0)}getRows(e){return Array.from(e.getChildren()).reduce((t,n)=>n.is("element","tableRow")?t+1:t,0)}createTableWalker(e,t={}){return new ue(e,t)}getSelectedTableCells(e){const t=[];for(const n of this.sortRanges(e.getRanges())){const i=n.getContainedElement();i&&i.is("element","tableCell")&&t.push(i)}return t}getTableCellsContainingSelection(e){const t=[];for(const n of e.getRanges()){const i=n.start.findAncestor("tableCell");i&&t.push(i)}return t}getSelectionAffectedTableCells(e){const t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){const t=e.map(n=>n.parent.index);return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),n=[...new ue(t)].filter(i=>e.includes(i.cell)).map(i=>i.column);return this._getFirstLastIndexesObject(n)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,n=new Set;let i=0;for(const s of e){const{row:a,column:l}=this.getCellLocation(s),c=parseInt(s.getAttribute("rowspan"))||1,d=parseInt(s.getAttribute("colspan"))||1;t.add(a),n.add(l),c>1&&t.add(a+c-1),d>1&&n.add(l+d-1),i+=c*d}return function(s,a){const l=Array.from(s.values()),c=Array.from(a.values()),d=Math.max(...l),u=Math.min(...l),g=Math.max(...c),f=Math.min(...c);return(d-u+1)*(g-f+1)}(t,n)==i}sortRanges(e){return Array.from(e).sort(xS)}_getFirstLastIndexesObject(e){const t=e.sort((n,i)=>n-i);return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),n=this.getRowIndexes(e),i=parseInt(t.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(n,i))return!1;const r=this.getColumnIndexes(e),s=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(r,s)}_areIndexesInSameSection({first:e,last:t},n){return e{const i=t.getSelectedTableCells(e.document.selection),r=i.shift(),{mergeWidth:s,mergeHeight:a}=function(l,c,d){let u=0,g=0;for(const P of c){const{row:z,column:j}=d.getCellLocation(P);u=af(P,j,u,"colspan"),g=af(P,z,g,"rowspan")}const{row:f,column:b}=d.getCellLocation(l),A=u-b,E=g-f;return{mergeWidth:A,mergeHeight:E}}(r,i,t);Oe("colspan",s,r,n),Oe("rowspan",a,r,n);for(const l of i)DS(l,r,n);Da(r.findAncestor("table"),t),n.setSelection(r,"in")})}}function DS(o,e,t){sf(o)||(sf(e)&&t.remove(t.createRangeIn(e)),t.move(t.createRangeIn(o),t.createPositionAt(e,"end"))),t.remove(o)}function sf(o){const e=o.getChild(0);return o.childCount==1&&e.is("element","paragraph")&&e.isEmpty}function af(o,e,t,n){const i=parseInt(o.getAttribute(n)||"1");return Math.max(t,e+i)}class BS extends ne{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),i=t.getRowIndexes(n),r=n[0].findAncestor("table"),s=[];for(let a=i.first;a<=i.last;a++)for(const l of r.getChild(a).getChildren())s.push(e.createRangeOn(l));e.change(a=>{a.setSelection(s)})}}class TS extends ne{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),i=n[0],r=n.pop(),s=i.findAncestor("table"),a=e.getCellLocation(i),l=e.getCellLocation(r),c=Math.min(a.column,l.column),d=Math.max(a.column,l.column),u=[];for(const g of new ue(s,{startColumn:c,endColumn:d}))u.push(t.createRangeOn(g.cell));t.change(g=>{g.setSelection(u)})}}function IS(o){o.document.registerPostFixer(e=>function(t,n){const i=n.document.differ.getChanges();let r=!1;const s=new Set;for(const a of i){let l=null;a.type=="insert"&&a.name=="table"&&(l=a.position.nodeAfter),a.type!="insert"&&a.type!="remove"||a.name!="tableRow"&&a.name!="tableCell"||(l=a.position.findAncestor("table")),OS(a)&&(l=a.range.start.findAncestor("table")),l&&!s.has(l)&&(r=PS(l,t)||r,r=RS(l,t)||r,s.add(l))}return r}(e,o))}function PS(o,e){let t=!1;const n=function(i){const r=parseInt(i.getAttribute("headingRows")||"0"),s=Array.from(i.getChildren()).reduce((l,c)=>c.is("element","tableRow")?l+1:l,0),a=[];for(const{row:l,cell:c,cellHeight:d}of new ue(i)){if(d<2)continue;const u=lu){const g=u-l;a.push({cell:c,rowspan:g})}}return a}(o);if(n.length){t=!0;for(const i of n)Oe("rowspan",i.rowspan,i.cell,e,1)}return t}function RS(o,e){let t=!1;const n=function(a){const l=new Array(a.childCount).fill(0);for(const{rowIndex:c}of new ue(a,{includeAllSlots:!0}))l[c]++;return l}(o),i=[];for(const[a,l]of n.entries())!l&&o.getChild(a).is("element","tableRow")&&i.push(a);if(i.length){t=!0;for(const a of i.reverse())e.remove(o.getChild(a)),n.splice(a,1)}const r=n.filter((a,l)=>o.getChild(l).is("element","tableRow")),s=r[0];if(!r.every(a=>a===s)){const a=r.reduce((l,c)=>c>l?c:l,0);for(const[l,c]of r.entries()){const d=a-c;if(d){for(let u=0;ufunction(t,n){const i=n.document.differ.getChanges();let r=!1;for(const s of i)s.type=="insert"&&s.name=="table"&&(r=zS(s.position.nodeAfter,t)||r),s.type=="insert"&&s.name=="tableRow"&&(r=lf(s.position.nodeAfter,t)||r),s.type=="insert"&&s.name=="tableCell"&&(r=Ta(s.position.nodeAfter,t)||r),s.type!="remove"&&s.type!="insert"||!MS(s)||(r=Ta(s.position.parent,t)||r);return r}(e,o))}function zS(o,e){let t=!1;for(const n of o.getChildren())n.is("element","tableRow")&&(t=lf(n,e)||t);return t}function lf(o,e){let t=!1;for(const n of o.getChildren())t=Ta(n,e)||t;return t}function Ta(o,e){if(o.childCount==0)return e.insertElement("paragraph",o),!0;const t=Array.from(o.getChildren()).filter(n=>n.is("$text"));for(const n of t)e.wrap(e.createRangeOn(n),"paragraph");return!!t.length}function MS(o){return!!o.position.parent.is("element","tableCell")&&(o.type=="insert"&&o.name=="$text"||o.type=="remove")}function FS(o,e){if(!o.is("element","paragraph"))return!1;const t=e.toViewElement(o);return!!t&&Up(o)!==t.is("element","span")}var cf=D(3881),VS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(cf.Z,VS),cf.Z.locals;class LS extends q{constructor(e){super(e),this._additionalSlots=[]}static get pluginName(){return"TableEditing"}static get requires(){return[qe]}init(){const e=this.editor,t=e.model,n=t.schema,i=e.conversion,r=e.plugins.get(qe);n.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),i.for("upcast").add(s=>{s.on("element:figure",(a,l,c)=>{if(!c.consumable.test(l.viewItem,{name:!0,classes:"table"}))return;const d=function(g){for(const f of g.getChildren())if(f.is("element","table"))return f}(l.viewItem);if(!d||!c.consumable.test(d,{name:!0}))return;c.consumable.consume(l.viewItem,{name:!0,classes:"table"});const u=ze(c.convertItem(d,l.modelCursor).modelRange.getItems());u?(c.convertChildren(l.viewItem,c.writer.createPositionAt(u,"end")),c.updateConversionResult(u,l)):c.consumable.revert(l.viewItem,{name:!0,classes:"table"})})}),i.for("upcast").add(bS()),i.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:$p(r,{asWidget:!0,additionalSlots:this._additionalSlots})}),i.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:$p(r,{additionalSlots:this._additionalSlots})}),i.for("upcast").elementToElement({model:"tableRow",view:"tr"}),i.for("upcast").add(s=>{s.on("element:tr",(a,l)=>{l.viewItem.isEmpty&&l.modelCursor.index==0&&a.stop()},{priority:"high"})}),i.for("downcast").elementToElement({model:"tableRow",view:(s,{writer:a})=>s.isEmpty?a.createEmptyElement("tr"):a.createContainerElement("tr")}),i.for("upcast").elementToElement({model:"tableCell",view:"td"}),i.for("upcast").elementToElement({model:"tableCell",view:"th"}),i.for("upcast").add(jp("td")),i.for("upcast").add(jp("th")),i.for("editingDowncast").elementToElement({model:"tableCell",view:Hp({asWidget:!0})}),i.for("dataDowncast").elementToElement({model:"tableCell",view:Hp()}),i.for("editingDowncast").elementToElement({model:"paragraph",view:qp({asWidget:!0}),converterPriority:"high"}),i.for("dataDowncast").elementToElement({model:"paragraph",view:qp(),converterPriority:"high"}),i.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),i.for("upcast").attributeToAttribute({model:{key:"colspan",value:df("colspan")},view:"colspan"}),i.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),i.for("upcast").attributeToAttribute({model:{key:"rowspan",value:df("rowspan")},view:"rowspan"}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new _S(e)),e.commands.add("insertTableRowAbove",new Wp(e,{order:"above"})),e.commands.add("insertTableRowBelow",new Wp(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Kp(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Kp(e,{order:"right"})),e.commands.add("removeTableRow",new CS(e)),e.commands.add("removeTableColumn",new vS(e)),e.commands.add("splitTableCellVertically",new Gp(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new Gp(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new SS(e)),e.commands.add("mergeTableCellRight",new Ji(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Ji(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Ji(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Ji(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new ES(e)),e.commands.add("setTableRowHeader",new yS(e)),e.commands.add("selectTableRow",new BS(e)),e.commands.add("selectTableColumn",new TS(e)),IS(t),NS(t),this.listenTo(t.document,"change:data",()=>{(function(s,a){const l=s.document.differ;for(const c of l.getChanges()){let d,u=!1;if(c.type=="attribute"){const A=c.range.start.nodeAfter;if(!A||!A.is("element","table")||c.attributeKey!="headingRows"&&c.attributeKey!="headingColumns")continue;d=A,u=c.attributeKey=="headingRows"}else c.name!="tableRow"&&c.name!="tableCell"||(d=c.position.findAncestor("table"),u=c.name=="tableRow");if(!d)continue;const g=d.getAttribute("headingRows")||0,f=d.getAttribute("headingColumns")||0,b=new ue(d);for(const A of b){const E=A.rowFS(g,a.mapper));for(const g of u)a.reconvertItem(g)}}(t,e.editing)})}registerAdditionalSlot(e){this._additionalSlots.push(e)}}function df(o){return e=>{const t=parseInt(e.getAttribute(o));return Number.isNaN(t)||t<=0?null:t}}var hf=D(1613),jS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(hf.Z,jS),hf.Z.locals;class $S extends re{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new St,this.focusTracker=new ht,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(n,i)=>`${i} × ${n}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to(n=>{n.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(n,i)=>{const{row:r,column:s}=i.target.dataset;this.items.get(10*(parseInt(r,10)-1)+(parseInt(s,10)-1)).focus()}),this.focusTracker.on("change:focusedElement",(n,i,r)=>{if(!r)return;const{row:s,column:a}=r.dataset;this.set({rows:parseInt(s),columns:parseInt(a)})}),this.on("change:columns",()=>this._highlightGridBoxes()),this.on("change:rows",()=>this._highlightGridBoxes())}render(){super.render(),function({keystrokeHandler:e,focusTracker:t,gridItems:n,numberOfColumns:i,uiLanguageDirection:r}){const s=typeof i=="number"?()=>i:i;function a(d){return u=>{const g=n.find(A=>A.element===t.focusedElement),f=n.getIndex(g),b=d(f,n);n.get(b).focus(),u.stopPropagation(),u.preventDefault()}}function l(d,u){return d===u-1?0:d+1}function c(d,u){return d===0?u-1:d-1}e.set("arrowright",a((d,u)=>r==="rtl"?c(d,u.length):l(d,u.length))),e.set("arrowleft",a((d,u)=>r==="rtl"?l(d,u.length):c(d,u.length))),e.set("arrowup",a((d,u)=>{let g=d-s();return g<0&&(g=d+s()*Math.floor(u.length/s()),g>u.length-1&&(g-=s())),g})),e.set("arrowdown",a((d,u)=>{let g=d+s();return g>u.length-1&&(g=d%s()),g}))}({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,i)=>{const r=Math.floor(i/10){const r=e.commands.get("insertTable"),s=Pt(i);let a;return s.bind("isEnabled").to(r),s.buttonView.set({icon:'',label:t("Insert table"),tooltip:!0}),s.on("change:isOpen",()=>{a||(a=new $S(i),s.panelView.children.add(a),a.delegate("execute").to(s),s.on("execute",()=>{e.execute("insertTable",{rows:a.rows,columns:a.columns}),e.editing.view.focus()}))}),s}),e.ui.componentFactory.add("tableColumn",i=>{const r=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'',r,i)}),e.ui.componentFactory.add("tableRow",i=>{const r=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'',r,i)}),e.ui.componentFactory.add("mergeTableCells",i=>{const r=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'',r,i)})}_prepareDropdown(e,t,n,i){const r=this.editor,s=Pt(i),a=this._fillDropdownWithListOptions(s,n);return s.buttonView.set({label:e,icon:t,tooltip:!0}),s.bind("isEnabled").toMany(a,"isEnabled",(...l)=>l.some(c=>c)),this.listenTo(s,"execute",l=>{r.execute(l.source.commandName),l.source instanceof hi||r.editing.view.focus()}),s}_prepareMergeSplitButtonDropdown(e,t,n,i){const r=this.editor,s=Pt(i,Fs),a="mergeTableCells",l=r.commands.get(a),c=this._fillDropdownWithListOptions(s,n);return s.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),s.bind("isEnabled").toMany([l,...c],"isEnabled",(...d)=>d.some(u=>u)),this.listenTo(s.buttonView,"execute",()=>{r.execute(a),r.editing.view.focus()}),this.listenTo(s,"execute",d=>{r.execute(d.source.commandName),r.editing.view.focus()}),s}_fillDropdownWithListOptions(e,t){const n=this.editor,i=[],r=new at;for(const s of t)qS(s,n,i,r);return Vs(e,r),i}}function qS(o,e,t,n){if(o.type==="button"||o.type==="switchbutton"){const i=o.model=new Ys(o.model),{commandName:r,bindIsOn:s}=o.model,a=e.commands.get(r);t.push(a),i.set({commandName:r}),i.bind("isEnabled").to(a),s&&i.bind("isOn").to(a,"value"),i.set({withText:!0})}n.add(o)}var uf=D(6945),US={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(uf.Z,US),uf.Z.locals;class bn extends q{static get pluginName(){return"TableSelection"}static get requires(){return[qe,qe]}init(){const e=this.editor,t=e.model,n=e.editing.view;this.listenTo(t,"deleteContent",(i,r)=>this._handleDeleteContent(i,r),{priority:"high"}),this.listenTo(n.document,"insertText",(i,r)=>this._handleInsertTextEvent(i,r),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(qe),t=this.editor.model.document.selection,n=e.getSelectedTableCells(t);return n.length==0?null:n}getSelectionAsFragment(){const e=this.editor.plugins.get(qe),t=this.getSelectedTableCells();return t?this.editor.model.change(n=>{const i=n.createDocumentFragment(),{first:r,last:s}=e.getColumnIndexes(t),{first:a,last:l}=e.getRowIndexes(t),c=t[0].findAncestor("table");let d=l,u=s;if(e.isSelectionRectangular(t)){const f={firstColumn:r,lastColumn:s,firstRow:a,lastRow:l};d=tf(c,f),u=nf(c,f)}const g=Zp(c,{startRow:a,startColumn:r,endRow:d,endColumn:u},n);return n.insert(g,i,0),i}):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change(i=>{i.setSelection(n.cells.map(r=>i.createRangeOn(r)),{backward:n.backward})})}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=ze(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(n=>n.on("selection",(i,r,s)=>{const a=s.writer;(function(d){for(const u of t)d.removeClass("ck-editor__editable_selected",u);t.clear()})(a);const l=this.getSelectedTableCells();if(!l)return;for(const d of l){const u=s.mapper.toViewElement(d);a.addClass("ck-editor__editable_selected",u),t.add(u)}const c=s.mapper.toViewElement(l[l.length-1]);a.setSelection(c,0)},{priority:"lowest"}))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change(n=>{const i=n.createPositionAt(t[0],0),r=e.model.schema.getNearestSelectionRange(i);n.setSelection(r)})}})}_handleDeleteContent(e,t){const n=this.editor.plugins.get(qe),i=t[0],r=t[1],s=this.editor.model,a=!r||r.direction=="backward",l=n.getSelectedTableCells(i);l.length&&(e.stop(),s.change(c=>{const d=l[a?l.length-1:0];s.change(g=>{for(const f of l)s.deleteContent(g.createSelection(f,"in"))});const u=s.schema.getNearestSelectionRange(c.createPositionAt(d,0));i.is("documentSelection")?c.setSelection(u):i.setTo(u)}))}_handleInsertTextEvent(e,t){const n=this.editor,i=this.getSelectedTableCells();if(!i)return;const r=n.editing.view,s=n.editing.mapper,a=i.map(l=>r.createRangeOn(s.toViewElement(l)));t.selection=r.createSelection(a)}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),i=n.getCellLocation(e),r=n.getCellLocation(t),s=Math.min(i.row,r.row),a=Math.max(i.row,r.row),l=Math.min(i.column,r.column),c=Math.max(i.column,r.column),d=new Array(a-s+1).fill(null).map(()=>[]),u={startRow:s,endRow:a,startColumn:l,endColumn:c};for(const{row:b,cell:A}of new ue(e.findAncestor("table"),u))d[b-s].push(A);const g=r.rowb.reverse()),{cells:d.flat(),backward:g||f}}}class WS extends q{static get pluginName(){return"TableClipboard"}static get requires(){return[bn,qe]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(n,i)=>this._onCopyCut(n,i)),this.listenTo(t,"cut",(n,i)=>this._onCopyCut(n,i)),this.listenTo(e.model,"insertContent",(n,[i,r])=>this._onInsertContent(n,i,r),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(bn);if(!n.getSelectedTableCells()||e.name=="cut"&&!this.editor.model.canEditAt(this.editor.model.document.selection))return;t.preventDefault(),e.stop();const i=this.editor.data,r=this.editor.editing.view.document,s=i.toView(n.getSelectionAsFragment());r.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:s,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const i=this.editor.model,r=this.editor.plugins.get(qe);let s=this.getTableIfOnlyTableInContent(t,i);if(!s)return;const a=r.getSelectionAffectedTableCells(i.document.selection);a.length?(e.stop(),i.change(l=>{const c={width:r.getColumns(s),height:r.getRows(s)},d=function(E,P,z,j){const Y=E[0].findAncestor("table"),ie=j.getColumnIndexes(E),Ee=j.getRowIndexes(E),he={firstColumn:ie.first,lastColumn:ie.last,firstRow:Ee.first,lastRow:Ee.last},Mt=E.length===1;return Mt&&(he.lastRow+=P.height-1,he.lastColumn+=P.width-1,function(rt,nr,Cn,Zt){const no=Zt.getColumns(rt),oo=Zt.getRows(rt);Cn>no&&Zt.insertColumns(rt,{at:no,columns:Cn-no}),nr>oo&&Zt.insertRows(rt,{at:oo,rows:nr-oo})}(Y,he.lastRow+1,he.lastColumn+1,j)),Mt||!j.isSelectionRectangular(E)?function(rt,nr,Cn){const{firstRow:Zt,lastRow:no,firstColumn:oo,lastColumn:Kf}=nr,Gf={first:Zt,last:no},Zf={first:oo,last:Kf};Pa(rt,oo,Gf,Cn),Pa(rt,Kf+1,Gf,Cn),Ia(rt,Zt,Zf,Cn),Ia(rt,no+1,Zf,Cn,Zt)}(Y,he,z):(he.lastRow=tf(Y,he),he.lastColumn=nf(Y,he)),he}(a,c,l,r),u=d.lastRow-d.firstRow+1,g=d.lastColumn-d.firstColumn+1,f={startRow:0,startColumn:0,endRow:Math.min(u,c.height)-1,endColumn:Math.min(g,c.width)-1};s=Zp(s,f,l);const b=a[0].findAncestor("table"),A=this._replaceSelectedCellsWithPasted(s,c,b,d,l);if(this.editor.plugins.get("TableSelection").isEnabled){const E=r.sortRanges(A.map(P=>l.createRangeOn(P)));l.setSelection(E)}else l.setSelection(A[0],0)})):Da(s,r)}_replaceSelectedCellsWithPasted(e,t,n,i,r){const{width:s,height:a}=t,l=function(E,P,z){const j=new Array(z).fill(null).map(()=>new Array(P).fill(null));for(const{column:Y,row:ie,cell:Ee}of new ue(E))j[ie][Y]=Ee;return j}(e,s,a),c=[...new ue(n,{startRow:i.firstRow,endRow:i.lastRow,startColumn:i.firstColumn,endColumn:i.lastColumn,includeAllSlots:!0})],d=[];let u;for(const E of c){const{row:P,column:z}=E;z===i.firstColumn&&(u=E.getPositionBefore());const j=P-i.firstRow,Y=z-i.firstColumn,ie=l[j%a][Y%s],Ee=ie?r.cloneElement(ie):null,he=this._replaceTableSlotCell(E,Ee,u,r);he&&(ef(he,P,z,i.lastRow,i.lastColumn,r),d.push(he),u=r.createPositionAfter(he))}const g=parseInt(n.getAttribute("headingRows")||"0"),f=parseInt(n.getAttribute("headingColumns")||"0"),b=i.firstRowmf(r,s,t)).map(({cell:r})=>Yp(r,e,n))}function Pa(o,e,t,n){if(!(e<1))return Qp(o,e).filter(({row:i,cellHeight:r})=>mf(i,r,t)).map(({cell:i,column:r})=>Xp(i,r,e,n))}function mf(o,e,t){const n=o+e-1,{first:i,last:r}=t;return o>=i&&o<=r||o=i}class KS extends q{static get pluginName(){return"TableKeyboard"}static get requires(){return[bn,qe]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"arrowKey",(...t)=>this._onArrowKey(...t),{context:"table"}),this.listenTo(e,"tab",(...t)=>this._handleTabOnSelectedTable(...t),{context:"figure"}),this.listenTo(e,"tab",(...t)=>this._handleTab(...t),{context:["th","td"]})}_handleTabOnSelectedTable(e,t){const n=this.editor,i=n.model.document.selection.getSelectedElement();i&&i.is("element","table")&&(t.preventDefault(),t.stopPropagation(),e.stop(),n.model.change(r=>{r.setSelection(r.createRangeIn(i.getChild(0).getChild(0)))}))}_handleTab(e,t){const n=this.editor,i=this.editor.plugins.get(qe),r=this.editor.plugins.get("TableSelection"),s=n.model.document.selection,a=!t.shiftKey;let l=i.getTableCellsContainingSelection(s)[0];if(l||(l=r.getFocusCell()),!l)return;t.preventDefault(),t.stopPropagation(),e.stop();const c=l.parent,d=c.parent,u=d.getChildIndex(c),g=c.getChildIndex(l),f=g===0;if(!a&&f&&u===0)return void n.model.change(P=>{P.setSelection(P.createRangeOn(d))});const b=g===c.childCount-1,A=u===i.getRows(d)-1;if(a&&A&&b&&(n.execute("insertTableRowBelow"),u===i.getRows(d)-1))return void n.model.change(P=>{P.setSelection(P.createRangeOn(d))});let E;if(a&&b)E=d.getChild(u+1).getChild(0);else if(!a&&f){const P=d.getChild(u-1);E=P.getChild(P.childCount-1)}else E=c.getChild(g+(a?1:-1));n.model.change(P=>{P.setSelection(P.createRangeIn(E))})}_onArrowKey(e,t){const n=this.editor,i=qr(t.keyCode,n.locale.contentLanguageDirection);this._handleArrowKeys(i,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.plugins.get(qe),i=this.editor.plugins.get("TableSelection"),r=this.editor.model,s=r.document.selection,a=["right","down"].includes(e),l=n.getSelectedTableCells(s);if(l.length){let d;return d=t?i.getFocusCell():a?l[l.length-1]:l[0],this._navigateFromCellInDirection(d,e,t),!0}const c=s.focus.findAncestor("tableCell");if(!c)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==a&&!s.containsEntireContent(c))return!1}else{const d=s.getSelectedElement();if(!d||!r.schema.isObject(d))return!1}return!!this._isSelectionAtCellEdge(s,c,a)&&(this._navigateFromCellInDirection(c,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const i=this.editor.model,r=this.editor.model.schema,s=n?e.getLastPosition():e.getFirstPosition();if(!r.getLimitElement(s).is("element","tableCell"))return i.createPositionAt(t,n?"end":0).isTouching(s);const a=i.createSelection(s);return i.modifySelection(a,{direction:n?"forward":"backward"}),s.isEqual(a.focus)}_navigateFromCellInDirection(e,t,n=!1){const i=this.editor.model,r=e.findAncestor("table"),s=[...new ue(r,{includeAllSlots:!0})],{row:a,column:l}=s[s.length-1],c=s.find(({cell:A})=>A==e);let{row:d,column:u}=c;switch(t){case"left":u--;break;case"up":d--;break;case"right":u+=c.cellWidth;break;case"down":d+=c.cellHeight}if(d<0||d>a||u<0&&d<=0||u>l&&d>=a)return void i.change(A=>{A.setSelection(A.createRangeOn(r))});u<0?(u=n?0:l,d--):u>l&&(u=n?l:0,d++);const g=s.find(A=>A.row==d&&A.column==u).cell,f=["right","down"].includes(t),b=this.editor.plugins.get("TableSelection");if(n&&b.isEnabled){const A=b.getAnchorCell()||e;b.setCellSelection(A,g)}else{const A=i.createPositionAt(g,f?0:"end");i.change(E=>{E.setSelection(A)})}}}class GS extends Ht{constructor(){super(...arguments),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class ZS extends q{static get pluginName(){return"TableMouse"}static get requires(){return[bn,qe]}init(){this.editor.editing.view.addObserver(GS),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(qe);let n=!1;const i=e.plugins.get(bn);this.listenTo(e.editing.view.document,"mousedown",(r,s)=>{const a=e.model.document.selection;if(!this.isEnabled||!i.isEnabled||!s.domEvent.shiftKey)return;const l=i.getAnchorCell()||t.getTableCellsContainingSelection(a)[0];if(!l)return;const c=this._getModelTableCellFromDomEvent(s);c&&gf(l,c)&&(n=!0,i.setCellSelection(l,c),s.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{n=!1}),this.listenTo(e.editing.view.document,"selectionChange",r=>{n&&r.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,i=!1,r=!1;const s=e.plugins.get(bn);this.listenTo(e.editing.view.document,"mousedown",(a,l)=>{this.isEnabled&&s.isEnabled&&(l.domEvent.shiftKey||l.domEvent.ctrlKey||l.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(l)))}),this.listenTo(e.editing.view.document,"mousemove",(a,l)=>{if(!l.domEvent.buttons||!t)return;const c=this._getModelTableCellFromDomEvent(l);c&&gf(t,c)&&(n=c,i||n==t||(i=!0)),i&&(r=!0,s.setCellSelection(t,n),l.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1,r=!1,t=null,n=null}),this.listenTo(e.editing.view.document,"selectionChange",a=>{r&&a.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,n=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}function gf(o,e){return o.parent.parent==e.parent.parent}var pf=D(6306),JS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(pf.Z,JS),pf.Z.locals;function YS(o){const e=o.getSelectedElement();return e&&ff(e)?e:null}function QS(o){const e=o.getFirstPosition();if(!e)return null;let t=e.parent;for(;t;){if(t.is("element")&&ff(t))return t;t=t.parent}return null}function ff(o){return!!o.getCustomProperty("table")&&Be(o)}var kf=D(7368),XS={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(kf.Z,XS),kf.Z.locals;var bf=D(9247),eD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(bf.Z,eD),bf.Z.locals;var wf=D(4070),tD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(wf.Z,tD),wf.Z.locals;var Af=D(6237),nD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Af.Z,nD),Af.Z.locals;var _f=D(5087),oD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(_f.Z,oD),_f.Z.locals;const wn=Qe.defaultPositions;wn.northArrowSouth,wn.northArrowSouthWest,wn.northArrowSouthEast,wn.southArrowNorth,wn.southArrowNorthWest,wn.southArrowNorthEast,wn.viewportStickyNorth;var Cf=D(7341),iD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Cf.Z,iD),Cf.Z.locals;var vf=D(2128),rD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(vf.Z,rD),vf.Z.locals;var yf=D(4101),sD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(yf.Z,sD),yf.Z.locals;var aD=Object.defineProperty,Ef=Object.getOwnPropertySymbols,lD=Object.prototype.hasOwnProperty,cD=Object.prototype.propertyIsEnumerable,xf=(o,e,t)=>e in o?aD(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Sf=(o,e)=>{for(var t in e||(e={}))lD.call(e,t)&&xf(o,t,e[t]);if(Ef)for(var t of Ef(e))cD.call(e,t)&&xf(o,t,e[t]);return o};const dD={autoRefresh:!0},Df=36e5;class Ra extends ge(){constructor(e,t={}){if(super(),!e)throw new I("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh=typeof e=="function"?e:()=>{return n=e,new Promise((i,r)=>{const s=new XMLHttpRequest;s.open("GET",n),s.addEventListener("load",()=>{const a=s.status,l=s.response;return a<200||a>299?r(new I("token-cannot-download-new-token",null)):i(l)}),s.addEventListener("error",()=>r(new Error("Network Error"))),s.addEventListener("abort",()=>r(new Error("Abort"))),s.send()});var n},this._options=Sf(Sf({},dD),t)}init(){return new Promise((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)})}refreshToken(){return this._refresh().then(e=>(this._validateTokenValue(e),this.set("value",e),this._options.autoRefresh&&this._registerRefreshTokenTimeout(),this))}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t=typeof e=="string",n=!/^".*"$/.test(e),i=t&&e.split(".").length===3;if(!n||!i)throw new I("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(){const e=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout),this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},e)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?Math.floor((1e3*t-Date.now())/2):Df}catch{return Df}}static create(e,t={}){return new Ra(e,t).init()}}const Oa=/^data:(\S*?);base64,/;class hD extends me(){constructor(e,t,n){if(super(),!e)throw new I("fileuploader-missing-file",null);if(!t)throw new I("fileuploader-missing-token",null);if(!n)throw new I("fileuploader-missing-api-address",null);this.file=function(i){if(typeof i!="string")return!1;const r=i.match(Oa);return!(!r||!r.length)}(e)?function(i,r=512){try{const s=i.match(Oa)[1],a=atob(i.replace(Oa,"")),l=[];for(let c=0;ce(n)),this}onError(e){return this.once("error",(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this.xhr,t=n=>()=>this.fire("error",n);e.addEventListener("error",t("Network Error")),e.addEventListener("abort",t("Abort")),e.upload&&e.upload.addEventListener("progress",n=>{n.lengthComputable&&this.fire("progress",{total:n.total,uploaded:n.loaded})}),e.addEventListener("load",()=>{const n=e.status,i=e.response;if(n<200||n>299)return this.fire("error",i.message||i.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((n,i)=>{t.addEventListener("load",()=>{const r=t.status,s=t.response;return r<200||r>299?s.message?i(new I("fileuploader-uploading-data-failed",this,{message:s.message})):i(s.error):n(s)}),t.addEventListener("error",()=>i(new Error("Network Error"))),t.addEventListener("abort",()=>i(new Error("Abort"))),t.send(e)})}}class uD{constructor(e,t){if(!e)throw new I("uploadgateway-missing-token",null);if(!t)throw new I("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new hD(e,this._token,this._apiAddress)}}class mD extends ui{static get pluginName(){return"CloudServicesCore"}createToken(e,t){return new Ra(e,t)}createUploadGateway(e,t){return new uD(e,t)}}var Bf=(o,e,t)=>new Promise((n,i)=>{var r=l=>{try{a(t.next(l))}catch(c){i(c)}},s=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,s);a((t=t.apply(o,e)).next())});const Na=["left","right","center","justify"];function Tf(o){return Na.includes(o)}function If(o,e){return e.contentLanguageDirection=="rtl"?o==="right":o==="left"}function Pf(o){const e=o.map(n=>{let i;return i=typeof n=="string"?{name:n}:n,i}).filter(n=>{const i=Na.includes(n.name);return i||Q("alignment-config-name-not-recognized",{option:n}),i}),t=e.filter(n=>!!n.className).length;if(t&&t{const s=r.slice(i+1);if(s.some(a=>a.name==n.name))throw new I("alignment-config-name-already-defined",{option:n,configuredOptions:o});if(n.className&&s.some(a=>a.className==n.className))throw new I("alignment-config-classname-already-defined",{option:n,configuredOptions:o})}),e}const za="alignment";class gD extends ne{refresh(){const e=this.editor.locale,t=ze(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value=e.contentLanguageDirection==="rtl"?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,r=i.document,s=e.value;i.change(a=>{const l=Array.from(r.selection.getSelectedBlocks()).filter(d=>this._canBeAligned(d)),c=l[0].getAttribute("alignment");If(s,n)||c===s||!s?function(d,u){for(const g of d)u.removeAttribute(za,g)}(l,a):function(d,u,g){for(const f of d)u.setAttribute(za,g,f)}(l,a,s)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,za)}}class pD extends q{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:Na.map(t=>({name:t}))})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=Pf(e.config.get("alignment.options")).filter(l=>Tf(l.name)&&!If(l.name,t)),r=i.some(l=>!!l.className);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),r?e.conversion.attributeToAttribute(function(l){const c={};for(const u of l)c[u.name]={key:"class",value:u.className};return{model:{key:"alignment",values:l.map(u=>u.name)},view:c}}(i)):e.conversion.for("downcast").attributeToAttribute(function(l){const c={};for(const{name:u}of l)c[u]={key:"style",value:{"text-align":u}};return{model:{key:"alignment",values:l.map(u=>u.name)},view:c}}(i));const s=function(l){const c=[];for(const{name:d}of l)c.push({view:{key:"style",value:{"text-align":d}},model:{key:"alignment",value:d}});return c}(i);for(const l of s)e.conversion.for("upcast").attributeToAttribute(l);const a=function(l){const c=[];for(const{name:d}of l)c.push({view:{key:"align",value:d},model:{key:"alignment",value:d}});return c}(i);for(const l of a)e.conversion.for("upcast").attributeToAttribute(l);e.commands.add("alignment",new gD(e))}}const Yi=new Map([["left",ve.alignLeft],["right",ve.alignRight],["center",ve.alignCenter],["justify",ve.alignJustify]]);class fD extends q{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t,i=Pf(e.config.get("alignment.options"));i.map(r=>r.name).filter(Tf).forEach(r=>this._addButton(r)),t.add("alignment",r=>{const s=Pt(r);Pi(s,()=>i.map(c=>t.create(`alignment:${c.name}`)),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:n("Text alignment toolbar")}),s.buttonView.set({label:n("Text alignment"),tooltip:!0}),s.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const a=r.contentLanguageDirection==="rtl"?Yi.get("right"):Yi.get("left"),l=e.commands.get("alignment");return s.buttonView.bind("icon").to(l,"value",c=>Yi.get(c)||a),s.bind("isEnabled").to(l,"isEnabled"),this.listenTo(s,"execute",()=>{e.editing.view.focus()}),s})}_addButton(e){const t=this.editor;t.ui.componentFactory.add(`alignment:${e}`,n=>{const i=t.commands.get("alignment"),r=new Ae(n);return r.set({label:this.localizedOptionTitles[e],icon:Yi.get(e),tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i),r.bind("isOn").to(i,"value",s=>s===e),this.listenTo(r,"execute",()=>{t.execute("alignment",{value:e}),t.editing.view.focus()}),r})}}function kD(o){const e=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"br",isVoid:!0},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"input",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"textarea",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],t=e.map(r=>r.name).join("|"),n=o.replace(new RegExp(``,"g"),` $& `).split(` -`);let i=0;return n.filter(r=>r.length).map(r=>function(s,a){return a.some(l=>!l.isVoid&&!!new RegExp(`<${l.name}( .*?)?>`).test(s))}(r,e)?za(r,i++):function(s,a){return a.some(l=>new RegExp(``).test(s))}(r,e)?za(r,--i):za(r,i)).join(` -`)}function za(o,e,t=" "){return`${t.repeat(Math.max(0,e))}${o}`}var Rf=D(2896),bD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Rf.Z,bD),Rf.Z.locals;const Of="SourceEditingMode";function wD(o){return function(e){return e.startsWith("<")}(o)?kD(o):o}const Ma="removeFormat";class AD extends q{static get pluginName(){return"RemoveFormatUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Ma,n=>{const i=e.commands.get(Ma),r=new Ae(n);return r.set({label:t("Remove Format"),icon:'',tooltip:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(Ma),e.editing.view.focus()}),r})}}class _D extends ne{refresh(){const e=this.editor.model;this.isEnabled=!!ze(this._getFormattingItems(e.document.selection,e.schema))}execute(){const e=this.editor.model,t=e.schema;e.change(n=>{for(const i of this._getFormattingItems(e.document.selection,t))if(i.is("selection"))for(const r of this._getFormattingAttributes(i,t))n.removeSelectionAttribute(r);else{const r=n.createRangeOn(i);for(const s of this._getFormattingAttributes(i,t))n.removeAttribute(s,r)}})}*_getFormattingItems(e,t){const n=i=>!!ze(this._getFormattingAttributes(i,t));for(const i of e.getRanges())for(const r of i.getItems())!t.isBlock(r)&&n(r)&&(yield r);for(const i of e.getSelectedBlocks())n(i)&&(yield i);n(e)&&(yield e)}*_getFormattingAttributes(e,t){for(const[n]of e.getAttributes()){const i=t.getAttributeProperties(n);i&&i.isFormatting&&(yield n)}}}class CD extends q{static get pluginName(){return"RemoveFormatEditing"}init(){const e=this.editor;e.commands.add("removeFormat",new _D(e))}}var vD=Object.defineProperty,Nf=Object.getOwnPropertySymbols,yD=Object.prototype.hasOwnProperty,ED=Object.prototype.propertyIsEnumerable,zf=(o,e,t)=>e in o?vD(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Mf=(o,e)=>{for(var t in e||(e={}))yD.call(e,t)&&zf(o,t,e[t]);if(Nf)for(var t of Nf(e))ED.call(e,t)&&zf(o,t,e[t]);return o};function An(o,e,t,n){e&&function(i,r,s){if(r.attributes)for(const[a]of Object.entries(r.attributes))i.removeAttribute(a,s);if(r.styles)for(const a of Object.keys(r.styles))i.removeStyle(a,s);r.classes&&i.removeClass(r.classes,s)}(o,e,n),t&&Gt(o,t,n)}function Gt(o,e,t){if(e.attributes)for(const[n,i]of Object.entries(e.attributes))o.setAttribute(n,i,t);e.styles&&o.setStyle(e.styles,t),e.classes&&o.addClass(e.classes,t)}function xD(o,e){const t=Ut(o);let n="attributes";for(n in e)t[n]=n=="classes"?Array.from(new Set([...o[n]||[],...e[n]])):Mf(Mf({},o[n]),e[n]);return t}function _n(o,e,t,n,i){const r=e.getAttribute(t),s={};for(const a of["attributes","styles","classes"]){if(a!=n){r&&r[a]&&(s[a]=r[a]);continue}if(n=="classes"){const c=new Set(r&&r.classes||[]);i(c),c.size&&(s[a]=Array.from(c));continue}const l=new Map(Object.entries(r&&r[a]||{}));i(l),l.size&&(s[a]=Object.fromEntries(l))}Object.keys(s).length?e.is("documentSelection")?o.setSelectionAttribute(t,s):o.setAttribute(t,s,e):r&&(e.is("documentSelection")?o.removeSelectionAttribute(t):o.removeAttribute(t,e))}function Fa({model:o}){return(e,t)=>t.writer.createElement(o,{htmlContent:e.getCustomProperty("$rawContent")})}function SD(o,{view:e,isInline:t}){const n=o.t;return(i,{writer:r})=>{const s=n("HTML object"),a=Qi(e,i,r),l=i.getAttribute("htmlAttributes");return r.addClass("html-object-embed__content",a),l&&Gt(r,l,a),oa(r.createContainerElement(t?"span":"div",{class:"html-object-embed","data-html-object-embed-label":s},a),r,{label:s})}}function Qi(o,e,t){return t.createRawElement(o,null,(n,i)=>{i.setContentOf(n,e.getAttribute("htmlContent"))})}function DD({priority:o,view:e}){return(t,n)=>{if(!t)return;const{writer:i}=n,r=i.createAttributeElement(e,null,{priority:o});return Gt(i,t,r),r}}function Vo({view:o},e){return t=>{t.on(`element:${o}`,(n,i,r)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const s=e.processViewAttributes(i.viewItem,r);s&&r.writer.setAttribute("htmlAttributes",s,i.modelRange)},{priority:"low"})}}function Lo({model:o}){return e=>{e.on(`attribute:htmlAttributes:${o}`,(t,n,i)=>{if(!i.consumable.consume(n.item,t.name))return;const{attributeOldValue:r,attributeNewValue:s}=n;An(i.writer,r,s,i.mapper.toViewElement(n.item))})}}const BD=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}}],TD=[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0},{model:"htmlListAttributes",view:"ol",appliesToBlock:!0},{model:"htmlListAttributes",view:"ul",appliesToBlock:!0},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{copyOnEnter:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],isInline:!0}}],ID=ss(function(o,e,t,n){wd(o,e,t,n)});var PD=Object.defineProperty,RD=Object.defineProperties,OD=Object.getOwnPropertyDescriptors,Ff=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,zD=Object.prototype.propertyIsEnumerable,Vf=(o,e,t)=>e in o?PD(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Xi=(o,e)=>{for(var t in e||(e={}))ND.call(e,t)&&Vf(o,t,e[t]);if(Ff)for(var t of Ff(e))zD.call(e,t)&&Vf(o,t,e[t]);return o},er=(o,e)=>RD(o,OD(e));class Xn extends q{constructor(){super(...arguments),this._definitions=[]}static get pluginName(){return"DataSchema"}init(){for(const e of BD)this.registerBlockElement(e);for(const e of TD)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push(er(Xi({},e),{isBlock:!0}))}registerInlineElement(e){this._definitions.push(er(Xi({},e),{isInline:!0}))}extendBlockElement(e){this._extendDefinition(er(Xi({},e),{isBlock:!0}))}extendInlineElement(e){this._extendDefinition(er(Xi({},e),{isInline:!0}))}getDefinitionsForView(e,t=!1){const n=new Set;for(const i of this._getMatchingViewDefinitions(e)){if(t)for(const r of this._getReferences(i.model))n.add(r);n.add(i)}return n}getDefinitionsForModel(e){return this._definitions.filter(t=>t.model==e)}_getMatchingViewDefinitions(e){return this._definitions.filter(t=>t.view&&function(n,i){return typeof n=="string"?n===i:n instanceof RegExp?n.test(i):!1}(e,t.view))}*_getReferences(e){const t=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],n=this._definitions.filter(i=>i.model==e);for(const{modelSchema:i}of n)if(i)for(const r of t)for(const s of Pe(i[r]||[])){const a=this._definitions.filter(l=>l.model==s);for(const l of a)s!==e&&(yield*this._getReferences(l.model),yield l)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter(([,n])=>n.model==e.model);if(t.length!=0)for(const[n,i]of t)this._definitions[n]=ID({},i,e,(r,s)=>Array.isArray(r)?r.concat(s):void 0);else this._definitions.push(e)}}const MD=function(o,e,t,n){for(var i=o.length,r=t+-1;++r-1;)a!==o&&Lf.call(a,l,1),Lf.call(o,l,1);return o},$D=_d(function(o,e){return o&&o.length&&e&&e.length?jD(o,e):o});var jf=D(5049),HD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(jf.Z,HD),jf.Z.locals;class Fe extends q{constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new Mn,this._disallowedAttributes=new Mn,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerModelPostFixer()}static get pluginName(){return"DataFilter"}static get requires(){return[Xn,Mo]}loadAllowedConfig(e){for(const t of e){const n=t.name||/[\s\S]+/,i=qf(t);this.allowElement(n),i.forEach(r=>this.allowAttributes(r))}}loadDisallowedConfig(e){for(const t of e){const n=t.name||/[\s\S]+/,i=qf(t);i.length==0?this.disallowElement(n):i.forEach(r=>this.disallowAttributes(r))}}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){return $f(e,t,this._disallowedAttributes),$f(e,t,this._allowedAttributes)}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&typeof e.appliesToBlock=="string")for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(e)},{priority:te.get("highest")+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)},{priority:te.get("highest")+1})}_registerElementHandlers(){this.on("register",(e,t)=>{const n=this.editor.model.schema;if(t.isObject&&!n.isRegistered(t.model))this._registerObjectElement(t);else if(t.isBlock)this._registerBlockElement(t);else{if(!t.isInline)throw new I("data-filter-invalid-definition",null,t);this._registerInlineElement(t)}e.stop()},{priority:"lowest"})}_registerModelPostFixer(){const e=this.editor.model;e.document.registerPostFixer(t=>{const n=e.document.differ.getChanges();let i=!1;const r=this._getCoupledAttributesMap();for(const s of n){if(s.type!="attribute"||s.attributeNewValue!==null)continue;const a=r.get(s.attributeKey);if(a)for(const{item:l}of s.range.getWalker({shallow:!0}))for(const c of a)l.hasAttribute(c)&&(t.removeAttribute(c,l),i=!0)}return i})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const t=this.editor,n=t.model.schema,i=t.conversion,{view:r,model:s}=e;n.register(s,e.modelSchema),r&&(n.extend(e.model,{allowAttributes:["htmlAttributes","htmlContent"]}),t.data.registerRawContentMatcher({name:r}),i.for("upcast").elementToElement({view:r,model:Fa(e),converterPriority:te.get("low")+1}),i.for("upcast").add(Vo(e,this)),i.for("editingDowncast").elementToStructure({model:{name:s,attributes:["htmlAttributes"]},view:SD(t,e)}),i.for("dataDowncast").elementToElement({model:s,view:(a,{writer:l})=>Qi(r,a,l)}),i.for("dataDowncast").add(Lo(e)))}_registerBlockElement(e){const t=this.editor,n=t.model.schema,i=t.conversion,{view:r,model:s}=e;if(!n.isRegistered(e.model)){if(n.register(e.model,e.modelSchema),!r)return;i.for("upcast").elementToElement({model:s,view:r,converterPriority:te.get("low")+1}),i.for("downcast").elementToElement({model:s,view:r})}r&&(n.extend(e.model,{allowAttributes:"htmlAttributes"}),i.for("upcast").add(Vo(e,this)),i.for("downcast").add(Lo(e)))}_registerInlineElement(e){const t=this.editor,n=t.model.schema,i=t.conversion,r=e.model;e.appliesToBlock||(n.extend("$text",{allowAttributes:r}),e.attributeProperties&&n.setAttributeProperties(r,e.attributeProperties),i.for("upcast").add(function({view:s,model:a},l){return c=>{c.on(`element:${s}`,(d,u,g)=>{let f=l.processViewAttributes(u.viewItem,g);if(f||g.consumable.test(u.viewItem,{name:!0})){f=f||{},g.consumable.consume(u.viewItem,{name:!0}),u.modelRange||(u=Object.assign(u,g.convertChildren(u.viewItem,u.modelCursor)));for(const b of u.modelRange.getItems())if(g.schema.checkAttribute(b,a)){const A=xD(f,b.getAttribute(a)||{});g.writer.setAttribute(a,A,b)}}},{priority:"low"})}}(e,this)),i.for("downcast").attributeToElement({model:r,view:DD(e)}))}}function $f(o,e,t){const n=function(l,{consumable:c},d){const u=d.matchAll(l)||[],g=[];for(const f of u)qD(c,l,f),delete f.match.name,c.consume(l,f.match),g.push(f);return g}(o,e,t),{attributes:i,styles:r,classes:s}=function(l){const c={attributes:new Set,classes:new Set,styles:new Set};for(const d of l)for(const u in c)(d.match[u]||[]).forEach(g=>c[u].add(g));return c}(n),a={};if(i.size)for(const l of i)_c(l)||i.delete(l);return i.size&&(a.attributes=Hf(i,l=>o.getAttribute(l))),r.size&&(a.styles=Hf(r,l=>o.getStyle(l))),s.size&&(a.classes=Array.from(s)),Object.keys(a).length?a:null}function qD(o,e,t){for(const n of["attributes","classes","styles"]){const i=t.match[n];if(i)for(const r of Array.from(i))o.test(e,{[n]:[r]})||$D(i,r)}}function Hf(o,e){const t={};for(const n of o)e(n)!==void 0&&(t[n]=e(n));return t}function Va(o,e){const{name:t}=o,n=o[e];return Ge(n)?Object.entries(n).map(([i,r])=>({name:t,[e]:{[i]:r}})):Array.isArray(n)?n.map(i=>({name:t,[e]:[i]})):[o]}function qf(o){const{name:e,attributes:t,classes:n,styles:i}=o,r=[];return t&&r.push(...Va({name:e,attributes:t},"attributes")),n&&r.push(...Va({name:e,classes:n},"classes")),i&&r.push(...Va({name:e,styles:i},"styles")),r}class UD extends q{static get requires(){return[Fe]}static get pluginName(){return"CodeBlockElementSupport"}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(Fe);e.on("register:pre",(t,n)=>{if(n.model!=="codeBlock")return;const i=this.editor,r=i.model.schema,s=i.conversion;r.extend("codeBlock",{allowAttributes:["htmlAttributes","htmlContentAttributes"]}),s.for("upcast").add(function(a){return l=>{l.on("element:code",(c,d,u)=>{const g=d.viewItem,f=g.parent;function b(A,E){const P=a.processViewAttributes(A,u);P&&u.writer.setAttribute(E,P,d.modelRange)}f&&f.is("element","pre")&&(b(f,"htmlAttributes"),b(g,"htmlContentAttributes"))},{priority:"low"})}}(e)),s.for("downcast").add(a=>{a.on("attribute:htmlAttributes:codeBlock",(l,c,d)=>{if(!d.consumable.consume(c.item,l.name))return;const{attributeOldValue:u,attributeNewValue:g}=c,f=d.mapper.toViewElement(c.item).parent;An(d.writer,u,g,f)}),a.on("attribute:htmlContentAttributes:codeBlock",(l,c,d)=>{if(!d.consumable.consume(c.item,l.name))return;const{attributeOldValue:u,attributeNewValue:g}=c,f=d.mapper.toViewElement(c.item);An(d.writer,u,g,f)})}),t.stop()})}}class WD extends q{static get requires(){return[Fe]}static get pluginName(){return"DualContentModelElementSupport"}init(){this.editor.plugins.get(Fe).on("register",(e,t)=>{const n=t,i=this.editor,r=i.model.schema,s=i.conversion;if(!n.paragraphLikeModel||r.isRegistered(n.model)||r.isRegistered(n.paragraphLikeModel))return;const a={model:n.paragraphLikeModel,view:n.view};r.register(n.model,n.modelSchema),r.register(a.model,{inheritAllFrom:"$block"}),s.for("upcast").elementToElement({view:n.view,model:(l,{writer:c})=>this._hasBlockContent(l)?c.createElement(n.model):c.createElement(a.model),converterPriority:te.get("low")+.5}),s.for("downcast").elementToElement({view:n.view,model:n.model}),this._addAttributeConversion(n),s.for("downcast").elementToElement({view:a.view,model:a.model}),this._addAttributeConversion(a),e.stop()})}_hasBlockContent(e){const t=this.editor.editing.view,n=t.domConverter.blockElements;for(const i of t.createRangeIn(e).getItems())if(i.is("element")&&n.includes(i.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,n=t.conversion,i=t.plugins.get(Fe);t.model.schema.extend(e.model,{allowAttributes:"htmlAttributes"}),n.for("upcast").add(Vo(e,i)),n.for("downcast").add(Lo(e))}}class KD extends q{static get requires(){return[Xn,zo]}static get pluginName(){return"HeadingElementSupport"}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t),this.removeClassesOnEnter(e,t)}registerHeadingElements(e,t){const n=e.plugins.get(Xn),i=[];for(const r of t)"model"in r&&"view"in r&&(n.registerBlockElement({view:r.view,model:r.model}),i.push(r.model));n.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:i}})}removeClassesOnEnter(e,t){const n=e.commands.get("enter");this.listenTo(n,"afterExecute",(i,r)=>{const s=e.model.document.selection.getFirstPosition().parent;t.some(a=>s.is("element",a.model))&&s.childCount===0&&_n(r.writer,s,"htmlAttributes","classes",a=>a.clear())})}}function tr(o,e,t){const n=o.createRangeOn(e);for(const{item:i}of n.getWalker())if(i.is("element",t))return i}class GD extends q{static get requires(){return[Fe]}static get pluginName(){return"ImageElementSupport"}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,n=e.conversion,i=e.plugins.get(Fe);i.on("register:figure",()=>{n.for("upcast").add(function(r){return s=>{s.on("element:figure",(a,l,c)=>{const d=l.viewItem;if(!l.modelRange||!d.hasClass("image"))return;const u=r.processViewAttributes(d,c);u&&c.writer.setAttribute("htmlFigureAttributes",u,l.modelRange)},{priority:"low"})}}(i))}),i.on("register:img",(r,s)=>{s.model!=="imageBlock"&&s.model!=="imageInline"||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlAttributes"]}),n.for("upcast").add(function(a){return l=>{l.on("element:img",(c,d,u)=>{if(!d.modelRange)return;const g=d.viewItem,f=g.parent;function b(E,P){const z=a.processViewAttributes(E,u);z&&u.writer.setAttribute(P,z,d.modelRange)}function A(E){d.modelRange&&d.modelRange.getContainedElement().is("element","imageBlock")&&b(E,"htmlLinkAttributes")}b(g,"htmlAttributes"),f.is("element","a")&&A(f)},{priority:"low"})}}(i)),n.for("downcast").add(a=>{function l(d){a.on(`attribute:${d}:imageInline`,(u,g,f)=>{if(!f.consumable.consume(g.item,u.name))return;const{attributeOldValue:b,attributeNewValue:A}=g,E=f.mapper.toViewElement(g.item);An(f.writer,b,A,E)},{priority:"low"})}function c(d,u){a.on(`attribute:${u}:imageBlock`,(g,f,b)=>{if(!b.consumable.test(f.item,g.name))return;const{attributeOldValue:A,attributeNewValue:E}=f,P=b.mapper.toViewElement(f.item),z=tr(b.writer,P,d);z&&(An(b.writer,A,E,z),b.consumable.consume(f.item,g.name))},{priority:"low"}),d==="a"&&a.on("attribute:linkHref:imageBlock",(g,f,b)=>{if(!b.consumable.consume(f.item,"attribute:htmlLinkAttributes:imageBlock"))return;const A=b.mapper.toViewElement(f.item),E=tr(b.writer,A,"a");Gt(b.writer,f.item.getAttribute("htmlLinkAttributes"),E)},{priority:"low"})}l("htmlAttributes"),c("img","htmlAttributes"),c("figure","htmlFigureAttributes"),c("a","htmlLinkAttributes")}),r.stop())})}}class ZD extends q{static get requires(){return[Fe]}static get pluginName(){return"MediaEmbedElementSupport"}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,n=e.conversion,i=this.editor.plugins.get(Fe),r=this.editor.plugins.get(Xn),s=e.config.get("mediaEmbed.elementName");r.registerBlockElement({model:"media",view:s}),i.on("register:figure",()=>{n.for("upcast").add(function(a){return l=>{l.on("element:figure",(c,d,u)=>{const g=d.viewItem;if(!d.modelRange||!g.hasClass("media"))return;const f=a.processViewAttributes(g,u);f&&u.writer.setAttribute("htmlFigureAttributes",f,d.modelRange)},{priority:"low"})}}(i))}),i.on(`register:${s}`,(a,l)=>{l.model==="media"&&(t.extend("media",{allowAttributes:["htmlAttributes","htmlFigureAttributes"]}),n.for("upcast").add(function(c,d){const u=(g,f,b)=>{function A(E,P){const z=c.processViewAttributes(E,b);z&&b.writer.setAttribute(P,z,f.modelRange)}A(f.viewItem,"htmlAttributes")};return g=>{g.on(`element:${d}`,u,{priority:"low"})}}(i,s)),n.for("dataDowncast").add(function(c){return d=>{function u(g,f){d.on(`attribute:${f}:media`,(b,A,E)=>{if(!E.consumable.consume(A.item,b.name))return;const{attributeOldValue:P,attributeNewValue:z}=A,j=E.mapper.toViewElement(A.item),Y=tr(E.writer,j,g);An(E.writer,P,z,Y)})}u(c,"htmlAttributes"),u("figure","htmlFigureAttributes")}}(s)),a.stop())})}}class JD extends q{static get requires(){return[Fe]}static get pluginName(){return"ScriptElementSupport"}init(){const e=this.editor.plugins.get(Fe);e.on("register:script",(t,n)=>{const i=this.editor,r=i.model.schema,s=i.conversion;r.register("htmlScript",n.modelSchema),r.extend("htmlScript",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"script"}),s.for("upcast").elementToElement({view:"script",model:Fa(n)}),s.for("upcast").add(Vo(n,e)),s.for("downcast").elementToElement({model:"htmlScript",view:(a,{writer:l})=>Qi("script",a,l)}),s.for("downcast").add(Lo(n)),t.stop()})}}class YD extends q{static get requires(){return[Fe]}static get pluginName(){return"TableElementSupport"}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,n=e.conversion,i=e.plugins.get(Fe),r=e.plugins.get("TableUtils");i.on("register:figure",()=>{n.for("upcast").add(function(s){return a=>{a.on("element:figure",(l,c,d)=>{const u=c.viewItem;if(!c.modelRange||!u.hasClass("table"))return;const g=s.processViewAttributes(u,d);g&&d.writer.setAttribute("htmlFigureAttributes",g,c.modelRange)},{priority:"low"})}}(i))}),i.on("register:table",(s,a)=>{a.model==="table"&&(t.extend("table",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),n.for("upcast").add(function(l){return c=>{c.on("element:table",(d,u,g)=>{if(!u.modelRange)return;const f=u.viewItem;b(f,"htmlAttributes");for(const A of f.getChildren())A.is("element","thead")&&b(A,"htmlTheadAttributes"),A.is("element","tbody")&&b(A,"htmlTbodyAttributes");function b(A,E){const P=l.processViewAttributes(A,g);P&&g.writer.setAttribute(E,P,u.modelRange)}},{priority:"low"})}}(i)),n.for("downcast").add(l=>{function c(d,u){l.on(`attribute:${u}:table`,(g,f,b)=>{if(!b.consumable.test(f.item,g.name))return;const A=b.mapper.toViewElement(f.item),E=tr(b.writer,A,d);E&&(b.consumable.consume(f.item,g.name),An(b.writer,f.attributeOldValue,f.attributeNewValue,E))})}c("table","htmlAttributes"),c("figure","htmlFigureAttributes"),c("thead","htmlTheadAttributes"),c("tbody","htmlTbodyAttributes")}),e.model.document.registerPostFixer(function(l,c){return d=>{const u=l.document.differ.getChanges();let g=!1;for(const f of u){if(f.type!="attribute"||f.attributeKey!="headingRows")continue;const b=f.range.start.nodeAfter,A=b.getAttribute("htmlTheadAttributes"),E=b.getAttribute("htmlTbodyAttributes");A&&!f.attributeNewValue?(d.removeAttribute("htmlTheadAttributes",b),g=!0):E&&f.attributeNewValue==c.getRows(b)&&(d.removeAttribute("htmlTbodyAttributes",b),g=!0)}return g}}(e.model,r)),s.stop())})}}class QD extends q{static get requires(){return[Fe]}static get pluginName(){return"StyleElementSupport"}init(){const e=this.editor.plugins.get(Fe);e.on("register:style",(t,n)=>{const i=this.editor,r=i.model.schema,s=i.conversion;r.register("htmlStyle",n.modelSchema),r.extend("htmlStyle",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"style"}),s.for("upcast").elementToElement({view:"style",model:Fa(n)}),s.for("upcast").add(Vo(n,e)),s.for("downcast").elementToElement({model:"htmlStyle",view:(a,{writer:l})=>Qi("style",a,l)}),s.for("downcast").add(Lo(n)),t.stop()})}}class XD extends q{static get requires(){return[Fe]}static get pluginName(){return"DocumentListElementSupport"}init(){const e=this.editor;if(!e.plugins.has("DocumentListEditing"))return;const t=e.model.schema,n=e.conversion,i=e.plugins.get(Fe),r=e.plugins.get("DocumentListEditing");r.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast(s,a,l){Gt(s,a,l)}}),r.registerDowncastStrategy({scope:"list",attributeName:"htmlListAttributes",setAttributeOnDowncast(s,a,l){Gt(s,a,l)}}),i.on("register",(s,a)=>{["ul","ol","li"].includes(a.view)&&(s.stop(),t.checkAttribute("$block","htmlListAttributes")||(t.extend("$block",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),t.extend("$blockObject",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),t.extend("$container",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),n.for("upcast").add(l=>{l.on("element:ul",La("htmlListAttributes",i),{priority:"low"}),l.on("element:ol",La("htmlListAttributes",i),{priority:"low"}),l.on("element:li",La("htmlLiAttributes",i),{priority:"low"})})))}),r.on("postFixer",(s,{listNodes:a,writer:l})=>{const c=[];for(const{node:d,previous:u}of a){if(!u)continue;const g=d.getAttribute("listIndent"),f=u.getAttribute("listIndent");let b=null;if(g>f?c[f]=u:g{e.model.change(r=>{for(const s of i)r.setAttribute("htmlListAttributes",{},s)})})}}function La(o,e){return(t,n,i)=>{const r=n.viewItem;n.modelRange||Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor));const s=e.processViewAttributes(r,i);for(const a of n.modelRange.getItems({shallow:!0}))a.hasAttribute("listItemId")&&(a.hasAttribute(o)||i.writer.setAttribute(o,s||{},a))}}class eB extends q{static get requires(){return[Fe,Xn]}static get pluginName(){return"CustomElementSupport"}init(){const e=this.editor.plugins.get(Fe),t=this.editor.plugins.get(Xn);e.on("register:$customElement",(n,i)=>{n.stop();const r=this.editor,s=r.model.schema,a=r.conversion,l=r.editing.view.domConverter.unsafeElements,c=r.data.htmlProcessor.domConverter.preElements;s.register(i.model,i.modelSchema),s.extend(i.model,{allowAttributes:["htmlElementName","htmlAttributes","htmlContent"],isContent:!0}),a.for("upcast").elementToElement({view:/.*/,model:(d,u)=>{if(d.name=="$comment"||!function(E){try{document.createElement(E)}catch{return!1}return!0}(d.name)||t.getDefinitionsForView(d.name).size)return null;l.includes(d.name)||l.push(d.name),c.includes(d.name)||c.push(d.name);const g=u.writer.createElement(i.model,{htmlElementName:d.name}),f=e.processViewAttributes(d,u);f&&u.writer.setAttribute("htmlAttributes",f,g);const b=new Bi(d.document).createDocumentFragment(d),A=r.data.processor.toData(b);u.writer.setAttribute("htmlContent",A,g);for(const{item:E}of r.editing.view.createRangeIn(d))u.consumable.consume(E,{name:!0});return g},converterPriority:"low"}),a.for("editingDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(d,{writer:u})=>{const g=d.getAttribute("htmlElementName"),f=u.createRawElement(g);return d.hasAttribute("htmlAttributes")&&Gt(u,d.getAttribute("htmlAttributes"),f),f}}),a.for("dataDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(d,{writer:u})=>{const g=d.getAttribute("htmlElementName"),f=d.getAttribute("htmlContent"),b=u.createRawElement(g,null,(A,E)=>{E.setContentOf(A,f);const P=A.firstChild;for(P.remove();P.firstChild;)A.appendChild(P.firstChild)});return d.hasAttribute("htmlAttributes")&&Gt(u,d.getAttribute("htmlAttributes"),b),b}})})}}function*eo(o,e,t){if(e)if(!(Symbol.iterator in e)&&e.is("documentSelection")&&e.isCollapsed)o.schema.checkAttributeInSelection(e,t)&&(yield e);else for(const n of function(i,r,s){return!(Symbol.iterator in r)&&(r.is("node")||r.is("$text")||r.is("$textProxy"))?i.schema.checkAttribute(r,s)?[i.createRangeOn(r)]:[]:i.schema.getValidRanges(i.createSelection(r).getRanges(),s)}(o,e,t))yield*n.getItems({shallow:!0})}var to=(o,e,t)=>new Promise((n,i)=>{var r=l=>{try{a(t.next(l))}catch(c){i(c)}},s=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,s);a((t=t.apply(o,e)).next())});function Uf(o,e){let t=new URL(o);if(e&&Object.keys(e).length>0){const n=new URLSearchParams;for(const[i,r]of Object.entries(e))if(Array.isArray(r))for(const s of r)n.append(i,s);else n.append(i,r);t.search=n.toString()}return t.toString()}class tB{constructor(e,t){this.loader=e,this.api_url=t}_getUploadUrl(e,t){return to(this,null,function*(){const n=yield fetch(this.api_url+"/vi/skey",{credentials:"include"}).catch(a=>{t(a)}),i=yield n.json(),r={fileName:e.name,mimeType:e.type||"application/octet-stream",size:e.size.toString(),skey:i},s=yield fetch(Uf(this.api_url+"/vi/file/getUploadURL",r),{method:"POST",credentials:"include"}).catch(a=>{t(a)});return this.loader.uploaded=10,s})}fileUpload(e,t,n){return to(this,null,function*(){yield fetch(t.values.uploadUrl,{mode:"no-cors",method:"POST",body:e}).catch(l=>{n(l)}),this.loader.uploaded=50;const i=yield fetch(this.api_url+"/vi/skey",{credentials:"include"}).catch(l=>{n(l)}),r=yield i.json(),s={key:t.values.uploadKey,node:void 0,skelType:"leaf",skey:r},a=yield fetch(Uf(this.api_url+"/vi/file/add",s),{method:"POST",credentials:"include"}).catch(l=>{n(l)});return this.loader.uploaded=75,a})}upload(){return to(this,null,function*(){return this.loader.uploadTotal=100,this.loader.uploaded=0,this.loader.file.then(e=>to(this,null,function*(){return new Promise((t,n)=>{this._getUploadUrl(e,n).then(i=>to(this,null,function*(){const r=yield i.json();this.fileUpload(e,r,n).then(s=>to(this,null,function*(){const a=yield s.json();this.loader.uploaded=100,t({default:this.api_url+a.values.downloadUrl})}))}))})}))})}abort(){this.xhr&&this.xhr.abort()}}var Wf=D(2245),nB={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Wf.Z,nB),Wf.Z.locals;class ja extends Vi{}ja.builtinPlugins=[class extends q{static get requires(){return[z2,zo,j2,k2,a2,Y2]}static get pluginName(){return"Essentials"}},class extends q{static get requires(){return[Nt]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const o=this.editor.config.get("ckfinder.uploadUrl");o&&(this.editor.plugins.get(Nt).createUploadAdapter=e=>new nx(e,o,this.editor.t))}},class extends ui{constructor(){super(...arguments),this.token=null,this._tokens=new Map}static get pluginName(){return"CloudServices"}static get requires(){return[mD]}init(){return Bf(this,null,function*(){const o=this.context.config.get("cloudServices")||{};for(const[t,n]of Object.entries(o))this[t]=n;if(!this.tokenUrl)return void(this.token=null);const e=this.context.plugins.get("CloudServicesCore");this.token=yield e.createToken(this.tokenUrl).init(),this._tokens.set(this.tokenUrl,this.token)})}registerTokenUrl(o){return Bf(this,null,function*(){if(this._tokens.has(o))return this.getTokenFor(o);const e=this.context.plugins.get("CloudServicesCore"),t=yield e.createToken(o).init();return this._tokens.set(o,t),t})}getTokenFor(o){const e=this._tokens.get(o);if(!e)throw new I("cloudservices-token-not-registered",this);return e}destroy(){super.destroy();for(const o of this._tokens.values())o.destroy()}},class extends q{static get requires(){return[ox,ix]}static get pluginName(){return"Bold"}},class extends q{static get requires(){return[sx,ax]}static get pluginName(){return"Italic"}},class extends q{static get requires(){return[hx,mx]}static get pluginName(){return"BlockQuote"}},class extends q{static get pluginName(){return"EasyImage"}static get requires(){return[gx,"ImageUpload"]}init(){const o=this.editor;o.plugins.has("ImageBlockEditing")||o.plugins.has("ImageInlineEditing")||Q("easy-image-image-feature-missing",o)}},class extends q{static get requires(){return[wx,_x]}static get pluginName(){return"Heading"}},class extends q{static get requires(){return[Vx,jx]}static get pluginName(){return"Image"}},class extends q{static get requires(){return[Wg,g5]}static get pluginName(){return"ImageStyle"}},class extends q{static get requires(){return[qi,zt]}static get pluginName(){return"ImageToolbar"}afterInit(){const o=this.editor,e=o.t,t=o.plugins.get(qi),n=o.plugins.get("ImageUtils");var i;t.register("image",{ariaLabel:e("Image toolbar"),items:(i=o.config.get("image.toolbar")||[],i.map(r=>xe(r)?r.name:r)),getRelatedElement:r=>n.getClosestSelectedImageWidget(r)})}},class extends q{static get pluginName(){return"ImageUpload"}static get requires(){return[t5,qx,Gx]}},class extends q{constructor(o){super(o),this._resizeUnit=o.config.get("image.resizeUnit")}static get requires(){return[s5]}static get pluginName(){return"ImageResizeButtons"}init(){const o=this.editor,e=o.config.get("image.resizeOptions"),t=o.commands.get("resizeImage");this.bind("isEnabled").to(t);for(const n of e)this._registerImageResizeButton(n);this._registerImageResizeDropdown(e)}_registerImageResizeButton(o){const e=this.editor,{name:t,value:n,icon:i}=o,r=n?n+this._resizeUnit:null;e.ui.componentFactory.add(t,s=>{const a=new Ae(s),l=e.commands.get("resizeImage"),c=this._getOptionLabelValue(o,!0);if(!da[i])throw new I("imageresizebuttons-missing-icon",e,o);return a.set({label:c,icon:da[i],tooltip:c,isToggleable:!0}),a.bind("isEnabled").to(this),a.bind("isOn").to(l,"value",Rg(r)),this.listenTo(a,"execute",()=>{e.execute("resizeImage",{width:r})}),a})}_registerImageResizeDropdown(o){const e=this.editor,t=e.t,n=o.find(r=>!r.value),i=r=>{const s=e.commands.get("resizeImage"),a=Pt(r,od),l=a.buttonView,c=t("Resize image");return l.set({tooltip:c,commandValue:n.value,icon:da.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button",ariaLabel:c,ariaLabelledBy:void 0}),l.bind("label").to(s,"value",d=>d&&d.width?d.width:this._getOptionLabelValue(n)),a.bind("isEnabled").to(this),Fs(a,()=>this._getResizeDropdownListItemDefinitions(o,s),{ariaLabel:t("Image resize list"),role:"menu"}),this.listenTo(a,"execute",d=>{e.execute(d.source.commandName,{width:d.source.commandValue}),e.editing.view.focus()}),a};e.ui.componentFactory.add("resizeImage",i),e.ui.componentFactory.add("imageResize",i)}_getOptionLabelValue(o,e=!1){const t=this.editor.t;return o.label?o.label:e?o.value?t("Resize image to %0",o.value+this._resizeUnit):t("Resize image to the original size"):o.value?o.value+this._resizeUnit:t("Original")}_getResizeDropdownListItemDefinitions(o,e){const t=new at;return o.map(n=>{const i=n.value?n.value+this._resizeUnit:null,r={type:"button",model:new Js({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(n),role:"menuitemradio",withText:!0,icon:null})};r.model.bind("isOn").to(e,"value",Rg(i)),t.add(r)}),t}},class extends q{static get pluginName(){return"Indent"}static get requires(){return[p5,f5]}},class extends q{constructor(o){super(o),o.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const o=this.editor,e=o.config.get("indentBlock");e.classes&&e.classes.length?(this._setupConversionUsingClasses(e.classes),o.commands.add("indentBlock",new Zi(o,new ep({direction:"forward",classes:e.classes}))),o.commands.add("outdentBlock",new Zi(o,new ep({direction:"backward",classes:e.classes})))):(o.data.addStyleProcessorRules(eE),this._setupConversionUsingOffset(),o.commands.add("indentBlock",new Zi(o,new Xg({direction:"forward",offset:e.offset,unit:e.unit}))),o.commands.add("outdentBlock",new Zi(o,new Xg({direction:"backward",offset:e.offset,unit:e.unit}))))}afterInit(){const o=this.editor,e=o.model.schema,t=o.commands.get("indent"),n=o.commands.get("outdent"),i=o.config.get("heading.options");(i&&i.map(r=>r.model)||k5).forEach(r=>{e.isRegistered(r)&&e.extend(r,{allowAttributes:"blockIndent"})}),e.setAttributeProperties("blockIndent",{isFormatting:!0}),t.registerChildCommand(o.commands.get("indentBlock")),n.registerChildCommand(o.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const o=this.editor.conversion,e=this.editor.locale.contentLanguageDirection==="rtl"?"margin-right":"margin-left";o.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),o.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(o){const e={model:{key:"blockIndent",values:[]},view:{}};for(const t of o)e.model.values.push(t),e.view[t]={key:"class",value:[t]};this.editor.conversion.attributeToAttribute(e)}},class extends q{static get requires(){return[$5,K5,Z5]}static get pluginName(){return"Link"}},class extends q{static get requires(){return[fS,oS]}static get pluginName(){return"List"}},la,class extends q{static get requires(){return[LS,HS,bn,ZS,KS,WS,Mo]}static get pluginName(){return"Table"}},class extends q{static get requires(){return[qi]}static get pluginName(){return"TableToolbar"}afterInit(){const o=this.editor,e=o.t,t=o.plugins.get(qi),n=o.config.get("table.contentToolbar"),i=o.config.get("table.tableToolbar");n&&t.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:QS}),i&&t.register("table",{ariaLabel:e("Table toolbar"),items:i,getRelatedElement:YS})}},class extends q{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}constructor(o){super(o),o.config.define("typing",{transformations:{include:d2}})}init(){const o=this.editor.model.document.selection;o.on("change:range",()=>{this.isEnabled=!o.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const o=this.editor,e=o.model,t=o.plugins.get("Delete"),n=function(r){const s=r.extra||[],a=r.remove||[],l=c=>!a.includes(c);return function(c){const d=new Set;for(const u of c)if(typeof u=="string"&&km[u])for(const g of km[u])d.add(g);else d.add(u);return Array.from(d)}(r.include.concat(s).filter(l)).filter(l).map(c=>typeof c=="string"&&fm[c]?fm[c]:c).filter(c=>typeof c=="object").map(c=>({from:h2(c.from),to:u2(c.to)}))}(o.config.get("typing.transformations")),i=new mm(o.model,r=>{for(const s of n)if(s.from.test(r))return{normalizedTransformation:s}});i.on("matched:data",(r,s)=>{if(!s.batch.isTyping)return;const{from:a,to:l}=s.normalizedTransformation,c=a.exec(s.text),d=l(c.slice(1)),u=s.range;let g=c.index;e.enqueueChange(f=>{for(let b=1;b{t.requestUndoOnBackspace()})})}),i.bind("isEnabled").to(this)}},class extends q{static get requires(){return[lx,cx]}static get pluginName(){return"Underline"}},class extends q{static get requires(){return[pD,fD]}static get pluginName(){return"Alignment"}},class extends q{constructor(o){super(o),this.set("isSourceEditingMode",!1),this._elementReplacer=new Cl,this._replacedRoots=new Map,this._dataFromRoots=new Map}static get pluginName(){return"SourceEditing"}static get requires(){return[Ii]}init(){const o=this.editor;o.t,o.ui.componentFactory.add("sourceEditing",e=>{const t=new Ae(e);return t.set({icon:'',tooltip:!0,withText:!0,class:"ck-source-editing-button"}),t.bind("isOn").to(this,"isSourceEditingMode"),t.bind("isEnabled").to(this,"isEnabled",o,"isReadOnly",o.plugins.get(Ii),"hasAny",(n,i,r)=>!!n&&!i&&!r),this.listenTo(t,"execute",()=>{this.isSourceEditingMode=!this.isSourceEditingMode}),t}),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",(e,t,n)=>{n?(this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())}),this.on("change:isEnabled",(e,t,n)=>this._handleReadOnlyMode(!n)),this.listenTo(o,"change:isReadOnly",(e,t,n)=>this._handleReadOnlyMode(n))),o.data.on("get",()=>{this.isSourceEditingMode&&this.updateEditorData()},{priority:"high"})}afterInit(){const o=this.editor;["RealTimeCollaborativeEditing","CommentsEditing","TrackChangesEditing","RevisionHistory"].some(e=>o.plugins.has(e))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),o.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}updateEditorData(){const o=this.editor,e={};for(const[t,n]of this._replacedRoots){const i=this._dataFromRoots.get(t),r=n.dataset.value;i!==r&&(e[t]=r)}Object.keys(e).length&&o.data.set(e,{batchType:{isUndoable:!0}})}_showSourceEditing(){const o=this.editor,e=o.editing.view,t=o.model;t.change(n=>{n.setSelection(null),n.removeSelectionAttribute(t.document.selection.getAttributeKeys())});for(const[n,i]of e.domRoots){const r=wD(o.data.get({rootName:n})),s=kr(i.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),a=kr(i.ownerDocument,"div",{class:"ck-source-editing-area","data-value":r},[s]);s.value=r,s.setSelectionRange(0,0),s.addEventListener("input",()=>{a.dataset.value=s.value,o.ui.update()}),e.change(l=>{const c=e.document.getRoot(n);l.addClass("ck-hidden",c)}),o.ui.setEditableElement("sourceEditing:"+n,s),this._replacedRoots.set(n,a),this._elementReplacer.replace(i,a),this._dataFromRoots.set(n,r)}this._focusSourceEditing()}_hideSourceEditing(){const o=this.editor.editing.view;this.updateEditorData(),o.change(e=>{for(const[t]of this._replacedRoots)e.removeClass("ck-hidden",o.document.getRoot(t))}),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),o.focus()}_focusSourceEditing(){const o=this.editor,[e]=this._replacedRoots.values(),t=e.querySelector("textarea");o.editing.view.document.isFocused=!1,t.focus()}_disableCommands(){const o=this.editor;for(const e of o.commands.commands())e.forceDisabled(Of)}_enableCommands(){const o=this.editor;for(const e of o.commands.commands())e.clearForceDisabled(Of)}_handleReadOnlyMode(o){if(this.isSourceEditingMode)for(const[,e]of this._replacedRoots)e.querySelector("textarea").readOnly=o}_isAllowedToHandleSourceEditingMode(){const o=this.editor.ui.view.editable;return o&&!o.hasExternalElement}},class extends q{static get requires(){return[CD,AD]}static get pluginName(){return"RemoveFormat"}},class extends q{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[Fe,UD,WD,KD,GD,ZD,JD,YD,QD,XD,eB]}init(){const o=this.editor,e=o.plugins.get(Fe);e.loadAllowedConfig(o.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(o.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(o){const e=this.editor.plugins.get("DataSchema"),t=Array.from(e.getDefinitionsForView(o,!1)),n=t.find(i=>i.isInline&&!t[0].isObject);return n?n.model:"htmlAttributes"}addModelHtmlClass(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"classes",a=>{for(const l of Pe(e))a.add(l)})})}removeModelHtmlClass(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"classes",a=>{for(const l of Pe(e))a.delete(l)})})}setModelHtmlAttributes(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"attributes",a=>{for(const[l,c]of Object.entries(e))a.set(l,c)})})}removeModelHtmlAttributes(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"attributes",a=>{for(const l of Pe(e))a.delete(l)})})}setModelHtmlStyles(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"styles",a=>{for(const[l,c]of Object.entries(e))a.set(l,c)})})}removeModelHtmlStyles(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"styles",a=>{for(const l of Pe(e))a.delete(l)})})}}],ja.defaultConfig={extraPlugins:[function(o){o.plugins.get("FileRepository").createUploadAdapter=e=>new tB(e,o.config.get("viur_api_url"))},function(o){o.conversion.attributeToElement({model:"bold",view:"b",upcastAlso:[e=>{const t=e.getStyle("font-weight");return t&&(t=="bold"||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]})}],toolbar:{items:["heading","|","bold","italic","underline","|","alignment","numberedList","bulletedList","blockQuote","|","indent","outdent","|","link","insertTable","imageUpload","|","undo","redo","RemoveFormat","sourceEditing"]},image:{toolbar:["imageStyle:inline","imageStyle:block","imageStyle:side","|","resizeImage:50","resizeImage:75","resizeImage:original","imageTextAlternative"],resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"},{model:"heading6",view:"h6",title:"Heading 6",class:"ck-heading_heading6"}]},alignment:{options:[{name:"left",className:"viur-txt-align--left"},{name:"right",className:"viur-txt-align--right"},{name:"center",className:"viur-txt-align--center"},{name:"justify",className:"viur-txt-align--justify"}]},indentBlock:{classes:["viur-txt-indent--1","viur-txt-indent--2","viur-txt-indent--3","viur-txt-indent--4","viur-txt-indent--5","viur-txt-indent--6","viur-txt-indent--7","viur-txt-indent--8","viur-txt-indent--9","viur-txt-indent--10"]},htmlSupport:{allow:[{name:"a",attributes:{target:!0,rel:!0}}]},language:"de",viur_api_url:"http://localhost:8080"}})(),M=M.default})())}(Wo,Wo.exports);var oA=Wo.exports;const rl=nA(oA),iA=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:"",editorConfig:{},editor:h.computed(()=>rl)});function D(S){x.emit("change",m.name,N.value,m.lang,m.index)}function M(S){N.value=S.target.value,x.emit("change",m.name,N.value,m.lang,m.index)}h.onMounted(()=>{m.value!==null&&(N.value=m.value),x.emit("change",m.name,m.value,m.lang,m.index)});function w(S){S.editing.view.change(p=>{p.setStyle("min-height","250px",S.editing.view.document.getRoot())})}return h.watch(()=>m.value,(S,p)=>{N.value=S}),{state:N,ClassicEditor:rl,boneState:C,changeEvent:D,onReady:w,changeEventTextarea:M}}}),rA=["disabled","value"];function sA(m,x,C,N,D,M){var S,p,y,B;const w=h.resolveComponent("ckeditor");return m.state.editor?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(S=m.boneState.bonestructure)!=null&&S.valid_html||(p=m.boneState.bonestructure)!=null&&p.validHtml?(h.openBlock(),h.createBlock(w,{key:0,modelValue:m.state.value,"onUpdate:modelValue":x[0]||(x[0]=v=>m.state.value=v),editor:m.state.editor,config:m.state.editorConfig,disabled:(y=m.boneState)==null?void 0:y.readonly,onReady:m.onReady,onInput:m.changeEvent},null,8,["modelValue","editor","config","disabled","onReady","onInput"])):(h.openBlock(),h.createElementBlock("sl-textarea",{key:1,disabled:(B=m.boneState)==null?void 0:B.readonly,value:m.value,onInput:x[1]||(x[1]=(...v)=>m.changeEventTextarea&&m.changeEventTextarea(...v))},null,40,rA))],64)):h.createCommentVNode("",!0)}const sl=de(iA,[["render",sA]]),aA=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({valueLat:null,valueLng:null});function D(){x.emit("change",m.name,[N.valueLat,N.valueLng],m.lang,m.index)}return h.onMounted(()=>{try{N.valueLat=m.value[0],N.valueLng=m.value[1]}catch{}x.emit("change",m.name,[N.valueLat,N.valueLng],m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),lA=["name","min","max","disabled"],cA=["name","min","max","disabled"];function dA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.withDirectives(h.createElementVNode("sl-input",{"onUpdate:modelValue":x[0]||(x[0]=w=>m.state.valueLat=w),index:"lat",type:"number",name:m.name,min:m.boneState.bonestructure.boundslat[0],max:m.boneState.bonestructure.boundslat[1],disabled:m.boneState.readonly,"value-as-number":"",step:"0.000001",onSlChange:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w)),placeholder:"Lat"},null,40,lA),[[h.vModelText,m.state.valueLat]]),h.withDirectives(h.createElementVNode("sl-input",{"onUpdate:modelValue":x[2]||(x[2]=w=>m.state.valueLng=w),index:"lng",type:"number",name:m.name,min:m.boneState.bonestructure.boundslat[0],max:m.boneState.bonestructure.boundslat[1],disabled:m.boneState.readonly,"value-as-number":"",step:"0.000001",onSlChange:x[3]||(x[3]=(...w)=>m.changeEvent&&m.changeEvent(...w)),placeholder:"Long"},null,40,cA),[[h.vModelText,m.state.valueLng]])],64)}const al=de(aA,[["render",dA],["__scopeId","data-v-7bc31020"]]),hA=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({counter:0,debounce:null}),D=h.inject("addMultipleEntry"),M=h.inject("removeMultipleEntries");function w(){N.counter+=1;let p=200;N.counter>1&&(p=500),N.debounce&&clearTimeout(N.debounce),N.debounce=setTimeout(()=>{for(let y=N.counter;y--;)D(m.lang);N.counter=0},p)}function S(){let p=200;N.debounce&&clearTimeout(N.debounce),N.debounce=setTimeout(()=>{M(m.lang)},p)}return h.onMounted(()=>{(!m.value||m.value.length===0)&&x.emit("change",m.name,[],m.lang)}),{state:N,boneState:C,handleAdd:w,handleRemove:S,removeMultipleEntries:M}}}),ll=m=>(h.pushScopeId("data-v-63e75dee"),m=m(),h.popScopeId(),m),uA={class:"actionbar"},mA=["title"],gA=[ll(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))],pA=["title"],fA=ll(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"plus-lg"},null,-1));function kA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",uA,[m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:0,variant:"danger",title:m.$t("bone.del"),outline:"",class:"delete-btn",onClick:x[0]||(x[0]=w=>m.handleRemove(m.lang))},gA,8,mA)):h.createCommentVNode("",!0),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:1,variant:"success",title:m.$t("bone.add"),outline:"",class:"add-btn",onClick:x[1]||(x[1]=w=>m.handleAdd(m.lang))},[fA,h.createTextVNode(" "+h.toDisplayString(m.$t("bone.add"))+" ",1),m.state.counter>1?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createTextVNode("("+h.toDisplayString(m.state.counter)+")",1)],64)):h.createCommentVNode("",!0)],8,pA)):h.createCommentVNode("",!0)])}const bA=de(hA,[["render",kA],["__scopeId","data-v-63e75dee"]]);var wA={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const AA=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.inject("addMultipleEntry"),D=h.inject("formatString"),M=null,w=h.reactive({skels:{},hasUsing:h.computed(()=>C==null?void 0:C.bonestructure.using)});function S(p){let y="";return C.bonestructure.type==="relational.tree.leaf.file"?y="skelType=leaf&":C.bonestructure.type==="relational.tree.node.file"&&(y="skelType=node&"),we.get(`/${wA.VITE_DEFAULT_RENDERER||"vi"}/${C.bonestructure.module}/list?${y}limit=99`).then(async B=>{var k;const v=await B.json();return w.skels=v.skellist.reduce((_,R)=>(_[R.key]=R,_),{}),(k=v.skellist)==null?void 0:k.map(_=>({text:D(C.bonestructure.format,{dest:_}),value:_.key,data:_}))})}return h.onMounted(()=>{(!m.value||m.value.length===0)&&x.emit("change",m.name,[],m.lang)}),{state:w,boneState:C,addMultipleEntry:N,removeMultipleEntries:M,getList:S}}}),cl=m=>(h.pushScopeId("data-v-eeea51c6"),m=m(),h.popScopeId(),m),_A={class:"actionbar"},CA=["title"],vA=[cl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))],yA=["source"],EA=["title"],xA=cl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"plus-lg"},null,-1));function SA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",_A,[m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:0,variant:"danger",title:m.$t("bone.del"),outline:"",class:"delete-btn",onClick:x[0]||(x[0]=w=>m.openSelector())},vA,8,CA)):h.createCommentVNode("",!0),h.createElementVNode("sl-combobox",{source:m.getList,hoist:"",onSlItemSelect:x[1]||(x[1]=w=>{var S;return m.addMultipleEntry(m.lang,{dest:(S=m.state.skels)==null?void 0:S[w.detail.item.value],rel:m.state.hasUsing?void 0:null})})},null,40,yA),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:1,variant:"success",title:m.$t("bone.add"),outline:"",class:"add-btn",onClick:x[2]||(x[2]=w=>m.addMultipleEntry(m.lang))},[xA,h.createTextVNode(" "+h.toDisplayString(m.$t("bone.list")),1)],8,EA)):h.createCommentVNode("",!0)])}const DA=de(AA,[["render",SA],["__scopeId","data-v-eeea51c6"]]);var dl={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const BA=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.inject("addMultipleEntry");h.inject("formatString");const D=null,M=h.ref(),w=h.reactive({skels:{},uploadinput:null,loading:!1,droparea:!1,hasUsing:h.computed(()=>C==null?void 0:C.bonestructure.using)});function S(B){const v={fileName:B.name,mimeType:B.type||"application/octet-stream",size:B.size.toString()};return new Promise((k,_)=>{we.securePost(`/${dl.VITE_DEFAULT_RENDERER||"vi"}/file/getUploadURL`,{dataObj:v}).then(async R=>{let T=await R.json();fetch(T.values.uploadUrl,{body:B,method:"POST",mode:"no-cors"}).then(async O=>{const F={key:T.values.uploadKey,node:void 0,skelType:"leaf"};we.securePost(`/${dl.VITE_DEFAULT_RENDERER||"vi"}/file/add`,{dataObj:F}).then(async L=>{let $=await L.json();$.action==="addSuccess"?k($.values):_($)}).catch(L=>{_(L)})}).catch(O=>{_(O)})}).catch(R=>{_(R)})})}async function p(B){w.loading=!0;for(let v of B.target.files){let k=await S(v);M.value.value=null;let _=null;w.hasUsing&&(_=void 0),N(m.lang,{dest:k,rel:_})}w.loading=!1}async function y(B){w.loading=!0,w.droparea=!1;for(let v of B.dataTransfer.files){let k=await S(v);M.value.value=null;let _=null;w.hasUsing&&(_=void 0),N(m.lang,{dest:k,rel:_})}w.loading=!1}return h.onMounted(()=>{(!m.value||m.value.length===0)&&x.emit("change",m.name,[],m.lang)}),{state:w,boneState:C,addMultipleEntry:N,removeMultipleEntries:D,uploadFile:S,uploadinput:M,handleUpload:p,handleDrop:y}}}),lr=m=>(h.pushScopeId("data-v-9bac9f8a"),m=m(),h.popScopeId(),m),TA=["title"],IA=[lr(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))],PA={key:1,class:"droparea"},RA=["multiple"],OA=["title"],NA=[lr(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"plus-lg"},null,-1))],zA=["title"],MA=lr(()=>h.createElementVNode("sl-icon",{name:"upload"},null,-1)),FA={key:0,slot:"suffix"};function VA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",{class:"actionbar",onDragover:x[4]||(x[4]=h.withModifiers(w=>m.state.droparea=!0,["prevent"])),onDragleave:x[5]||(x[5]=w=>m.state.droparea=!1),onDrop:x[6]||(x[6]=h.withModifiers((...w)=>m.handleDrop&&m.handleDrop(...w),["prevent"]))},[m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:0,variant:"danger",title:m.$t("bone.del"),outline:"",class:"delete-btn",onClick:x[0]||(x[0]=w=>m.openSelector())},IA,8,TA)):h.createCommentVNode("",!0),m.state.droparea?(h.openBlock(),h.createElementBlock("div",PA," Dateien hier hinziehen ")):h.createCommentVNode("",!0),h.createElementVNode("input",{ref:"uploadinput",hidden:"",type:"file",multiple:m.boneState.multiple,onChange:x[1]||(x[1]=(...w)=>m.handleUpload&&m.handleUpload(...w))},null,40,RA),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:2,outline:"",title:m.$t("bone.list"),class:"add-btn",onClick:x[2]||(x[2]=w=>m.addMultipleEntry(m.lang))},NA,8,OA)):h.createCommentVNode("",!0),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:3,variant:"success",outline:"",title:m.$t("bone.upload"),class:"upload-btn",onClick:x[3]||(x[3]=w=>m.uploadinput.click())},[MA,h.createTextVNode(" "+h.toDisplayString(m.$t("bone.upload"))+" ",1),m.state.loading?(h.openBlock(),h.createElementBlock("sl-spinner",FA)):h.createCommentVNode("",!0)],8,zA)):h.createCommentVNode("",!0)],32)}const LA=de(BA,[["render",VA],["__scopeId","data-v-9bac9f8a"]]),cr=or.defineStore("boneStore",()=>{const m=h.reactive({additionalBones:h.shallowRef({}),defaultBones:h.shallowRef({rawBone:sr,keyBone:Ua,stringBone:Wa,emailBone:Ka,dateBone:Ga,booleanBone:Ja,selectBone:Za,passwordBone:Ya,recordBone:Xa,numericBone:tl,colorBone:el,relationalBone:nl,jsonBone:zw,fileBone:il,textBone:sl,spatialBone:al}),actionbars:h.shallowRef({"relational.tree.leaf.file.file":LA,"relational.":DA}),multibones:h.shallowRef(["select","select."])});function x(w,S){m.additionalBones[w]=S}function C(){let w=m.defaultBones;for(const[S,p]of Object.entries(m.additionalBones))w.add(p);return w}function N(w){if(Object.keys(m.additionalBones).includes(w))return m.additionalBones[w];{let S=w.split("."),p=Object.entries(m.additionalBones).filter(y=>y[0].startsWith(S[0]+"."));if(p.length>0){p.sort((y,B)=>B.length-y.length);for(let y of p)if(w.startsWith(y[0]))return m.additionalBones[y[0]]}}return w==="date"?Ga:w==="key"?Ua:w==="str.email"?Ka:w==="str"||w.startsWith("str.")?Wa:w==="select"||w.startsWith("select.")?Za:w==="bool"?Ja:w==="password"?Ya:w==="record"?Xa:w==="numeric"||w.startsWith("numeric.")?tl:w==="relational.tree.leaf.file.file"?il:w==="relational"||w.startsWith("relational.")?nl:w==="color"?el:w==="text"?sl:w==="spatial"?al:sr}function D(w,S){m.actionbars[w]=S}function M(w){if(Object.keys(m.actionbars).includes(w))return m.actionbars[w];{let S=w.split("."),p=Object.entries(m.actionbars).filter(y=>y[0].startsWith(S[0]+"."));if(p.length>0){p.sort((y,B)=>B.length-y.length);for(let y of p)if(w.startsWith(y[0]))return m.actionbars[y[0]]}}return bA}return{state:m,addBoneWidget:x,getBoneWidget:N,importWidgets:C,addBoneActionbar:D,getBoneActionbar:M}});function jA(m){return cr().getBoneActionbar(m)}function Yt(m){return cr().getBoneWidget(m)}function $A(m){const x=cr();if(x.state.multibones.includes(m))return!0;{let C=m.split("."),N=Object.entries(x.state.multibones).filter(D=>D[1].startsWith(C[0]+"."));if(N.length>0){N.sort((D,M)=>M.length-D.length);for(let D of N)if(m.startsWith(D[1]))return!0}}return!1}const dr=m=>(h.pushScopeId("data-v-25f20336"),m=m(),h.popScopeId(),m),HA=dr(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Nutzterdaten",-1)),qA=dr(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Lieferadresse",-1)),UA={key:0},WA=dr(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Rechnungsadresse",-1)),KA=de({__name:"UserInformation",props:{mode:{type:String,default:"form"},conditions:{type:Function}},setup(m){const x=vn(),C=h.reactive({formValues:{},requiredFieldsFilled:h.computed(()=>{if(C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("billing.city")&&Object.keys(C.formValues).includes("billing.street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname");if(!C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname")}),isCustomAdress:!1,addSkel:null,errors:{}});function N(w){w.target.checked&&(C.isCustomAdress=!1),w.target.checked||(C.isCustomAdress=!0)}function D(w,S){for(const[p,y]of Object.entries(S.value[0]))C.formValues[p]=y}function M(w){let S={};return w.forEach(p=>{let y=p[0],B=p[1];S[y]=B}),S}return h.watch(C.formValues,w=>{Object.entries(w).forEach(([S,p])=>{p===""&&delete C.formValues[S]})}),h.onBeforeMount(async()=>{await x.getAdressStructure(),C.addSkel=x.state.structure.address}),(w,S)=>{const p=h.resolveComponent("bone");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",null,[HA,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,y=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:y[0]},[y[1].visible&&y[1].params.group==="Customer Info"?(h.openBlock(),h.createBlock(p,{key:0,is:h.unref(Yt)(y[1].type),name:y[0],structure:M(C.addSkel),errors:C.errors[y[0]]?C.errors[y[0]]:[],skel:C.formValues,onChange:B=>D(y[0],B),class:"viur-shop-form-grid-w-2"},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]),h.createElementVNode("div",null,[qA,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,y=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:y[0]},[y[1].visible&&y[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(p,{key:0,is:h.unref(Yt)(y[1].type),name:y[0],structure:M(C.addSkel),errors:C.errors[y[0]]?C.errors[y[0]]:[],skel:C.formValues,onChange:B=>D(y[0],B)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]),C.isCustomAdress?(h.openBlock(),h.createElementBlock("div",UA,[WA,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,y=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:y[0]},[y[1].visible&&y[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(p,{key:0,is:h.unref(Yt)(y[1].type),name:y[0],structure:M(C.addSkel),errors:C.errors[y[0]]?C.errors[y[0]]:[],skel:C.formValues,onChange:B=>D(y[0],B)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))])):h.createCommentVNode("",!0),h.createElementVNode("sl-checkbox",{onSlChange:N,checked:""}," Rechnungsadresse wie Lieferadresse ",32)],64)}}},[["__scopeId","data-v-25f20336"]]),GA=h.defineComponent({props:{isDragging:Boolean,draggingLineBottom:Boolean,draggingLineTop:Boolean},components:{},emits:["change","delete","handleDragStart","handleDragEnd","handleDragOver","handleDrop"],setup(m,x){const C=h.inject("boneState");return{state:h.reactive({isDraggable:!1}),boneState:C}}}),hl=m=>(h.pushScopeId("data-v-141aaf9b"),m=m(),h.popScopeId(),m),ZA=["draggable"],JA=["disabled"],YA=[hl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"grip-vertical"},null,-1))],QA={class:"value"},XA=["disabled","title"],e0=[hl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))];function t0(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["value-line",{"is-dragging":m.isDragging,"dragging-line-bottom":m.draggingLineBottom,"dragging-line-top":m.draggingLineTop}]),draggable:m.state.isDraggable,onDragover:x[2]||(x[2]=w=>m.$emit("handleDragOver",w)),onDrop:x[3]||(x[3]=w=>m.$emit("handleDrop",w)),onDragstart:x[4]||(x[4]=w=>m.$emit("handleDragStart",w)),onDragend:x[5]||(x[5]=w=>m.$emit("handleDragEnd"))},[h.createElementVNode("sl-button",{disabled:m.boneState.readonly,class:"drag-button",onMousedown:x[0]||(x[0]=w=>m.state.isDraggable=!0)},YA,40,JA),h.createElementVNode("div",QA,[h.renderSlot(m.$slots,"default",{},void 0,!0)]),h.createElementVNode("sl-button",{variant:"danger",disabled:m.boneState.readonly,outline:"",title:m.$t("bone.del"),class:"delete-btn",onClick:x[1]||(x[1]=w=>m.$emit("delete"))},e0,8,XA)],42,ZA)}const n0=de(GA,[["render",t0],["__scopeId","data-v-141aaf9b"]]),o0=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change","handleClick"],setup(m,x){const C=h.inject("boneState");return{state:h.reactive({debug:!1}),boneState:C}}}),i0={class:"bone-name"},r0={key:0},s0={class:"bone"};function a0(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("label",i0,[h.renderSlot(m.$slots,"default",{},void 0,!0),h.createCommentVNode("",!0)]),m.state.debug?(h.openBlock(),h.createElementBlock("div",r0,[h.createElementVNode("div",s0,h.toDisplayString(m.name),1),h.createElementVNode("pre",null," "+h.toDisplayString(m.boneState)+` - `,1)])):h.createCommentVNode("",!0)],64)}const l0=de(o0,[["render",a0],["__scopeId","data-v-b7149172"]]),c0=h.defineComponent({inheritAttrs:!1,emits:["change","change-internal","handleClick"],components:{wrapperMultiple:n0,BoneLabel:l0},props:{is:{type:Object,default:sr},name:{type:String,required:!0},languages:Array,multiple:Boolean,readonly:Boolean,required:Boolean,params:Object,value:[Object,String,Number,Boolean,Array],structure:{type:Object,required:!0},skel:{type:null,required:!0},errors:Object,showLabelInfo:{type:Boolean,required:!1,default:!1},autofocus:{type:Boolean,required:!1,default:!1}},setup(m,x){const C=h.reactive({bonestructure:h.computed(()=>{var T;return(T=m.structure)==null?void 0:T[m.name]}),bonevalue:null,dragStartIndex:{lang:null,index:Number},dropIndex:{lang:null,index:Number},draggingLineBottom:{lang:String,index:Number},draggingLineTop:{lang:String,index:Number},isDragging:{lang:String,index:Number},multilanguage:h.computed(()=>{var T;return((T=C.languages)==null?void 0:T.length)&&C.languages.length>0}),languages:h.computed(()=>m.languages?m.languages:C.bonestructure&&Object.keys(C.bonestructure).includes("languages")?C.bonestructure.languages:[]),readonly:h.computed(()=>m.readonly?m.readonly:C.bonestructure&&Object.keys(C.bonestructure).includes("readonly")?C.bonestructure.readonly:!1),required:h.computed(()=>m.required?m.required:C.bonestructure&&Object.keys(C.bonestructure).includes("required")?C.bonestructure.required:!1),hasTooltip:h.computed(()=>!!(C.bonestructure&&Object.keys(C.bonestructure.params).includes("tooltip"))),multiple:h.computed(()=>m.multiple?m.multiple:C.bonestructure&&Object.keys(C.bonestructure).includes("multiple")?C.bonestructure.multiple:!1),params:h.computed(()=>m.params?m.params:C.bonestructure&&Object.keys(C.bonestructure).includes("params")?C.bonestructure.params:{}),actionbar:h.computed(()=>{var T;return jA((T=C.bonestructure)==null?void 0:T.type)}),isEmpty:h.computed(()=>{function T(O){for(const[F,L]of Object.entries(O))if(L!==null){if(Array.isArray(L)&&L.length>0)return!1;if(!Array.isArray(L))return!1}return!0}return C.readonly?!1:!C.bonevalue||Array.isArray(C.bonevalue)&&C.bonevalue.length===0?!0:C.bonevalue===Object(C.bonevalue)&&!Array.isArray(C.bonevalue)?T(C.bonevalue):!1}),errors:[],errorMessages:h.computed(()=>{let T=[];for(let O of m.errors)O.fieldPath[0]===m.name&&(O.severity>2||C.required&&(O.severity===2||O.severity===0))&&T.push(O.errorMessage);return T})});h.provide("boneState",C);function N(T,O,F){w(O,T,"isDragging"),w(O,T,"dragStartIndex")}function D(T,O,F){F.preventDefault();const L=F.clientY-F.target.getBoundingClientRect().top,$=F.target.closest(".value-line");L<$.offsetHeight/2?(w(O,T,"draggingLineTop"),S("draggingLineBottom"),C.dropIndex.index=T):(w(O,T,"draggingLineBottom"),S("draggingLineTop"),C.dropIndex.index=T+1);let K=O?C.bonevalue[O]:C.bonevalue;C.dropIndex.index>K.length-1&&(C.dropIndex.index-=1)}function M(T,O,F){let L=null;C.dragStartIndex.index!==C.dropIndex.index&&(O?(L=C.bonevalue[O].splice(C.dragStartIndex.index,1)[0],C.bonevalue[O].splice(C.dropIndex.index,0,L)):(L=C.bonevalue.splice(C.dragStartIndex.index,1)[0],C.bonevalue.splice(C.dropIndex.index,0,L)),console.dir(C.bonevalue[0]),x.emit("change",{name:m.name,value:y(),lang:O,index:T})),S("draggingLineBottom","draggingLineTop","isDragging","dragStartIndex","dropIndex")}function w(T,O,F){C[F].lang=T||null,C[F].index=O}function S(...T){T.forEach(O=>{C[O]={lang:null,index:Number}})}function p(T,O,F=null,L=null,$){if(O===void 0||(F?(C.bonevalue||(C.bonevalue={}),Object.keys(C.bonevalue).includes(F)&&L!==null?C.bonevalue[F][L]=O:C.bonevalue[F]=O):L!==null?C.bonevalue[L]=O:$===!1||(C.bonevalue=O),C.readonly))return!1;let K={name:T,value:y(),lang:F,index:L},J={name:T,value:O,lang:F,index:L};$!=null&&(K.pwMatch=$,J.pwMatch=$),x.emit("change",K),x.emit("change-internal",J)}function y(){function T(F,L=null){let $=[];if(Array.isArray(F))if(C.bonestructure.type=="spatial"&&F.length===2&&!Array.isArray(F[0]))$.push({[L+".lat"]:F[0]}),$.push({[L+".lng"]:F[1]});else if(Object.values(F).filter(K=>K===Object(K)).length>0)for(const[K,J]of F.entries())J.rel!==null?$.push(T(J,L+"."+K)):$.push(T(J,L));else for(const[K,J]of F.entries())$.push(T(J,L));else if(F===Object(F))for(const[K,J]of Object.entries(F))L?L.endsWith(".dest")||L.endsWith(".rel")?L.endsWith(".dest")&&K==="key"?(/\.[0-9]*\.dest$/.test(L)?$.push(T(J,L.replace(/\.[0-9]*\.dest/,""))):$.push(T(J,L.replace(/\.dest/,""))),$.push(T(J,L.replace(/\.dest/,"")+"."+K))):L.endsWith(".rel")&&$.push(T(J,L.replace(/\.rel/,"")+"."+K)):$.push(T(J,L+"."+K)):$.push(T(J,K));else F==null&&(F=""),L!==null&&$.push({[L]:F});return $}let O=T(C.bonevalue,m.name);return O=O.flat(10),O}function B(T=null,O=""){T?Object.keys(C.bonevalue).includes(T)?C.bonevalue[T].push(O):C.bonevalue[T]=[O]:C.bonevalue?C.bonevalue.push(O):C.bonevalue=[O]}h.provide("addMultipleEntry",B);function v(T,O=null){var F;O?(F=C.bonevalue)==null||F[O].splice(T,1):C.bonevalue.splice(T,1),x.emit("change",{name:m.name,value:y(),lang:O,index:T}),x.emit("change-internal",{name:m.name,value:y(),lang:O,index:T})}function k(T=null){var O;T?(O=C.bonevalue)==null||O[T].splice(0):C.bonevalue.splice(0),x.emit("change",{name:m.name,value:y(),lang:T}),x.emit("change-internal",{name:m.name,value:y(),lang:T})}h.provide("removeMultipleEntries",k);function _(T=null,O=""){B(T,O)}function R(T,O){function F(J){let te=[],Z=[],ee=/\$\((.*?)\)/g;for(;Z;){if(Z=ee.exec(J),!Z){Z=!1;continue}te.push(Z[1])}return te}function L(J,te){let Z=J.split("."),ee=J.split("."),I=te;for(let Q of Z)if(ee.shift(),I&&I!=="-"&&Object.keys(I).includes(Q)&&I[Q])if(Array.isArray(I[Q])){let _e=[];for(let Se of I[Q])_e.push(L(ee.join("."),Se));I=_e.join(", ")}else I=I[Q];else(!I||typeof I[Q]=="object"&&!I[Q])&&(I="-");return I}let $=F(T),K=[];Array.isArray(O)||(O=[O]);for(let J of O){let te=T;for(let Z of $){let ee=L(Z,J);te=te.replace("$("+Z+")",ee)}K.push(te)}return K.join(", ")}return h.provide("formatString",R),h.onBeforeMount(()=>{var T;m.value?C.bonevalue=m.value:C.bonevalue=(T=m.skel)==null?void 0:T[m.name]}),h.watch(()=>m.skel,(T,O)=>{var F;C.bonevalue=(F=m.skel)==null?void 0:F[m.name]}),h.watch(()=>{var T;return(T=m.errors)==null?void 0:T[m.name]},(T,O)=>{C.errors=m.errors}),{state:C,updateValue:p,addMultipleEntry:B,removeMultipleEntry:v,removeMultipleEntries:k,BoneHasMultipleHandling:$A,multipleBonePressEnter:_,handleDragStart:N,handleDragOver:D,handleDrop:M,setStateProperties:w,resetStateProperties:S}}}),so=m=>(h.pushScopeId("data-v-dee63f3c"),m=m(),h.popScopeId(),m),d0={key:0,class:"required"},h0=["content"],u0=[so(()=>h.createElementVNode("div",{class:"tooltip"},[h.createElementVNode("sl-icon",{name:"question"})],-1))],m0={key:0,variant:"info",open:"",class:"label-info"},g0=so(()=>h.createElementVNode("sl-icon",{slot:"icon",library:"bootstrap",name:"info-circle-fill"},null,-1)),p0={class:"bone-inner-wrap"},f0={key:0,class:"lang-tab",placement:"bottom"},k0=["panel"],b0=["name"],w0=[so(()=>h.createElementVNode("sl-input",{readonly:"",size:"medium",placeholder:"Keine Einträge"},null,-1))],A0={key:1,class:"multiple-placeholder"},_0=[so(()=>h.createElementVNode("sl-input",{readonly:"",size:"medium",placeholder:"Keine Einträge"},null,-1))],C0={open:"",summary:"Errors",variant:"info"},v0=so(()=>h.createElementVNode("sl-icon",{slot:"icon",name:"exclamation-triangle"},null,-1)),y0={class:"error-msg"};function E0(m,x,C,N,D,M){var p;const w=h.resolveComponent("bone-label"),S=h.resolveComponent("wrapper-multiple");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["bone-wrapper",(""+m.state.bonestructure.type.split(".")[0],{"has-subbones":m.state.bonestructure.using})])},[h.createVNode(w,{name:m.name},{default:h.withCtx(()=>[h.createElementVNode("span",{class:h.normalizeClass({required:m.state.required})},h.toDisplayString(m.state.bonestructure.descr),3),m.state.required?(h.openBlock(),h.createElementBlock("span",d0," *")):h.createCommentVNode("",!0),m.state.hasTooltip&&!m.showLabelInfo?(h.openBlock(),h.createElementBlock("sl-tooltip",{key:1,content:m.state.bonestructure.params.tooltip,placement:"top-center"},u0,8,h0)):h.createCommentVNode("",!0)]),_:1},8,["name"]),m.showLabelInfo&&m.state.hasTooltip?(h.openBlock(),h.createElementBlock("sl-alert",m0,[g0,h.createTextVNode(" "+h.toDisplayString(m.state.bonestructure.params.tooltip),1)])):h.createCommentVNode("",!0),h.createElementVNode("div",p0,[m.state.multilanguage?(h.openBlock(),h.createElementBlock("sl-tab-group",f0,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.languages,y=>{var B,v,k,_;return h.openBlock(),h.createElementBlock(h.Fragment,{key:y+"_tab"},[h.createElementVNode("sl-tab",{slot:"nav",panel:"lang_"+y},h.toDisplayString(m.$t(y)),9,k0),h.createElementVNode("sl-tab-panel",{name:"lang_"+y},[m.state.multiple&&!m.BoneHasMultipleHandling(m.state.bonestructure.type)?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(B=m.state.bonevalue)!=null&&B[y].length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList((v=m.state.bonevalue)==null?void 0:v[y],(R,T)=>(h.openBlock(),h.createElementBlock("div",{key:T,class:"multiple-bone"},[h.createVNode(S,{readonly:!m.state.readonly,"is-dragging":m.state.isDragging.lang===y&&m.state.isDragging.index===T,"dragging-line-bottom":m.state.draggingLineBottom.lang===y&&m.state.draggingLineBottom.index===T,"dragging-line-top":m.state.draggingLineTop.lang===y&&m.state.draggingLineTop.index===T,onDelete:O=>m.removeMultipleEntry(T,y),onHandleDragStart:O=>m.handleDragStart(T,y,O),onHandleDragOver:O=>m.handleDragOver(T,y,O),onHandleDrop:O=>m.handleDrop(T,y,O)},{default:h.withCtx(()=>[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{value:R,index:T,lang:y,name:m.name,onChange:m.updateValue,onKeydown:h.withKeys(O=>m.multipleBonePressEnter(y),["enter"])},null,40,["value","index","lang","name","onChange","onKeydown"]))]),_:2},1032,["readonly","is-dragging","dragging-line-bottom","dragging-line-top","onDelete","onHandleDragStart","onHandleDragOver","onHandleDrop"])]))),128)):(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["multiple-placeholder",{readonly:m.state.readonly}])},w0,2)),m.state.readonly?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.state.actionbar),{key:2,value:(k=m.state.bonevalue)==null?void 0:k[y],name:m.name,lang:y,onChange:m.updateValue},null,40,["value","name","lang","onChange"]))],64)):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{key:1,value:(_=m.state.bonevalue)==null?void 0:_[y],index:null,lang:y,name:m.name,onChange:m.updateValue},null,40,["value","lang","name","onChange"]))],8,b0)],64)}),128))])):(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[m.state.multiple&&!m.BoneHasMultipleHandling(m.state.bonestructure.type)?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(p=m.state.bonevalue)!=null&&p.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(m.state.bonevalue,(y,B)=>(h.openBlock(),h.createElementBlock("div",{key:B,class:"multiple-bone"},[h.createVNode(S,{readonly:!m.state.readonly,"is-dragging":m.state.isDragging.index===B,"dragging-line-bottom":m.state.draggingLineBottom.index===B,"dragging-line-top":m.state.draggingLineTop.index===B,onDelete:v=>m.removeMultipleEntry(B),onHandleDragStart:v=>m.handleDragStart(B,m.lang=null,v),onHandleDragOver:v=>m.handleDragOver(B,m.lang=null,v),onHandleDrop:v=>m.handleDrop(B,m.lang=null,v)},{default:h.withCtx(()=>[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{value:y,index:B,name:m.name,onChange:m.updateValue,onKeydown:x[0]||(x[0]=h.withKeys(v=>m.multipleBonePressEnter(),["enter"]))},null,40,["value","index","name","onChange"]))]),_:2},1032,["readonly","is-dragging","dragging-line-bottom","dragging-line-top","onDelete","onHandleDragStart","onHandleDragOver","onHandleDrop"])]))),128)):(h.openBlock(),h.createElementBlock("div",A0,_0)),m.state.readonly?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.state.actionbar),{key:2,value:m.state.bonevalue,name:m.name,onChange:m.updateValue},null,40,["value","name","onChange"]))],64)):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{key:1,value:m.state.bonevalue,name:m.name,index:null,autofocus:m.autofocus,onChange:m.updateValue,onKeypress:h.withKeys(m.updateValue,["enter"])},null,40,["value","name","autofocus","onChange","onKeypress"]))],64)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.errorMessages,y=>(h.openBlock(),h.createElementBlock("sl-alert",C0,[v0,h.createElementVNode("div",y0,h.toDisplayString(y),1)]))),256))])],2)}const hr=de(c0,[["render",E0],["__scopeId","data-v-dee63f3c"]]),Qt=m=>(h.pushScopeId("data-v-71a3c8c9"),m=m(),h.popScopeId(),m),x0=Qt(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Nutzterdaten",-1)),S0=Qt(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Lieferadresse",-1)),D0=["onSlChange","onSlClear","label"],B0=["value"],T0={key:0},I0=Qt(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Rechnungsadresse",-1)),P0=[Qt(()=>h.createElementVNode("sl-icon",{name:"x-lg",slot:"prefix"},null,-1))],R0=Qt(()=>h.createElementVNode("sl-icon",{name:"plus-lg",slot:"prefix"},null,-1)),O0=Qt(()=>h.createElementVNode("sl-icon",{slot:"icon",name:"exclamation-triangle"},null,-1)),N0=Qt(()=>h.createElementVNode("br",null,null,-1)),z0=de({__name:"UserInfoMulti",props:{mode:{type:String,default:"form"}},setup(m){const x=vn(),C=h.reactive({formValues:{},requiredFieldsFilled:h.computed(()=>{if(C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("billing.city")&&Object.keys(C.formValues).includes("billing.street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname");if(!C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname")}),isCustomAdress:!1,shippingAdressAmount:1,maxShippingAdress:h.computed(()=>Object.keys(x.state.carts).length+2),amountAlert:{title:"",msg:""},items:null,addSkel:null,errors:{},selectedItem:{},isInit:h.computed(()=>!!x.state.carts[x.state.basket])}),N=h.ref(null),D=h.ref(null);function M(k){k.target.checked&&(C.isCustomAdress=!1),k.target.checked||(C.isCustomAdress=!0)}function w(){if(C.shippingAdressAmount===C.maxShippingAdress){C.amountAlert.title="Zu viele Lieferadressen",C.amountAlert.msg=`Sie können nur maximal: "${C.maxShippingAdress}" Lieferadressen verwenden.`,D.value.show();return}C.shippingAdressAmount+=1}function S(k,_){for(const[R,T]of Object.entries(_.value[0]))C.formValues[R]=T}function p(){if(C.shippingAdressAmount===1){C.amountAlert.title="Zu wenig Lieferadressen",C.amountAlert.msg="Mindestens eine Lieferadresse muss angegeben werden.",D.value.show();return}C.shippingAdressAmount-=1}function y(k,_){if(console.log(k.target.value),!k.target.value.length){B();return}C.selectedItem[_]=k.target.value,C.isItemSelected=!0}function B(k,_){console.log("clearing..."),delete C.selectedItem[_],C.isItemSelected=!1}function v(k){let _={};return k.forEach(R=>{let T=R[0],O=R[1];_[T]=O}),_}return h.watch(C.formValues,k=>{Object.entries(k).forEach(([_,R])=>{R===""&&delete C.formValues[_]})}),h.onBeforeMount(async()=>{await x.getAdressStructure(),C.addSkel=x.state.structure.address}),(k,_)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",null,[x0,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,R=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:R[0]},[R[1].visible&&R[1].params.group==="Customer Info"?(h.openBlock(),h.createBlock(hr,{key:0,is:h.unref(Yt)(R[1].type),name:R[0],structure:v(C.addSkel),errors:C.errors[R[0]]?C.errors[R[0]]:[],skel:C.formValues,onChange:T=>S(R[0],T),class:"viur-shop-form-grid-w-2"},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]),S0,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.shippingAdressAmount,R=>(h.openBlock(),h.createElementBlock("div",{key:R},[h.createElementVNode("sl-select",{clearable:"",ref_for:!0,ref_key:"itemSelection",ref:N,onSlChange:T=>y(T,R),onSlClear:T=>B(T,R),label:C.selectedItem[R]?h.unref(x).state.carts[C.selectedItem[R]].info.name:"Warenkorb für Adresse wählen.",class:"grid-w-4"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(h.unref(x).state.carts,(T,O)=>(h.openBlock(),h.createElementBlock("sl-option",{value:O},h.toDisplayString(T.info.name),9,B0))),256))],40,D0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,T=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:T[0]},[T[1].visible&&T[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(hr,{key:0,is:h.unref(Yt)(T[1].type),name:T[0],structure:v(C.addSkel),errors:C.errors[T[0]]?C.errors[T[0]]:[],skel:C.formValues,onChange:O=>S(T[0],O)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]))),128)),C.isCustomAdress?(h.openBlock(),h.createElementBlock("div",T0,[I0,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,R=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:R[0]},[R[1].visible&&R[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(hr,{key:0,is:h.unref(Yt)(R[1].type),name:R[0],structure:v(C.addSkel),errors:C.errors[R[0]]?C.errors[R[0]]:[],skel:C.formValues,onChange:T=>S(R[0],T)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))])):h.createCommentVNode("",!0),h.createElementVNode("div",{class:"viur-shop-form-btn-wrap"},[h.createElementVNode("sl-button",{size:"medium",onClick:p,title:"Lieferadresse entfernen"},P0),h.createElementVNode("sl-button",{size:"medium",variant:"primary",onClick:w},[R0,h.createTextVNode(" Lieferadresse hinzufügen ")])]),h.createElementVNode("sl-alert",{variant:"warning",duration:"2000",ref_key:"shippingWarning",ref:D,closable:""},[O0,h.createElementVNode("strong",null,h.toDisplayString(C.amountAlert.title),1),N0,h.createTextVNode(" "+h.toDisplayString(C.amountAlert.msg),1)],512),h.createElementVNode("sl-checkbox",{onSlChange:M,checked:""}," Rechnungsadresse wie Lieferadresse ",32)],64))}},[["__scopeId","data-v-71a3c8c9"]]),ul={__name:"ExampleUsage",setup(m){const x=vn(),C=h.computed(()=>x.state.basketRootNode.key?x.state.basketRootNode.key:""),N=h.reactive({rootNode:{},tabs:{cart:{component:h.shallowRef(rr),props:{sidebar:!0,mode:"basket",cartKey:C},displayName:"Warenkorb",icon:{name:"cart",library:"hsk"},position:2,disabled:!1,atShow:null,atHide:null},orderComplete:{component:h.shallowRef(xb),props:{},displayName:"Bestellung Abgeschlossen",icon:{name:"order-confirmed",library:"hsk"},position:6,disabled:!0,atShow:null,atHide:null},userInfo:{component:h.shallowRef(KA),props:{},displayName:"Daten Eingeben",icon:{name:"user",library:"hsk"},position:3,disabled:!1,atShow:null,atHide:null},userInfoMulti:{component:h.shallowRef(z0),props:{},displayName:"Daten Eingeben (Multi)",icon:{name:"user",library:"hsk"},position:4,disabled:!1,atShow:null,atHide:null}}});function D(M){(M==null?void 0:M.detail.name)==="confirm"&&(N.tabs.orderComplete.disabled=!1)}return h.onBeforeMount(async()=>{await x.init(),await x.getAdressStructure(),console.log("debug init exampleusage :",x.state.basketRootNode)}),(M,w)=>(h.openBlock(),h.createBlock(_b,{tabs:N.tabs,onTabChange:D},null,8,["tabs"]))}},M0={install(m){m.component("CartView",rr),m.component("ExampleUsage",ul),m.component("ConfirmView",qa)}};Ve.CartView=rr,Ve.ConfirmView=qa,Ve.ExampleUsage=ul,Ve.default=M0,Ve.useCartStore=vn,Object.defineProperties(Ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); +`);let i=0;return n.filter(r=>r.length).map(r=>function(s,a){return a.some(l=>!l.isVoid&&!!new RegExp(`<${l.name}( .*?)?>`).test(s))}(r,e)?Ma(r,i++):function(s,a){return a.some(l=>new RegExp(``).test(s))}(r,e)?Ma(r,--i):Ma(r,i)).join(` +`)}function Ma(o,e,t=" "){return`${t.repeat(Math.max(0,e))}${o}`}var Rf=D(2896),bD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Rf.Z,bD),Rf.Z.locals;const Of="SourceEditingMode";function wD(o){return function(e){return e.startsWith("<")}(o)?kD(o):o}const Fa="removeFormat";class AD extends q{static get pluginName(){return"RemoveFormatUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Fa,n=>{const i=e.commands.get(Fa),r=new Ae(n);return r.set({label:t("Remove Format"),icon:'',tooltip:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute(Fa),e.editing.view.focus()}),r})}}class _D extends ne{refresh(){const e=this.editor.model;this.isEnabled=!!ze(this._getFormattingItems(e.document.selection,e.schema))}execute(){const e=this.editor.model,t=e.schema;e.change(n=>{for(const i of this._getFormattingItems(e.document.selection,t))if(i.is("selection"))for(const r of this._getFormattingAttributes(i,t))n.removeSelectionAttribute(r);else{const r=n.createRangeOn(i);for(const s of this._getFormattingAttributes(i,t))n.removeAttribute(s,r)}})}*_getFormattingItems(e,t){const n=i=>!!ze(this._getFormattingAttributes(i,t));for(const i of e.getRanges())for(const r of i.getItems())!t.isBlock(r)&&n(r)&&(yield r);for(const i of e.getSelectedBlocks())n(i)&&(yield i);n(e)&&(yield e)}*_getFormattingAttributes(e,t){for(const[n]of e.getAttributes()){const i=t.getAttributeProperties(n);i&&i.isFormatting&&(yield n)}}}class CD extends q{static get pluginName(){return"RemoveFormatEditing"}init(){const e=this.editor;e.commands.add("removeFormat",new _D(e))}}var vD=Object.defineProperty,Nf=Object.getOwnPropertySymbols,yD=Object.prototype.hasOwnProperty,ED=Object.prototype.propertyIsEnumerable,zf=(o,e,t)=>e in o?vD(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Mf=(o,e)=>{for(var t in e||(e={}))yD.call(e,t)&&zf(o,t,e[t]);if(Nf)for(var t of Nf(e))ED.call(e,t)&&zf(o,t,e[t]);return o};function An(o,e,t,n){e&&function(i,r,s){if(r.attributes)for(const[a]of Object.entries(r.attributes))i.removeAttribute(a,s);if(r.styles)for(const a of Object.keys(r.styles))i.removeStyle(a,s);r.classes&&i.removeClass(r.classes,s)}(o,e,n),t&&Gt(o,t,n)}function Gt(o,e,t){if(e.attributes)for(const[n,i]of Object.entries(e.attributes))o.setAttribute(n,i,t);e.styles&&o.setStyle(e.styles,t),e.classes&&o.addClass(e.classes,t)}function xD(o,e){const t=Ut(o);let n="attributes";for(n in e)t[n]=n=="classes"?Array.from(new Set([...o[n]||[],...e[n]])):Mf(Mf({},o[n]),e[n]);return t}function _n(o,e,t,n,i){const r=e.getAttribute(t),s={};for(const a of["attributes","styles","classes"]){if(a!=n){r&&r[a]&&(s[a]=r[a]);continue}if(n=="classes"){const c=new Set(r&&r.classes||[]);i(c),c.size&&(s[a]=Array.from(c));continue}const l=new Map(Object.entries(r&&r[a]||{}));i(l),l.size&&(s[a]=Object.fromEntries(l))}Object.keys(s).length?e.is("documentSelection")?o.setSelectionAttribute(t,s):o.setAttribute(t,s,e):r&&(e.is("documentSelection")?o.removeSelectionAttribute(t):o.removeAttribute(t,e))}function Va({model:o}){return(e,t)=>t.writer.createElement(o,{htmlContent:e.getCustomProperty("$rawContent")})}function SD(o,{view:e,isInline:t}){const n=o.t;return(i,{writer:r})=>{const s=n("HTML object"),a=Qi(e,i,r),l=i.getAttribute("htmlAttributes");return r.addClass("html-object-embed__content",a),l&&Gt(r,l,a),ia(r.createContainerElement(t?"span":"div",{class:"html-object-embed","data-html-object-embed-label":s},a),r,{label:s})}}function Qi(o,e,t){return t.createRawElement(o,null,(n,i)=>{i.setContentOf(n,e.getAttribute("htmlContent"))})}function DD({priority:o,view:e}){return(t,n)=>{if(!t)return;const{writer:i}=n,r=i.createAttributeElement(e,null,{priority:o});return Gt(i,t,r),r}}function Vo({view:o},e){return t=>{t.on(`element:${o}`,(n,i,r)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const s=e.processViewAttributes(i.viewItem,r);s&&r.writer.setAttribute("htmlAttributes",s,i.modelRange)},{priority:"low"})}}function Lo({model:o}){return e=>{e.on(`attribute:htmlAttributes:${o}`,(t,n,i)=>{if(!i.consumable.consume(n.item,t.name))return;const{attributeOldValue:r,attributeNewValue:s}=n;An(i.writer,r,s,i.mapper.toViewElement(n.item))})}}const BD=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}}],TD=[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0},{model:"htmlListAttributes",view:"ol",appliesToBlock:!0},{model:"htmlListAttributes",view:"ul",appliesToBlock:!0},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{copyOnEnter:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],isInline:!0}}],ID=as(function(o,e,t,n){wd(o,e,t,n)});var PD=Object.defineProperty,RD=Object.defineProperties,OD=Object.getOwnPropertyDescriptors,Ff=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,zD=Object.prototype.propertyIsEnumerable,Vf=(o,e,t)=>e in o?PD(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Xi=(o,e)=>{for(var t in e||(e={}))ND.call(e,t)&&Vf(o,t,e[t]);if(Ff)for(var t of Ff(e))zD.call(e,t)&&Vf(o,t,e[t]);return o},er=(o,e)=>RD(o,OD(e));class Xn extends q{constructor(){super(...arguments),this._definitions=[]}static get pluginName(){return"DataSchema"}init(){for(const e of BD)this.registerBlockElement(e);for(const e of TD)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push(er(Xi({},e),{isBlock:!0}))}registerInlineElement(e){this._definitions.push(er(Xi({},e),{isInline:!0}))}extendBlockElement(e){this._extendDefinition(er(Xi({},e),{isBlock:!0}))}extendInlineElement(e){this._extendDefinition(er(Xi({},e),{isInline:!0}))}getDefinitionsForView(e,t=!1){const n=new Set;for(const i of this._getMatchingViewDefinitions(e)){if(t)for(const r of this._getReferences(i.model))n.add(r);n.add(i)}return n}getDefinitionsForModel(e){return this._definitions.filter(t=>t.model==e)}_getMatchingViewDefinitions(e){return this._definitions.filter(t=>t.view&&function(n,i){return typeof n=="string"?n===i:n instanceof RegExp?n.test(i):!1}(e,t.view))}*_getReferences(e){const t=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],n=this._definitions.filter(i=>i.model==e);for(const{modelSchema:i}of n)if(i)for(const r of t)for(const s of Pe(i[r]||[])){const a=this._definitions.filter(l=>l.model==s);for(const l of a)s!==e&&(yield*this._getReferences(l.model),yield l)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter(([,n])=>n.model==e.model);if(t.length!=0)for(const[n,i]of t)this._definitions[n]=ID({},i,e,(r,s)=>Array.isArray(r)?r.concat(s):void 0);else this._definitions.push(e)}}const MD=function(o,e,t,n){for(var i=o.length,r=t+-1;++r-1;)a!==o&&Lf.call(a,l,1),Lf.call(o,l,1);return o},$D=_d(function(o,e){return o&&o.length&&e&&e.length?jD(o,e):o});var jf=D(5049),HD={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(jf.Z,HD),jf.Z.locals;class Fe extends q{constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new Mn,this._disallowedAttributes=new Mn,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerModelPostFixer()}static get pluginName(){return"DataFilter"}static get requires(){return[Xn,Mo]}loadAllowedConfig(e){for(const t of e){const n=t.name||/[\s\S]+/,i=qf(t);this.allowElement(n),i.forEach(r=>this.allowAttributes(r))}}loadDisallowedConfig(e){for(const t of e){const n=t.name||/[\s\S]+/,i=qf(t);i.length==0?this.disallowElement(n):i.forEach(r=>this.disallowAttributes(r))}}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){return $f(e,t,this._disallowedAttributes),$f(e,t,this._allowedAttributes)}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&typeof e.appliesToBlock=="string")for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(e)},{priority:te.get("highest")+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)},{priority:te.get("highest")+1})}_registerElementHandlers(){this.on("register",(e,t)=>{const n=this.editor.model.schema;if(t.isObject&&!n.isRegistered(t.model))this._registerObjectElement(t);else if(t.isBlock)this._registerBlockElement(t);else{if(!t.isInline)throw new I("data-filter-invalid-definition",null,t);this._registerInlineElement(t)}e.stop()},{priority:"lowest"})}_registerModelPostFixer(){const e=this.editor.model;e.document.registerPostFixer(t=>{const n=e.document.differ.getChanges();let i=!1;const r=this._getCoupledAttributesMap();for(const s of n){if(s.type!="attribute"||s.attributeNewValue!==null)continue;const a=r.get(s.attributeKey);if(a)for(const{item:l}of s.range.getWalker({shallow:!0}))for(const c of a)l.hasAttribute(c)&&(t.removeAttribute(c,l),i=!0)}return i})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const t=this.editor,n=t.model.schema,i=t.conversion,{view:r,model:s}=e;n.register(s,e.modelSchema),r&&(n.extend(e.model,{allowAttributes:["htmlAttributes","htmlContent"]}),t.data.registerRawContentMatcher({name:r}),i.for("upcast").elementToElement({view:r,model:Va(e),converterPriority:te.get("low")+1}),i.for("upcast").add(Vo(e,this)),i.for("editingDowncast").elementToStructure({model:{name:s,attributes:["htmlAttributes"]},view:SD(t,e)}),i.for("dataDowncast").elementToElement({model:s,view:(a,{writer:l})=>Qi(r,a,l)}),i.for("dataDowncast").add(Lo(e)))}_registerBlockElement(e){const t=this.editor,n=t.model.schema,i=t.conversion,{view:r,model:s}=e;if(!n.isRegistered(e.model)){if(n.register(e.model,e.modelSchema),!r)return;i.for("upcast").elementToElement({model:s,view:r,converterPriority:te.get("low")+1}),i.for("downcast").elementToElement({model:s,view:r})}r&&(n.extend(e.model,{allowAttributes:"htmlAttributes"}),i.for("upcast").add(Vo(e,this)),i.for("downcast").add(Lo(e)))}_registerInlineElement(e){const t=this.editor,n=t.model.schema,i=t.conversion,r=e.model;e.appliesToBlock||(n.extend("$text",{allowAttributes:r}),e.attributeProperties&&n.setAttributeProperties(r,e.attributeProperties),i.for("upcast").add(function({view:s,model:a},l){return c=>{c.on(`element:${s}`,(d,u,g)=>{let f=l.processViewAttributes(u.viewItem,g);if(f||g.consumable.test(u.viewItem,{name:!0})){f=f||{},g.consumable.consume(u.viewItem,{name:!0}),u.modelRange||(u=Object.assign(u,g.convertChildren(u.viewItem,u.modelCursor)));for(const b of u.modelRange.getItems())if(g.schema.checkAttribute(b,a)){const A=xD(f,b.getAttribute(a)||{});g.writer.setAttribute(a,A,b)}}},{priority:"low"})}}(e,this)),i.for("downcast").attributeToElement({model:r,view:DD(e)}))}}function $f(o,e,t){const n=function(l,{consumable:c},d){const u=d.matchAll(l)||[],g=[];for(const f of u)qD(c,l,f),delete f.match.name,c.consume(l,f.match),g.push(f);return g}(o,e,t),{attributes:i,styles:r,classes:s}=function(l){const c={attributes:new Set,classes:new Set,styles:new Set};for(const d of l)for(const u in c)(d.match[u]||[]).forEach(g=>c[u].add(g));return c}(n),a={};if(i.size)for(const l of i)_c(l)||i.delete(l);return i.size&&(a.attributes=Hf(i,l=>o.getAttribute(l))),r.size&&(a.styles=Hf(r,l=>o.getStyle(l))),s.size&&(a.classes=Array.from(s)),Object.keys(a).length?a:null}function qD(o,e,t){for(const n of["attributes","classes","styles"]){const i=t.match[n];if(i)for(const r of Array.from(i))o.test(e,{[n]:[r]})||$D(i,r)}}function Hf(o,e){const t={};for(const n of o)e(n)!==void 0&&(t[n]=e(n));return t}function La(o,e){const{name:t}=o,n=o[e];return Ge(n)?Object.entries(n).map(([i,r])=>({name:t,[e]:{[i]:r}})):Array.isArray(n)?n.map(i=>({name:t,[e]:[i]})):[o]}function qf(o){const{name:e,attributes:t,classes:n,styles:i}=o,r=[];return t&&r.push(...La({name:e,attributes:t},"attributes")),n&&r.push(...La({name:e,classes:n},"classes")),i&&r.push(...La({name:e,styles:i},"styles")),r}class UD extends q{static get requires(){return[Fe]}static get pluginName(){return"CodeBlockElementSupport"}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(Fe);e.on("register:pre",(t,n)=>{if(n.model!=="codeBlock")return;const i=this.editor,r=i.model.schema,s=i.conversion;r.extend("codeBlock",{allowAttributes:["htmlAttributes","htmlContentAttributes"]}),s.for("upcast").add(function(a){return l=>{l.on("element:code",(c,d,u)=>{const g=d.viewItem,f=g.parent;function b(A,E){const P=a.processViewAttributes(A,u);P&&u.writer.setAttribute(E,P,d.modelRange)}f&&f.is("element","pre")&&(b(f,"htmlAttributes"),b(g,"htmlContentAttributes"))},{priority:"low"})}}(e)),s.for("downcast").add(a=>{a.on("attribute:htmlAttributes:codeBlock",(l,c,d)=>{if(!d.consumable.consume(c.item,l.name))return;const{attributeOldValue:u,attributeNewValue:g}=c,f=d.mapper.toViewElement(c.item).parent;An(d.writer,u,g,f)}),a.on("attribute:htmlContentAttributes:codeBlock",(l,c,d)=>{if(!d.consumable.consume(c.item,l.name))return;const{attributeOldValue:u,attributeNewValue:g}=c,f=d.mapper.toViewElement(c.item);An(d.writer,u,g,f)})}),t.stop()})}}class WD extends q{static get requires(){return[Fe]}static get pluginName(){return"DualContentModelElementSupport"}init(){this.editor.plugins.get(Fe).on("register",(e,t)=>{const n=t,i=this.editor,r=i.model.schema,s=i.conversion;if(!n.paragraphLikeModel||r.isRegistered(n.model)||r.isRegistered(n.paragraphLikeModel))return;const a={model:n.paragraphLikeModel,view:n.view};r.register(n.model,n.modelSchema),r.register(a.model,{inheritAllFrom:"$block"}),s.for("upcast").elementToElement({view:n.view,model:(l,{writer:c})=>this._hasBlockContent(l)?c.createElement(n.model):c.createElement(a.model),converterPriority:te.get("low")+.5}),s.for("downcast").elementToElement({view:n.view,model:n.model}),this._addAttributeConversion(n),s.for("downcast").elementToElement({view:a.view,model:a.model}),this._addAttributeConversion(a),e.stop()})}_hasBlockContent(e){const t=this.editor.editing.view,n=t.domConverter.blockElements;for(const i of t.createRangeIn(e).getItems())if(i.is("element")&&n.includes(i.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,n=t.conversion,i=t.plugins.get(Fe);t.model.schema.extend(e.model,{allowAttributes:"htmlAttributes"}),n.for("upcast").add(Vo(e,i)),n.for("downcast").add(Lo(e))}}class KD extends q{static get requires(){return[Xn,zo]}static get pluginName(){return"HeadingElementSupport"}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t),this.removeClassesOnEnter(e,t)}registerHeadingElements(e,t){const n=e.plugins.get(Xn),i=[];for(const r of t)"model"in r&&"view"in r&&(n.registerBlockElement({view:r.view,model:r.model}),i.push(r.model));n.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:i}})}removeClassesOnEnter(e,t){const n=e.commands.get("enter");this.listenTo(n,"afterExecute",(i,r)=>{const s=e.model.document.selection.getFirstPosition().parent;t.some(a=>s.is("element",a.model))&&s.childCount===0&&_n(r.writer,s,"htmlAttributes","classes",a=>a.clear())})}}function tr(o,e,t){const n=o.createRangeOn(e);for(const{item:i}of n.getWalker())if(i.is("element",t))return i}class GD extends q{static get requires(){return[Fe]}static get pluginName(){return"ImageElementSupport"}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,n=e.conversion,i=e.plugins.get(Fe);i.on("register:figure",()=>{n.for("upcast").add(function(r){return s=>{s.on("element:figure",(a,l,c)=>{const d=l.viewItem;if(!l.modelRange||!d.hasClass("image"))return;const u=r.processViewAttributes(d,c);u&&c.writer.setAttribute("htmlFigureAttributes",u,l.modelRange)},{priority:"low"})}}(i))}),i.on("register:img",(r,s)=>{s.model!=="imageBlock"&&s.model!=="imageInline"||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlAttributes"]}),n.for("upcast").add(function(a){return l=>{l.on("element:img",(c,d,u)=>{if(!d.modelRange)return;const g=d.viewItem,f=g.parent;function b(E,P){const z=a.processViewAttributes(E,u);z&&u.writer.setAttribute(P,z,d.modelRange)}function A(E){d.modelRange&&d.modelRange.getContainedElement().is("element","imageBlock")&&b(E,"htmlLinkAttributes")}b(g,"htmlAttributes"),f.is("element","a")&&A(f)},{priority:"low"})}}(i)),n.for("downcast").add(a=>{function l(d){a.on(`attribute:${d}:imageInline`,(u,g,f)=>{if(!f.consumable.consume(g.item,u.name))return;const{attributeOldValue:b,attributeNewValue:A}=g,E=f.mapper.toViewElement(g.item);An(f.writer,b,A,E)},{priority:"low"})}function c(d,u){a.on(`attribute:${u}:imageBlock`,(g,f,b)=>{if(!b.consumable.test(f.item,g.name))return;const{attributeOldValue:A,attributeNewValue:E}=f,P=b.mapper.toViewElement(f.item),z=tr(b.writer,P,d);z&&(An(b.writer,A,E,z),b.consumable.consume(f.item,g.name))},{priority:"low"}),d==="a"&&a.on("attribute:linkHref:imageBlock",(g,f,b)=>{if(!b.consumable.consume(f.item,"attribute:htmlLinkAttributes:imageBlock"))return;const A=b.mapper.toViewElement(f.item),E=tr(b.writer,A,"a");Gt(b.writer,f.item.getAttribute("htmlLinkAttributes"),E)},{priority:"low"})}l("htmlAttributes"),c("img","htmlAttributes"),c("figure","htmlFigureAttributes"),c("a","htmlLinkAttributes")}),r.stop())})}}class ZD extends q{static get requires(){return[Fe]}static get pluginName(){return"MediaEmbedElementSupport"}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,n=e.conversion,i=this.editor.plugins.get(Fe),r=this.editor.plugins.get(Xn),s=e.config.get("mediaEmbed.elementName");r.registerBlockElement({model:"media",view:s}),i.on("register:figure",()=>{n.for("upcast").add(function(a){return l=>{l.on("element:figure",(c,d,u)=>{const g=d.viewItem;if(!d.modelRange||!g.hasClass("media"))return;const f=a.processViewAttributes(g,u);f&&u.writer.setAttribute("htmlFigureAttributes",f,d.modelRange)},{priority:"low"})}}(i))}),i.on(`register:${s}`,(a,l)=>{l.model==="media"&&(t.extend("media",{allowAttributes:["htmlAttributes","htmlFigureAttributes"]}),n.for("upcast").add(function(c,d){const u=(g,f,b)=>{function A(E,P){const z=c.processViewAttributes(E,b);z&&b.writer.setAttribute(P,z,f.modelRange)}A(f.viewItem,"htmlAttributes")};return g=>{g.on(`element:${d}`,u,{priority:"low"})}}(i,s)),n.for("dataDowncast").add(function(c){return d=>{function u(g,f){d.on(`attribute:${f}:media`,(b,A,E)=>{if(!E.consumable.consume(A.item,b.name))return;const{attributeOldValue:P,attributeNewValue:z}=A,j=E.mapper.toViewElement(A.item),Y=tr(E.writer,j,g);An(E.writer,P,z,Y)})}u(c,"htmlAttributes"),u("figure","htmlFigureAttributes")}}(s)),a.stop())})}}class JD extends q{static get requires(){return[Fe]}static get pluginName(){return"ScriptElementSupport"}init(){const e=this.editor.plugins.get(Fe);e.on("register:script",(t,n)=>{const i=this.editor,r=i.model.schema,s=i.conversion;r.register("htmlScript",n.modelSchema),r.extend("htmlScript",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"script"}),s.for("upcast").elementToElement({view:"script",model:Va(n)}),s.for("upcast").add(Vo(n,e)),s.for("downcast").elementToElement({model:"htmlScript",view:(a,{writer:l})=>Qi("script",a,l)}),s.for("downcast").add(Lo(n)),t.stop()})}}class YD extends q{static get requires(){return[Fe]}static get pluginName(){return"TableElementSupport"}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,n=e.conversion,i=e.plugins.get(Fe),r=e.plugins.get("TableUtils");i.on("register:figure",()=>{n.for("upcast").add(function(s){return a=>{a.on("element:figure",(l,c,d)=>{const u=c.viewItem;if(!c.modelRange||!u.hasClass("table"))return;const g=s.processViewAttributes(u,d);g&&d.writer.setAttribute("htmlFigureAttributes",g,c.modelRange)},{priority:"low"})}}(i))}),i.on("register:table",(s,a)=>{a.model==="table"&&(t.extend("table",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),n.for("upcast").add(function(l){return c=>{c.on("element:table",(d,u,g)=>{if(!u.modelRange)return;const f=u.viewItem;b(f,"htmlAttributes");for(const A of f.getChildren())A.is("element","thead")&&b(A,"htmlTheadAttributes"),A.is("element","tbody")&&b(A,"htmlTbodyAttributes");function b(A,E){const P=l.processViewAttributes(A,g);P&&g.writer.setAttribute(E,P,u.modelRange)}},{priority:"low"})}}(i)),n.for("downcast").add(l=>{function c(d,u){l.on(`attribute:${u}:table`,(g,f,b)=>{if(!b.consumable.test(f.item,g.name))return;const A=b.mapper.toViewElement(f.item),E=tr(b.writer,A,d);E&&(b.consumable.consume(f.item,g.name),An(b.writer,f.attributeOldValue,f.attributeNewValue,E))})}c("table","htmlAttributes"),c("figure","htmlFigureAttributes"),c("thead","htmlTheadAttributes"),c("tbody","htmlTbodyAttributes")}),e.model.document.registerPostFixer(function(l,c){return d=>{const u=l.document.differ.getChanges();let g=!1;for(const f of u){if(f.type!="attribute"||f.attributeKey!="headingRows")continue;const b=f.range.start.nodeAfter,A=b.getAttribute("htmlTheadAttributes"),E=b.getAttribute("htmlTbodyAttributes");A&&!f.attributeNewValue?(d.removeAttribute("htmlTheadAttributes",b),g=!0):E&&f.attributeNewValue==c.getRows(b)&&(d.removeAttribute("htmlTbodyAttributes",b),g=!0)}return g}}(e.model,r)),s.stop())})}}class QD extends q{static get requires(){return[Fe]}static get pluginName(){return"StyleElementSupport"}init(){const e=this.editor.plugins.get(Fe);e.on("register:style",(t,n)=>{const i=this.editor,r=i.model.schema,s=i.conversion;r.register("htmlStyle",n.modelSchema),r.extend("htmlStyle",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"style"}),s.for("upcast").elementToElement({view:"style",model:Va(n)}),s.for("upcast").add(Vo(n,e)),s.for("downcast").elementToElement({model:"htmlStyle",view:(a,{writer:l})=>Qi("style",a,l)}),s.for("downcast").add(Lo(n)),t.stop()})}}class XD extends q{static get requires(){return[Fe]}static get pluginName(){return"DocumentListElementSupport"}init(){const e=this.editor;if(!e.plugins.has("DocumentListEditing"))return;const t=e.model.schema,n=e.conversion,i=e.plugins.get(Fe),r=e.plugins.get("DocumentListEditing");r.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast(s,a,l){Gt(s,a,l)}}),r.registerDowncastStrategy({scope:"list",attributeName:"htmlListAttributes",setAttributeOnDowncast(s,a,l){Gt(s,a,l)}}),i.on("register",(s,a)=>{["ul","ol","li"].includes(a.view)&&(s.stop(),t.checkAttribute("$block","htmlListAttributes")||(t.extend("$block",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),t.extend("$blockObject",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),t.extend("$container",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),n.for("upcast").add(l=>{l.on("element:ul",ja("htmlListAttributes",i),{priority:"low"}),l.on("element:ol",ja("htmlListAttributes",i),{priority:"low"}),l.on("element:li",ja("htmlLiAttributes",i),{priority:"low"})})))}),r.on("postFixer",(s,{listNodes:a,writer:l})=>{const c=[];for(const{node:d,previous:u}of a){if(!u)continue;const g=d.getAttribute("listIndent"),f=u.getAttribute("listIndent");let b=null;if(g>f?c[f]=u:g{e.model.change(r=>{for(const s of i)r.setAttribute("htmlListAttributes",{},s)})})}}function ja(o,e){return(t,n,i)=>{const r=n.viewItem;n.modelRange||Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor));const s=e.processViewAttributes(r,i);for(const a of n.modelRange.getItems({shallow:!0}))a.hasAttribute("listItemId")&&(a.hasAttribute(o)||i.writer.setAttribute(o,s||{},a))}}class eB extends q{static get requires(){return[Fe,Xn]}static get pluginName(){return"CustomElementSupport"}init(){const e=this.editor.plugins.get(Fe),t=this.editor.plugins.get(Xn);e.on("register:$customElement",(n,i)=>{n.stop();const r=this.editor,s=r.model.schema,a=r.conversion,l=r.editing.view.domConverter.unsafeElements,c=r.data.htmlProcessor.domConverter.preElements;s.register(i.model,i.modelSchema),s.extend(i.model,{allowAttributes:["htmlElementName","htmlAttributes","htmlContent"],isContent:!0}),a.for("upcast").elementToElement({view:/.*/,model:(d,u)=>{if(d.name=="$comment"||!function(E){try{document.createElement(E)}catch{return!1}return!0}(d.name)||t.getDefinitionsForView(d.name).size)return null;l.includes(d.name)||l.push(d.name),c.includes(d.name)||c.push(d.name);const g=u.writer.createElement(i.model,{htmlElementName:d.name}),f=e.processViewAttributes(d,u);f&&u.writer.setAttribute("htmlAttributes",f,g);const b=new Bi(d.document).createDocumentFragment(d),A=r.data.processor.toData(b);u.writer.setAttribute("htmlContent",A,g);for(const{item:E}of r.editing.view.createRangeIn(d))u.consumable.consume(E,{name:!0});return g},converterPriority:"low"}),a.for("editingDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(d,{writer:u})=>{const g=d.getAttribute("htmlElementName"),f=u.createRawElement(g);return d.hasAttribute("htmlAttributes")&&Gt(u,d.getAttribute("htmlAttributes"),f),f}}),a.for("dataDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(d,{writer:u})=>{const g=d.getAttribute("htmlElementName"),f=d.getAttribute("htmlContent"),b=u.createRawElement(g,null,(A,E)=>{E.setContentOf(A,f);const P=A.firstChild;for(P.remove();P.firstChild;)A.appendChild(P.firstChild)});return d.hasAttribute("htmlAttributes")&&Gt(u,d.getAttribute("htmlAttributes"),b),b}})})}}function*eo(o,e,t){if(e)if(!(Symbol.iterator in e)&&e.is("documentSelection")&&e.isCollapsed)o.schema.checkAttributeInSelection(e,t)&&(yield e);else for(const n of function(i,r,s){return!(Symbol.iterator in r)&&(r.is("node")||r.is("$text")||r.is("$textProxy"))?i.schema.checkAttribute(r,s)?[i.createRangeOn(r)]:[]:i.schema.getValidRanges(i.createSelection(r).getRanges(),s)}(o,e,t))yield*n.getItems({shallow:!0})}var to=(o,e,t)=>new Promise((n,i)=>{var r=l=>{try{a(t.next(l))}catch(c){i(c)}},s=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,s);a((t=t.apply(o,e)).next())});function Uf(o,e){let t=new URL(o);if(e&&Object.keys(e).length>0){const n=new URLSearchParams;for(const[i,r]of Object.entries(e))if(Array.isArray(r))for(const s of r)n.append(i,s);else n.append(i,r);t.search=n.toString()}return t.toString()}class tB{constructor(e,t){this.loader=e,this.api_url=t}_getUploadUrl(e,t){return to(this,null,function*(){const n=yield fetch(this.api_url+"/vi/skey",{credentials:"include"}).catch(a=>{t(a)}),i=yield n.json(),r={fileName:e.name,mimeType:e.type||"application/octet-stream",size:e.size.toString(),skey:i},s=yield fetch(Uf(this.api_url+"/vi/file/getUploadURL",r),{method:"POST",credentials:"include"}).catch(a=>{t(a)});return this.loader.uploaded=10,s})}fileUpload(e,t,n){return to(this,null,function*(){yield fetch(t.values.uploadUrl,{mode:"no-cors",method:"POST",body:e}).catch(l=>{n(l)}),this.loader.uploaded=50;const i=yield fetch(this.api_url+"/vi/skey",{credentials:"include"}).catch(l=>{n(l)}),r=yield i.json(),s={key:t.values.uploadKey,node:void 0,skelType:"leaf",skey:r},a=yield fetch(Uf(this.api_url+"/vi/file/add",s),{method:"POST",credentials:"include"}).catch(l=>{n(l)});return this.loader.uploaded=75,a})}upload(){return to(this,null,function*(){return this.loader.uploadTotal=100,this.loader.uploaded=0,this.loader.file.then(e=>to(this,null,function*(){return new Promise((t,n)=>{this._getUploadUrl(e,n).then(i=>to(this,null,function*(){const r=yield i.json();this.fileUpload(e,r,n).then(s=>to(this,null,function*(){const a=yield s.json();this.loader.uploaded=100,t({default:this.api_url+a.values.downloadUrl})}))}))})}))})}abort(){this.xhr&&this.xhr.abort()}}var Wf=D(2245),nB={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};G()(Wf.Z,nB),Wf.Z.locals;class $a extends Vi{}$a.builtinPlugins=[class extends q{static get requires(){return[z2,zo,j2,k2,a2,Y2]}static get pluginName(){return"Essentials"}},class extends q{static get requires(){return[Nt]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const o=this.editor.config.get("ckfinder.uploadUrl");o&&(this.editor.plugins.get(Nt).createUploadAdapter=e=>new nx(e,o,this.editor.t))}},class extends ui{constructor(){super(...arguments),this.token=null,this._tokens=new Map}static get pluginName(){return"CloudServices"}static get requires(){return[mD]}init(){return Bf(this,null,function*(){const o=this.context.config.get("cloudServices")||{};for(const[t,n]of Object.entries(o))this[t]=n;if(!this.tokenUrl)return void(this.token=null);const e=this.context.plugins.get("CloudServicesCore");this.token=yield e.createToken(this.tokenUrl).init(),this._tokens.set(this.tokenUrl,this.token)})}registerTokenUrl(o){return Bf(this,null,function*(){if(this._tokens.has(o))return this.getTokenFor(o);const e=this.context.plugins.get("CloudServicesCore"),t=yield e.createToken(o).init();return this._tokens.set(o,t),t})}getTokenFor(o){const e=this._tokens.get(o);if(!e)throw new I("cloudservices-token-not-registered",this);return e}destroy(){super.destroy();for(const o of this._tokens.values())o.destroy()}},class extends q{static get requires(){return[ox,ix]}static get pluginName(){return"Bold"}},class extends q{static get requires(){return[sx,ax]}static get pluginName(){return"Italic"}},class extends q{static get requires(){return[hx,mx]}static get pluginName(){return"BlockQuote"}},class extends q{static get pluginName(){return"EasyImage"}static get requires(){return[gx,"ImageUpload"]}init(){const o=this.editor;o.plugins.has("ImageBlockEditing")||o.plugins.has("ImageInlineEditing")||Q("easy-image-image-feature-missing",o)}},class extends q{static get requires(){return[wx,_x]}static get pluginName(){return"Heading"}},class extends q{static get requires(){return[Vx,jx]}static get pluginName(){return"Image"}},class extends q{static get requires(){return[Wg,g5]}static get pluginName(){return"ImageStyle"}},class extends q{static get requires(){return[qi,zt]}static get pluginName(){return"ImageToolbar"}afterInit(){const o=this.editor,e=o.t,t=o.plugins.get(qi),n=o.plugins.get("ImageUtils");var i;t.register("image",{ariaLabel:e("Image toolbar"),items:(i=o.config.get("image.toolbar")||[],i.map(r=>xe(r)?r.name:r)),getRelatedElement:r=>n.getClosestSelectedImageWidget(r)})}},class extends q{static get pluginName(){return"ImageUpload"}static get requires(){return[t5,qx,Gx]}},class extends q{constructor(o){super(o),this._resizeUnit=o.config.get("image.resizeUnit")}static get requires(){return[s5]}static get pluginName(){return"ImageResizeButtons"}init(){const o=this.editor,e=o.config.get("image.resizeOptions"),t=o.commands.get("resizeImage");this.bind("isEnabled").to(t);for(const n of e)this._registerImageResizeButton(n);this._registerImageResizeDropdown(e)}_registerImageResizeButton(o){const e=this.editor,{name:t,value:n,icon:i}=o,r=n?n+this._resizeUnit:null;e.ui.componentFactory.add(t,s=>{const a=new Ae(s),l=e.commands.get("resizeImage"),c=this._getOptionLabelValue(o,!0);if(!ha[i])throw new I("imageresizebuttons-missing-icon",e,o);return a.set({label:c,icon:ha[i],tooltip:c,isToggleable:!0}),a.bind("isEnabled").to(this),a.bind("isOn").to(l,"value",Rg(r)),this.listenTo(a,"execute",()=>{e.execute("resizeImage",{width:r})}),a})}_registerImageResizeDropdown(o){const e=this.editor,t=e.t,n=o.find(r=>!r.value),i=r=>{const s=e.commands.get("resizeImage"),a=Pt(r,od),l=a.buttonView,c=t("Resize image");return l.set({tooltip:c,commandValue:n.value,icon:ha.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button",ariaLabel:c,ariaLabelledBy:void 0}),l.bind("label").to(s,"value",d=>d&&d.width?d.width:this._getOptionLabelValue(n)),a.bind("isEnabled").to(this),Vs(a,()=>this._getResizeDropdownListItemDefinitions(o,s),{ariaLabel:t("Image resize list"),role:"menu"}),this.listenTo(a,"execute",d=>{e.execute(d.source.commandName,{width:d.source.commandValue}),e.editing.view.focus()}),a};e.ui.componentFactory.add("resizeImage",i),e.ui.componentFactory.add("imageResize",i)}_getOptionLabelValue(o,e=!1){const t=this.editor.t;return o.label?o.label:e?o.value?t("Resize image to %0",o.value+this._resizeUnit):t("Resize image to the original size"):o.value?o.value+this._resizeUnit:t("Original")}_getResizeDropdownListItemDefinitions(o,e){const t=new at;return o.map(n=>{const i=n.value?n.value+this._resizeUnit:null,r={type:"button",model:new Ys({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(n),role:"menuitemradio",withText:!0,icon:null})};r.model.bind("isOn").to(e,"value",Rg(i)),t.add(r)}),t}},class extends q{static get pluginName(){return"Indent"}static get requires(){return[p5,f5]}},class extends q{constructor(o){super(o),o.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const o=this.editor,e=o.config.get("indentBlock");e.classes&&e.classes.length?(this._setupConversionUsingClasses(e.classes),o.commands.add("indentBlock",new Zi(o,new ep({direction:"forward",classes:e.classes}))),o.commands.add("outdentBlock",new Zi(o,new ep({direction:"backward",classes:e.classes})))):(o.data.addStyleProcessorRules(eE),this._setupConversionUsingOffset(),o.commands.add("indentBlock",new Zi(o,new Xg({direction:"forward",offset:e.offset,unit:e.unit}))),o.commands.add("outdentBlock",new Zi(o,new Xg({direction:"backward",offset:e.offset,unit:e.unit}))))}afterInit(){const o=this.editor,e=o.model.schema,t=o.commands.get("indent"),n=o.commands.get("outdent"),i=o.config.get("heading.options");(i&&i.map(r=>r.model)||k5).forEach(r=>{e.isRegistered(r)&&e.extend(r,{allowAttributes:"blockIndent"})}),e.setAttributeProperties("blockIndent",{isFormatting:!0}),t.registerChildCommand(o.commands.get("indentBlock")),n.registerChildCommand(o.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const o=this.editor.conversion,e=this.editor.locale.contentLanguageDirection==="rtl"?"margin-right":"margin-left";o.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),o.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(o){const e={model:{key:"blockIndent",values:[]},view:{}};for(const t of o)e.model.values.push(t),e.view[t]={key:"class",value:[t]};this.editor.conversion.attributeToAttribute(e)}},class extends q{static get requires(){return[$5,K5,Z5]}static get pluginName(){return"Link"}},class extends q{static get requires(){return[fS,oS]}static get pluginName(){return"List"}},ca,class extends q{static get requires(){return[LS,HS,bn,ZS,KS,WS,Mo]}static get pluginName(){return"Table"}},class extends q{static get requires(){return[qi]}static get pluginName(){return"TableToolbar"}afterInit(){const o=this.editor,e=o.t,t=o.plugins.get(qi),n=o.config.get("table.contentToolbar"),i=o.config.get("table.tableToolbar");n&&t.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:QS}),i&&t.register("table",{ariaLabel:e("Table toolbar"),items:i,getRelatedElement:YS})}},class extends q{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}constructor(o){super(o),o.config.define("typing",{transformations:{include:d2}})}init(){const o=this.editor.model.document.selection;o.on("change:range",()=>{this.isEnabled=!o.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const o=this.editor,e=o.model,t=o.plugins.get("Delete"),n=function(r){const s=r.extra||[],a=r.remove||[],l=c=>!a.includes(c);return function(c){const d=new Set;for(const u of c)if(typeof u=="string"&&km[u])for(const g of km[u])d.add(g);else d.add(u);return Array.from(d)}(r.include.concat(s).filter(l)).filter(l).map(c=>typeof c=="string"&&fm[c]?fm[c]:c).filter(c=>typeof c=="object").map(c=>({from:h2(c.from),to:u2(c.to)}))}(o.config.get("typing.transformations")),i=new mm(o.model,r=>{for(const s of n)if(s.from.test(r))return{normalizedTransformation:s}});i.on("matched:data",(r,s)=>{if(!s.batch.isTyping)return;const{from:a,to:l}=s.normalizedTransformation,c=a.exec(s.text),d=l(c.slice(1)),u=s.range;let g=c.index;e.enqueueChange(f=>{for(let b=1;b{t.requestUndoOnBackspace()})})}),i.bind("isEnabled").to(this)}},class extends q{static get requires(){return[lx,cx]}static get pluginName(){return"Underline"}},class extends q{static get requires(){return[pD,fD]}static get pluginName(){return"Alignment"}},class extends q{constructor(o){super(o),this.set("isSourceEditingMode",!1),this._elementReplacer=new Cl,this._replacedRoots=new Map,this._dataFromRoots=new Map}static get pluginName(){return"SourceEditing"}static get requires(){return[Ii]}init(){const o=this.editor;o.t,o.ui.componentFactory.add("sourceEditing",e=>{const t=new Ae(e);return t.set({icon:'',tooltip:!0,withText:!0,class:"ck-source-editing-button"}),t.bind("isOn").to(this,"isSourceEditingMode"),t.bind("isEnabled").to(this,"isEnabled",o,"isReadOnly",o.plugins.get(Ii),"hasAny",(n,i,r)=>!!n&&!i&&!r),this.listenTo(t,"execute",()=>{this.isSourceEditingMode=!this.isSourceEditingMode}),t}),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",(e,t,n)=>{n?(this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())}),this.on("change:isEnabled",(e,t,n)=>this._handleReadOnlyMode(!n)),this.listenTo(o,"change:isReadOnly",(e,t,n)=>this._handleReadOnlyMode(n))),o.data.on("get",()=>{this.isSourceEditingMode&&this.updateEditorData()},{priority:"high"})}afterInit(){const o=this.editor;["RealTimeCollaborativeEditing","CommentsEditing","TrackChangesEditing","RevisionHistory"].some(e=>o.plugins.has(e))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),o.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}updateEditorData(){const o=this.editor,e={};for(const[t,n]of this._replacedRoots){const i=this._dataFromRoots.get(t),r=n.dataset.value;i!==r&&(e[t]=r)}Object.keys(e).length&&o.data.set(e,{batchType:{isUndoable:!0}})}_showSourceEditing(){const o=this.editor,e=o.editing.view,t=o.model;t.change(n=>{n.setSelection(null),n.removeSelectionAttribute(t.document.selection.getAttributeKeys())});for(const[n,i]of e.domRoots){const r=wD(o.data.get({rootName:n})),s=br(i.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),a=br(i.ownerDocument,"div",{class:"ck-source-editing-area","data-value":r},[s]);s.value=r,s.setSelectionRange(0,0),s.addEventListener("input",()=>{a.dataset.value=s.value,o.ui.update()}),e.change(l=>{const c=e.document.getRoot(n);l.addClass("ck-hidden",c)}),o.ui.setEditableElement("sourceEditing:"+n,s),this._replacedRoots.set(n,a),this._elementReplacer.replace(i,a),this._dataFromRoots.set(n,r)}this._focusSourceEditing()}_hideSourceEditing(){const o=this.editor.editing.view;this.updateEditorData(),o.change(e=>{for(const[t]of this._replacedRoots)e.removeClass("ck-hidden",o.document.getRoot(t))}),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),o.focus()}_focusSourceEditing(){const o=this.editor,[e]=this._replacedRoots.values(),t=e.querySelector("textarea");o.editing.view.document.isFocused=!1,t.focus()}_disableCommands(){const o=this.editor;for(const e of o.commands.commands())e.forceDisabled(Of)}_enableCommands(){const o=this.editor;for(const e of o.commands.commands())e.clearForceDisabled(Of)}_handleReadOnlyMode(o){if(this.isSourceEditingMode)for(const[,e]of this._replacedRoots)e.querySelector("textarea").readOnly=o}_isAllowedToHandleSourceEditingMode(){const o=this.editor.ui.view.editable;return o&&!o.hasExternalElement}},class extends q{static get requires(){return[CD,AD]}static get pluginName(){return"RemoveFormat"}},class extends q{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[Fe,UD,WD,KD,GD,ZD,JD,YD,QD,XD,eB]}init(){const o=this.editor,e=o.plugins.get(Fe);e.loadAllowedConfig(o.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(o.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(o){const e=this.editor.plugins.get("DataSchema"),t=Array.from(e.getDefinitionsForView(o,!1)),n=t.find(i=>i.isInline&&!t[0].isObject);return n?n.model:"htmlAttributes"}addModelHtmlClass(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"classes",a=>{for(const l of Pe(e))a.add(l)})})}removeModelHtmlClass(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"classes",a=>{for(const l of Pe(e))a.delete(l)})})}setModelHtmlAttributes(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"attributes",a=>{for(const[l,c]of Object.entries(e))a.set(l,c)})})}removeModelHtmlAttributes(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"attributes",a=>{for(const l of Pe(e))a.delete(l)})})}setModelHtmlStyles(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"styles",a=>{for(const[l,c]of Object.entries(e))a.set(l,c)})})}removeModelHtmlStyles(o,e,t){const n=this.editor.model,i=this.getGhsAttributeNameForElement(o);n.change(r=>{for(const s of eo(n,t,i))_n(r,s,i,"styles",a=>{for(const l of Pe(e))a.delete(l)})})}}],$a.defaultConfig={extraPlugins:[function(o){o.plugins.get("FileRepository").createUploadAdapter=e=>new tB(e,o.config.get("viur_api_url"))},function(o){o.conversion.attributeToElement({model:"bold",view:"b",upcastAlso:[e=>{const t=e.getStyle("font-weight");return t&&(t=="bold"||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]})}],toolbar:{items:["heading","|","bold","italic","underline","|","alignment","numberedList","bulletedList","blockQuote","|","indent","outdent","|","link","insertTable","imageUpload","|","undo","redo","RemoveFormat","sourceEditing"]},image:{toolbar:["imageStyle:inline","imageStyle:block","imageStyle:side","|","resizeImage:50","resizeImage:75","resizeImage:original","imageTextAlternative"],resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"},{model:"heading6",view:"h6",title:"Heading 6",class:"ck-heading_heading6"}]},alignment:{options:[{name:"left",className:"viur-txt-align--left"},{name:"right",className:"viur-txt-align--right"},{name:"center",className:"viur-txt-align--center"},{name:"justify",className:"viur-txt-align--justify"}]},indentBlock:{classes:["viur-txt-indent--1","viur-txt-indent--2","viur-txt-indent--3","viur-txt-indent--4","viur-txt-indent--5","viur-txt-indent--6","viur-txt-indent--7","viur-txt-indent--8","viur-txt-indent--9","viur-txt-indent--10"]},htmlSupport:{allow:[{name:"a",attributes:{target:!0,rel:!0}}]},language:"de",viur_api_url:"http://localhost:8080"}})(),M=M.default})())}(Wo,Wo.exports);var oA=Wo.exports;const rl=nA(oA),iA=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({value:"",editorConfig:{},editor:h.computed(()=>rl)});function D(S){x.emit("change",m.name,N.value,m.lang,m.index)}function M(S){N.value=S.target.value,x.emit("change",m.name,N.value,m.lang,m.index)}h.onMounted(()=>{m.value!==null&&(N.value=m.value),x.emit("change",m.name,m.value,m.lang,m.index)});function w(S){S.editing.view.change(p=>{p.setStyle("min-height","250px",S.editing.view.document.getRoot())})}return h.watch(()=>m.value,(S,p)=>{N.value=S}),{state:N,ClassicEditor:rl,boneState:C,changeEvent:D,onReady:w,changeEventTextarea:M}}}),rA=["disabled","value"];function sA(m,x,C,N,D,M){var S,p,y,B;const w=h.resolveComponent("ckeditor");return m.state.editor?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(S=m.boneState.bonestructure)!=null&&S.valid_html||(p=m.boneState.bonestructure)!=null&&p.validHtml?(h.openBlock(),h.createBlock(w,{key:0,modelValue:m.state.value,"onUpdate:modelValue":x[0]||(x[0]=v=>m.state.value=v),editor:m.state.editor,config:m.state.editorConfig,disabled:(y=m.boneState)==null?void 0:y.readonly,onReady:m.onReady,onInput:m.changeEvent},null,8,["modelValue","editor","config","disabled","onReady","onInput"])):(h.openBlock(),h.createElementBlock("sl-textarea",{key:1,disabled:(B=m.boneState)==null?void 0:B.readonly,value:m.value,onInput:x[1]||(x[1]=(...v)=>m.changeEventTextarea&&m.changeEventTextarea(...v))},null,40,rA))],64)):h.createCommentVNode("",!0)}const sl=de(iA,[["render",sA]]),aA=h.defineComponent({inheritAttrs:!1,props:{name:String,value:[Object,String,Number,Boolean,Array],index:Number,lang:String},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({valueLat:null,valueLng:null});function D(){x.emit("change",m.name,[N.valueLat,N.valueLng],m.lang,m.index)}return h.onMounted(()=>{try{N.valueLat=m.value[0],N.valueLng=m.value[1]}catch{}x.emit("change",m.name,[N.valueLat,N.valueLng],m.lang,m.index)}),{state:N,boneState:C,changeEvent:D}}}),lA=["name","min","max","disabled"],cA=["name","min","max","disabled"];function dA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.withDirectives(h.createElementVNode("sl-input",{"onUpdate:modelValue":x[0]||(x[0]=w=>m.state.valueLat=w),index:"lat",type:"number",name:m.name,min:m.boneState.bonestructure.boundslat[0],max:m.boneState.bonestructure.boundslat[1],disabled:m.boneState.readonly,"value-as-number":"",step:"0.000001",onSlChange:x[1]||(x[1]=(...w)=>m.changeEvent&&m.changeEvent(...w)),placeholder:"Lat"},null,40,lA),[[h.vModelText,m.state.valueLat]]),h.withDirectives(h.createElementVNode("sl-input",{"onUpdate:modelValue":x[2]||(x[2]=w=>m.state.valueLng=w),index:"lng",type:"number",name:m.name,min:m.boneState.bonestructure.boundslat[0],max:m.boneState.bonestructure.boundslat[1],disabled:m.boneState.readonly,"value-as-number":"",step:"0.000001",onSlChange:x[3]||(x[3]=(...w)=>m.changeEvent&&m.changeEvent(...w)),placeholder:"Long"},null,40,cA),[[h.vModelText,m.state.valueLng]])],64)}const al=de(aA,[["render",dA],["__scopeId","data-v-7bc31020"]]),hA=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.reactive({counter:0,debounce:null}),D=h.inject("addMultipleEntry"),M=h.inject("removeMultipleEntries");function w(){N.counter+=1;let p=200;N.counter>1&&(p=500),N.debounce&&clearTimeout(N.debounce),N.debounce=setTimeout(()=>{for(let y=N.counter;y--;)D(m.lang);N.counter=0},p)}function S(){let p=200;N.debounce&&clearTimeout(N.debounce),N.debounce=setTimeout(()=>{M(m.lang)},p)}return h.onMounted(()=>{(!m.value||m.value.length===0)&&x.emit("change",m.name,[],m.lang)}),{state:N,boneState:C,handleAdd:w,handleRemove:S,removeMultipleEntries:M}}}),ll=m=>(h.pushScopeId("data-v-63e75dee"),m=m(),h.popScopeId(),m),uA={class:"actionbar"},mA=["title"],gA=[ll(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))],pA=["title"],fA=ll(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"plus-lg"},null,-1));function kA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",uA,[m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:0,variant:"danger",title:m.$t("bone.del"),outline:"",class:"delete-btn",onClick:x[0]||(x[0]=w=>m.handleRemove(m.lang))},gA,8,mA)):h.createCommentVNode("",!0),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:1,variant:"success",title:m.$t("bone.add"),outline:"",class:"add-btn",onClick:x[1]||(x[1]=w=>m.handleAdd(m.lang))},[fA,h.createTextVNode(" "+h.toDisplayString(m.$t("bone.add"))+" ",1),m.state.counter>1?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createTextVNode("("+h.toDisplayString(m.state.counter)+")",1)],64)):h.createCommentVNode("",!0)],8,pA)):h.createCommentVNode("",!0)])}const bA=de(hA,[["render",kA],["__scopeId","data-v-63e75dee"]]);var wA={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const AA=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.inject("addMultipleEntry"),D=h.inject("formatString"),M=null,w=h.reactive({skels:{},hasUsing:h.computed(()=>C==null?void 0:C.bonestructure.using)});function S(p){let y="";return C.bonestructure.type==="relational.tree.leaf.file"?y="skelType=leaf&":C.bonestructure.type==="relational.tree.node.file"&&(y="skelType=node&"),we.get(`/${wA.VITE_DEFAULT_RENDERER||"vi"}/${C.bonestructure.module}/list?${y}limit=99`).then(async B=>{var k;const v=await B.json();return w.skels=v.skellist.reduce((_,R)=>(_[R.key]=R,_),{}),(k=v.skellist)==null?void 0:k.map(_=>({text:D(C.bonestructure.format,{dest:_}),value:_.key,data:_}))})}return h.onMounted(()=>{(!m.value||m.value.length===0)&&x.emit("change",m.name,[],m.lang)}),{state:w,boneState:C,addMultipleEntry:N,removeMultipleEntries:M,getList:S}}}),cl=m=>(h.pushScopeId("data-v-eeea51c6"),m=m(),h.popScopeId(),m),_A={class:"actionbar"},CA=["title"],vA=[cl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))],yA=["source"],EA=["title"],xA=cl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"plus-lg"},null,-1));function SA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",_A,[m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:0,variant:"danger",title:m.$t("bone.del"),outline:"",class:"delete-btn",onClick:x[0]||(x[0]=w=>m.openSelector())},vA,8,CA)):h.createCommentVNode("",!0),h.createElementVNode("sl-combobox",{source:m.getList,hoist:"",onSlItemSelect:x[1]||(x[1]=w=>{var S;return m.addMultipleEntry(m.lang,{dest:(S=m.state.skels)==null?void 0:S[w.detail.item.value],rel:m.state.hasUsing?void 0:null})})},null,40,yA),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:1,variant:"success",title:m.$t("bone.add"),outline:"",class:"add-btn",onClick:x[2]||(x[2]=w=>m.addMultipleEntry(m.lang))},[xA,h.createTextVNode(" "+h.toDisplayString(m.$t("bone.list")),1)],8,EA)):h.createCommentVNode("",!0)])}const DA=de(AA,[["render",SA],["__scopeId","data-v-eeea51c6"]]);var dl={VITE_API_URL:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const BA=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change"],setup(m,x){const C=h.inject("boneState"),N=h.inject("addMultipleEntry");h.inject("formatString");const D=null,M=h.ref(),w=h.reactive({skels:{},uploadinput:null,loading:!1,droparea:!1,hasUsing:h.computed(()=>C==null?void 0:C.bonestructure.using)});function S(B){const v={fileName:B.name,mimeType:B.type||"application/octet-stream",size:B.size.toString()};return new Promise((k,_)=>{we.securePost(`/${dl.VITE_DEFAULT_RENDERER||"vi"}/file/getUploadURL`,{dataObj:v}).then(async R=>{let T=await R.json();fetch(T.values.uploadUrl,{body:B,method:"POST",mode:"no-cors"}).then(async O=>{const F={key:T.values.uploadKey,node:void 0,skelType:"leaf"};we.securePost(`/${dl.VITE_DEFAULT_RENDERER||"vi"}/file/add`,{dataObj:F}).then(async L=>{let $=await L.json();$.action==="addSuccess"?k($.values):_($)}).catch(L=>{_(L)})}).catch(O=>{_(O)})}).catch(R=>{_(R)})})}async function p(B){w.loading=!0;for(let v of B.target.files){let k=await S(v);M.value.value=null;let _=null;w.hasUsing&&(_=void 0),N(m.lang,{dest:k,rel:_})}w.loading=!1}async function y(B){w.loading=!0,w.droparea=!1;for(let v of B.dataTransfer.files){let k=await S(v);M.value.value=null;let _=null;w.hasUsing&&(_=void 0),N(m.lang,{dest:k,rel:_})}w.loading=!1}return h.onMounted(()=>{(!m.value||m.value.length===0)&&x.emit("change",m.name,[],m.lang)}),{state:w,boneState:C,addMultipleEntry:N,removeMultipleEntries:D,uploadFile:S,uploadinput:M,handleUpload:p,handleDrop:y}}}),cr=m=>(h.pushScopeId("data-v-9bac9f8a"),m=m(),h.popScopeId(),m),TA=["title"],IA=[cr(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))],PA={key:1,class:"droparea"},RA=["multiple"],OA=["title"],NA=[cr(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"plus-lg"},null,-1))],zA=["title"],MA=cr(()=>h.createElementVNode("sl-icon",{name:"upload"},null,-1)),FA={key:0,slot:"suffix"};function VA(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",{class:"actionbar",onDragover:x[4]||(x[4]=h.withModifiers(w=>m.state.droparea=!0,["prevent"])),onDragleave:x[5]||(x[5]=w=>m.state.droparea=!1),onDrop:x[6]||(x[6]=h.withModifiers((...w)=>m.handleDrop&&m.handleDrop(...w),["prevent"]))},[m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:0,variant:"danger",title:m.$t("bone.del"),outline:"",class:"delete-btn",onClick:x[0]||(x[0]=w=>m.openSelector())},IA,8,TA)):h.createCommentVNode("",!0),m.state.droparea?(h.openBlock(),h.createElementBlock("div",PA," Dateien hier hinziehen ")):h.createCommentVNode("",!0),h.createElementVNode("input",{ref:"uploadinput",hidden:"",type:"file",multiple:m.boneState.multiple,onChange:x[1]||(x[1]=(...w)=>m.handleUpload&&m.handleUpload(...w))},null,40,RA),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:2,outline:"",title:m.$t("bone.list"),class:"add-btn",onClick:x[2]||(x[2]=w=>m.addMultipleEntry(m.lang))},NA,8,OA)):h.createCommentVNode("",!0),m.boneState.multiple&&!m.readonly?(h.openBlock(),h.createElementBlock("sl-button",{key:3,variant:"success",outline:"",title:m.$t("bone.upload"),class:"upload-btn",onClick:x[3]||(x[3]=w=>m.uploadinput.click())},[MA,h.createTextVNode(" "+h.toDisplayString(m.$t("bone.upload"))+" ",1),m.state.loading?(h.openBlock(),h.createElementBlock("sl-spinner",FA)):h.createCommentVNode("",!0)],8,zA)):h.createCommentVNode("",!0)],32)}const LA=de(BA,[["render",VA],["__scopeId","data-v-9bac9f8a"]]),dr=or.defineStore("boneStore",()=>{const m=h.reactive({additionalBones:h.shallowRef({}),defaultBones:h.shallowRef({rawBone:ar,keyBone:Ua,stringBone:Wa,emailBone:Ka,dateBone:Ga,booleanBone:Ja,selectBone:Za,passwordBone:Ya,recordBone:Xa,numericBone:tl,colorBone:el,relationalBone:nl,jsonBone:zw,fileBone:il,textBone:sl,spatialBone:al}),actionbars:h.shallowRef({"relational.tree.leaf.file.file":LA,"relational.":DA}),multibones:h.shallowRef(["select","select."])});function x(w,S){m.additionalBones[w]=S}function C(){let w=m.defaultBones;for(const[S,p]of Object.entries(m.additionalBones))w.add(p);return w}function N(w){if(Object.keys(m.additionalBones).includes(w))return m.additionalBones[w];{let S=w.split("."),p=Object.entries(m.additionalBones).filter(y=>y[0].startsWith(S[0]+"."));if(p.length>0){p.sort((y,B)=>B.length-y.length);for(let y of p)if(w.startsWith(y[0]))return m.additionalBones[y[0]]}}return w==="date"?Ga:w==="key"?Ua:w==="str.email"?Ka:w==="str"||w.startsWith("str.")?Wa:w==="select"||w.startsWith("select.")?Za:w==="bool"?Ja:w==="password"?Ya:w==="record"?Xa:w==="numeric"||w.startsWith("numeric.")?tl:w==="relational.tree.leaf.file.file"?il:w==="relational"||w.startsWith("relational.")?nl:w==="color"?el:w==="text"?sl:w==="spatial"?al:ar}function D(w,S){m.actionbars[w]=S}function M(w){if(Object.keys(m.actionbars).includes(w))return m.actionbars[w];{let S=w.split("."),p=Object.entries(m.actionbars).filter(y=>y[0].startsWith(S[0]+"."));if(p.length>0){p.sort((y,B)=>B.length-y.length);for(let y of p)if(w.startsWith(y[0]))return m.actionbars[y[0]]}}return bA}return{state:m,addBoneWidget:x,getBoneWidget:N,importWidgets:C,addBoneActionbar:D,getBoneActionbar:M}});function jA(m){return dr().getBoneActionbar(m)}function Yt(m){return dr().getBoneWidget(m)}function $A(m){const x=dr();if(x.state.multibones.includes(m))return!0;{let C=m.split("."),N=Object.entries(x.state.multibones).filter(D=>D[1].startsWith(C[0]+"."));if(N.length>0){N.sort((D,M)=>M.length-D.length);for(let D of N)if(m.startsWith(D[1]))return!0}}return!1}const hr=m=>(h.pushScopeId("data-v-25f20336"),m=m(),h.popScopeId(),m),HA=hr(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Nutzterdaten",-1)),qA=hr(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Lieferadresse",-1)),UA={key:0},WA=hr(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Rechnungsadresse",-1)),KA=de({__name:"UserInformation",props:{mode:{type:String,default:"form"},conditions:{type:Function}},setup(m){const x=vn(),C=h.reactive({formValues:{},requiredFieldsFilled:h.computed(()=>{if(C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("billing.city")&&Object.keys(C.formValues).includes("billing.street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname");if(!C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname")}),isCustomAdress:!1,addSkel:null,errors:{}});function N(w){w.target.checked&&(C.isCustomAdress=!1),w.target.checked||(C.isCustomAdress=!0)}function D(w,S){for(const[p,y]of Object.entries(S.value[0]))C.formValues[p]=y}function M(w){let S={};return w.forEach(p=>{let y=p[0],B=p[1];S[y]=B}),S}return h.watch(C.formValues,w=>{Object.entries(w).forEach(([S,p])=>{p===""&&delete C.formValues[S]})}),h.onBeforeMount(async()=>{await x.getAdressStructure(),C.addSkel=x.state.structure.address}),(w,S)=>{const p=h.resolveComponent("bone");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",null,[HA,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,y=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:y[0]},[y[1].visible&&y[1].params.group==="Customer Info"?(h.openBlock(),h.createBlock(p,{key:0,is:h.unref(Yt)(y[1].type),name:y[0],structure:M(C.addSkel),errors:C.errors[y[0]]?C.errors[y[0]]:[],skel:C.formValues,onChange:B=>D(y[0],B),class:"viur-shop-form-grid-w-2"},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]),h.createElementVNode("div",null,[qA,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,y=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:y[0]},[y[1].visible&&y[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(p,{key:0,is:h.unref(Yt)(y[1].type),name:y[0],structure:M(C.addSkel),errors:C.errors[y[0]]?C.errors[y[0]]:[],skel:C.formValues,onChange:B=>D(y[0],B)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]),C.isCustomAdress?(h.openBlock(),h.createElementBlock("div",UA,[WA,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,y=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:y[0]},[y[1].visible&&y[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(p,{key:0,is:h.unref(Yt)(y[1].type),name:y[0],structure:M(C.addSkel),errors:C.errors[y[0]]?C.errors[y[0]]:[],skel:C.formValues,onChange:B=>D(y[0],B)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))])):h.createCommentVNode("",!0),h.createElementVNode("sl-checkbox",{onSlChange:N,checked:""}," Rechnungsadresse wie Lieferadresse ",32)],64)}}},[["__scopeId","data-v-25f20336"]]),GA=h.defineComponent({props:{isDragging:Boolean,draggingLineBottom:Boolean,draggingLineTop:Boolean},components:{},emits:["change","delete","handleDragStart","handleDragEnd","handleDragOver","handleDrop"],setup(m,x){const C=h.inject("boneState");return{state:h.reactive({isDraggable:!1}),boneState:C}}}),hl=m=>(h.pushScopeId("data-v-141aaf9b"),m=m(),h.popScopeId(),m),ZA=["draggable"],JA=["disabled"],YA=[hl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"grip-vertical"},null,-1))],QA={class:"value"},XA=["disabled","title"],e0=[hl(()=>h.createElementVNode("sl-icon",{slot:"prefix",name:"x-lg"},null,-1))];function t0(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["value-line",{"is-dragging":m.isDragging,"dragging-line-bottom":m.draggingLineBottom,"dragging-line-top":m.draggingLineTop}]),draggable:m.state.isDraggable,onDragover:x[2]||(x[2]=w=>m.$emit("handleDragOver",w)),onDrop:x[3]||(x[3]=w=>m.$emit("handleDrop",w)),onDragstart:x[4]||(x[4]=w=>m.$emit("handleDragStart",w)),onDragend:x[5]||(x[5]=w=>m.$emit("handleDragEnd"))},[h.createElementVNode("sl-button",{disabled:m.boneState.readonly,class:"drag-button",onMousedown:x[0]||(x[0]=w=>m.state.isDraggable=!0)},YA,40,JA),h.createElementVNode("div",QA,[h.renderSlot(m.$slots,"default",{},void 0,!0)]),h.createElementVNode("sl-button",{variant:"danger",disabled:m.boneState.readonly,outline:"",title:m.$t("bone.del"),class:"delete-btn",onClick:x[1]||(x[1]=w=>m.$emit("delete"))},e0,8,XA)],42,ZA)}const n0=de(GA,[["render",t0],["__scopeId","data-v-141aaf9b"]]),o0=h.defineComponent({props:{name:String,value:Object,index:Number,lang:String,readonly:Boolean,params:Object},components:{},emits:["change","handleClick"],setup(m,x){const C=h.inject("boneState");return{state:h.reactive({debug:!1}),boneState:C}}}),i0={class:"bone-name"},r0={key:0},s0={class:"bone"};function a0(m,x,C,N,D,M){return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("label",i0,[h.renderSlot(m.$slots,"default",{},void 0,!0),h.createCommentVNode("",!0)]),m.state.debug?(h.openBlock(),h.createElementBlock("div",r0,[h.createElementVNode("div",s0,h.toDisplayString(m.name),1),h.createElementVNode("pre",null," "+h.toDisplayString(m.boneState)+` + `,1)])):h.createCommentVNode("",!0)],64)}const l0=de(o0,[["render",a0],["__scopeId","data-v-b7149172"]]),c0=h.defineComponent({inheritAttrs:!1,emits:["change","change-internal","handleClick"],components:{wrapperMultiple:n0,BoneLabel:l0},props:{is:{type:Object,default:ar},name:{type:String,required:!0},languages:Array,multiple:Boolean,readonly:Boolean,required:Boolean,params:Object,value:[Object,String,Number,Boolean,Array],structure:{type:Object,required:!0},skel:{type:null,required:!0},errors:Object,showLabelInfo:{type:Boolean,required:!1,default:!1},autofocus:{type:Boolean,required:!1,default:!1}},setup(m,x){const C=h.reactive({bonestructure:h.computed(()=>{var T;return(T=m.structure)==null?void 0:T[m.name]}),bonevalue:null,dragStartIndex:{lang:null,index:Number},dropIndex:{lang:null,index:Number},draggingLineBottom:{lang:String,index:Number},draggingLineTop:{lang:String,index:Number},isDragging:{lang:String,index:Number},multilanguage:h.computed(()=>{var T;return((T=C.languages)==null?void 0:T.length)&&C.languages.length>0}),languages:h.computed(()=>m.languages?m.languages:C.bonestructure&&Object.keys(C.bonestructure).includes("languages")?C.bonestructure.languages:[]),readonly:h.computed(()=>m.readonly?m.readonly:C.bonestructure&&Object.keys(C.bonestructure).includes("readonly")?C.bonestructure.readonly:!1),required:h.computed(()=>m.required?m.required:C.bonestructure&&Object.keys(C.bonestructure).includes("required")?C.bonestructure.required:!1),hasTooltip:h.computed(()=>!!(C.bonestructure&&Object.keys(C.bonestructure.params).includes("tooltip"))),multiple:h.computed(()=>m.multiple?m.multiple:C.bonestructure&&Object.keys(C.bonestructure).includes("multiple")?C.bonestructure.multiple:!1),params:h.computed(()=>m.params?m.params:C.bonestructure&&Object.keys(C.bonestructure).includes("params")?C.bonestructure.params:{}),actionbar:h.computed(()=>{var T;return jA((T=C.bonestructure)==null?void 0:T.type)}),isEmpty:h.computed(()=>{function T(O){for(const[F,L]of Object.entries(O))if(L!==null){if(Array.isArray(L)&&L.length>0)return!1;if(!Array.isArray(L))return!1}return!0}return C.readonly?!1:!C.bonevalue||Array.isArray(C.bonevalue)&&C.bonevalue.length===0?!0:C.bonevalue===Object(C.bonevalue)&&!Array.isArray(C.bonevalue)?T(C.bonevalue):!1}),errors:[],errorMessages:h.computed(()=>{let T=[];for(let O of m.errors)O.fieldPath[0]===m.name&&(O.severity>2||C.required&&(O.severity===2||O.severity===0))&&T.push(O.errorMessage);return T})});h.provide("boneState",C);function N(T,O,F){w(O,T,"isDragging"),w(O,T,"dragStartIndex")}function D(T,O,F){F.preventDefault();const L=F.clientY-F.target.getBoundingClientRect().top,$=F.target.closest(".value-line");L<$.offsetHeight/2?(w(O,T,"draggingLineTop"),S("draggingLineBottom"),C.dropIndex.index=T):(w(O,T,"draggingLineBottom"),S("draggingLineTop"),C.dropIndex.index=T+1);let K=O?C.bonevalue[O]:C.bonevalue;C.dropIndex.index>K.length-1&&(C.dropIndex.index-=1)}function M(T,O,F){let L=null;C.dragStartIndex.index!==C.dropIndex.index&&(O?(L=C.bonevalue[O].splice(C.dragStartIndex.index,1)[0],C.bonevalue[O].splice(C.dropIndex.index,0,L)):(L=C.bonevalue.splice(C.dragStartIndex.index,1)[0],C.bonevalue.splice(C.dropIndex.index,0,L)),console.dir(C.bonevalue[0]),x.emit("change",{name:m.name,value:y(),lang:O,index:T})),S("draggingLineBottom","draggingLineTop","isDragging","dragStartIndex","dropIndex")}function w(T,O,F){C[F].lang=T||null,C[F].index=O}function S(...T){T.forEach(O=>{C[O]={lang:null,index:Number}})}function p(T,O,F=null,L=null,$){if(O===void 0||(F?(C.bonevalue||(C.bonevalue={}),Object.keys(C.bonevalue).includes(F)&&L!==null?C.bonevalue[F][L]=O:C.bonevalue[F]=O):L!==null?C.bonevalue[L]=O:$===!1||(C.bonevalue=O),C.readonly))return!1;let K={name:T,value:y(),lang:F,index:L},J={name:T,value:O,lang:F,index:L};$!=null&&(K.pwMatch=$,J.pwMatch=$),x.emit("change",K),x.emit("change-internal",J)}function y(){function T(F,L=null){let $=[];if(Array.isArray(F))if(C.bonestructure.type=="spatial"&&F.length===2&&!Array.isArray(F[0]))$.push({[L+".lat"]:F[0]}),$.push({[L+".lng"]:F[1]});else if(Object.values(F).filter(K=>K===Object(K)).length>0)for(const[K,J]of F.entries())J.rel!==null?$.push(T(J,L+"."+K)):$.push(T(J,L));else for(const[K,J]of F.entries())$.push(T(J,L));else if(F===Object(F))for(const[K,J]of Object.entries(F))L?L.endsWith(".dest")||L.endsWith(".rel")?L.endsWith(".dest")&&K==="key"?(/\.[0-9]*\.dest$/.test(L)?$.push(T(J,L.replace(/\.[0-9]*\.dest/,""))):$.push(T(J,L.replace(/\.dest/,""))),$.push(T(J,L.replace(/\.dest/,"")+"."+K))):L.endsWith(".rel")&&$.push(T(J,L.replace(/\.rel/,"")+"."+K)):$.push(T(J,L+"."+K)):$.push(T(J,K));else F==null&&(F=""),L!==null&&$.push({[L]:F});return $}let O=T(C.bonevalue,m.name);return O=O.flat(10),O}function B(T=null,O=""){T?Object.keys(C.bonevalue).includes(T)?C.bonevalue[T].push(O):C.bonevalue[T]=[O]:C.bonevalue?C.bonevalue.push(O):C.bonevalue=[O]}h.provide("addMultipleEntry",B);function v(T,O=null){var F;O?(F=C.bonevalue)==null||F[O].splice(T,1):C.bonevalue.splice(T,1),x.emit("change",{name:m.name,value:y(),lang:O,index:T}),x.emit("change-internal",{name:m.name,value:y(),lang:O,index:T})}function k(T=null){var O;T?(O=C.bonevalue)==null||O[T].splice(0):C.bonevalue.splice(0),x.emit("change",{name:m.name,value:y(),lang:T}),x.emit("change-internal",{name:m.name,value:y(),lang:T})}h.provide("removeMultipleEntries",k);function _(T=null,O=""){B(T,O)}function R(T,O){function F(J){let te=[],Z=[],ee=/\$\((.*?)\)/g;for(;Z;){if(Z=ee.exec(J),!Z){Z=!1;continue}te.push(Z[1])}return te}function L(J,te){let Z=J.split("."),ee=J.split("."),I=te;for(let Q of Z)if(ee.shift(),I&&I!=="-"&&Object.keys(I).includes(Q)&&I[Q])if(Array.isArray(I[Q])){let _e=[];for(let Se of I[Q])_e.push(L(ee.join("."),Se));I=_e.join(", ")}else I=I[Q];else(!I||typeof I[Q]=="object"&&!I[Q])&&(I="-");return I}let $=F(T),K=[];Array.isArray(O)||(O=[O]);for(let J of O){let te=T;for(let Z of $){let ee=L(Z,J);te=te.replace("$("+Z+")",ee)}K.push(te)}return K.join(", ")}return h.provide("formatString",R),h.onBeforeMount(()=>{var T;m.value?C.bonevalue=m.value:C.bonevalue=(T=m.skel)==null?void 0:T[m.name]}),h.watch(()=>m.skel,(T,O)=>{var F;C.bonevalue=(F=m.skel)==null?void 0:F[m.name]}),h.watch(()=>{var T;return(T=m.errors)==null?void 0:T[m.name]},(T,O)=>{C.errors=m.errors}),{state:C,updateValue:p,addMultipleEntry:B,removeMultipleEntry:v,removeMultipleEntries:k,BoneHasMultipleHandling:$A,multipleBonePressEnter:_,handleDragStart:N,handleDragOver:D,handleDrop:M,setStateProperties:w,resetStateProperties:S}}}),so=m=>(h.pushScopeId("data-v-dee63f3c"),m=m(),h.popScopeId(),m),d0={key:0,class:"required"},h0=["content"],u0=[so(()=>h.createElementVNode("div",{class:"tooltip"},[h.createElementVNode("sl-icon",{name:"question"})],-1))],m0={key:0,variant:"info",open:"",class:"label-info"},g0=so(()=>h.createElementVNode("sl-icon",{slot:"icon",library:"bootstrap",name:"info-circle-fill"},null,-1)),p0={class:"bone-inner-wrap"},f0={key:0,class:"lang-tab",placement:"bottom"},k0=["panel"],b0=["name"],w0=[so(()=>h.createElementVNode("sl-input",{readonly:"",size:"medium",placeholder:"Keine Einträge"},null,-1))],A0={key:1,class:"multiple-placeholder"},_0=[so(()=>h.createElementVNode("sl-input",{readonly:"",size:"medium",placeholder:"Keine Einträge"},null,-1))],C0={open:"",summary:"Errors",variant:"info"},v0=so(()=>h.createElementVNode("sl-icon",{slot:"icon",name:"exclamation-triangle"},null,-1)),y0={class:"error-msg"};function E0(m,x,C,N,D,M){var p;const w=h.resolveComponent("bone-label"),S=h.resolveComponent("wrapper-multiple");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["bone-wrapper",(""+m.state.bonestructure.type.split(".")[0],{"has-subbones":m.state.bonestructure.using})])},[h.createVNode(w,{name:m.name},{default:h.withCtx(()=>[h.createElementVNode("span",{class:h.normalizeClass({required:m.state.required})},h.toDisplayString(m.state.bonestructure.descr),3),m.state.required?(h.openBlock(),h.createElementBlock("span",d0," *")):h.createCommentVNode("",!0),m.state.hasTooltip&&!m.showLabelInfo?(h.openBlock(),h.createElementBlock("sl-tooltip",{key:1,content:m.state.bonestructure.params.tooltip,placement:"top-center"},u0,8,h0)):h.createCommentVNode("",!0)]),_:1},8,["name"]),m.showLabelInfo&&m.state.hasTooltip?(h.openBlock(),h.createElementBlock("sl-alert",m0,[g0,h.createTextVNode(" "+h.toDisplayString(m.state.bonestructure.params.tooltip),1)])):h.createCommentVNode("",!0),h.createElementVNode("div",p0,[m.state.multilanguage?(h.openBlock(),h.createElementBlock("sl-tab-group",f0,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.languages,y=>{var B,v,k,_;return h.openBlock(),h.createElementBlock(h.Fragment,{key:y+"_tab"},[h.createElementVNode("sl-tab",{slot:"nav",panel:"lang_"+y},h.toDisplayString(m.$t(y)),9,k0),h.createElementVNode("sl-tab-panel",{name:"lang_"+y},[m.state.multiple&&!m.BoneHasMultipleHandling(m.state.bonestructure.type)?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(B=m.state.bonevalue)!=null&&B[y].length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList((v=m.state.bonevalue)==null?void 0:v[y],(R,T)=>(h.openBlock(),h.createElementBlock("div",{key:T,class:"multiple-bone"},[h.createVNode(S,{readonly:!m.state.readonly,"is-dragging":m.state.isDragging.lang===y&&m.state.isDragging.index===T,"dragging-line-bottom":m.state.draggingLineBottom.lang===y&&m.state.draggingLineBottom.index===T,"dragging-line-top":m.state.draggingLineTop.lang===y&&m.state.draggingLineTop.index===T,onDelete:O=>m.removeMultipleEntry(T,y),onHandleDragStart:O=>m.handleDragStart(T,y,O),onHandleDragOver:O=>m.handleDragOver(T,y,O),onHandleDrop:O=>m.handleDrop(T,y,O)},{default:h.withCtx(()=>[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{value:R,index:T,lang:y,name:m.name,onChange:m.updateValue,onKeydown:h.withKeys(O=>m.multipleBonePressEnter(y),["enter"])},null,40,["value","index","lang","name","onChange","onKeydown"]))]),_:2},1032,["readonly","is-dragging","dragging-line-bottom","dragging-line-top","onDelete","onHandleDragStart","onHandleDragOver","onHandleDrop"])]))),128)):(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["multiple-placeholder",{readonly:m.state.readonly}])},w0,2)),m.state.readonly?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.state.actionbar),{key:2,value:(k=m.state.bonevalue)==null?void 0:k[y],name:m.name,lang:y,onChange:m.updateValue},null,40,["value","name","lang","onChange"]))],64)):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{key:1,value:(_=m.state.bonevalue)==null?void 0:_[y],index:null,lang:y,name:m.name,onChange:m.updateValue},null,40,["value","lang","name","onChange"]))],8,b0)],64)}),128))])):(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[m.state.multiple&&!m.BoneHasMultipleHandling(m.state.bonestructure.type)?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(p=m.state.bonevalue)!=null&&p.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(m.state.bonevalue,(y,B)=>(h.openBlock(),h.createElementBlock("div",{key:B,class:"multiple-bone"},[h.createVNode(S,{readonly:!m.state.readonly,"is-dragging":m.state.isDragging.index===B,"dragging-line-bottom":m.state.draggingLineBottom.index===B,"dragging-line-top":m.state.draggingLineTop.index===B,onDelete:v=>m.removeMultipleEntry(B),onHandleDragStart:v=>m.handleDragStart(B,m.lang=null,v),onHandleDragOver:v=>m.handleDragOver(B,m.lang=null,v),onHandleDrop:v=>m.handleDrop(B,m.lang=null,v)},{default:h.withCtx(()=>[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{value:y,index:B,name:m.name,onChange:m.updateValue,onKeydown:x[0]||(x[0]=h.withKeys(v=>m.multipleBonePressEnter(),["enter"]))},null,40,["value","index","name","onChange"]))]),_:2},1032,["readonly","is-dragging","dragging-line-bottom","dragging-line-top","onDelete","onHandleDragStart","onHandleDragOver","onHandleDrop"])]))),128)):(h.openBlock(),h.createElementBlock("div",A0,_0)),m.state.readonly?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.state.actionbar),{key:2,value:m.state.bonevalue,name:m.name,onChange:m.updateValue},null,40,["value","name","onChange"]))],64)):(h.openBlock(),h.createBlock(h.resolveDynamicComponent(m.is),{key:1,value:m.state.bonevalue,name:m.name,index:null,autofocus:m.autofocus,onChange:m.updateValue,onKeypress:h.withKeys(m.updateValue,["enter"])},null,40,["value","name","autofocus","onChange","onKeypress"]))],64)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m.state.errorMessages,y=>(h.openBlock(),h.createElementBlock("sl-alert",C0,[v0,h.createElementVNode("div",y0,h.toDisplayString(y),1)]))),256))])],2)}const ur=de(c0,[["render",E0],["__scopeId","data-v-dee63f3c"]]),Qt=m=>(h.pushScopeId("data-v-71a3c8c9"),m=m(),h.popScopeId(),m),x0=Qt(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Nutzterdaten",-1)),S0=Qt(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Lieferadresse",-1)),D0=["onSlChange","onSlClear","label"],B0=["value"],T0={key:0},I0=Qt(()=>h.createElementVNode("h2",{class:"viur-shop-form-headline headline"},"Rechnungsadresse",-1)),P0=[Qt(()=>h.createElementVNode("sl-icon",{name:"x-lg",slot:"prefix"},null,-1))],R0=Qt(()=>h.createElementVNode("sl-icon",{name:"plus-lg",slot:"prefix"},null,-1)),O0=Qt(()=>h.createElementVNode("sl-icon",{slot:"icon",name:"exclamation-triangle"},null,-1)),N0=Qt(()=>h.createElementVNode("br",null,null,-1)),z0=de({__name:"UserInfoMulti",props:{mode:{type:String,default:"form"}},setup(m){const x=vn(),C=h.reactive({formValues:{},requiredFieldsFilled:h.computed(()=>{if(C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("billing.city")&&Object.keys(C.formValues).includes("billing.street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname");if(!C.isCustomAdress)return Object.keys(C.formValues).includes("city")&&Object.keys(C.formValues).includes("street")&&Object.keys(C.formValues).includes("email")&&Object.keys(C.formValues).includes("firstname")&&Object.keys(C.formValues).includes("lastname")}),isCustomAdress:!1,shippingAdressAmount:1,maxShippingAdress:h.computed(()=>Object.keys(x.state.carts).length+2),amountAlert:{title:"",msg:""},items:null,addSkel:null,errors:{},selectedItem:{},isInit:h.computed(()=>!!x.state.carts[x.state.basket])}),N=h.ref(null),D=h.ref(null);function M(k){k.target.checked&&(C.isCustomAdress=!1),k.target.checked||(C.isCustomAdress=!0)}function w(){if(C.shippingAdressAmount===C.maxShippingAdress){C.amountAlert.title="Zu viele Lieferadressen",C.amountAlert.msg=`Sie können nur maximal: "${C.maxShippingAdress}" Lieferadressen verwenden.`,D.value.show();return}C.shippingAdressAmount+=1}function S(k,_){for(const[R,T]of Object.entries(_.value[0]))C.formValues[R]=T}function p(){if(C.shippingAdressAmount===1){C.amountAlert.title="Zu wenig Lieferadressen",C.amountAlert.msg="Mindestens eine Lieferadresse muss angegeben werden.",D.value.show();return}C.shippingAdressAmount-=1}function y(k,_){if(console.log(k.target.value),!k.target.value.length){B();return}C.selectedItem[_]=k.target.value,C.isItemSelected=!0}function B(k,_){console.log("clearing..."),delete C.selectedItem[_],C.isItemSelected=!1}function v(k){let _={};return k.forEach(R=>{let T=R[0],O=R[1];_[T]=O}),_}return h.watch(C.formValues,k=>{Object.entries(k).forEach(([_,R])=>{R===""&&delete C.formValues[_]})}),h.onBeforeMount(async()=>{await x.getAdressStructure(),C.addSkel=x.state.structure.address}),(k,_)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",null,[x0,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,R=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:R[0]},[R[1].visible&&R[1].params.group==="Customer Info"?(h.openBlock(),h.createBlock(ur,{key:0,is:h.unref(Yt)(R[1].type),name:R[0],structure:v(C.addSkel),errors:C.errors[R[0]]?C.errors[R[0]]:[],skel:C.formValues,onChange:T=>S(R[0],T),class:"viur-shop-form-grid-w-2"},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]),S0,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.shippingAdressAmount,R=>(h.openBlock(),h.createElementBlock("div",{key:R},[h.createElementVNode("sl-select",{clearable:"",ref_for:!0,ref_key:"itemSelection",ref:N,onSlChange:T=>y(T,R),onSlClear:T=>B(T,R),label:C.selectedItem[R]?h.unref(x).state.carts[C.selectedItem[R]].info.name:"Warenkorb für Adresse wählen.",class:"grid-w-4"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(h.unref(x).state.carts,(T,O)=>(h.openBlock(),h.createElementBlock("sl-option",{value:O},h.toDisplayString(T.info.name),9,B0))),256))],40,D0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,T=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:T[0]},[T[1].visible&&T[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(ur,{key:0,is:h.unref(Yt)(T[1].type),name:T[0],structure:v(C.addSkel),errors:C.errors[T[0]]?C.errors[T[0]]:[],skel:C.formValues,onChange:O=>S(T[0],O)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))]))),128)),C.isCustomAdress?(h.openBlock(),h.createElementBlock("div",T0,[I0,(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(C.addSkel,R=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:R[0]},[R[1].visible&&R[1].params.group==="Customer Address"?(h.openBlock(),h.createBlock(ur,{key:0,is:h.unref(Yt)(R[1].type),name:R[0],structure:v(C.addSkel),errors:C.errors[R[0]]?C.errors[R[0]]:[],skel:C.formValues,onChange:T=>S(R[0],T)},null,8,["is","name","structure","errors","skel","onChange"])):h.createCommentVNode("",!0)],64))),128))])):h.createCommentVNode("",!0),h.createElementVNode("div",{class:"viur-shop-form-btn-wrap"},[h.createElementVNode("sl-button",{size:"medium",onClick:p,title:"Lieferadresse entfernen"},P0),h.createElementVNode("sl-button",{size:"medium",variant:"primary",onClick:w},[R0,h.createTextVNode(" Lieferadresse hinzufügen ")])]),h.createElementVNode("sl-alert",{variant:"warning",duration:"2000",ref_key:"shippingWarning",ref:D,closable:""},[O0,h.createElementVNode("strong",null,h.toDisplayString(C.amountAlert.title),1),N0,h.createTextVNode(" "+h.toDisplayString(C.amountAlert.msg),1)],512),h.createElementVNode("sl-checkbox",{onSlChange:M,checked:""}," Rechnungsadresse wie Lieferadresse ",32)],64))}},[["__scopeId","data-v-71a3c8c9"]]),ul={__name:"ExampleUsage",setup(m){const x=vn(),C=h.computed(()=>x.state.basketRootNode.key?x.state.basketRootNode.key:""),N=h.reactive({rootNode:{},tabs:{cart:{component:h.shallowRef(rr),props:{sidebar:!0,mode:"basket",cartKey:C},displayName:"Warenkorb",icon:{name:"cart",library:"hsk"},position:2,disabled:!1,atShow:null,atHide:null},confirm:{component:h.shallowRef(sr),props:{},displayName:"Bestellung prüfen",icon:{name:"order-check",library:"hsk"},position:5,disabled:!1,atShow:null,atHide:null},orderComplete:{component:h.shallowRef(xb),props:{},displayName:"Bestellung Abgeschlossen",icon:{name:"order-confirmed",library:"hsk"},position:6,disabled:!0,atShow:null,atHide:null},userInfo:{component:h.shallowRef(KA),props:{},displayName:"Daten Eingeben",icon:{name:"user",library:"hsk"},position:3,disabled:!1,atShow:null,atHide:null},userInfoMulti:{component:h.shallowRef(z0),props:{},displayName:"Daten Eingeben (Multi)",icon:{name:"user",library:"hsk"},position:4,disabled:!1,atShow:null,atHide:null}}});function D(M){(M==null?void 0:M.detail.name)==="confirm"&&(N.tabs.orderComplete.disabled=!1)}return h.onBeforeMount(async()=>{await x.init(),await x.getAdressStructure(),console.log("debug init exampleusage :",x.state.basketRootNode)}),(M,w)=>(h.openBlock(),h.createBlock(_b,{tabs:N.tabs,onTabChange:D},null,8,["tabs"]))}},M0={install(m){m.component("CartView",rr),m.component("ExampleUsage",ul),m.component("ConfirmView",sr)}};Ve.CartView=rr,Ve.ConfirmView=sr,Ve.ExampleUsage=ul,Ve.default=M0,Ve.useCartStore=vn,Object.defineProperties(Ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); diff --git a/source/package-lock.json b/source/package-lock.json index 82b7230..0cb40ab 100644 --- a/source/package-lock.json +++ b/source/package-lock.json @@ -1,12 +1,12 @@ { "name": "@viur/shop-components", - "version": "0.0.1-dev.38", + "version": "0.0.1-dev.39", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@viur/shop-components", - "version": "0.0.1-dev.38", + "version": "0.0.1-dev.39", "license": "MIT", "dependencies": { "@viur/ignite": "^5.1.2", diff --git a/source/package.json b/source/package.json index 2e9ced4..ce71f0e 100644 --- a/source/package.json +++ b/source/package.json @@ -1,6 +1,6 @@ { "name": "@viur/shop-components", - "version": "0.0.1-dev.38", + "version": "0.0.1-dev.39", "description": "Frontend Vue components for the shop module of ViUR", "repository": { "type": "git", diff --git a/source/src/components/order/process/ExampleUsage.vue b/source/src/components/order/process/ExampleUsage.vue index 0fae87f..9e4c443 100644 --- a/source/src/components/order/process/ExampleUsage.vue +++ b/source/src/components/order/process/ExampleUsage.vue @@ -37,16 +37,16 @@ const state = reactive({ atShow: null, atHide: null, }, - // confirm: { - // component: shallowRef(ConfirmView), - // props: {}, - // displayName: "Bestellung prüfen", - // icon: { name: "order-check", library: "hsk" }, - // position: 5, - // disabled: false, - // atShow: null, - // atHide: null, - // }, + confirm: { + component: shallowRef(ConfirmView), + props: {}, + displayName: "Bestellung prüfen", + icon: { name: "order-check", library: "hsk" }, + position: 5, + disabled: false, + atShow: null, + atHide: null, + }, // order: { // component: shallowRef(CategoryView), // props: {