var Ic = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Em(Ls) { return Ls && Ls.__esModule && Object.prototype.hasOwnProperty.call(Ls, "default") ? Ls.default : Ls; } var Yd = { exports: {} }; /*! grapesjs - 0.21.2 */ (function(Ls, Mm) { (function(Uf, Fc) { Ls.exports = Fc(); })(typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : Ic, () => (() => { var Uf = { 410: (S, H, pt) => { var at, _t, J; _t = [pt(50), pt(316)], (J = typeof (at = function(W, z) { var k = Array.prototype.slice; function P(j, V, Y) { return Y.length <= 4 ? j.call(V, Y[0], Y[1], Y[2], Y[3]) : j.apply(V, Y); } function E(j, V) { return k.call(j, V); } function M(j, V) { return j != null && (W.isArray(V) || (V = E(arguments, 1)), W.all(V, function(Y) { return Y in j; })); } var D = function() { var j = !1, V = -1; function Y() { V++, j = !0, W.defer(function() { j = !1; }); } return function() { return j || Y(), V; }; }(); function ot() { this.registeredObjects = [], this.cidIndexes = []; } function it(j, V, Y, nt) { for (var wt, rt = 0, gt = V.length; rt < gt; rt++) if (wt = V[rt]) { if (j === "on") { if (!nt.objectRegistry.register(wt)) continue; } else if (!nt.objectRegistry.unregister(wt)) continue; W.isFunction(wt[j]) && wt[j]("all", Y, nt); } } function Et(j, V) { var Y = V.type, nt = V.undoTypes, wt = !nt[Y] || nt[Y][j]; W.isFunction(wt) && wt(V.object, V.before, V.after, V.options); } function jt(j, V, Y, nt, wt) { if (!(Y.isCurrentlyUndoRedoing || j === "undo" && Y.pointer === -1 || j === "redo" && Y.pointer === Y.length - 1)) { Y.isCurrentlyUndoRedoing = !0; var rt, gt, N = j === "undo"; for (wt ? gt = N && Y.pointer === Y.length - 1 || !N && Y.pointer === -1 ? W.clone(Y.models) : k.apply(Y.models, N ? [0, Y.pointer] : [Y.pointer, Y.length - 1]) : (rt = Y.at(N ? Y.pointer : Y.pointer + 1), gt = nt ? Y.where({ magicFusionIndex: rt.get("magicFusionIndex") }) : [rt]), Y.pointer += (N ? -1 : 1) * gt.length; rt = N ? gt.pop() : gt.shift(); ) rt[j](); Y.isCurrentlyUndoRedoing = !1, V.trigger(j, V); } } function Dt(j, V) { var Y = j.condition, nt = typeof Y; return nt === "function" ? !!P(Y, j, V) : nt !== "boolean" || Y; } function ee(j, V, Y, nt) { if (j.track && !j.isCurrentlyUndoRedoing && V in nt && Dt(nt[V], Y)) { var wt = P(nt[V].on, nt[V], Y); if (M(wt, "object", "before", "after")) { if (wt.type = V, wt.magicFusionIndex = D(), wt.undoTypes = nt, j.pointer < j.length - 1) for (var rt = j.length - j.pointer - 1; rt--; ) j.pop(); j.pointer = j.length, j.add(wt), j.length > j.maximumStackLength && (j.shift(), j.pointer--); } } } ot.prototype = { isRegistered: function(j) { return j && j.cid ? this.registeredObjects[j.cid] : W.contains(this.registeredObjects, j); }, register: function(j) { return !this.isRegistered(j) && (j && j.cid ? (this.registeredObjects[j.cid] = j, this.cidIndexes.push(j.cid)) : this.registeredObjects.push(j), !0); }, unregister: function(j) { if (this.isRegistered(j)) { if (j && j.cid) delete this.registeredObjects[j.cid], this.cidIndexes.splice(W.indexOf(this.cidIndexes, j.cid), 1); else { var V = W.indexOf(this.registeredObjects, j); this.registeredObjects.splice(V, 1); } return !0; } return !1; }, get: function() { return W.map(this.cidIndexes, function(j) { return this.registeredObjects[j]; }, this).concat(this.registeredObjects); } }; var xt = { add: { undo: function(j, V, Y, nt) { j.remove(Y, nt); }, redo: function(j, V, Y, nt) { nt.index && (nt.at = nt.index), j.add(Y, nt); }, on: function(j, V, Y) { return { object: V, before: void 0, after: j, options: W.clone(Y) }; } }, remove: { undo: function(j, V, Y, nt) { "index" in nt && (nt.at = nt.index), j.add(V, nt); }, redo: function(j, V, Y, nt) { j.remove(V, nt); }, on: function(j, V, Y) { return { object: V, before: j, after: void 0, options: W.clone(Y) }; } }, change: { undo: function(j, V, Y, nt) { W.isEmpty(V) ? W.each(W.keys(Y), j.unset, j) : (j.set(V), nt && nt.unsetData && nt.unsetData.before && nt.unsetData.before.length && W.each(nt.unsetData.before, j.unset, j)); }, redo: function(j, V, Y, nt) { W.isEmpty(Y) ? W.each(W.keys(V), j.unset, j) : (j.set(Y), nt && nt.unsetData && nt.unsetData.after && nt.unsetData.after.length && W.each(nt.unsetData.after, j.unset, j)); }, on: function(j, V) { var Y = j.changedAttributes(), nt = W.keys(Y), wt = W.pick(j.previousAttributes(), nt), rt = W.keys(wt), gt = (V || (V = {})).unsetData = { after: [], before: [] }; return nt.length != rt.length && (nt.length > rt.length ? W.each(nt, function(N) { N in wt || gt.before.push(N); }, this) : W.each(rt, function(N) { N in Y || gt.after.push(N); })), { object: j, before: wt, after: Y, options: W.clone(V) }; } }, reset: { undo: function(j, V, Y) { j.reset(V); }, redo: function(j, V, Y) { j.reset(Y); }, on: function(j, V) { return { object: j, before: V.previousModels, after: W.clone(j.models) }; } } }; function bt() { } function Wt(j, V, Y, nt) { if (typeof V == "object") return W.each(V, function(wt, rt) { j === 2 ? Wt(j, wt, Y, nt) : Wt(j, rt, wt, Y); }); switch (j) { case 0: M(Y, "undo", "redo", "on") && W.all(W.pick(Y, "undo", "redo", "on"), W.isFunction) && (nt[V] = Y); break; case 1: nt[V] && W.isObject(Y) && (nt[V] = W.extend({}, nt[V], Y)); break; case 2: delete nt[V]; } return this; } bt.prototype = xt; var Ft = z.Model.extend({ defaults: { type: null, object: null, before: null, after: null, magicFusionIndex: null }, undo: function(j) { Et("undo", this.attributes); }, redo: function(j) { Et("redo", this.attributes); } }), Ht = z.Collection.extend({ model: Ft, pointer: -1, track: !1, isCurrentlyUndoRedoing: !1, maximumStackLength: 1 / 0, setMaxLength: function(j) { this.maximumStackLength = j; } }), Q = z.Model.extend({ defaults: { maximumStackLength: 1 / 0, track: !1 }, initialize: function(j) { this.stack = new Ht(), this.objectRegistry = new ot(), this.undoTypes = new bt(), this.stack.setMaxLength(this.get("maximumStackLength")), this.on("change:maximumStackLength", function(V, Y) { this.stack.setMaxLength(Y); }, this), j && j.track && this.startTracking(), j && j.register && (W.isArray(j.register) || W.isArguments(j.register) ? P(this.register, this, j.register) : this.register(j.register)); }, startTracking: function() { this.set("track", !0), this.stack.track = !0; }, stopTracking: function() { this.set("track", !1), this.stack.track = !1; }, isTracking: function() { return this.get("track"); }, _addToStack: function(j) { ee(this.stack, j, E(arguments, 1), this.undoTypes); }, register: function() { it("on", arguments, this._addToStack, this); }, unregister: function() { it("off", arguments, this._addToStack, this); }, unregisterAll: function() { P(this.unregister, this, this.objectRegistry.get()); }, undo: function(j) { jt("undo", this, this.stack, j); }, undoAll: function() { jt("undo", this, this.stack, !1, !0); }, redo: function(j) { jt("redo", this, this.stack, j); }, redoAll: function() { jt("redo", this, this.stack, !1, !0); }, isAvailable: function(j) { var V = this.stack, Y = V.length; switch (j) { case "undo": return Y > 0 && V.pointer > -1; case "redo": return Y > 0 && V.pointer < Y - 1; default: return !1; } }, merge: function(j) { for (var V, Y = W.isArray(j) ? j : E(arguments); V = Y.pop(); ) V instanceof Q && V.stack instanceof Ht && (V.stack = this.stack); }, addUndoType: function(j, V) { Wt(0, j, V, this.undoTypes); }, changeUndoType: function(j, V) { Wt(1, j, V, this.undoTypes); }, removeUndoType: function(j) { Wt(2, j, void 0, this.undoTypes); }, clear: function() { this.stack.reset(), this.stack.pointer = -1; } }); return W.extend(Q, { defaults: function(j) { W.extend(Q.prototype.defaults, j); }, addUndoType: function(j, V) { Wt(0, j, V, xt); }, changeUndoType: function(j, V) { Wt(1, j, V, xt); }, removeUndoType: function(j) { Wt(2, j, void 0, xt); } }), z.UndoManager = Q; }) == "function" ? at.apply(H, _t) : at) === void 0 || (S.exports = J); }, 316: (S, H, pt) => { var at, _t; (function(J) { var W = typeof self == "object" && self.self === self && self || typeof pt.g == "object" && pt.g.global === pt.g && pt.g; at = [pt(50), pt(895), H], _t = function(z, k, P) { W.Backbone = function(E, M, D, ot) { var it = E.Backbone, Et = Array.prototype.slice; M.VERSION = "1.4.1", M.$ = ot, M.noConflict = function() { return E.Backbone = it, this; }, M.emulateHTTP = !1, M.emulateJSON = !1; var jt, Dt = M.Events = {}, ee = /\s+/, xt = function(b, I, U, ht, kt) { var Ot, fe = 0; if (U && typeof U == "object") for (ht !== void 0 && ("context" in kt) && kt.context === void 0 && (kt.context = ht), Ot = D.keys(U); fe < Ot.length; fe++) I = xt(b, I, Ot[fe], U[Ot[fe]], kt); else if (U && ee.test(U)) for (Ot = U.split(ee); fe < Ot.length; fe++) I = b(I, Ot[fe], ht, kt); else I = b(I, U, ht, kt); return I; }; Dt.on = function(b, I, U) { return this._events = xt(bt, this._events || {}, b, I, { context: U, ctx: this, listening: jt }), jt && ((this._listeners || (this._listeners = {}))[jt.id] = jt, jt.interop = !1), this; }, Dt.listenTo = function(b, I, U) { if (!b) return this; var ht = b._listenId || (b._listenId = D.uniqueId("l")), kt = this._listeningTo || (this._listeningTo = {}), Ot = jt = kt[ht]; Ot || (this._listenId || (this._listenId = D.uniqueId("l")), Ot = jt = kt[ht] = new V(this, b)); var fe = Wt(b, I, U, this); if (jt = void 0, fe) throw fe; return Ot.interop && Ot.on(I, U), this; }; var bt = function(b, I, U, ht) { if (U) { var kt = b[I] || (b[I] = []), Ot = ht.context, fe = ht.ctx, ke = ht.listening; ke && ke.count++, kt.push({ callback: U, context: Ot, ctx: Ot || fe, listening: ke }); } return b; }, Wt = function(b, I, U, ht) { try { b.on(I, U, ht); } catch (kt) { return kt; } }; Dt.off = function(b, I, U) { return this._events ? (this._events = xt(Ft, this._events, b, I, { context: U, listeners: this._listeners }), this) : this; }, Dt.stopListening = function(b, I, U) { var ht = this._listeningTo; if (!ht) return this; for (var kt = b ? [b._listenId] : D.keys(ht), Ot = 0; Ot < kt.length; Ot++) { var fe = ht[kt[Ot]]; if (!fe) break; fe.obj.off(I, U, this), fe.interop && fe.off(I, U); } return D.isEmpty(ht) && (this._listeningTo = void 0), this; }; var Ft = function(b, I, U, ht) { if (b) { var kt, Ot = ht.context, fe = ht.listeners, ke = 0; if (I || Ot || U) { for (kt = I ? [I] : D.keys(b); ke < kt.length; ke++) { var Ve = b[I = kt[ke]]; if (!Ve) break; for (var ze = [], Qe = 0; Qe < Ve.length; Qe++) { var Kt = Ve[Qe]; if (U && U !== Kt.callback && U !== Kt.callback._callback || Ot && Ot !== Kt.context) ze.push(Kt); else { var R = Kt.listening; R && R.off(I, U); } } ze.length ? b[I] = ze : delete b[I]; } return b; } for (kt = D.keys(fe); ke < kt.length; ke++) fe[kt[ke]].cleanup(); } }; Dt.once = function(b, I, U) { var ht = xt(Ht, {}, b, I, this.off.bind(this)); return typeof b == "string" && U == null && (I = void 0), this.on(ht, I, U); }, Dt.listenToOnce = function(b, I, U) { var ht = xt(Ht, {}, I, U, this.stopListening.bind(this, b)); return this.listenTo(b, ht); }; var Ht = function(b, I, U, ht) { if (U) { var kt = b[I] = D.once(function() { ht(I, kt), U.apply(this, arguments); }); kt._callback = U; } return b; }; Dt.trigger = function(b) { if (!this._events) return this; for (var I = Math.max(0, arguments.length - 1), U = Array(I), ht = 0; ht < I; ht++) U[ht] = arguments[ht + 1]; return xt(Q, this._events, b, void 0, U), this; }; var Q = function(b, I, U, ht) { if (b) { var kt = b[I], Ot = b.all; kt && Ot && (Ot = Ot.slice()), kt && j(kt, ht), Ot && j(Ot, [I].concat(ht)); } return b; }, j = function(b, I) { var U, ht = -1, kt = b.length, Ot = I[0], fe = I[1], ke = I[2]; switch (I.length) { case 0: for (; ++ht < kt; ) (U = b[ht]).callback.call(U.ctx); return; case 1: for (; ++ht < kt; ) (U = b[ht]).callback.call(U.ctx, Ot); return; case 2: for (; ++ht < kt; ) (U = b[ht]).callback.call(U.ctx, Ot, fe); return; case 3: for (; ++ht < kt; ) (U = b[ht]).callback.call(U.ctx, Ot, fe, ke); return; default: for (; ++ht < kt; ) (U = b[ht]).callback.apply(U.ctx, I); return; } }, V = function(b, I) { this.id = b._listenId, this.listener = b, this.obj = I, this.interop = !0, this.count = 0, this._events = void 0; }; V.prototype.on = Dt.on, V.prototype.off = function(b, I) { var U; this.interop ? (this._events = xt(Ft, this._events, b, I, { context: void 0, listeners: void 0 }), U = !this._events) : (this.count--, U = this.count === 0), U && this.cleanup(); }, V.prototype.cleanup = function() { delete this.listener._listeningTo[this.obj._listenId], this.interop || delete this.obj._listeners[this.id]; }, Dt.bind = Dt.on, Dt.unbind = Dt.off, D.extend(M, Dt); var Y = M.Model = function(b, I) { var U = b || {}; I || (I = {}), this.preinitialize.apply(this, arguments), this.cid = D.uniqueId(this.cidPrefix), this.attributes = {}, I.collection && (this.collection = I.collection), I.parse && (U = this.parse(U, I) || {}); var ht = D.result(this, "defaults"); U = D.defaults(D.extend({}, ht, U), ht), this.set(U, I), this.changed = {}, this.initialize.apply(this, arguments); }; D.extend(Y.prototype, Dt, { changed: null, validationError: null, idAttribute: "id", cidPrefix: "c", preinitialize: function() { }, initialize: function() { }, toJSON: function(b) { return D.clone(this.attributes); }, sync: function() { return M.sync.apply(this, arguments); }, get: function(b) { return this.attributes[b]; }, escape: function(b) { return D.escape(this.get(b)); }, has: function(b) { return this.get(b) != null; }, matches: function(b) { return !!D.iteratee(b, this)(this.attributes); }, set: function(b, I, U) { if (b == null) return this; var ht; if (typeof b == "object" ? (ht = b, U = I) : (ht = {})[b] = I, U || (U = {}), !this._validate(ht, U)) return !1; var kt = U.unset, Ot = U.silent, fe = [], ke = this._changing; this._changing = !0, ke || (this._previousAttributes = D.clone(this.attributes), this.changed = {}); var Ve = this.attributes, ze = this.changed, Qe = this._previousAttributes; for (var Kt in ht) I = ht[Kt], D.isEqual(Ve[Kt], I) || fe.push(Kt), D.isEqual(Qe[Kt], I) ? delete ze[Kt] : ze[Kt] = I, kt ? delete Ve[Kt] : Ve[Kt] = I; if (this.idAttribute in ht) { var R = this.id; this.id = this.get(this.idAttribute), this.trigger("changeId", this, R, U); } if (!Ot) { fe.length && (this._pending = U); for (var tt = 0; tt < fe.length; tt++) this.trigger("change:" + fe[tt], this, Ve[fe[tt]], U); } if (ke) return this; if (!Ot) for (; this._pending; ) U = this._pending, this._pending = !1, this.trigger("change", this, U); return this._pending = !1, this._changing = !1, this; }, unset: function(b, I) { return this.set(b, void 0, D.extend({}, I, { unset: !0 })); }, clear: function(b) { var I = {}; for (var U in this.attributes) I[U] = void 0; return this.set(I, D.extend({}, b, { unset: !0 })); }, hasChanged: function(b) { return b == null ? !D.isEmpty(this.changed) : D.has(this.changed, b); }, changedAttributes: function(b) { if (!b) return !!this.hasChanged() && D.clone(this.changed); var I, U = this._changing ? this._previousAttributes : this.attributes, ht = {}; for (var kt in b) { var Ot = b[kt]; D.isEqual(U[kt], Ot) || (ht[kt] = Ot, I = !0); } return !!I && ht; }, previous: function(b) { return b != null && this._previousAttributes ? this._previousAttributes[b] : null; }, previousAttributes: function() { return D.clone(this._previousAttributes); }, fetch: function(b) { b = D.extend({ parse: !0 }, b); var I = this, U = b.success; return b.success = function(ht) { var kt = b.parse ? I.parse(ht, b) : ht; if (!I.set(kt, b)) return !1; U && U.call(b.context, I, ht, b), I.trigger("sync", I, ht, b); }, zt(this, b), this.sync("read", this, b); }, save: function(b, I, U) { var ht; b == null || typeof b == "object" ? (ht = b, U = I) : (ht = {})[b] = I; var kt = (U = D.extend({ validate: !0, parse: !0 }, U)).wait; if (ht && !kt) { if (!this.set(ht, U)) return !1; } else if (!this._validate(ht, U)) return !1; var Ot = this, fe = U.success, ke = this.attributes; U.success = function(Qe) { Ot.attributes = ke; var Kt = U.parse ? Ot.parse(Qe, U) : Qe; if (kt && (Kt = D.extend({}, ht, Kt)), Kt && !Ot.set(Kt, U)) return !1; fe && fe.call(U.context, Ot, Qe, U), Ot.trigger("sync", Ot, Qe, U); }, zt(this, U), ht && kt && (this.attributes = D.extend({}, ke, ht)); var Ve = this.isNew() ? "create" : U.patch ? "patch" : "update"; Ve !== "patch" || U.attrs || (U.attrs = ht); var ze = this.sync(Ve, this, U); return this.attributes = ke, ze; }, destroy: function(b) { b = b ? D.clone(b) : {}; var I = this, U = b.success, ht = b.wait, kt = function() { I.stopListening(), I.trigger("destroy", I, I.collection, b); }; b.success = function(fe) { ht && kt(), U && U.call(b.context, I, fe, b), I.isNew() || I.trigger("sync", I, fe, b); }; var Ot = !1; return this.isNew() ? D.defer(b.success) : (zt(this, b), Ot = this.sync("delete", this, b)), ht || kt(), Ot; }, url: function() { var b = D.result(this, "urlRoot") || D.result(this.collection, "url") || mt(); if (this.isNew()) return b; var I = this.get(this.idAttribute); return b.replace(/[^\/]$/, "$&/") + encodeURIComponent(I); }, parse: function(b, I) { return b; }, clone: function() { return new this.constructor(this.attributes); }, isNew: function() { return !this.has(this.idAttribute); }, isValid: function(b) { return this._validate({}, D.extend({}, b, { validate: !0 })); }, _validate: function(b, I) { if (!I.validate || !this.validate) return !0; b = D.extend({}, this.attributes, b); var U = this.validationError = this.validate(b, I) || null; return !U || (this.trigger("invalid", this, U, D.extend(I, { validationError: U })), !1); } }); var nt = M.Collection = function(b, I) { I || (I = {}), this.preinitialize.apply(this, arguments), I.model && (this.model = I.model), I.comparator !== void 0 && (this.comparator = I.comparator), this._reset(), this.initialize.apply(this, arguments), b && this.reset(b, D.extend({ silent: !0 }, I)); }, wt = { add: !0, remove: !0, merge: !0 }, rt = { add: !0, remove: !1 }, gt = function(b, I, U) { U = Math.min(Math.max(U, 0), b.length); var ht, kt = Array(b.length - U), Ot = I.length; for (ht = 0; ht < kt.length; ht++) kt[ht] = b[ht + U]; for (ht = 0; ht < Ot; ht++) b[ht + U] = I[ht]; for (ht = 0; ht < kt.length; ht++) b[ht + Ot + U] = kt[ht]; }; D.extend(nt.prototype, Dt, { model: Y, preinitialize: function() { }, initialize: function() { }, toJSON: function(b) { return this.map(function(I) { return I.toJSON(b); }); }, sync: function() { return M.sync.apply(this, arguments); }, add: function(b, I) { return this.set(b, D.extend({ merge: !1 }, I, rt)); }, remove: function(b, I) { I = D.extend({}, I); var U = !D.isArray(b); b = U ? [b] : b.slice(); var ht = this._removeModels(b, I); return !I.silent && ht.length && (I.changes = { added: [], merged: [], removed: ht }, this.trigger("update", this, I)), U ? ht[0] : ht; }, set: function(b, I) { if (b != null) { (I = D.extend({}, wt, I)).parse && !this._isModel(b) && (b = this.parse(b, I) || []); var U = !D.isArray(b); b = U ? [b] : b.slice(); var ht = I.at; ht != null && (ht = +ht), ht > this.length && (ht = this.length), ht < 0 && (ht += this.length + 1); var kt, Ot, fe = [], ke = [], Ve = [], ze = [], Qe = {}, Kt = I.add, R = I.merge, tt = I.remove, ut = !1, yt = this.comparator && ht == null && I.sort !== !1, Yt = D.isString(this.comparator) ? this.comparator : null; for (Ot = 0; Ot < b.length; Ot++) { kt = b[Ot]; var he = this.get(kt); if (he) { if (R && kt !== he) { var Re = this._isModel(kt) ? kt.attributes : kt; I.parse && (Re = he.parse(Re, I)), he.set(Re, I), Ve.push(he), yt && !ut && (ut = he.hasChanged(Yt)); } Qe[he.cid] || (Qe[he.cid] = !0, fe.push(he)), b[Ot] = he; } else Kt && (kt = b[Ot] = this._prepareModel(kt, I)) && (ke.push(kt), this._addReference(kt, I), Qe[kt.cid] = !0, fe.push(kt)); } if (tt) { for (Ot = 0; Ot < this.length; Ot++) Qe[(kt = this.models[Ot]).cid] || ze.push(kt); ze.length && this._removeModels(ze, I); } var We = !1, Ln = !yt && Kt && tt; if (fe.length && Ln ? (We = this.length !== fe.length || D.some(this.models, function(pn, Ne) { return pn !== fe[Ne]; }), this.models.length = 0, gt(this.models, fe, 0), this.length = this.models.length) : ke.length && (yt && (ut = !0), gt(this.models, ke, ht ?? this.length), this.length = this.models.length), ut && this.sort({ silent: !0 }), !I.silent) { for (Ot = 0; Ot < ke.length; Ot++) ht != null && (I.index = ht + Ot), (kt = ke[Ot]).trigger("add", kt, this, I); (ut || We) && this.trigger("sort", this, I), (ke.length || ze.length || Ve.length) && (I.changes = { added: ke, removed: ze, merged: Ve }, this.trigger("update", this, I)); } return U ? b[0] : b; } }, reset: function(b, I) { I = I ? D.clone(I) : {}; for (var U = 0; U < this.models.length; U++) this._removeReference(this.models[U], I); return I.previousModels = this.models, this._reset(), b = this.add(b, D.extend({ silent: !0 }, I)), I.silent || this.trigger("reset", this, I), b; }, push: function(b, I) { return this.add(b, D.extend({ at: this.length }, I)); }, pop: function(b) { var I = this.at(this.length - 1); return this.remove(I, b); }, unshift: function(b, I) { return this.add(b, D.extend({ at: 0 }, I)); }, shift: function(b) { var I = this.at(0); return this.remove(I, b); }, slice: function() { return Et.apply(this.models, arguments); }, get: function(b) { if (b != null) return this._byId[b] || this._byId[this.modelId(this._isModel(b) ? b.attributes : b, b.idAttribute)] || b.cid && this._byId[b.cid]; }, has: function(b) { return this.get(b) != null; }, at: function(b) { return b < 0 && (b += this.length), this.models[b]; }, where: function(b, I) { return this[I ? "find" : "filter"](b); }, findWhere: function(b) { return this.where(b, !0); }, sort: function(b) { var I = this.comparator; if (!I) throw new Error("Cannot sort a set without a comparator"); b || (b = {}); var U = I.length; return D.isFunction(I) && (I = I.bind(this)), U === 1 || D.isString(I) ? this.models = this.sortBy(I) : this.models.sort(I), b.silent || this.trigger("sort", this, b), this; }, pluck: function(b) { return this.map(b + ""); }, fetch: function(b) { var I = (b = D.extend({ parse: !0 }, b)).success, U = this; return b.success = function(ht) { var kt = b.reset ? "reset" : "set"; U[kt](ht, b), I && I.call(b.context, U, ht, b), U.trigger("sync", U, ht, b); }, zt(this, b), this.sync("read", this, b); }, create: function(b, I) { var U = (I = I ? D.clone(I) : {}).wait; if (!(b = this._prepareModel(b, I))) return !1; U || this.add(b, I); var ht = this, kt = I.success; return I.success = function(Ot, fe, ke) { U && ht.add(Ot, ke), kt && kt.call(ke.context, Ot, fe, ke); }, b.save(null, I), b; }, parse: function(b, I) { return b; }, clone: function() { return new this.constructor(this.models, { model: this.model, comparator: this.comparator }); }, modelId: function(b, I) { return b[I || this.model.prototype.idAttribute || "id"]; }, values: function() { return new Lt(this, Tt); }, keys: function() { return new Lt(this, Qt); }, entries: function() { return new Lt(this, Oe); }, _reset: function() { this.length = 0, this.models = [], this._byId = {}; }, _prepareModel: function(b, I) { return this._isModel(b) ? (b.collection || (b.collection = this), b) : ((I = I ? D.clone(I) : {}).collection = this, (U = this.model.prototype ? new this.model(b, I) : this.model(b, I)).validationError ? (this.trigger("invalid", this, U.validationError, I), !1) : U); var U; }, _removeModels: function(b, I) { for (var U = [], ht = 0; ht < b.length; ht++) { var kt = this.get(b[ht]); if (kt) { var Ot = this.indexOf(kt); this.models.splice(Ot, 1), this.length--, delete this._byId[kt.cid]; var fe = this.modelId(kt.attributes, kt.idAttribute); fe != null && delete this._byId[fe], I.silent || (I.index = Ot, kt.trigger("remove", kt, this, I)), U.push(kt), this._removeReference(kt, I); } } return U; }, _isModel: function(b) { return b instanceof Y; }, _addReference: function(b, I) { this._byId[b.cid] = b; var U = this.modelId(b.attributes, b.idAttribute); U != null && (this._byId[U] = b), b.on("all", this._onModelEvent, this); }, _removeReference: function(b, I) { delete this._byId[b.cid]; var U = this.modelId(b.attributes, b.idAttribute); U != null && delete this._byId[U], this === b.collection && delete b.collection, b.off("all", this._onModelEvent, this); }, _onModelEvent: function(b, I, U, ht) { if (I) { if ((b === "add" || b === "remove") && U !== this) return; if (b === "destroy" && this.remove(I, ht), b === "changeId") { var kt = this.modelId(I.previousAttributes(), I.idAttribute), Ot = this.modelId(I.attributes, I.idAttribute); kt != null && delete this._byId[kt], Ot != null && (this._byId[Ot] = I); } } this.trigger.apply(this, arguments); } }); var N = typeof Symbol == "function" && Symbol.iterator; N && (nt.prototype[N] = nt.prototype.values); var Lt = function(b, I) { this._collection = b, this._kind = I, this._index = 0; }, Tt = 1, Qt = 2, Oe = 3; N && (Lt.prototype[N] = function() { return this; }), Lt.prototype.next = function() { if (this._collection) { if (this._index < this._collection.length) { var b, I = this._collection.at(this._index); if (this._index++, this._kind === Tt) b = I; else { var U = this._collection.modelId(I.attributes, I.idAttribute); b = this._kind === Qt ? U : [U, I]; } return { value: b, done: !1 }; } this._collection = void 0; } return { value: void 0, done: !0 }; }; var Se = M.View = function(b) { this.cid = D.uniqueId("view"), this.preinitialize.apply(this, arguments), D.extend(this, D.pick(b, De)), this._ensureElement(), this.initialize.apply(this, arguments); }, _e = /^(\S+)\s*(.*)$/, De = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"]; D.extend(Se.prototype, Dt, { tagName: "div", $: function(b) { return this.$el.find(b); }, preinitialize: function() { }, initialize: function() { }, render: function() { return this; }, remove: function() { return this._removeElement(), this.stopListening(), this; }, _removeElement: function() { this.$el.remove(); }, setElement: function(b) { return this.undelegateEvents(), this._setElement(b), this.delegateEvents(), this; }, _setElement: function(b) { this.$el = b instanceof M.$ ? b : M.$(b), this.el = this.$el[0]; }, delegateEvents: function(b) { if (b || (b = D.result(this, "events")), !b) return this; for (var I in this.undelegateEvents(), b) { var U = b[I]; if (D.isFunction(U) || (U = this[U]), U) { var ht = I.match(_e); this.delegate(ht[1], ht[2], U.bind(this)); } } return this; }, delegate: function(b, I, U) { return this.$el.on(b + ".delegateEvents" + this.cid, I, U), this; }, undelegateEvents: function() { return this.$el && this.$el.off(".delegateEvents" + this.cid), this; }, undelegate: function(b, I, U) { return this.$el.off(b + ".delegateEvents" + this.cid, I, U), this; }, _createElement: function(b) { return document.createElement(b); }, _ensureElement: function() { if (this.el) this.setElement(D.result(this, "el")); else { var b = D.extend({}, D.result(this, "attributes")); this.id && (b.id = D.result(this, "id")), this.className && (b.class = D.result(this, "className")), this.setElement(this._createElement(D.result(this, "tagName"))), this._setAttributes(b); } }, _setAttributes: function(b) { this.$el.attr(b); } }); var xe = function(b, I, U, ht) { switch (I) { case 1: return function() { return b[U](this[ht]); }; case 2: return function(kt) { return b[U](this[ht], kt); }; case 3: return function(kt, Ot) { return b[U](this[ht], be(kt, this), Ot); }; case 4: return function(kt, Ot, fe) { return b[U](this[ht], be(kt, this), Ot, fe); }; default: return function() { var kt = Et.call(arguments); return kt.unshift(this[ht]), b[U].apply(b, kt); }; } }, Te = function(b, I, U, ht) { D.each(U, function(kt, Ot) { I[Ot] && (b.prototype[Ot] = xe(I, kt, Ot, ht)); }); }, be = function(b, I) { return D.isFunction(b) ? b : D.isObject(b) && !I._isModel(b) ? ge(b) : D.isString(b) ? function(U) { return U.get(b); } : b; }, ge = function(b) { var I = D.matches(b); return function(U) { return I(U.attributes); }; }, pe = { forEach: 3, each: 3, map: 3, collect: 3, reduce: 0, foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3, select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3, contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3, head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3, without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3, isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3, sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3 }, ce = { keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, omit: 0, chain: 1, isEmpty: 1 }; D.each([[nt, pe, "models"], [Y, ce, "attributes"]], function(b) { var I = b[0], U = b[1], ht = b[2]; I.mixin = function(kt) { var Ot = D.reduce(D.functions(kt), function(fe, ke) { return fe[ke] = 0, fe; }, {}); Te(I, kt, Ot, ht); }, Te(I, D, U, ht); }), M.sync = function(b, I, U) { var ht = st[b]; D.defaults(U || (U = {}), { emulateHTTP: M.emulateHTTP, emulateJSON: M.emulateJSON }); var kt = { type: ht, dataType: "json" }; if (U.url || (kt.url = D.result(I, "url") || mt()), U.data != null || !I || b !== "create" && b !== "update" && b !== "patch" || (kt.contentType = "application/json", kt.data = JSON.stringify(U.attrs || I.toJSON(U))), U.emulateJSON && (kt.contentType = "application/x-www-form-urlencoded", kt.data = kt.data ? { model: kt.data } : {}), U.emulateHTTP && (ht === "PUT" || ht === "DELETE" || ht === "PATCH")) { kt.type = "POST", U.emulateJSON && (kt.data._method = ht); var Ot = U.beforeSend; U.beforeSend = function(Ve) { if (Ve.setRequestHeader("X-HTTP-Method-Override", ht), Ot) return Ot.apply(this, arguments); }; } kt.type === "GET" || U.emulateJSON || (kt.processData = !1); var fe = U.error; U.error = function(Ve, ze, Qe) { U.textStatus = ze, U.errorThrown = Qe, fe && fe.call(U.context, Ve, ze, Qe); }; var ke = U.xhr = M.ajax(D.extend(kt, U)); return I.trigger("request", I, ke, U), ke; }; var st = { create: "POST", update: "PUT", patch: "PATCH", delete: "DELETE", read: "GET" }; M.ajax = function() { return M.$.ajax.apply(M.$, arguments); }; var Xt = M.Router = function(b) { b || (b = {}), this.preinitialize.apply(this, arguments), b.routes && (this.routes = b.routes), this._bindRoutes(), this.initialize.apply(this, arguments); }, qt = /\((.*?)\)/g, ne = /(\(\?)?:\w+/g, ae = /\*\w+/g, Zt = /[\-{}\[\]+?.,\\\^$|#\s]/g; D.extend(Xt.prototype, Dt, { preinitialize: function() { }, initialize: function() { }, route: function(b, I, U) { D.isRegExp(b) || (b = this._routeToRegExp(b)), D.isFunction(I) && (U = I, I = ""), U || (U = this[I]); var ht = this; return M.history.route(b, function(kt) { var Ot = ht._extractParameters(b, kt); ht.execute(U, Ot, I) !== !1 && (ht.trigger.apply(ht, ["route:" + I].concat(Ot)), ht.trigger("route", I, Ot), M.history.trigger("route", ht, I, Ot)); }), this; }, execute: function(b, I, U) { b && b.apply(this, I); }, navigate: function(b, I) { return M.history.navigate(b, I), this; }, _bindRoutes: function() { if (this.routes) { this.routes = D.result(this, "routes"); for (var b, I = D.keys(this.routes); (b = I.pop()) != null; ) this.route(b, this.routes[b]); } }, _routeToRegExp: function(b) { return b = b.replace(Zt, "\\$&").replace(qt, "(?:$1)?").replace(ne, function(I, U) { return U ? I : "([^/?]+)"; }).replace(ae, "([^?]*?)"), new RegExp("^" + b + "(?:\\?([\\s\\S]*))?$"); }, _extractParameters: function(b, I) { var U = b.exec(I).slice(1); return D.map(U, function(ht, kt) { return kt === U.length - 1 ? ht || null : ht ? decodeURIComponent(ht) : null; }); } }); var Ae = M.History = function() { this.handlers = [], this.checkUrl = this.checkUrl.bind(this), typeof window < "u" && (this.location = window.location, this.history = window.history); }, Ke = /^[#\/]|\s+$/g, Xe = /^\/+|\/+$/g, vn = /#.*$/; Ae.started = !1, D.extend(Ae.prototype, Dt, { interval: 50, atRoot: function() { return this.location.pathname.replace(/[^\/]$/, "$&/") === this.root && !this.getSearch(); }, matchRoot: function() { return this.decodeFragment(this.location.pathname).slice(0, this.root.length - 1) + "/" === this.root; }, decodeFragment: function(b) { return decodeURI(b.replace(/%25/g, "%2525")); }, getSearch: function() { var b = this.location.href.replace(/#.*/, "").match(/\?.+/); return b ? b[0] : ""; }, getHash: function(b) { var I = (b || this).location.href.match(/#(.*)$/); return I ? I[1] : ""; }, getPath: function() { var b = this.decodeFragment(this.location.pathname + this.getSearch()).slice(this.root.length - 1); return b.charAt(0) === "/" ? b.slice(1) : b; }, getFragment: function(b) { return b == null && (b = this._usePushState || !this._wantsHashChange ? this.getPath() : this.getHash()), b.replace(Ke, ""); }, start: function(b) { if (Ae.started) throw new Error("Backbone.history has already been started"); if (Ae.started = !0, this.options = D.extend({ root: "/" }, this.options, b), this.root = this.options.root, this._wantsHashChange = this.options.hashChange !== !1, this._hasHashChange = "onhashchange" in window && (document.documentMode === void 0 || document.documentMode > 7), this._useHashChange = this._wantsHashChange && this._hasHashChange, this._wantsPushState = !!this.options.pushState, this._hasPushState = !(!this.history || !this.history.pushState), this._usePushState = this._wantsPushState && this._hasPushState, this.fragment = this.getFragment(), this.root = ("/" + this.root + "/").replace(Xe, "/"), this._wantsHashChange && this._wantsPushState) { if (!this._hasPushState && !this.atRoot()) { var I = this.root.slice(0, -1) || "/"; return this.location.replace(I + "#" + this.getPath()), !0; } this._hasPushState && this.atRoot() && this.navigate(this.getHash(), { replace: !0 }); } if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) { this.iframe = document.createElement("iframe"), this.iframe.src = "javascript:0", this.iframe.style.display = "none", this.iframe.tabIndex = -1; var U = document.body, ht = U.insertBefore(this.iframe, U.firstChild).contentWindow; ht.document.open(), ht.document.close(), ht.location.hash = "#" + this.fragment; } var kt = window.addEventListener || function(Ot, fe) { return attachEvent("on" + Ot, fe); }; if (this._usePushState ? kt("popstate", this.checkUrl, !1) : this._useHashChange && !this.iframe ? kt("hashchange", this.checkUrl, !1) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), !this.options.silent) return this.loadUrl(); }, stop: function() { var b = window.removeEventListener || function(I, U) { return detachEvent("on" + I, U); }; this._usePushState ? b("popstate", this.checkUrl, !1) : this._useHashChange && !this.iframe && b("hashchange", this.checkUrl, !1), this.iframe && (document.body.removeChild(this.iframe), this.iframe = null), this._checkUrlInterval && clearInterval(this._checkUrlInterval), Ae.started = !1; }, route: function(b, I) { this.handlers.unshift({ route: b, callback: I }); }, checkUrl: function(b) { var I = this.getFragment(); if (I === this.fragment && this.iframe && (I = this.getHash(this.iframe.contentWindow)), I === this.fragment) return !1; this.iframe && this.navigate(I), this.loadUrl(); }, loadUrl: function(b) { return !!this.matchRoot() && (b = this.fragment = this.getFragment(b), D.some(this.handlers, function(I) { if (I.route.test(b)) return I.callback(b), !0; })); }, navigate: function(b, I) { if (!Ae.started) return !1; I && I !== !0 || (I = { trigger: !!I }), b = this.getFragment(b || ""); var U = this.root; b !== "" && b.charAt(0) !== "?" || (U = U.slice(0, -1) || "/"); var ht = U + b; b = b.replace(vn, ""); var kt = this.decodeFragment(b); if (this.fragment !== kt) { if (this.fragment = kt, this._usePushState) this.history[I.replace ? "replaceState" : "pushState"]({}, document.title, ht); else { if (!this._wantsHashChange) return this.location.assign(ht); if (this._updateHash(this.location, b, I.replace), this.iframe && b !== this.getHash(this.iframe.contentWindow)) { var Ot = this.iframe.contentWindow; I.replace || (Ot.document.open(), Ot.document.close()), this._updateHash(Ot.location, b, I.replace); } } return I.trigger ? this.loadUrl(b) : void 0; } }, _updateHash: function(b, I, U) { if (U) { var ht = b.href.replace(/(javascript:|#).*$/, ""); b.replace(ht + "#" + I); } else b.hash = "#" + I; } }), M.history = new Ae(); var Rn = function(b, I) { var U, ht = this; return U = b && D.has(b, "constructor") ? b.constructor : function() { return ht.apply(this, arguments); }, D.extend(U, ht, I), U.prototype = D.create(ht.prototype, b), U.prototype.constructor = U, U.__super__ = ht.prototype, U; }; Y.extend = nt.extend = Xt.extend = Se.extend = Ae.extend = Rn; var mt = function() { throw new Error('A "url" property or function must be specified'); }, zt = function(b, I) { var U = I.error; I.error = function(ht) { U && U.call(I.context, b, ht, I), b.trigger("error", b, ht, I); }; }; return M; }(W, P, z, k); }.apply(H, at), _t === void 0 || (S.exports = _t); })(); }, 210: (S, H, pt) => { (function(at) { at.extendMode("css", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(J, W) { return /^[;{}]$/.test(W); } }), at.extendMode("javascript", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(J, W, z, k) { return this.jsonMode ? /^[\[,{]$/.test(W) || /^}/.test(z) : (W != ";" || !k.lexical || k.lexical.type != ")") && /^[;{}]$/.test(W) && !/^;/.test(z); } }); var _t = /^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/; at.extendMode("xml", { commentStart: "", newlineAfterToken: function(J, W, z, k) { var P = !1; return this.configuration == "html" && (P = !!k.context && _t.test(k.context.tagName)), !P && (J == "tag" && />$/.test(W) && k.context || /^ -1 && D > -1 && D > M && (E = E.substr(0, M) + E.substring(M + P.commentStart.length, D) + E.substr(D + P.commentEnd.length)), k.replaceRange(E, W, z); } }); }), at.defineExtension("autoIndentRange", function(J, W) { var z = this; this.operation(function() { for (var k = J.line; k <= W.line; k++) z.indentLine(k, "smart"); }); }), at.defineExtension("autoFormatRange", function(J, W) { var z = this, k = z.getMode(), P = z.getRange(J, W).split(` `), E = at.copyState(k, z.getTokenAt(J).state), M = z.getOption("tabSize"), D = "", ot = 0, it = J.ch === 0; function Et() { D += ` `, it = !0, ++ot; } for (var jt = 0; jt < P.length; ++jt) { for (var Dt = new at.StringStream(P[jt], M); !Dt.eol(); ) { var ee = at.innerMode(k, E), xt = k.token(Dt, E), bt = Dt.current(); Dt.start = Dt.pos, it && !/\S/.test(bt) || (D += bt, it = !1), !it && ee.mode.newlineAfterToken && ee.mode.newlineAfterToken(xt, bt, Dt.string.slice(Dt.pos) || P[jt + 1] || "", ee.state) && Et(); } !Dt.pos && k.blankLine && k.blankLine(E), !it && jt < P.length - 1 && Et(); } z.operation(function() { z.replaceRange(D, J, W); for (var Wt = J.line + 1, Ft = J.line + ot; Wt <= Ft; ++Wt) z.indentLine(Wt, "smart"); z.setSelection(J, z.getCursor(!1)); }); }); })(pt(631)); }, 631: function(S) { S.exports = function() { var H = navigator.userAgent, pt = navigator.platform, at = /gecko\/\d/i.test(H), _t = /MSIE \d/.test(H), J = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(H), W = /Edge\/(\d+)/.exec(H), z = _t || J || W, k = z && (_t ? document.documentMode || 6 : +(W || J)[1]), P = !W && /WebKit\//.test(H), E = P && /Qt\/\d+\.\d+/.test(H), M = !W && /Chrome\/(\d+)/.exec(H), D = M && +M[1], ot = /Opera\//.test(H), it = /Apple Computer/.test(navigator.vendor), Et = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(H), jt = /PhantomJS/.test(H), Dt = it && (/Mobile\/\w+/.test(H) || navigator.maxTouchPoints > 2), ee = /Android/.test(H), xt = Dt || ee || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(H), bt = Dt || /Mac/.test(pt), Wt = /\bCrOS\b/.test(H), Ft = /win/i.test(pt), Ht = ot && H.match(/Version\/(\d*\.\d*)/); Ht && (Ht = Number(Ht[1])), Ht && Ht >= 15 && (ot = !1, P = !0); var Q = bt && (E || ot && (Ht == null || Ht < 12.11)), j = at || z && k >= 9; function V(o) { return new RegExp("(^|\\s)" + o + "(?:$|\\s)\\s*"); } var Y, nt = function(o, s) { var u = o.className, c = V(s).exec(u); if (c) { var p = u.slice(c.index + c[0].length); o.className = u.slice(0, c.index) + (p ? c[1] + p : ""); } }; function wt(o) { for (var s = o.childNodes.length; s > 0; --s) o.removeChild(o.firstChild); return o; } function rt(o, s) { return wt(o).appendChild(s); } function gt(o, s, u, c) { var p = document.createElement(o); if (u && (p.className = u), c && (p.style.cssText = c), typeof s == "string") p.appendChild(document.createTextNode(s)); else if (s) for (var g = 0; g < s.length; ++g) p.appendChild(s[g]); return p; } function N(o, s, u, c) { var p = gt(o, s, u, c); return p.setAttribute("role", "presentation"), p; } function Lt(o, s) { if (s.nodeType == 3 && (s = s.parentNode), o.contains) return o.contains(s); do if (s.nodeType == 11 && (s = s.host), s == o) return !0; while (s = s.parentNode); } function Tt() { var o; try { o = document.activeElement; } catch { o = document.body || null; } for (; o && o.shadowRoot && o.shadowRoot.activeElement; ) o = o.shadowRoot.activeElement; return o; } function Qt(o, s) { var u = o.className; V(s).test(u) || (o.className += (u ? " " : "") + s); } function Oe(o, s) { for (var u = o.split(" "), c = 0; c < u.length; c++) u[c] && !V(u[c]).test(s) && (s += " " + u[c]); return s; } Y = document.createRange ? function(o, s, u, c) { var p = document.createRange(); return p.setEnd(c || o, u), p.setStart(o, s), p; } : function(o, s, u) { var c = document.body.createTextRange(); try { c.moveToElementText(o.parentNode); } catch { return c; } return c.collapse(!0), c.moveEnd("character", u), c.moveStart("character", s), c; }; var Se = function(o) { o.select(); }; function _e(o) { var s = Array.prototype.slice.call(arguments, 1); return function() { return o.apply(null, s); }; } function De(o, s, u) { for (var c in s || (s = {}), o) !o.hasOwnProperty(c) || u === !1 && s.hasOwnProperty(c) || (s[c] = o[c]); return s; } function xe(o, s, u, c, p) { s == null && (s = o.search(/[^\s\u00a0]/)) == -1 && (s = o.length); for (var g = c || 0, m = p || 0; ; ) { var y = o.indexOf(" ", g); if (y < 0 || y >= s) return m + (s - g); m += y - g, m += u - m % u, g = y + 1; } } Dt ? Se = function(o) { o.selectionStart = 0, o.selectionEnd = o.value.length; } : z && (Se = function(o) { try { o.select(); } catch { } }); var Te = function() { this.id = null, this.f = null, this.time = 0, this.handler = _e(this.onTimeout, this); }; function be(o, s) { for (var u = 0; u < o.length; ++u) if (o[u] == s) return u; return -1; } Te.prototype.onTimeout = function(o) { o.id = 0, o.time <= +/* @__PURE__ */ new Date() ? o.f() : setTimeout(o.handler, o.time - +/* @__PURE__ */ new Date()); }, Te.prototype.set = function(o, s) { this.f = s; var u = +/* @__PURE__ */ new Date() + o; (!this.id || u < this.time) && (clearTimeout(this.id), this.id = setTimeout(this.handler, o), this.time = u); }; var ge = 50, pe = { toString: function() { return "CodeMirror.Pass"; } }, ce = { scroll: !1 }, st = { origin: "*mouse" }, Xt = { origin: "+move" }; function qt(o, s, u) { for (var c = 0, p = 0; ; ) { var g = o.indexOf(" ", c); g == -1 && (g = o.length); var m = g - c; if (g == o.length || p + m >= s) return c + Math.min(m, s - p); if (p += g - c, c = g + 1, (p += u - p % u) >= s) return c; } } var ne = [""]; function ae(o) { for (; ne.length <= o; ) ne.push(Zt(ne) + " "); return ne[o]; } function Zt(o) { return o[o.length - 1]; } function Ae(o, s) { for (var u = [], c = 0; c < o.length; c++) u[c] = s(o[c], c); return u; } function Ke(o, s, u) { for (var c = 0, p = u(s); c < o.length && u(o[c]) <= p; ) c++; o.splice(c, 0, s); } function Xe() { } function vn(o, s) { var u; return Object.create ? u = Object.create(o) : (Xe.prototype = o, u = new Xe()), s && De(s, u), u; } var Rn = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; function mt(o) { return /\w/.test(o) || o > "€" && (o.toUpperCase() != o.toLowerCase() || Rn.test(o)); } function zt(o, s) { return s ? !!(s.source.indexOf("\\w") > -1 && mt(o)) || s.test(o) : mt(o); } function b(o) { for (var s in o) if (o.hasOwnProperty(s) && o[s]) return !1; return !0; } var I = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; function U(o) { return o.charCodeAt(0) >= 768 && I.test(o); } function ht(o, s, u) { for (; (u < 0 ? s > 0 : s < o.length) && U(o.charAt(s)); ) s += u; return s; } function kt(o, s, u) { for (var c = s > u ? -1 : 1; ; ) { if (s == u) return s; var p = (s + u) / 2, g = c < 0 ? Math.ceil(p) : Math.floor(p); if (g == s) return o(g) ? s : u; o(g) ? u = g : s = g + c; } } function Ot(o, s, u, c) { if (!o) return c(s, u, "ltr", 0); for (var p = !1, g = 0; g < o.length; ++g) { var m = o[g]; (m.from < u && m.to > s || s == u && m.to == s) && (c(Math.max(m.from, s), Math.min(m.to, u), m.level == 1 ? "rtl" : "ltr", g), p = !0); } p || c(s, u, "ltr"); } var fe = null; function ke(o, s, u) { var c; fe = null; for (var p = 0; p < o.length; ++p) { var g = o[p]; if (g.from < s && g.to > s) return p; g.to == s && (g.from != g.to && u == "before" ? c = p : fe = p), g.from == s && (g.from != g.to && u != "before" ? c = p : fe = p); } return c ?? fe; } var Ve = function() { var o = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", s = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; function u(O) { return O <= 247 ? o.charAt(O) : 1424 <= O && O <= 1524 ? "R" : 1536 <= O && O <= 1785 ? s.charAt(O - 1536) : 1774 <= O && O <= 2220 ? "r" : 8192 <= O && O <= 8203 ? "w" : O == 8204 ? "b" : "L"; } var c = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/, p = /[stwN]/, g = /[LRr]/, m = /[Lb1n]/, y = /[1n]/; function x(O, B, $) { this.level = O, this.from = B, this.to = $; } return function(O, B) { var $ = B == "ltr" ? "L" : "R"; if (O.length == 0 || B == "ltr" && !c.test(O)) return !1; for (var ft = O.length, dt = [], Ct = 0; Ct < ft; ++Ct) dt.push(u(O.charCodeAt(Ct))); for (var Rt = 0, $t = $; Rt < ft; ++Rt) { var re = dt[Rt]; re == "m" ? dt[Rt] = $t : $t = re; } for (var le = 0, Jt = $; le < ft; ++le) { var ye = dt[le]; ye == "1" && Jt == "r" ? dt[le] = "n" : g.test(ye) && (Jt = ye, ye == "r" && (dt[le] = "R")); } for (var me = 1, Ce = dt[0]; me < ft - 1; ++me) { var sn = dt[me]; sn == "+" && Ce == "1" && dt[me + 1] == "1" ? dt[me] = "1" : sn != "," || Ce != dt[me + 1] || Ce != "1" && Ce != "n" || (dt[me] = Ce), Ce = sn; } for (var an = 0; an < ft; ++an) { var gr = dt[an]; if (gr == ",") dt[an] = "N"; else if (gr == "%") { var hn = void 0; for (hn = an + 1; hn < ft && dt[hn] == "%"; ++hn) ; for (var sr = an && dt[an - 1] == "!" || hn < ft && dt[hn] == "1" ? "1" : "N", vr = an; vr < hn; ++vr) dt[vr] = sr; an = hn - 1; } } for (var xn = 0, En = $; xn < ft; ++xn) { var dr = dt[xn]; En == "L" && dr == "1" ? dt[xn] = "L" : g.test(dr) && (En = dr); } for (var Vn = 0; Vn < ft; ++Vn) if (p.test(dt[Vn])) { var An = void 0; for (An = Vn + 1; An < ft && p.test(dt[An]); ++An) ; for (var jn = (Vn ? dt[Vn - 1] : $) == "L", mr = jn == ((An < ft ? dt[An] : $) == "L") ? jn ? "L" : "R" : $, ri = Vn; ri < An; ++ri) dt[ri] = mr; Vn = An - 1; } for (var fo, ar = [], Cn = 0; Cn < ft; ) if (m.test(dt[Cn])) { var bc = Cn; for (++Cn; Cn < ft && m.test(dt[Cn]); ++Cn) ; ar.push(new x(0, bc, Cn)); } else { var Fo = Cn, Li = ar.length, Di = B == "rtl" ? 1 : 0; for (++Cn; Cn < ft && dt[Cn] != "L"; ++Cn) ; for (var zn = Fo; zn < Cn; ) if (y.test(dt[zn])) { Fo < zn && (ar.splice(Li, 0, new x(1, Fo, zn)), Li += Di); var Cs = zn; for (++zn; zn < Cn && y.test(dt[zn]); ++zn) ; ar.splice(Li, 0, new x(2, Cs, zn)), Li += Di, Fo = zn; } else ++zn; Fo < Cn && ar.splice(Li, 0, new x(1, Fo, Cn)); } return B == "ltr" && (ar[0].level == 1 && (fo = O.match(/^\s+/)) && (ar[0].from = fo[0].length, ar.unshift(new x(0, 0, fo[0].length))), Zt(ar).level == 1 && (fo = O.match(/\s+$/)) && (Zt(ar).to -= fo[0].length, ar.push(new x(0, ft - fo[0].length, ft)))), B == "rtl" ? ar.reverse() : ar; }; }(); function ze(o, s) { var u = o.order; return u == null && (u = o.order = Ve(o.text, s)), u; } var Qe = [], Kt = function(o, s, u) { if (o.addEventListener) o.addEventListener(s, u, !1); else if (o.attachEvent) o.attachEvent("on" + s, u); else { var c = o._handlers || (o._handlers = {}); c[s] = (c[s] || Qe).concat(u); } }; function R(o, s) { return o._handlers && o._handlers[s] || Qe; } function tt(o, s, u) { if (o.removeEventListener) o.removeEventListener(s, u, !1); else if (o.detachEvent) o.detachEvent("on" + s, u); else { var c = o._handlers, p = c && c[s]; if (p) { var g = be(p, u); g > -1 && (c[s] = p.slice(0, g).concat(p.slice(g + 1))); } } } function ut(o, s) { var u = R(o, s); if (u.length) for (var c = Array.prototype.slice.call(arguments, 2), p = 0; p < u.length; ++p) u[p].apply(null, c); } function yt(o, s, u) { return typeof s == "string" && (s = { type: s, preventDefault: function() { this.defaultPrevented = !0; } }), ut(o, u || s.type, o, s), pn(s) || s.codemirrorIgnore; } function Yt(o) { var s = o._handlers && o._handlers.cursorActivity; if (s) for (var u = o.curOp.cursorActivityHandlers || (o.curOp.cursorActivityHandlers = []), c = 0; c < s.length; ++c) be(u, s[c]) == -1 && u.push(s[c]); } function he(o, s) { return R(o, s).length > 0; } function Re(o) { o.prototype.on = function(s, u) { Kt(this, s, u); }, o.prototype.off = function(s, u) { tt(this, s, u); }; } function We(o) { o.preventDefault ? o.preventDefault() : o.returnValue = !1; } function Ln(o) { o.stopPropagation ? o.stopPropagation() : o.cancelBubble = !0; } function pn(o) { return o.defaultPrevented != null ? o.defaultPrevented : o.returnValue == 0; } function Ne(o) { We(o), Ln(o); } function Ar(o) { return o.target || o.srcElement; } function Yn(o) { var s = o.which; return s == null && (1 & o.button ? s = 1 : 2 & o.button ? s = 3 : 4 & o.button && (s = 2)), bt && o.ctrlKey && s == 1 && (s = 3), s; } var jr, fn, _n = function() { if (z && k < 9) return !1; var o = gt("div"); return "draggable" in o || "dragDrop" in o; }(); function Bn(o) { if (jr == null) { var s = gt("span", "​"); rt(o, gt("span", [s, document.createTextNode("x")])), o.firstChild.offsetHeight != 0 && (jr = s.offsetWidth <= 1 && s.offsetHeight > 2 && !(z && k < 8)); } var u = jr ? gt("span", "​") : gt("span", " ", null, "display: inline-block; width: 1px; margin-right: -1px"); return u.setAttribute("cm-text", ""), u; } function Mr(o) { if (fn != null) return fn; var s = rt(o, document.createTextNode("AخA")), u = Y(s, 0, 1).getBoundingClientRect(), c = Y(s, 1, 2).getBoundingClientRect(); return wt(o), !(!u || u.left == u.right) && (fn = c.right - u.right < 3); } var Dn, _o = ` b`.split(/\n/).length != 3 ? function(o) { for (var s = 0, u = [], c = o.length; s <= c; ) { var p = o.indexOf(` `, s); p == -1 && (p = o.length); var g = o.slice(s, o.charAt(p - 1) == "\r" ? p - 1 : p), m = g.indexOf("\r"); m != -1 ? (u.push(g.slice(0, m)), s += m + 1) : (u.push(g), s = p + 1); } return u; } : function(o) { return o.split(/\r\n?|\n/); }, Vo = window.getSelection ? function(o) { try { return o.selectionStart != o.selectionEnd; } catch { return !1; } } : function(o) { var s; try { s = o.ownerDocument.selection.createRange(); } catch { } return !(!s || s.parentElement() != o) && s.compareEndPoints("StartToEnd", s) != 0; }, xo = "oncopy" in (Dn = gt("div")) || (Dn.setAttribute("oncopy", "return;"), typeof Dn.oncopy == "function"), Ro = null; function ro(o) { if (Ro != null) return Ro; var s = rt(o, gt("span", "x")), u = s.getBoundingClientRect(), c = Y(s, 0, 1).getBoundingClientRect(); return Ro = Math.abs(u.left - c.left) > 1; } var ur = {}, ln = {}; function Ho(o, s) { arguments.length > 2 && (s.dependencies = Array.prototype.slice.call(arguments, 2)), ur[o] = s; } function Lr(o, s) { ln[o] = s; } function Co(o) { if (typeof o == "string" && ln.hasOwnProperty(o)) o = ln[o]; else if (o && typeof o.name == "string" && ln.hasOwnProperty(o.name)) { var s = ln[o.name]; typeof s == "string" && (s = { name: s }), (o = vn(s, o)).name = s.name; } else { if (typeof o == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(o)) return Co("application/xml"); if (typeof o == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(o)) return Co("application/json"); } return typeof o == "string" ? { name: o } : o || { name: "null" }; } function Jr(o, s) { s = Co(s); var u = ur[s.name]; if (!u) return Jr(o, "text/plain"); var c = u(o, s); if (Wn.hasOwnProperty(s.name)) { var p = Wn[s.name]; for (var g in p) p.hasOwnProperty(g) && (c.hasOwnProperty(g) && (c["_" + g] = c[g]), c[g] = p[g]); } if (c.name = s.name, s.helperType && (c.helperType = s.helperType), s.modeProps) for (var m in s.modeProps) c[m] = s.modeProps[m]; return c; } var Wn = {}; function Nn(o, s) { De(s, Wn.hasOwnProperty(o) ? Wn[o] : Wn[o] = {}); } function $n(o, s) { if (s === !0) return s; if (o.copyState) return o.copyState(s); var u = {}; for (var c in s) { var p = s[c]; p instanceof Array && (p = p.concat([])), u[c] = p; } return u; } function zo(o, s) { for (var u; o.innerMode && (u = o.innerMode(s)) && u.mode != o; ) s = u.state, o = u.mode; return u || { mode: o, state: s }; } function mo(o, s, u) { return !o.startState || o.startState(s, u); } var qe = function(o, s, u) { this.pos = this.start = 0, this.string = o, this.tabSize = s || 8, this.lastColumnPos = this.lastColumnValue = 0, this.lineStart = 0, this.lineOracle = u; }; function ve(o, s) { if ((s -= o.first) < 0 || s >= o.size) throw new Error("There is no line " + (s + o.first) + " in the document."); for (var u = o; !u.lines; ) for (var c = 0; ; ++c) { var p = u.children[c], g = p.chunkSize(); if (s < g) { u = p; break; } s -= g; } return u.lines[s]; } function rr(o, s, u) { var c = [], p = s.line; return o.iter(s.line, u.line + 1, function(g) { var m = g.text; p == u.line && (m = m.slice(0, u.ch)), p == s.line && (m = m.slice(s.ch)), c.push(m), ++p; }), c; } function Uo(o, s, u) { var c = []; return o.iter(s, u, function(p) { c.push(p.text); }), c; } function or(o, s) { var u = s - o.height; if (u) for (var c = o; c; c = c.parent) c.height += u; } function Ye(o) { if (o.parent == null) return null; for (var s = o.parent, u = be(s.lines, o), c = s.parent; c; s = c, c = c.parent) for (var p = 0; c.children[p] != s; ++p) u += c.children[p].chunkSize(); return u + s.first; } function In(o, s) { var u = o.first; t: do { for (var c = 0; c < o.children.length; ++c) { var p = o.children[c], g = p.height; if (s < g) { o = p; continue t; } s -= g, u += p.chunkSize(); } return u; } while (!o.lines); for (var m = 0; m < o.lines.length; ++m) { var y = o.lines[m].height; if (s < y) break; s -= y; } return u + m; } function yo(o, s) { return s >= o.first && s < o.first + o.size; } function Bo(o, s) { return String(o.lineNumberFormatter(s + o.firstLineNumber)); } function Bt(o, s, u) { if (u === void 0 && (u = null), !(this instanceof Bt)) return new Bt(o, s, u); this.line = o, this.ch = s, this.sticky = u; } function T(o, s) { return o.line - s.line || o.ch - s.ch; } function G(o, s) { return o.sticky == s.sticky && T(o, s) == 0; } function Mt(o) { return Bt(o.line, o.ch); } function te(o, s) { return T(o, s) < 0 ? s : o; } function de(o, s) { return T(o, s) < 0 ? o : s; } function $e(o, s) { return Math.max(o.first, Math.min(s, o.first + o.size - 1)); } function oe(o, s) { if (s.line < o.first) return Bt(o.first, 0); var u = o.first + o.size - 1; return s.line > u ? Bt(u, ve(o, u).text.length) : Hn(s, ve(o, s.line).text.length); } function Hn(o, s) { var u = o.ch; return u == null || u > s ? Bt(o.line, s) : u < 0 ? Bt(o.line, 0) : o; } function Tn(o, s) { for (var u = [], c = 0; c < s.length; c++) u[c] = oe(o, s[c]); return u; } qe.prototype.eol = function() { return this.pos >= this.string.length; }, qe.prototype.sol = function() { return this.pos == this.lineStart; }, qe.prototype.peek = function() { return this.string.charAt(this.pos) || void 0; }, qe.prototype.next = function() { if (this.pos < this.string.length) return this.string.charAt(this.pos++); }, qe.prototype.eat = function(o) { var s = this.string.charAt(this.pos); if (typeof o == "string" ? s == o : s && (o.test ? o.test(s) : o(s))) return ++this.pos, s; }, qe.prototype.eatWhile = function(o) { for (var s = this.pos; this.eat(o); ) ; return this.pos > s; }, qe.prototype.eatSpace = function() { for (var o = this.pos; /[\s\u00a0]/.test(this.string.charAt(this.pos)); ) ++this.pos; return this.pos > o; }, qe.prototype.skipToEnd = function() { this.pos = this.string.length; }, qe.prototype.skipTo = function(o) { var s = this.string.indexOf(o, this.pos); if (s > -1) return this.pos = s, !0; }, qe.prototype.backUp = function(o) { this.pos -= o; }, qe.prototype.column = function() { return this.lastColumnPos < this.start && (this.lastColumnValue = xe(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue - (this.lineStart ? xe(this.string, this.lineStart, this.tabSize) : 0); }, qe.prototype.indentation = function() { return xe(this.string, null, this.tabSize) - (this.lineStart ? xe(this.string, this.lineStart, this.tabSize) : 0); }, qe.prototype.match = function(o, s, u) { if (typeof o != "string") { var c = this.string.slice(this.pos).match(o); return c && c.index > 0 ? null : (c && s !== !1 && (this.pos += c[0].length), c); } var p = function(g) { return u ? g.toLowerCase() : g; }; if (p(this.string.substr(this.pos, o.length)) == p(o)) return s !== !1 && (this.pos += o.length), !0; }, qe.prototype.current = function() { return this.string.slice(this.start, this.pos); }, qe.prototype.hideFirstChars = function(o, s) { this.lineStart += o; try { return s(); } finally { this.lineStart -= o; } }, qe.prototype.lookAhead = function(o) { var s = this.lineOracle; return s && s.lookAhead(o); }, qe.prototype.baseToken = function() { var o = this.lineOracle; return o && o.baseToken(this.pos); }; var Hi = function(o, s) { this.state = o, this.lookAhead = s; }, _r = function(o, s, u, c) { this.state = s, this.doc = o, this.line = u, this.maxLookAhead = c || 0, this.baseTokens = null, this.baseTokenPos = 1; }; function Ds(o, s, u, c) { var p = [o.state.modeGen], g = {}; So(o, s.text, o.doc.mode, u, function(O, B) { return p.push(O, B); }, g, c); for (var m = u.state, y = function(O) { u.baseTokens = p; var B = o.state.overlays[O], $ = 1, ft = 0; u.state = !0, So(o, s.text, B.mode, u, function(dt, Ct) { for (var Rt = $; ft < dt; ) { var $t = p[$]; $t > dt && p.splice($, 1, dt, p[$ + 1], $t), $ += 2, ft = Math.min(dt, $t); } if (Ct) if (B.opaque) p.splice(Rt, $ - Rt, dt, "overlay " + Ct), $ = Rt + 2; else for (; Rt < $; Rt += 2) { var re = p[Rt + 1]; p[Rt + 1] = (re ? re + " " : "") + "overlay " + Ct; } }, g), u.state = m, u.baseTokens = null, u.baseTokenPos = 1; }, x = 0; x < o.state.overlays.length; ++x) y(x); return { styles: p, classes: g.bgClass || g.textClass ? g : null }; } function xr(o, s, u) { if (!s.styles || s.styles[0] != o.state.modeGen) { var c = bo(o, Ye(s)), p = s.text.length > o.options.maxHighlightLength && $n(o.doc.mode, c.state), g = Ds(o, s, c); p && (c.state = p), s.stateAfter = c.save(!p), s.styles = g.styles, g.classes ? s.styleClasses = g.classes : s.styleClasses && (s.styleClasses = null), u === o.doc.highlightFrontier && (o.doc.modeFrontier = Math.max(o.doc.modeFrontier, ++o.doc.highlightFrontier)); } return s.styles; } function bo(o, s, u) { var c = o.doc, p = o.display; if (!c.mode.startState) return new _r(c, !0, s); var g = zi(o, s, u), m = g > c.first && ve(c, g - 1).stateAfter, y = m ? _r.fromSaved(c, m, g) : new _r(c, mo(c.mode), g); return c.iter(g, s, function(x) { oo(o, x.text, y); var O = y.line; x.stateAfter = O == s - 1 || O % 5 == 0 || O >= p.viewFrom && O < p.viewTo ? y.save() : null, y.nextLine(); }), u && (c.modeFrontier = y.line), y; } function oo(o, s, u, c) { var p = o.doc.mode, g = new qe(s, o.options.tabSize, u); for (g.start = g.pos = c || 0, s == "" && io(p, u.state); !g.eol(); ) Xn(p, g, u.state), g.start = g.pos; } function io(o, s) { if (o.blankLine) return o.blankLine(s); if (o.innerMode) { var u = zo(o, s); return u.mode.blankLine ? u.mode.blankLine(u.state) : void 0; } } function Xn(o, s, u, c) { for (var p = 0; p < 10; p++) { c && (c[0] = zo(o, u).mode); var g = o.token(s, u); if (s.pos > s.start) return g; } throw new Error("Mode " + o.name + " failed to advance stream."); } _r.prototype.lookAhead = function(o) { var s = this.doc.getLine(this.line + o); return s != null && o > this.maxLookAhead && (this.maxLookAhead = o), s; }, _r.prototype.baseToken = function(o) { if (!this.baseTokens) return null; for (; this.baseTokens[this.baseTokenPos] <= o; ) this.baseTokenPos += 2; var s = this.baseTokens[this.baseTokenPos + 1]; return { type: s && s.replace(/( |^)overlay .*/, ""), size: this.baseTokens[this.baseTokenPos] - o }; }, _r.prototype.nextLine = function() { this.line++, this.maxLookAhead > 0 && this.maxLookAhead--; }, _r.fromSaved = function(o, s, u) { return s instanceof Hi ? new _r(o, $n(o.mode, s.state), u, s.lookAhead) : new _r(o, $n(o.mode, s), u); }, _r.prototype.save = function(o) { var s = o !== !1 ? $n(this.doc.mode, this.state) : this.state; return this.maxLookAhead > 0 ? new Hi(s, this.maxLookAhead) : s; }; var wo = function(o, s, u) { this.start = o.start, this.end = o.pos, this.string = o.current(), this.type = s || null, this.state = u; }; function Wo(o, s, u, c) { var p, g, m = o.doc, y = m.mode, x = ve(m, (s = oe(m, s)).line), O = bo(o, s.line, u), B = new qe(x.text, o.options.tabSize, O); for (c && (g = []); (c || B.pos < s.ch) && !B.eol(); ) B.start = B.pos, p = Xn(y, B, O.state), c && g.push(new wo(B, p, $n(m.mode, O.state))); return c ? g : new wo(B, p, O.state); } function Ns(o, s) { if (o) for (; ; ) { var u = o.match(/(?:^|\s+)line-(background-)?(\S+)/); if (!u) break; o = o.slice(0, u.index) + o.slice(u.index + u[0].length); var c = u[1] ? "bgClass" : "textClass"; s[c] == null ? s[c] = u[2] : new RegExp("(?:^|\\s)" + u[2] + "(?:$|\\s)").test(s[c]) || (s[c] += " " + u[2]); } return o; } function So(o, s, u, c, p, g, m) { var y = u.flattenSpans; y == null && (y = o.options.flattenSpans); var x, O = 0, B = null, $ = new qe(s, o.options.tabSize, c), ft = o.options.addModeClass && [null]; for (s == "" && Ns(io(u, c.state), g); !$.eol(); ) { if ($.pos > o.options.maxHighlightLength ? (y = !1, m && oo(o, s, c, $.pos), $.pos = s.length, x = null) : x = Ns(Xn(u, $, c.state, ft), g), ft) { var dt = ft[0].name; dt && (x = "m-" + (x ? dt + " " + x : dt)); } if (!y || B != x) { for (; O < $.start; ) p(O = Math.min($.start, O + 5e3), B); B = x; } $.start = $.pos; } for (; O < $.pos; ) { var Ct = Math.min($.pos, O + 5e3); p(Ct, B), O = Ct; } } function zi(o, s, u) { for (var c, p, g = o.doc, m = u ? -1 : s - (o.doc.mode.innerMode ? 1e3 : 100), y = s; y > m; --y) { if (y <= g.first) return g.first; var x = ve(g, y - 1), O = x.stateAfter; if (O && (!u || y + (O instanceof Hi ? O.lookAhead : 0) <= g.modeFrontier)) return y; var B = xe(x.text, null, o.options.tabSize); (p == null || c > B) && (p = y - 1, c = B); } return p; } function Is(o, s) { if (o.modeFrontier = Math.min(o.modeFrontier, s), !(o.highlightFrontier < s - 10)) { for (var u = o.first, c = s - 1; c > u; c--) { var p = ve(o, c).stateAfter; if (p && (!(p instanceof Hi) || c + p.lookAhead < s)) { u = c + 1; break; } } o.highlightFrontier = Math.min(o.highlightFrontier, u); } } var Jn = !1, Zr = !1; function fi() { Jn = !0; } function Fs() { Zr = !0; } function Cr(o, s, u) { this.marker = o, this.from = s, this.to = u; } function Oo(o, s) { if (o) for (var u = 0; u < o.length; ++u) { var c = o[u]; if (c.marker == s) return c; } } function di(o, s) { for (var u, c = 0; c < o.length; ++c) o[c] != s && (u || (u = [])).push(o[c]); return u; } function Vs(o, s, u) { var c = u && window.WeakSet && (u.markedSpans || (u.markedSpans = /* @__PURE__ */ new WeakSet())); c && o.markedSpans && c.has(o.markedSpans) ? o.markedSpans.push(s) : (o.markedSpans = o.markedSpans ? o.markedSpans.concat([s]) : [s], c && c.add(o.markedSpans)), s.marker.attachLine(o); } function Aa(o, s, u) { var c; if (o) for (var p = 0; p < o.length; ++p) { var g = o[p], m = g.marker; if (g.from == null || (m.inclusiveLeft ? g.from <= s : g.from < s) || g.from == s && m.type == "bookmark" && (!u || !g.marker.insertLeft)) { var y = g.to == null || (m.inclusiveRight ? g.to >= s : g.to > s); (c || (c = [])).push(new Cr(m, g.from, y ? null : g.to)); } } return c; } function hi(o, s, u) { var c; if (o) for (var p = 0; p < o.length; ++p) { var g = o[p], m = g.marker; if (g.to == null || (m.inclusiveRight ? g.to >= s : g.to > s) || g.from == s && m.type == "bookmark" && (!u || g.marker.insertLeft)) { var y = g.from == null || (m.inclusiveLeft ? g.from <= s : g.from < s); (c || (c = [])).push(new Cr(m, y ? null : g.from - s, g.to == null ? null : g.to - s)); } } return c; } function $o(o, s) { if (s.full) return null; var u = yo(o, s.from.line) && ve(o, s.from.line).markedSpans, c = yo(o, s.to.line) && ve(o, s.to.line).markedSpans; if (!u && !c) return null; var p = s.from.ch, g = s.to.ch, m = T(s.from, s.to) == 0, y = Aa(u, p, m), x = hi(c, g, m), O = s.text.length == 1, B = Zt(s.text).length + (O ? p : 0); if (y) for (var $ = 0; $ < y.length; ++$) { var ft = y[$]; if (ft.to == null) { var dt = Oo(x, ft.marker); dt ? O && (ft.to = dt.to == null ? null : dt.to + B) : ft.to = p; } } if (x) for (var Ct = 0; Ct < x.length; ++Ct) { var Rt = x[Ct]; Rt.to != null && (Rt.to += B), Rt.from == null ? Oo(y, Rt.marker) || (Rt.from = B, O && (y || (y = [])).push(Rt)) : (Rt.from += B, O && (y || (y = [])).push(Rt)); } y && (y = Ui(y)), x && x != y && (x = Ui(x)); var $t = [y]; if (!O) { var re, le = s.text.length - 2; if (le > 0 && y) for (var Jt = 0; Jt < y.length; ++Jt) y[Jt].to == null && (re || (re = [])).push(new Cr(y[Jt].marker, null, null)); for (var ye = 0; ye < le; ++ye) $t.push(re); $t.push(x); } return $t; } function Ui(o) { for (var s = 0; s < o.length; ++s) { var u = o[s]; u.from != null && u.from == u.to && u.marker.clearWhenEmpty !== !1 && o.splice(s--, 1); } return o.length ? o : null; } function Be(o, s, u) { var c = null; if (o.iter(s.line, u.line + 1, function(dt) { if (dt.markedSpans) for (var Ct = 0; Ct < dt.markedSpans.length; ++Ct) { var Rt = dt.markedSpans[Ct].marker; !Rt.readOnly || c && be(c, Rt) != -1 || (c || (c = [])).push(Rt); } }), !c) return null; for (var p = [{ from: s, to: u }], g = 0; g < c.length; ++g) for (var m = c[g], y = m.find(0), x = 0; x < p.length; ++x) { var O = p[x]; if (!(T(O.to, y.from) < 0 || T(O.from, y.to) > 0)) { var B = [x, 1], $ = T(O.from, y.from), ft = T(O.to, y.to); ($ < 0 || !m.inclusiveLeft && !$) && B.push({ from: O.from, to: y.from }), (ft > 0 || !m.inclusiveRight && !ft) && B.push({ from: y.to, to: O.to }), p.splice.apply(p, B), x += B.length - 3; } } return p; } function Zn(o) { var s = o.markedSpans; if (s) { for (var u = 0; u < s.length; ++u) s[u].marker.detachLine(o); o.markedSpans = null; } } function Bi(o, s) { if (s) { for (var u = 0; u < s.length; ++u) s[u].marker.attachLine(o); o.markedSpans = s; } } function hr(o) { return o.inclusiveLeft ? -1 : 0; } function qn(o) { return o.inclusiveRight ? 1 : 0; } function mn(o, s) { var u = o.lines.length - s.lines.length; if (u != 0) return u; var c = o.find(), p = s.find(), g = T(c.from, p.from) || hr(o) - hr(s); if (g) return -g; var m = T(c.to, p.to) || qn(o) - qn(s); return m || s.id - o.id; } function Sr(o, s) { var u, c = Zr && o.markedSpans; if (c) for (var p = void 0, g = 0; g < c.length; ++g) (p = c[g]).marker.collapsed && (s ? p.from : p.to) == null && (!u || mn(u, p.marker) < 0) && (u = p.marker); return u; } function qo(o) { return Sr(o, !0); } function Dr(o) { return Sr(o, !1); } function Wi(o, s) { var u, c = Zr && o.markedSpans; if (c) for (var p = 0; p < c.length; ++p) { var g = c[p]; g.marker.collapsed && (g.from == null || g.from < s) && (g.to == null || g.to > s) && (!u || mn(u, g.marker) < 0) && (u = g.marker); } return u; } function yn(o, s, u, c, p) { var g = ve(o, s), m = Zr && g.markedSpans; if (m) for (var y = 0; y < m.length; ++y) { var x = m[y]; if (x.marker.collapsed) { var O = x.marker.find(0), B = T(O.from, u) || hr(x.marker) - hr(p), $ = T(O.to, c) || qn(x.marker) - qn(p); if (!(B >= 0 && $ <= 0 || B <= 0 && $ >= 0) && (B <= 0 && (x.marker.inclusiveRight && p.inclusiveLeft ? T(O.to, u) >= 0 : T(O.to, u) > 0) || B >= 0 && (x.marker.inclusiveRight && p.inclusiveLeft ? T(O.from, c) <= 0 : T(O.from, c) < 0))) return !0; } } } function Or(o) { for (var s; s = qo(o); ) o = s.find(-1, !0).line; return o; } function $i(o) { for (var s; s = Dr(o); ) o = s.find(1, !0).line; return o; } function gi(o) { for (var s, u; s = Dr(o); ) o = s.find(1, !0).line, (u || (u = [])).push(o); return u; } function pr(o, s) { var u = ve(o, s), c = Or(u); return u == c ? s : Ye(c); } function Nr(o, s) { if (s > o.lastLine()) return s; var u, c = ve(o, s); if (!Ir(o, c)) return s; for (; u = Dr(c); ) c = u.find(1, !0).line; return Ye(c) + 1; } function Ir(o, s) { var u = Zr && s.markedSpans; if (u) { for (var c = void 0, p = 0; p < u.length; ++p) if ((c = u[p]).marker.collapsed && (c.from == null || !c.marker.widgetNode && c.from == 0 && c.marker.inclusiveLeft && kn(o, s, c))) return !0; } } function kn(o, s, u) { if (u.to == null) { var c = u.marker.find(1, !0); return kn(o, c.line, Oo(c.line.markedSpans, u.marker)); } if (u.marker.inclusiveRight && u.to == s.text.length) return !0; for (var p = void 0, g = 0; g < s.markedSpans.length; ++g) if ((p = s.markedSpans[g]).marker.collapsed && !p.marker.widgetNode && p.from == u.to && (p.to == null || p.to != u.from) && (p.marker.inclusiveLeft || u.marker.inclusiveRight) && kn(o, s, p)) return !0; } function Fr(o) { for (var s = 0, u = (o = Or(o)).parent, c = 0; c < u.lines.length; ++c) { var p = u.lines[c]; if (p == o) break; s += p.height; } for (var g = u.parent; g; g = (u = g).parent) for (var m = 0; m < g.children.length; ++m) { var y = g.children[m]; if (y == u) break; s += y.height; } return s; } function vi(o) { if (o.height == 0) return 0; for (var s, u = o.text.length, c = o; s = qo(c); ) { var p = s.find(0, !0); c = p.from.line, u += p.from.ch - p.to.ch; } for (c = o; s = Dr(c); ) { var g = s.find(0, !0); u -= c.text.length - g.from.ch, u += (c = g.to.line).text.length - g.to.ch; } return u; } function Rs(o) { var s = o.display, u = o.doc; s.maxLine = ve(u, u.first), s.maxLineLength = vi(s.maxLine), s.maxLineChanged = !0, u.iter(function(c) { var p = vi(c); p > s.maxLineLength && (s.maxLineLength = p, s.maxLine = c); }); } var Vr = function(o, s, u) { this.text = o, Bi(this, s), this.height = u ? u(this) : 1; }; function Hs(o, s, u, c) { o.text = s, o.stateAfter && (o.stateAfter = null), o.styles && (o.styles = null), o.order != null && (o.order = null), Zn(o), Bi(o, u); var p = c ? c(o) : 1; p != o.height && or(o, p); } function ja(o) { o.parent = null, Zn(o); } Vr.prototype.lineNo = function() { return Ye(this); }, Re(Vr); var Ma = {}, qi = {}; function Go(o, s) { if (!o || /^\s*$/.test(o)) return null; var u = s.addModeClass ? qi : Ma; return u[o] || (u[o] = o.replace(/\S+/g, "cm-$&")); } function Gi(o, s) { var u = N("span", null, null, P ? "padding-right: .1px" : null), c = { pre: N("pre", [u], "CodeMirror-line"), content: u, col: 0, pos: 0, cm: o, trailingSpace: !1, splitSpaces: o.getOption("lineWrapping") }; s.measure = {}; for (var p = 0; p <= (s.rest ? s.rest.length : 0); p++) { var g = p ? s.rest[p - 1] : s.line, m = void 0; c.pos = 0, c.addToken = Da, Mr(o.display.measure) && (m = ze(g, o.doc.direction)) && (c.addToken = El(c.addToken, m)), c.map = [], Ki(g, c, xr(o, g, s != o.display.externalMeasured && Ye(g))), g.styleClasses && (g.styleClasses.bgClass && (c.bgClass = Oe(g.styleClasses.bgClass, c.bgClass || "")), g.styleClasses.textClass && (c.textClass = Oe(g.styleClasses.textClass, c.textClass || ""))), c.map.length == 0 && c.map.push(0, 0, c.content.appendChild(Bn(o.display.measure))), p == 0 ? (s.measure.map = c.map, s.measure.cache = {}) : ((s.measure.maps || (s.measure.maps = [])).push(c.map), (s.measure.caches || (s.measure.caches = [])).push({})); } if (P) { var y = c.content.lastChild; (/\bcm-tab\b/.test(y.className) || y.querySelector && y.querySelector(".cm-tab")) && (c.content.className = "cm-tab-wrap-hack"); } return ut(o, "renderLine", o, s.line, c.pre), c.pre.className && (c.textClass = Oe(c.pre.className, c.textClass || "")), c; } function La(o) { var s = gt("span", "•", "cm-invalidchar"); return s.title = "\\u" + o.charCodeAt(0).toString(16), s.setAttribute("aria-label", s.title), s; } function Da(o, s, u, c, p, g, m) { if (s) { var y, x = o.splitSpaces ? Na(s, o.trailingSpace) : s, O = o.cm.state.specialChars, B = !1; if (O.test(s)) { y = document.createDocumentFragment(); for (var $ = 0; ; ) { O.lastIndex = $; var ft = O.exec(s), dt = ft ? ft.index - $ : s.length - $; if (dt) { var Ct = document.createTextNode(x.slice($, $ + dt)); z && k < 9 ? y.appendChild(gt("span", [Ct])) : y.appendChild(Ct), o.map.push(o.pos, o.pos + dt, Ct), o.col += dt, o.pos += dt; } if (!ft) break; $ += dt + 1; var Rt = void 0; if (ft[0] == " ") { var $t = o.cm.options.tabSize, re = $t - o.col % $t; (Rt = y.appendChild(gt("span", ae(re), "cm-tab"))).setAttribute("role", "presentation"), Rt.setAttribute("cm-text", " "), o.col += re; } else ft[0] == "\r" || ft[0] == ` ` ? ((Rt = y.appendChild(gt("span", ft[0] == "\r" ? "␍" : "␤", "cm-invalidchar"))).setAttribute("cm-text", ft[0]), o.col += 1) : ((Rt = o.cm.options.specialCharPlaceholder(ft[0])).setAttribute("cm-text", ft[0]), z && k < 9 ? y.appendChild(gt("span", [Rt])) : y.appendChild(Rt), o.col += 1); o.map.push(o.pos, o.pos + 1, Rt), o.pos++; } } else o.col += s.length, y = document.createTextNode(x), o.map.push(o.pos, o.pos + s.length, y), z && k < 9 && (B = !0), o.pos += s.length; if (o.trailingSpace = x.charCodeAt(s.length - 1) == 32, u || c || p || B || g || m) { var le = u || ""; c && (le += c), p && (le += p); var Jt = gt("span", [y], le, g); if (m) for (var ye in m) m.hasOwnProperty(ye) && ye != "style" && ye != "class" && Jt.setAttribute(ye, m[ye]); return o.content.appendChild(Jt); } o.content.appendChild(y); } } function Na(o, s) { if (o.length > 1 && !/ /.test(o)) return o; for (var u = s, c = "", p = 0; p < o.length; p++) { var g = o.charAt(p); g != " " || !u || p != o.length - 1 && o.charCodeAt(p + 1) != 32 || (g = " "), c += g, u = g == " "; } return c; } function El(o, s) { return function(u, c, p, g, m, y, x) { p = p ? p + " cm-force-border" : "cm-force-border"; for (var O = u.pos, B = O + c.length; ; ) { for (var $ = void 0, ft = 0; ft < s.length && !(($ = s[ft]).to > O && $.from <= O); ft++) ; if ($.to >= B) return o(u, c, p, g, m, y, x); o(u, c.slice(0, $.to - O), p, g, null, y, x), g = null, c = c.slice($.to - O), O = $.to; } }; } function To(o, s, u, c) { var p = !c && u.widgetNode; p && o.map.push(o.pos, o.pos + s, p), !c && o.cm.display.input.needsContentAttribute && (p || (p = o.content.appendChild(document.createElement("span"))), p.setAttribute("cm-marker", u.id)), p && (o.cm.display.input.setUneditable(p), o.content.appendChild(p)), o.pos += s, o.trailingSpace = !1; } function Ki(o, s, u) { var c = o.markedSpans, p = o.text, g = 0; if (c) for (var m, y, x, O, B, $, ft, dt = p.length, Ct = 0, Rt = 1, $t = "", re = 0; ; ) { if (re == Ct) { x = O = B = y = "", ft = null, $ = null, re = 1 / 0; for (var le = [], Jt = void 0, ye = 0; ye < c.length; ++ye) { var me = c[ye], Ce = me.marker; if (Ce.type == "bookmark" && me.from == Ct && Ce.widgetNode) le.push(Ce); else if (me.from <= Ct && (me.to == null || me.to > Ct || Ce.collapsed && me.to == Ct && me.from == Ct)) { if (me.to != null && me.to != Ct && re > me.to && (re = me.to, O = ""), Ce.className && (x += " " + Ce.className), Ce.css && (y = (y ? y + ";" : "") + Ce.css), Ce.startStyle && me.from == Ct && (B += " " + Ce.startStyle), Ce.endStyle && me.to == re && (Jt || (Jt = [])).push(Ce.endStyle, me.to), Ce.title && ((ft || (ft = {})).title = Ce.title), Ce.attributes) for (var sn in Ce.attributes) (ft || (ft = {}))[sn] = Ce.attributes[sn]; Ce.collapsed && (!$ || mn($.marker, Ce) < 0) && ($ = me); } else me.from > Ct && re > me.from && (re = me.from); } if (Jt) for (var an = 0; an < Jt.length; an += 2) Jt[an + 1] == re && (O += " " + Jt[an]); if (!$ || $.from == Ct) for (var gr = 0; gr < le.length; ++gr) To(s, 0, le[gr]); if ($ && ($.from || 0) == Ct) { if (To(s, ($.to == null ? dt + 1 : $.to) - Ct, $.marker, $.from == null), $.to == null) return; $.to == Ct && ($ = !1); } } if (Ct >= dt) break; for (var hn = Math.min(dt, re); ; ) { if ($t) { var sr = Ct + $t.length; if (!$) { var vr = sr > hn ? $t.slice(0, hn - Ct) : $t; s.addToken(s, vr, m ? m + x : x, B, Ct + vr.length == re ? O : "", y, ft); } if (sr >= hn) { $t = $t.slice(hn - Ct), Ct = hn; break; } Ct = sr, B = ""; } $t = p.slice(g, g = u[Rt++]), m = Go(u[Rt++], s.cm.options); } } else for (var xn = 1; xn < u.length; xn += 2) s.addToken(s, p.slice(g, g = u[xn]), Go(u[xn + 1], s.cm.options)); } function Yi(o, s, u) { this.line = s, this.rest = gi(s), this.size = this.rest ? Ye(Zt(this.rest)) - u + 1 : 1, this.node = this.text = null, this.hidden = Ir(o, s); } function so(o, s, u) { for (var c, p = [], g = s; g < u; g = c) { var m = new Yi(o.doc, ve(o.doc, g), g); c = g + m.size, p.push(m); } return p; } var Tr = null; function mi(o) { Tr ? Tr.ops.push(o) : o.ownsGroup = Tr = { ops: [o], delayedCallbacks: [] }; } function Xi(o) { var s = o.delayedCallbacks, u = 0; do { for (; u < s.length; u++) s[u].call(null); for (var c = 0; c < o.ops.length; c++) { var p = o.ops[c]; if (p.cursorActivityHandlers) for (; p.cursorActivityCalled < p.cursorActivityHandlers.length; ) p.cursorActivityHandlers[p.cursorActivityCalled++].call(null, p.cm); } } while (u < s.length); } function Ji(o, s) { var u = o.ownsGroup; if (u) try { Xi(u); } finally { Tr = null, s(u); } } var ko = null; function bn(o, s) { var u = R(o, s); if (u.length) { var c, p = Array.prototype.slice.call(arguments, 2); Tr ? c = Tr.delayedCallbacks : ko ? c = ko : (c = ko = [], setTimeout(Po, 0)); for (var g = function(y) { c.push(function() { return u[y].apply(null, p); }); }, m = 0; m < u.length; ++m) g(m); } } function Po() { var o = ko; ko = null; for (var s = 0; s < o.length; ++s) o[s](); } function zs(o, s, u, c) { for (var p = 0; p < s.changes.length; p++) { var g = s.changes[p]; g == "text" ? Ia(o, s) : g == "gutter" ? Yo(o, s, u, c) : g == "class" ? Zi(o, s) : g == "widget" && bi(o, s, c); } s.changes = null; } function Ko(o) { return o.node == o.text && (o.node = gt("div", null, null, "position: relative"), o.text.parentNode && o.text.parentNode.replaceChild(o.node, o.text), o.node.appendChild(o.text), z && k < 8 && (o.node.style.zIndex = 2)), o.node; } function yi(o, s) { var u = s.bgClass ? s.bgClass + " " + (s.line.bgClass || "") : s.line.bgClass; if (u && (u += " CodeMirror-linebackground"), s.background) u ? s.background.className = u : (s.background.parentNode.removeChild(s.background), s.background = null); else if (u) { var c = Ko(s); s.background = c.insertBefore(gt("div", null, u), c.firstChild), o.display.input.setUneditable(s.background); } } function Us(o, s) { var u = o.display.externalMeasured; return u && u.line == s.line ? (o.display.externalMeasured = null, s.measure = u.measure, u.built) : Gi(o, s); } function Ia(o, s) { var u = s.text.className, c = Us(o, s); s.text == s.node && (s.node = c.pre), s.text.parentNode.replaceChild(c.pre, s.text), s.text = c.pre, c.bgClass != s.bgClass || c.textClass != s.textClass ? (s.bgClass = c.bgClass, s.textClass = c.textClass, Zi(o, s)) : u && (s.text.className = u); } function Zi(o, s) { yi(o, s), s.line.wrapClass ? Ko(s).className = s.line.wrapClass : s.node != s.text && (s.node.className = ""); var u = s.textClass ? s.textClass + " " + (s.line.textClass || "") : s.line.textClass; s.text.className = u || ""; } function Yo(o, s, u, c) { if (s.gutter && (s.node.removeChild(s.gutter), s.gutter = null), s.gutterBackground && (s.node.removeChild(s.gutterBackground), s.gutterBackground = null), s.line.gutterClass) { var p = Ko(s); s.gutterBackground = gt("div", null, "CodeMirror-gutter-background " + s.line.gutterClass, "left: " + (o.options.fixedGutter ? c.fixedPos : -c.gutterTotalWidth) + "px; width: " + c.gutterTotalWidth + "px"), o.display.input.setUneditable(s.gutterBackground), p.insertBefore(s.gutterBackground, s.text); } var g = s.line.gutterMarkers; if (o.options.lineNumbers || g) { var m = Ko(s), y = s.gutter = gt("div", null, "CodeMirror-gutter-wrapper", "left: " + (o.options.fixedGutter ? c.fixedPos : -c.gutterTotalWidth) + "px"); if (y.setAttribute("aria-hidden", "true"), o.display.input.setUneditable(y), m.insertBefore(y, s.text), s.line.gutterClass && (y.className += " " + s.line.gutterClass), !o.options.lineNumbers || g && g["CodeMirror-linenumbers"] || (s.lineNumber = y.appendChild(gt("div", Bo(o.options, u), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + c.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + o.display.lineNumInnerWidth + "px"))), g) for (var x = 0; x < o.display.gutterSpecs.length; ++x) { var O = o.display.gutterSpecs[x].className, B = g.hasOwnProperty(O) && g[O]; B && y.appendChild(gt("div", [B], "CodeMirror-gutter-elt", "left: " + c.gutterLeft[O] + "px; width: " + c.gutterWidth[O] + "px")); } } } function bi(o, s, u) { s.alignable && (s.alignable = null); for (var c = V("CodeMirror-linewidget"), p = s.node.firstChild, g = void 0; p; p = g) g = p.nextSibling, c.test(p.className) && s.node.removeChild(p); Fa(o, s, u); } function Bs(o, s, u, c) { var p = Us(o, s); return s.text = s.node = p.pre, p.bgClass && (s.bgClass = p.bgClass), p.textClass && (s.textClass = p.textClass), Zi(o, s), Yo(o, s, u, c), Fa(o, s, c), s.node; } function Fa(o, s, u) { if (Qi(o, s.line, s, u, !0), s.rest) for (var c = 0; c < s.rest.length; c++) Qi(o, s.rest[c], s, u, !1); } function Qi(o, s, u, c, p) { if (s.widgets) for (var g = Ko(u), m = 0, y = s.widgets; m < y.length; ++m) { var x = y[m], O = gt("div", [x.node], "CodeMirror-linewidget" + (x.className ? " " + x.className : "")); x.handleMouseEvents || O.setAttribute("cm-ignore-events", "true"), Al(x, O, u, c), o.display.input.setUneditable(O), p && x.above ? g.insertBefore(O, u.gutter || u.text) : g.appendChild(O), bn(x, "redraw"); } } function Al(o, s, u, c) { if (o.noHScroll) { (u.alignable || (u.alignable = [])).push(s); var p = c.wrapperWidth; s.style.left = c.fixedPos + "px", o.coverGutter || (p -= c.gutterTotalWidth, s.style.paddingLeft = c.gutterTotalWidth + "px"), s.style.width = p + "px"; } o.coverGutter && (s.style.zIndex = 5, s.style.position = "relative", o.noHScroll || (s.style.marginLeft = -c.gutterTotalWidth + "px")); } function _(o) { if (o.height != null) return o.height; var s = o.doc.cm; if (!s) return 0; if (!Lt(document.body, o.node)) { var u = "position: relative;"; o.coverGutter && (u += "margin-left: -" + s.display.gutters.offsetWidth + "px;"), o.noHScroll && (u += "width: " + s.display.wrapper.clientWidth + "px;"), rt(s.display.measure, gt("div", [o.node], null, u)); } return o.height = o.node.parentNode.offsetHeight; } function A(o, s) { for (var u = Ar(s); u != o.wrapper; u = u.parentNode) if (!u || u.nodeType == 1 && u.getAttribute("cm-ignore-events") == "true" || u.parentNode == o.sizer && u != o.mover) return !0; } function K(o) { return o.lineSpace.offsetTop; } function Z(o) { return o.mover.offsetHeight - o.lineSpace.offsetHeight; } function vt(o) { if (o.cachedPaddingH) return o.cachedPaddingH; var s = rt(o.measure, gt("pre", "x", "CodeMirror-line-like")), u = window.getComputedStyle ? window.getComputedStyle(s) : s.currentStyle, c = { left: parseInt(u.paddingLeft), right: parseInt(u.paddingRight) }; return isNaN(c.left) || isNaN(c.right) || (o.cachedPaddingH = c), c; } function lt(o) { return ge - o.display.nativeBarWidth; } function Nt(o) { return o.display.scroller.clientWidth - lt(o) - o.display.barWidth; } function Gt(o) { return o.display.scroller.clientHeight - lt(o) - o.display.barHeight; } function je(o, s, u) { var c = o.options.lineWrapping, p = c && Nt(o); if (!s.measure.heights || c && s.measure.width != p) { var g = s.measure.heights = []; if (c) { s.measure.width = p; for (var m = s.text.firstChild.getClientRects(), y = 0; y < m.length - 1; y++) { var x = m[y], O = m[y + 1]; Math.abs(x.bottom - O.bottom) > 2 && g.push((x.bottom + O.top) / 2 - u.top); } } g.push(u.bottom - u.top); } } function He(o, s, u) { if (o.line == s) return { map: o.measure.map, cache: o.measure.cache }; if (o.rest) { for (var c = 0; c < o.rest.length; c++) if (o.rest[c] == s) return { map: o.measure.maps[c], cache: o.measure.caches[c] }; for (var p = 0; p < o.rest.length; p++) if (Ye(o.rest[p]) > u) return { map: o.measure.maps[p], cache: o.measure.caches[p], before: !0 }; } } function cn(o, s) { var u = Ye(s = Or(s)), c = o.display.externalMeasured = new Yi(o.doc, s, u); c.lineN = u; var p = c.built = Gi(o, c); return c.text = p.pre, rt(o.display.lineMeasure, p.pre), c; } function Rr(o, s, u, c) { return Hr(o, Eo(o, s), u, c); } function ts(o, s) { if (s >= o.display.viewFrom && s < o.display.viewTo) return o.display.view[_i(o, s)]; var u = o.display.externalMeasured; return u && s >= u.lineN && s < u.lineN + u.size ? u : void 0; } function Eo(o, s) { var u = Ye(s), c = ts(o, u); c && !c.text ? c = null : c && c.changes && (zs(o, c, u, Nl(o)), o.curOp.forceUpdate = !0), c || (c = cn(o, s)); var p = He(c, s, u); return { line: s, view: c, rect: null, map: p.map, cache: p.cache, before: p.before, hasHeights: !1 }; } function Hr(o, s, u, c, p) { s.before && (u = -1); var g, m = u + (c || ""); return s.cache.hasOwnProperty(m) ? g = s.cache[m] : (s.rect || (s.rect = s.view.text.getBoundingClientRect()), s.hasHeights || (je(o, s.view, s.rect), s.hasHeights = !0), (g = yp(o, s, u, c)).bogus || (s.cache[m] = g)), { left: g.left, right: g.right, top: p ? g.rtop : g.top, bottom: p ? g.rbottom : g.bottom }; } var Ao, Vc = { left: 0, right: 0, top: 0, bottom: 0 }; function Ws(o, s, u) { for (var c, p, g, m, y, x, O = 0; O < o.length; O += 3) if (y = o[O], x = o[O + 1], s < y ? (p = 0, g = 1, m = "left") : s < x ? g = (p = s - y) + 1 : (O == o.length - 3 || s == x && o[O + 3] > s) && (p = (g = x - y) - 1, s >= x && (m = "right")), p != null) { if (c = o[O + 2], y == x && u == (c.insertLeft ? "left" : "right") && (m = u), u == "left" && p == 0) for (; O && o[O - 2] == o[O - 3] && o[O - 1].insertLeft; ) c = o[(O -= 3) + 2], m = "left"; if (u == "right" && p == x - y) for (; O < o.length - 3 && o[O + 3] == o[O + 4] && !o[O + 5].insertLeft; ) c = o[(O += 3) + 2], m = "right"; break; } return { node: c, start: p, end: g, collapse: m, coverStart: y, coverEnd: x }; } function Rc(o, s) { var u = Vc; if (s == "left") for (var c = 0; c < o.length && (u = o[c]).left == u.right; c++) ; else for (var p = o.length - 1; p >= 0 && (u = o[p]).left == u.right; p--) ; return u; } function yp(o, s, u, c) { var p, g = Ws(s.map, u, c), m = g.node, y = g.start, x = g.end, O = g.collapse; if (m.nodeType == 3) { for (var B = 0; B < 4; B++) { for (; y && U(s.line.text.charAt(g.coverStart + y)); ) --y; for (; g.coverStart + x < g.coverEnd && U(s.line.text.charAt(g.coverStart + x)); ) ++x; if ((p = z && k < 9 && y == 0 && x == g.coverEnd - g.coverStart ? m.parentNode.getBoundingClientRect() : Rc(Y(m, y, x).getClientRects(), c)).left || p.right || y == 0) break; x = y, y -= 1, O = "right"; } z && k < 11 && (p = bp(o.display.measure, p)); } else { var $; y > 0 && (O = c = "right"), p = o.options.lineWrapping && ($ = m.getClientRects()).length > 1 ? $[c == "right" ? $.length - 1 : 0] : m.getBoundingClientRect(); } if (z && k < 9 && !y && (!p || !p.left && !p.right)) { var ft = m.parentNode.getClientRects()[0]; p = ft ? { left: ft.left, right: ft.left + Jo(o.display), top: ft.top, bottom: ft.bottom } : Vc; } for (var dt = p.top - s.rect.top, Ct = p.bottom - s.rect.top, Rt = (dt + Ct) / 2, $t = s.view.measure.heights, re = 0; re < $t.length - 1 && !(Rt < $t[re]); re++) ; var le = re ? $t[re - 1] : 0, Jt = $t[re], ye = { left: (O == "right" ? p.right : p.left) - s.rect.left, right: (O == "left" ? p.left : p.right) - s.rect.left, top: le, bottom: Jt }; return p.left || p.right || (ye.bogus = !0), o.options.singleCursorHeightPerLine || (ye.rtop = dt, ye.rbottom = Ct), ye; } function bp(o, s) { if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !ro(o)) return s; var u = screen.logicalXDPI / screen.deviceXDPI, c = screen.logicalYDPI / screen.deviceYDPI; return { left: s.left * u, right: s.right * u, top: s.top * c, bottom: s.bottom * c }; } function Hc(o) { if (o.measure && (o.measure.cache = {}, o.measure.heights = null, o.rest)) for (var s = 0; s < o.rest.length; s++) o.measure.caches[s] = {}; } function es(o) { o.display.externalMeasure = null, wt(o.display.lineMeasure); for (var s = 0; s < o.display.view.length; s++) Hc(o.display.view[s]); } function Xo(o) { es(o), o.display.cachedCharWidth = o.display.cachedTextHeight = o.display.cachedPaddingH = null, o.options.lineWrapping || (o.display.maxLineChanged = !0), o.display.lineNumChars = null; } function $s() { return M && ee ? -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) : window.pageXOffset || (document.documentElement || document.body).scrollLeft; } function zc() { return M && ee ? -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) : window.pageYOffset || (document.documentElement || document.body).scrollTop; } function Va(o) { var s = Or(o).widgets, u = 0; if (s) for (var c = 0; c < s.length; ++c) s[c].above && (u += _(s[c])); return u; } function Ra(o, s, u, c, p) { if (!p) { var g = Va(s); u.top += g, u.bottom += g; } if (c == "line") return u; c || (c = "local"); var m = Fr(s); if (c == "local" ? m += K(o.display) : m -= o.display.viewOffset, c == "page" || c == "window") { var y = o.display.lineSpace.getBoundingClientRect(); m += y.top + (c == "window" ? 0 : zc()); var x = y.left + (c == "window" ? 0 : $s()); u.left += x, u.right += x; } return u.top += m, u.bottom += m, u; } function jl(o, s, u) { if (u == "div") return s; var c = s.left, p = s.top; if (u == "page") c -= $s(), p -= zc(); else if (u == "local" || !u) { var g = o.display.sizer.getBoundingClientRect(); c += g.left, p += g.top; } var m = o.display.lineSpace.getBoundingClientRect(); return { left: c - m.left, top: p - m.top }; } function Ha(o, s, u, c, p) { return c || (c = ve(o.doc, s.line)), Ra(o, c, Rr(o, c, s.ch, p), u); } function kr(o, s, u, c, p, g) { function m(Ct, Rt) { var $t = Hr(o, p, Ct, Rt ? "right" : "left", g); return Rt ? $t.left = $t.right : $t.right = $t.left, Ra(o, c, $t, u); } c = c || ve(o.doc, s.line), p || (p = Eo(o, c)); var y = ze(c, o.doc.direction), x = s.ch, O = s.sticky; if (x >= c.text.length ? (x = c.text.length, O = "before") : x <= 0 && (x = 0, O = "after"), !y) return m(O == "before" ? x - 1 : x, O == "before"); function B(Ct, Rt, $t) { return m($t ? Ct - 1 : Ct, y[Rt].level == 1 != $t); } var $ = ke(y, x, O), ft = fe, dt = B(x, $, O == "before"); return ft != null && (dt.other = B(x, ft, O != "before")), dt; } function za(o, s) { var u = 0; s = oe(o.doc, s), o.options.lineWrapping || (u = Jo(o.display) * s.ch); var c = ve(o.doc, s.line), p = Fr(c) + K(o.display); return { left: u, right: u, top: p, bottom: p + c.height }; } function Ml(o, s, u, c, p) { var g = Bt(o, s, u); return g.xRel = p, c && (g.outside = c), g; } function Ll(o, s, u) { var c = o.doc; if ((u += o.display.viewOffset) < 0) return Ml(c.first, 0, null, -1, -1); var p = In(c, u), g = c.first + c.size - 1; if (p > g) return Ml(c.first + c.size - 1, ve(c, g).text.length, null, 1, 1); s < 0 && (s = 0); for (var m = ve(c, p); ; ) { var y = Dl(o, m, p, s, u), x = Wi(m, y.ch + (y.xRel > 0 || y.outside > 0 ? 1 : 0)); if (!x) return y; var O = x.find(1); if (O.line == p) return O; m = ve(c, p = O.line); } } function Uc(o, s, u, c) { c -= Va(s); var p = s.text.length, g = kt(function(m) { return Hr(o, u, m - 1).bottom <= c; }, p, 0); return { begin: g, end: p = kt(function(m) { return Hr(o, u, m).top > c; }, g, p) }; } function Bc(o, s, u, c) { return u || (u = Eo(o, s)), Uc(o, s, u, Ra(o, s, Hr(o, u, c), "line").top); } function ns(o, s, u, c) { return !(o.bottom <= u) && (o.top > u || (c ? o.left : o.right) > s); } function Dl(o, s, u, c, p) { p -= Fr(s); var g = Eo(o, s), m = Va(s), y = 0, x = s.text.length, O = !0, B = ze(s, o.doc.direction); if (B) { var $ = (o.options.lineWrapping ? os : rs)(o, s, u, g, B, c, p); y = (O = $.level != 1) ? $.from : $.to - 1, x = O ? $.to : $.from - 1; } var ft, dt, Ct = null, Rt = null, $t = kt(function(me) { var Ce = Hr(o, g, me); return Ce.top += m, Ce.bottom += m, !!ns(Ce, c, p, !1) && (Ce.top <= p && Ce.left <= c && (Ct = me, Rt = Ce), !0); }, y, x), re = !1; if (Rt) { var le = c - Rt.left < Rt.right - c, Jt = le == O; $t = Ct + (Jt ? 0 : 1), dt = Jt ? "after" : "before", ft = le ? Rt.left : Rt.right; } else { O || $t != x && $t != y || $t++, dt = $t == 0 ? "after" : $t == s.text.length ? "before" : Hr(o, g, $t - (O ? 1 : 0)).bottom + m <= p == O ? "after" : "before"; var ye = kr(o, Bt(u, $t, dt), "line", s, g); ft = ye.left, re = p < ye.top ? -1 : p >= ye.bottom ? 1 : 0; } return Ml(u, $t = ht(s.text, $t, 1), dt, re, c - ft); } function rs(o, s, u, c, p, g, m) { var y = kt(function($) { var ft = p[$], dt = ft.level != 1; return ns(kr(o, Bt(u, dt ? ft.to : ft.from, dt ? "before" : "after"), "line", s, c), g, m, !0); }, 0, p.length - 1), x = p[y]; if (y > 0) { var O = x.level != 1, B = kr(o, Bt(u, O ? x.from : x.to, O ? "after" : "before"), "line", s, c); ns(B, g, m, !0) && B.top > m && (x = p[y - 1]); } return x; } function os(o, s, u, c, p, g, m) { var y = Uc(o, s, c, m), x = y.begin, O = y.end; /\s/.test(s.text.charAt(O - 1)) && O--; for (var B = null, $ = null, ft = 0; ft < p.length; ft++) { var dt = p[ft]; if (!(dt.from >= O || dt.to <= x)) { var Ct = Hr(o, c, dt.level != 1 ? Math.min(O, dt.to) - 1 : Math.max(x, dt.from)).right, Rt = Ct < g ? g - Ct + 1e9 : Ct - g; (!B || $ > Rt) && (B = dt, $ = Rt); } } return B || (B = p[p.length - 1]), B.from < x && (B = { from: x, to: B.to, level: B.level }), B.to > O && (B = { from: B.from, to: O, level: B.level }), B; } function ao(o) { if (o.cachedTextHeight != null) return o.cachedTextHeight; if (Ao == null) { Ao = gt("pre", null, "CodeMirror-line-like"); for (var s = 0; s < 49; ++s) Ao.appendChild(document.createTextNode("x")), Ao.appendChild(gt("br")); Ao.appendChild(document.createTextNode("x")); } rt(o.measure, Ao); var u = Ao.offsetHeight / 50; return u > 3 && (o.cachedTextHeight = u), wt(o.measure), u || 1; } function Jo(o) { if (o.cachedCharWidth != null) return o.cachedCharWidth; var s = gt("span", "xxxxxxxxxx"), u = gt("pre", [s], "CodeMirror-line-like"); rt(o.measure, u); var c = s.getBoundingClientRect(), p = (c.right - c.left) / 10; return p > 2 && (o.cachedCharWidth = p), p || 10; } function Nl(o) { for (var s = o.display, u = {}, c = {}, p = s.gutters.clientLeft, g = s.gutters.firstChild, m = 0; g; g = g.nextSibling, ++m) { var y = o.display.gutterSpecs[m].className; u[y] = g.offsetLeft + g.clientLeft + p, c[y] = g.clientWidth; } return { fixedPos: Il(s), gutterTotalWidth: s.gutters.offsetWidth, gutterLeft: u, gutterWidth: c, wrapperWidth: s.wrapper.clientWidth }; } function Il(o) { return o.scroller.getBoundingClientRect().left - o.sizer.getBoundingClientRect().left; } function Wc(o) { var s = ao(o.display), u = o.options.lineWrapping, c = u && Math.max(5, o.display.scroller.clientWidth / Jo(o.display) - 3); return function(p) { if (Ir(o.doc, p)) return 0; var g = 0; if (p.widgets) for (var m = 0; m < p.widgets.length; m++) p.widgets[m].height && (g += p.widgets[m].height); return u ? g + (Math.ceil(p.text.length / c) || 1) * s : g + s; }; } function Fl(o) { var s = o.doc, u = Wc(o); s.iter(function(c) { var p = u(c); p != c.height && or(c, p); }); } function wi(o, s, u, c) { var p = o.display; if (!u && Ar(s).getAttribute("cm-not-content") == "true") return null; var g, m, y = p.lineSpace.getBoundingClientRect(); try { g = s.clientX - y.left, m = s.clientY - y.top; } catch { return null; } var x, O = Ll(o, g, m); if (c && O.xRel > 0 && (x = ve(o.doc, O.line).text).length == O.ch) { var B = xe(x, x.length, o.options.tabSize) - x.length; O = Bt(O.line, Math.max(0, Math.round((g - vt(o.display).left) / Jo(o.display)) - B)); } return O; } function _i(o, s) { if (s >= o.display.viewTo || (s -= o.display.viewFrom) < 0) return null; for (var u = o.display.view, c = 0; c < u.length; c++) if ((s -= u[c].size) < 0) return c; } function Qn(o, s, u, c) { s == null && (s = o.doc.first), u == null && (u = o.doc.first + o.doc.size), c || (c = 0); var p = o.display; if (c && u < p.viewTo && (p.updateLineNumbers == null || p.updateLineNumbers > s) && (p.updateLineNumbers = s), o.curOp.viewChanged = !0, s >= p.viewTo) Zr && pr(o.doc, s) < p.viewTo && Zo(o); else if (u <= p.viewFrom) Zr && Nr(o.doc, u + c) > p.viewFrom ? Zo(o) : (p.viewFrom += c, p.viewTo += c); else if (s <= p.viewFrom && u >= p.viewTo) Zo(o); else if (s <= p.viewFrom) { var g = Ua(o, u, u + c, 1); g ? (p.view = p.view.slice(g.index), p.viewFrom = g.lineN, p.viewTo += c) : Zo(o); } else if (u >= p.viewTo) { var m = Ua(o, s, s, -1); m ? (p.view = p.view.slice(0, m.index), p.viewTo = m.lineN) : Zo(o); } else { var y = Ua(o, s, s, -1), x = Ua(o, u, u + c, 1); y && x ? (p.view = p.view.slice(0, y.index).concat(so(o, y.lineN, x.lineN)).concat(p.view.slice(x.index)), p.viewTo += c) : Zo(o); } var O = p.externalMeasured; O && (u < O.lineN ? O.lineN += c : s < O.lineN + O.size && (p.externalMeasured = null)); } function lo(o, s, u) { o.curOp.viewChanged = !0; var c = o.display, p = o.display.externalMeasured; if (p && s >= p.lineN && s < p.lineN + p.size && (c.externalMeasured = null), !(s < c.viewFrom || s >= c.viewTo)) { var g = c.view[_i(o, s)]; if (g.node != null) { var m = g.changes || (g.changes = []); be(m, u) == -1 && m.push(u); } } } function Zo(o) { o.display.viewFrom = o.display.viewTo = o.doc.first, o.display.view = [], o.display.viewOffset = 0; } function Ua(o, s, u, c) { var p, g = _i(o, s), m = o.display.view; if (!Zr || u == o.doc.first + o.doc.size) return { index: g, lineN: u }; for (var y = o.display.viewFrom, x = 0; x < g; x++) y += m[x].size; if (y != s) { if (c > 0) { if (g == m.length - 1) return null; p = y + m[g].size - s, g++; } else p = y - s; s += p, u += p; } for (; pr(o.doc, u) != u; ) { if (g == (c < 0 ? 0 : m.length - 1)) return null; u += c * m[g - (c < 0 ? 1 : 0)].size, g += c; } return { index: g, lineN: u }; } function wp(o, s, u) { var c = o.display; c.view.length == 0 || s >= c.viewTo || u <= c.viewFrom ? (c.view = so(o, s, u), c.viewFrom = s) : (c.viewFrom > s ? c.view = so(o, s, c.viewFrom).concat(c.view) : c.viewFrom < s && (c.view = c.view.slice(_i(o, s))), c.viewFrom = s, c.viewTo < u ? c.view = c.view.concat(so(o, c.viewTo, u)) : c.viewTo > u && (c.view = c.view.slice(0, _i(o, u)))), c.viewTo = u; } function $c(o) { for (var s = o.display.view, u = 0, c = 0; c < s.length; c++) { var p = s[c]; p.hidden || p.node && !p.changes || ++u; } return u; } function qs(o) { o.display.input.showSelection(o.display.input.prepareSelection()); } function Gs(o, s) { s === void 0 && (s = !0); var u = o.doc, c = {}, p = c.cursors = document.createDocumentFragment(), g = c.selection = document.createDocumentFragment(), m = o.options.$customCursor; m && (s = !0); for (var y = 0; y < u.sel.ranges.length; y++) if (s || y != u.sel.primIndex) { var x = u.sel.ranges[y]; if (!(x.from().line >= o.display.viewTo || x.to().line < o.display.viewFrom)) { var O = x.empty(); if (m) { var B = m(o, x); B && Ks(o, B, p); } else (O || o.options.showCursorWhenSelecting) && Ks(o, x.head, p); O || _p(o, x, g); } } return c; } function Ks(o, s, u) { var c = kr(o, s, "div", null, null, !o.options.singleCursorHeightPerLine), p = u.appendChild(gt("div", " ", "CodeMirror-cursor")); if (p.style.left = c.left + "px", p.style.top = c.top + "px", p.style.height = Math.max(0, c.bottom - c.top) * o.options.cursorHeight + "px", /\bcm-fat-cursor\b/.test(o.getWrapperElement().className)) { var g = Ha(o, s, "div", null, null), m = g.right - g.left; p.style.width = (m > 0 ? m : o.defaultCharWidth()) + "px"; } if (c.other) { var y = u.appendChild(gt("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor")); y.style.display = "", y.style.left = c.other.left + "px", y.style.top = c.other.top + "px", y.style.height = 0.85 * (c.other.bottom - c.other.top) + "px"; } } function Ys(o, s) { return o.top - s.top || o.left - s.left; } function _p(o, s, u) { var c = o.display, p = o.doc, g = document.createDocumentFragment(), m = vt(o.display), y = m.left, x = Math.max(c.sizerWidth, Nt(o) - c.sizer.offsetLeft) - m.right, O = p.direction == "ltr"; function B(Jt, ye, me, Ce) { ye < 0 && (ye = 0), ye = Math.round(ye), Ce = Math.round(Ce), g.appendChild(gt("div", null, "CodeMirror-selected", "position: absolute; left: " + Jt + `px; top: ` + ye + "px; width: " + (me ?? x - Jt) + `px; height: ` + (Ce - ye) + "px")); } function $(Jt, ye, me) { var Ce, sn, an = ve(p, Jt), gr = an.text.length; function hn(xn, En) { return Ha(o, Bt(Jt, xn), "div", an, En); } function sr(xn, En, dr) { var Vn = Bc(o, an, null, xn), An = En == "ltr" == (dr == "after") ? "left" : "right"; return hn(dr == "after" ? Vn.begin : Vn.end - (/\s/.test(an.text.charAt(Vn.end - 1)) ? 2 : 1), An)[An]; } var vr = ze(an, p.direction); return Ot(vr, ye || 0, me ?? gr, function(xn, En, dr, Vn) { var An = dr == "ltr", jn = hn(xn, An ? "left" : "right"), mr = hn(En - 1, An ? "right" : "left"), ri = ye == null && xn == 0, fo = me == null && En == gr, ar = Vn == 0, Cn = !vr || Vn == vr.length - 1; if (mr.top - jn.top <= 3) { var bc = (O ? fo : ri) && Cn, Fo = (O ? ri : fo) && ar ? y : (An ? jn : mr).left, Li = bc ? x : (An ? mr : jn).right; B(Fo, jn.top, Li - Fo, jn.bottom); } else { var Di, zn, Cs, wc; An ? (Di = O && ri && ar ? y : jn.left, zn = O ? x : sr(xn, dr, "before"), Cs = O ? y : sr(En, dr, "after"), wc = O && fo && Cn ? x : mr.right) : (Di = O ? sr(xn, dr, "before") : y, zn = !O && ri && ar ? x : jn.right, Cs = !O && fo && Cn ? y : mr.left, wc = O ? sr(En, dr, "after") : x), B(Di, jn.top, zn - Di, jn.bottom), jn.bottom < mr.top && B(y, jn.bottom, null, mr.top), B(Cs, mr.top, wc - Cs, mr.bottom); } (!Ce || Ys(jn, Ce) < 0) && (Ce = jn), Ys(mr, Ce) < 0 && (Ce = mr), (!sn || Ys(jn, sn) < 0) && (sn = jn), Ys(mr, sn) < 0 && (sn = mr); }), { start: Ce, end: sn }; } var ft = s.from(), dt = s.to(); if (ft.line == dt.line) $(ft.line, ft.ch, dt.ch); else { var Ct = ve(p, ft.line), Rt = ve(p, dt.line), $t = Or(Ct) == Or(Rt), re = $(ft.line, ft.ch, $t ? Ct.text.length + 1 : null).end, le = $(dt.line, $t ? 0 : null, dt.ch).start; $t && (re.top < le.top - 2 ? (B(re.right, re.top, null, re.bottom), B(y, le.top, le.left, le.bottom)) : B(re.right, re.top, le.left - re.right, re.bottom)), re.bottom < le.top && B(y, re.bottom, null, le.top); } u.appendChild(g); } function is(o) { if (o.state.focused) { var s = o.display; clearInterval(s.blinker); var u = !0; s.cursorDiv.style.visibility = "", o.options.cursorBlinkRate > 0 ? s.blinker = setInterval(function() { o.hasFocus() || xi(o), s.cursorDiv.style.visibility = (u = !u) ? "" : "hidden"; }, o.options.cursorBlinkRate) : o.options.cursorBlinkRate < 0 && (s.cursorDiv.style.visibility = "hidden"); } } function qc(o) { o.hasFocus() || (o.display.input.focus(), o.state.focused || Rl(o)); } function Vl(o) { o.state.delayingBlurEvent = !0, setTimeout(function() { o.state.delayingBlurEvent && (o.state.delayingBlurEvent = !1, o.state.focused && xi(o)); }, 100); } function Rl(o, s) { o.state.delayingBlurEvent && !o.state.draggingText && (o.state.delayingBlurEvent = !1), o.options.readOnly != "nocursor" && (o.state.focused || (ut(o, "focus", o, s), o.state.focused = !0, Qt(o.display.wrapper, "CodeMirror-focused"), o.curOp || o.display.selForContextMenu == o.doc.sel || (o.display.input.reset(), P && setTimeout(function() { return o.display.input.reset(!0); }, 20)), o.display.input.receivedFocus()), is(o)); } function xi(o, s) { o.state.delayingBlurEvent || (o.state.focused && (ut(o, "blur", o, s), o.state.focused = !1, nt(o.display.wrapper, "CodeMirror-focused")), clearInterval(o.display.blinker), setTimeout(function() { o.state.focused || (o.display.shift = !1); }, 150)); } function Ba(o) { for (var s = o.display, u = s.lineDiv.offsetTop, c = Math.max(0, s.scroller.getBoundingClientRect().top), p = s.lineDiv.getBoundingClientRect().top, g = 0, m = 0; m < s.view.length; m++) { var y = s.view[m], x = o.options.lineWrapping, O = void 0, B = 0; if (!y.hidden) { if (p += y.line.height, z && k < 8) { var $ = y.node.offsetTop + y.node.offsetHeight; O = $ - u, u = $; } else { var ft = y.node.getBoundingClientRect(); O = ft.bottom - ft.top, !x && y.text.firstChild && (B = y.text.firstChild.getBoundingClientRect().right - ft.left - 1); } var dt = y.line.height - O; if ((dt > 5e-3 || dt < -5e-3) && (p < c && (g -= dt), or(y.line, O), Xs(y.line), y.rest)) for (var Ct = 0; Ct < y.rest.length; Ct++) Xs(y.rest[Ct]); if (B > o.display.sizerWidth) { var Rt = Math.ceil(B / Jo(o.display)); Rt > o.display.maxLineLength && (o.display.maxLineLength = Rt, o.display.maxLine = y.line, o.display.maxLineChanged = !0); } } } Math.abs(g) > 2 && (s.scroller.scrollTop += g); } function Xs(o) { if (o.widgets) for (var s = 0; s < o.widgets.length; ++s) { var u = o.widgets[s], c = u.node.parentNode; c && (u.height = c.offsetHeight); } } function Js(o, s, u) { var c = u && u.top != null ? Math.max(0, u.top) : o.scroller.scrollTop; c = Math.floor(c - K(o)); var p = u && u.bottom != null ? u.bottom : c + o.wrapper.clientHeight, g = In(s, c), m = In(s, p); if (u && u.ensure) { var y = u.ensure.from.line, x = u.ensure.to.line; y < g ? (g = y, m = In(s, Fr(ve(s, y)) + o.wrapper.clientHeight)) : Math.min(x, s.lastLine()) >= m && (g = In(s, Fr(ve(s, x)) - o.wrapper.clientHeight), m = x); } return { from: g, to: Math.max(m, g + 1) }; } function xp(o, s) { if (!yt(o, "scrollCursorIntoView")) { var u = o.display, c = u.sizer.getBoundingClientRect(), p = null; if (s.top + c.top < 0 ? p = !0 : s.bottom + c.top > (window.innerHeight || document.documentElement.clientHeight) && (p = !1), p != null && !jt) { var g = gt("div", "​", null, `position: absolute; top: ` + (s.top - u.viewOffset - K(o.display)) + `px; height: ` + (s.bottom - s.top + lt(o) + u.barHeight) + `px; left: ` + s.left + "px; width: " + Math.max(2, s.right - s.left) + "px;"); o.display.lineSpace.appendChild(g), g.scrollIntoView(p), o.display.lineSpace.removeChild(g); } } } function Hl(o, s, u, c) { var p; c == null && (c = 0), o.options.lineWrapping || s != u || (u = s.sticky == "before" ? Bt(s.line, s.ch + 1, "before") : s, s = s.ch ? Bt(s.line, s.sticky == "before" ? s.ch - 1 : s.ch, "after") : s); for (var g = 0; g < 5; g++) { var m = !1, y = kr(o, s), x = u && u != s ? kr(o, u) : y, O = zl(o, p = { left: Math.min(y.left, x.left), top: Math.min(y.top, x.top) - c, right: Math.max(y.left, x.left), bottom: Math.max(y.bottom, x.bottom) + c }), B = o.doc.scrollTop, $ = o.doc.scrollLeft; if (O.scrollTop != null && (Qs(o, O.scrollTop), Math.abs(o.doc.scrollTop - B) > 1 && (m = !0)), O.scrollLeft != null && (jo(o, O.scrollLeft), Math.abs(o.doc.scrollLeft - $) > 1 && (m = !0)), !m) break; } return p; } function Cp(o, s) { var u = zl(o, s); u.scrollTop != null && Qs(o, u.scrollTop), u.scrollLeft != null && jo(o, u.scrollLeft); } function zl(o, s) { var u = o.display, c = ao(o.display); s.top < 0 && (s.top = 0); var p = o.curOp && o.curOp.scrollTop != null ? o.curOp.scrollTop : u.scroller.scrollTop, g = Gt(o), m = {}; s.bottom - s.top > g && (s.bottom = s.top + g); var y = o.doc.height + Z(u), x = s.top < c, O = s.bottom > y - c; if (s.top < p) m.scrollTop = x ? 0 : s.top; else if (s.bottom > p + g) { var B = Math.min(s.top, (O ? y : s.bottom) - g); B != p && (m.scrollTop = B); } var $ = o.options.fixedGutter ? 0 : u.gutters.offsetWidth, ft = o.curOp && o.curOp.scrollLeft != null ? o.curOp.scrollLeft : u.scroller.scrollLeft - $, dt = Nt(o) - u.gutters.offsetWidth, Ct = s.right - s.left > dt; return Ct && (s.right = s.left + dt), s.left < 10 ? m.scrollLeft = 0 : s.left < ft ? m.scrollLeft = Math.max(0, s.left + $ - (Ct ? 0 : 10)) : s.right > dt + ft - 3 && (m.scrollLeft = s.right + (Ct ? 0 : 10) - dt), m; } function Wa(o, s) { s != null && (Ci(o), o.curOp.scrollTop = (o.curOp.scrollTop == null ? o.doc.scrollTop : o.curOp.scrollTop) + s); } function ss(o) { Ci(o); var s = o.getCursor(); o.curOp.scrollToPos = { from: s, to: s, margin: o.options.cursorScrollMargin }; } function Zs(o, s, u) { s == null && u == null || Ci(o), s != null && (o.curOp.scrollLeft = s), u != null && (o.curOp.scrollTop = u); } function Sp(o, s) { Ci(o), o.curOp.scrollToPos = s; } function Ci(o) { var s = o.curOp.scrollToPos; s && (o.curOp.scrollToPos = null, Gc(o, za(o, s.from), za(o, s.to), s.margin)); } function Gc(o, s, u, c) { var p = zl(o, { left: Math.min(s.left, u.left), top: Math.min(s.top, u.top) - c, right: Math.max(s.right, u.right), bottom: Math.max(s.bottom, u.bottom) + c }); Zs(o, p.scrollLeft, p.scrollTop); } function Qs(o, s) { Math.abs(o.doc.scrollTop - s) < 2 || (at || Bl(o, { top: s }), ta(o, s, !0), at && Bl(o), ls(o, 100)); } function ta(o, s, u) { s = Math.max(0, Math.min(o.display.scroller.scrollHeight - o.display.scroller.clientHeight, s)), (o.display.scroller.scrollTop != s || u) && (o.doc.scrollTop = s, o.display.scrollbars.setScrollTop(s), o.display.scroller.scrollTop != s && (o.display.scroller.scrollTop = s)); } function jo(o, s, u, c) { s = Math.max(0, Math.min(s, o.display.scroller.scrollWidth - o.display.scroller.clientWidth)), (u ? s == o.doc.scrollLeft : Math.abs(o.doc.scrollLeft - s) < 2) && !c || (o.doc.scrollLeft = s, oa(o), o.display.scroller.scrollLeft != s && (o.display.scroller.scrollLeft = s), o.display.scrollbars.setScrollLeft(s)); } function ea(o) { var s = o.display, u = s.gutters.offsetWidth, c = Math.round(o.doc.height + Z(o.display)); return { clientHeight: s.scroller.clientHeight, viewHeight: s.wrapper.clientHeight, scrollWidth: s.scroller.scrollWidth, clientWidth: s.scroller.clientWidth, viewWidth: s.wrapper.clientWidth, barLeft: o.options.fixedGutter ? u : 0, docHeight: c, scrollHeight: c + lt(o) + s.barHeight, nativeBarWidth: s.nativeBarWidth, gutterWidth: u }; } var Si = function(o, s, u) { this.cm = u; var c = this.vert = gt("div", [gt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"), p = this.horiz = gt("div", [gt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); c.tabIndex = p.tabIndex = -1, o(c), o(p), Kt(c, "scroll", function() { c.clientHeight && s(c.scrollTop, "vertical"); }), Kt(p, "scroll", function() { p.clientWidth && s(p.scrollLeft, "horizontal"); }), this.checkedZeroWidth = !1, z && k < 8 && (this.horiz.style.minHeight = this.vert.style.minWidth = "18px"); }; Si.prototype.update = function(o) { var s = o.scrollWidth > o.clientWidth + 1, u = o.scrollHeight > o.clientHeight + 1, c = o.nativeBarWidth; if (u) { this.vert.style.display = "block", this.vert.style.bottom = s ? c + "px" : "0"; var p = o.viewHeight - (s ? c : 0); this.vert.firstChild.style.height = Math.max(0, o.scrollHeight - o.clientHeight + p) + "px"; } else this.vert.scrollTop = 0, this.vert.style.display = "", this.vert.firstChild.style.height = "0"; if (s) { this.horiz.style.display = "block", this.horiz.style.right = u ? c + "px" : "0", this.horiz.style.left = o.barLeft + "px"; var g = o.viewWidth - o.barLeft - (u ? c : 0); this.horiz.firstChild.style.width = Math.max(0, o.scrollWidth - o.clientWidth + g) + "px"; } else this.horiz.style.display = "", this.horiz.firstChild.style.width = "0"; return !this.checkedZeroWidth && o.clientHeight > 0 && (c == 0 && this.zeroWidthHack(), this.checkedZeroWidth = !0), { right: u ? c : 0, bottom: s ? c : 0 }; }, Si.prototype.setScrollLeft = function(o) { this.horiz.scrollLeft != o && (this.horiz.scrollLeft = o), this.disableHoriz && this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); }, Si.prototype.setScrollTop = function(o) { this.vert.scrollTop != o && (this.vert.scrollTop = o), this.disableVert && this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); }, Si.prototype.zeroWidthHack = function() { var o = bt && !Et ? "12px" : "18px"; this.horiz.style.height = this.vert.style.width = o, this.horiz.style.visibility = this.vert.style.visibility = "hidden", this.disableHoriz = new Te(), this.disableVert = new Te(); }, Si.prototype.enableZeroWidthBar = function(o, s, u) { function c() { var p = o.getBoundingClientRect(); (u == "vert" ? document.elementFromPoint(p.right - 1, (p.top + p.bottom) / 2) : document.elementFromPoint((p.right + p.left) / 2, p.bottom - 1)) != o ? o.style.visibility = "hidden" : s.set(1e3, c); } o.style.visibility = "", s.set(1e3, c); }, Si.prototype.clear = function() { var o = this.horiz.parentNode; o.removeChild(this.horiz), o.removeChild(this.vert); }; var na = function() { }; function as(o, s) { s || (s = ea(o)); var u = o.display.barWidth, c = o.display.barHeight; zr(o, s); for (var p = 0; p < 4 && u != o.display.barWidth || c != o.display.barHeight; p++) u != o.display.barWidth && o.options.lineWrapping && Ba(o), zr(o, ea(o)), u = o.display.barWidth, c = o.display.barHeight; } function zr(o, s) { var u = o.display, c = u.scrollbars.update(s); u.sizer.style.paddingRight = (u.barWidth = c.right) + "px", u.sizer.style.paddingBottom = (u.barHeight = c.bottom) + "px", u.heightForcer.style.borderBottom = c.bottom + "px solid transparent", c.right && c.bottom ? (u.scrollbarFiller.style.display = "block", u.scrollbarFiller.style.height = c.bottom + "px", u.scrollbarFiller.style.width = c.right + "px") : u.scrollbarFiller.style.display = "", c.bottom && o.options.coverGutterNextToScrollbar && o.options.fixedGutter ? (u.gutterFiller.style.display = "block", u.gutterFiller.style.height = c.bottom + "px", u.gutterFiller.style.width = s.gutterWidth + "px") : u.gutterFiller.style.display = ""; } na.prototype.update = function() { return { bottom: 0, right: 0 }; }, na.prototype.setScrollLeft = function() { }, na.prototype.setScrollTop = function() { }, na.prototype.clear = function() { }; var Kc = { native: Si, null: na }; function Yc(o) { o.display.scrollbars && (o.display.scrollbars.clear(), o.display.scrollbars.addClass && nt(o.display.wrapper, o.display.scrollbars.addClass)), o.display.scrollbars = new Kc[o.options.scrollbarStyle](function(s) { o.display.wrapper.insertBefore(s, o.display.scrollbarFiller), Kt(s, "mousedown", function() { o.state.focused && setTimeout(function() { return o.display.input.focus(); }, 0); }), s.setAttribute("cm-not-content", "true"); }, function(s, u) { u == "horizontal" ? jo(o, s) : Qs(o, s); }, o), o.display.scrollbars.addClass && Qt(o.display.wrapper, o.display.scrollbars.addClass); } var Op = 0; function Oi(o) { o.curOp = { cm: o, viewChanged: !1, startHeight: o.doc.height, forceUpdate: !1, updateInput: 0, typing: !1, changeObjs: null, cursorActivityHandlers: null, cursorActivityCalled: 0, selectionChanged: !1, updateMaxLine: !1, scrollLeft: null, scrollTop: null, scrollToPos: null, focus: !1, id: ++Op, markArrays: null }, mi(o.curOp); } function Ti(o) { var s = o.curOp; s && Ji(s, function(u) { for (var c = 0; c < u.ops.length; c++) u.ops[c].cm.curOp = null; Tp(u); }); } function Tp(o) { for (var s = o.ops, u = 0; u < s.length; u++) kp(s[u]); for (var c = 0; c < s.length; c++) Pp(s[c]); for (var p = 0; p < s.length; p++) Ep(s[p]); for (var g = 0; g < s.length; g++) ra(s[g]); for (var m = 0; m < s.length; m++) Ap(s[m]); } function kp(o) { var s = o.cm, u = s.display; ki(s), o.updateMaxLine && Rs(s), o.mustUpdate = o.viewChanged || o.forceUpdate || o.scrollTop != null || o.scrollToPos && (o.scrollToPos.from.line < u.viewFrom || o.scrollToPos.to.line >= u.viewTo) || u.maxLineChanged && s.options.lineWrapping, o.update = o.mustUpdate && new $a(s, o.mustUpdate && { top: o.scrollTop, ensure: o.scrollToPos }, o.forceUpdate); } function Pp(o) { o.updatedDisplay = o.mustUpdate && Ul(o.cm, o.update); } function Ep(o) { var s = o.cm, u = s.display; o.updatedDisplay && Ba(s), o.barMeasure = ea(s), u.maxLineChanged && !s.options.lineWrapping && (o.adjustWidthTo = Rr(s, u.maxLine, u.maxLine.text.length).left + 3, s.display.sizerWidth = o.adjustWidthTo, o.barMeasure.scrollWidth = Math.max(u.scroller.clientWidth, u.sizer.offsetLeft + o.adjustWidthTo + lt(s) + s.display.barWidth), o.maxScrollLeft = Math.max(0, u.sizer.offsetLeft + o.adjustWidthTo - Nt(s))), (o.updatedDisplay || o.selectionChanged) && (o.preparedSelection = u.input.prepareSelection()); } function ra(o) { var s = o.cm; o.adjustWidthTo != null && (s.display.sizer.style.minWidth = o.adjustWidthTo + "px", o.maxScrollLeft < s.doc.scrollLeft && jo(s, Math.min(s.display.scroller.scrollLeft, o.maxScrollLeft), !0), s.display.maxLineChanged = !1); var u = o.focus && o.focus == Tt(); o.preparedSelection && s.display.input.showSelection(o.preparedSelection, u), (o.updatedDisplay || o.startHeight != s.doc.height) && as(s, o.barMeasure), o.updatedDisplay && qa(s, o.barMeasure), o.selectionChanged && is(s), s.state.focused && o.updateInput && s.display.input.reset(o.typing), u && qc(o.cm); } function Ap(o) { var s = o.cm, u = s.display, c = s.doc; o.updatedDisplay && Xc(s, o.update), u.wheelStartX == null || o.scrollTop == null && o.scrollLeft == null && !o.scrollToPos || (u.wheelStartX = u.wheelStartY = null), o.scrollTop != null && ta(s, o.scrollTop, o.forceScroll), o.scrollLeft != null && jo(s, o.scrollLeft, !0, !0), o.scrollToPos && xp(s, Hl(s, oe(c, o.scrollToPos.from), oe(c, o.scrollToPos.to), o.scrollToPos.margin)); var p = o.maybeHiddenMarkers, g = o.maybeUnhiddenMarkers; if (p) for (var m = 0; m < p.length; ++m) p[m].lines.length || ut(p[m], "hide"); if (g) for (var y = 0; y < g.length; ++y) g[y].lines.length && ut(g[y], "unhide"); u.wrapper.offsetHeight && (c.scrollTop = s.display.scroller.scrollTop), o.changeObjs && ut(s, "changes", s, o.changeObjs), o.update && o.update.finish(); } function fr(o, s) { if (o.curOp) return s(); Oi(o); try { return s(); } finally { Ti(o); } } function Gn(o, s) { return function() { if (o.curOp) return s.apply(o, arguments); Oi(o); try { return s.apply(o, arguments); } finally { Ti(o); } }; } function ir(o) { return function() { if (this.curOp) return o.apply(this, arguments); Oi(this); try { return o.apply(this, arguments); } finally { Ti(this); } }; } function Kn(o) { return function() { var s = this.cm; if (!s || s.curOp) return o.apply(this, arguments); Oi(s); try { return o.apply(this, arguments); } finally { Ti(s); } }; } function ls(o, s) { o.doc.highlightFrontier < o.display.viewTo && o.state.highlight.set(s, _e(jp, o)); } function jp(o) { var s = o.doc; if (!(s.highlightFrontier >= o.display.viewTo)) { var u = +/* @__PURE__ */ new Date() + o.options.workTime, c = bo(o, s.highlightFrontier), p = []; s.iter(c.line, Math.min(s.first + s.size, o.display.viewTo + 500), function(g) { if (c.line >= o.display.viewFrom) { var m = g.styles, y = g.text.length > o.options.maxHighlightLength ? $n(s.mode, c.state) : null, x = Ds(o, g, c, !0); y && (c.state = y), g.styles = x.styles; var O = g.styleClasses, B = x.classes; B ? g.styleClasses = B : O && (g.styleClasses = null); for (var $ = !m || m.length != g.styles.length || O != B && (!O || !B || O.bgClass != B.bgClass || O.textClass != B.textClass), ft = 0; !$ && ft < m.length; ++ft) $ = m[ft] != g.styles[ft]; $ && p.push(c.line), g.stateAfter = c.save(), c.nextLine(); } else g.text.length <= o.options.maxHighlightLength && oo(o, g.text, c), g.stateAfter = c.line % 5 == 0 ? c.save() : null, c.nextLine(); if (+/* @__PURE__ */ new Date() > u) return ls(o, o.options.workDelay), !0; }), s.highlightFrontier = c.line, s.modeFrontier = Math.max(s.modeFrontier, c.line), p.length && fr(o, function() { for (var g = 0; g < p.length; g++) lo(o, p[g], "text"); }); } } var $a = function(o, s, u) { var c = o.display; this.viewport = s, this.visible = Js(c, o.doc, s), this.editorIsHidden = !c.wrapper.offsetWidth, this.wrapperHeight = c.wrapper.clientHeight, this.wrapperWidth = c.wrapper.clientWidth, this.oldDisplayWidth = Nt(o), this.force = u, this.dims = Nl(o), this.events = []; }; function ki(o) { var s = o.display; !s.scrollbarsClipped && s.scroller.offsetWidth && (s.nativeBarWidth = s.scroller.offsetWidth - s.scroller.clientWidth, s.heightForcer.style.height = lt(o) + "px", s.sizer.style.marginBottom = -s.nativeBarWidth + "px", s.sizer.style.borderRightWidth = lt(o) + "px", s.scrollbarsClipped = !0); } function Mp(o) { if (o.hasFocus()) return null; var s = Tt(); if (!s || !Lt(o.display.lineDiv, s)) return null; var u = { activeElt: s }; if (window.getSelection) { var c = window.getSelection(); c.anchorNode && c.extend && Lt(o.display.lineDiv, c.anchorNode) && (u.anchorNode = c.anchorNode, u.anchorOffset = c.anchorOffset, u.focusNode = c.focusNode, u.focusOffset = c.focusOffset); } return u; } function Lp(o) { if (o && o.activeElt && o.activeElt != Tt() && (o.activeElt.focus(), !/^(INPUT|TEXTAREA)$/.test(o.activeElt.nodeName) && o.anchorNode && Lt(document.body, o.anchorNode) && Lt(document.body, o.focusNode))) { var s = window.getSelection(), u = document.createRange(); u.setEnd(o.anchorNode, o.anchorOffset), u.collapse(!1), s.removeAllRanges(), s.addRange(u), s.extend(o.focusNode, o.focusOffset); } } function Ul(o, s) { var u = o.display, c = o.doc; if (s.editorIsHidden) return Zo(o), !1; if (!s.force && s.visible.from >= u.viewFrom && s.visible.to <= u.viewTo && (u.updateLineNumbers == null || u.updateLineNumbers >= u.viewTo) && u.renderedView == u.view && $c(o) == 0) return !1; Zc(o) && (Zo(o), s.dims = Nl(o)); var p = c.first + c.size, g = Math.max(s.visible.from - o.options.viewportMargin, c.first), m = Math.min(p, s.visible.to + o.options.viewportMargin); u.viewFrom < g && g - u.viewFrom < 20 && (g = Math.max(c.first, u.viewFrom)), u.viewTo > m && u.viewTo - m < 20 && (m = Math.min(p, u.viewTo)), Zr && (g = pr(o.doc, g), m = Nr(o.doc, m)); var y = g != u.viewFrom || m != u.viewTo || u.lastWrapHeight != s.wrapperHeight || u.lastWrapWidth != s.wrapperWidth; wp(o, g, m), u.viewOffset = Fr(ve(o.doc, u.viewFrom)), o.display.mover.style.top = u.viewOffset + "px"; var x = $c(o); if (!y && x == 0 && !s.force && u.renderedView == u.view && (u.updateLineNumbers == null || u.updateLineNumbers >= u.viewTo)) return !1; var O = Mp(o); return x > 4 && (u.lineDiv.style.display = "none"), Jc(o, u.updateLineNumbers, s.dims), x > 4 && (u.lineDiv.style.display = ""), u.renderedView = u.view, Lp(O), wt(u.cursorDiv), wt(u.selectionDiv), u.gutters.style.height = u.sizer.style.minHeight = 0, y && (u.lastWrapHeight = s.wrapperHeight, u.lastWrapWidth = s.wrapperWidth, ls(o, 400)), u.updateLineNumbers = null, !0; } function Xc(o, s) { for (var u = s.viewport, c = !0; ; c = !1) { if (c && o.options.lineWrapping && s.oldDisplayWidth != Nt(o)) c && (s.visible = Js(o.display, o.doc, u)); else if (u && u.top != null && (u = { top: Math.min(o.doc.height + Z(o.display) - Gt(o), u.top) }), s.visible = Js(o.display, o.doc, u), s.visible.from >= o.display.viewFrom && s.visible.to <= o.display.viewTo) break; if (!Ul(o, s)) break; Ba(o); var p = ea(o); qs(o), as(o, p), qa(o, p), s.force = !1; } s.signal(o, "update", o), o.display.viewFrom == o.display.reportedViewFrom && o.display.viewTo == o.display.reportedViewTo || (s.signal(o, "viewportChange", o, o.display.viewFrom, o.display.viewTo), o.display.reportedViewFrom = o.display.viewFrom, o.display.reportedViewTo = o.display.viewTo); } function Bl(o, s) { var u = new $a(o, s); if (Ul(o, u)) { Ba(o), Xc(o, u); var c = ea(o); qs(o), as(o, c), qa(o, c), u.finish(); } } function Jc(o, s, u) { var c = o.display, p = o.options.lineNumbers, g = c.lineDiv, m = g.firstChild; function y(Ct) { var Rt = Ct.nextSibling; return P && bt && o.display.currentWheelTarget == Ct ? Ct.style.display = "none" : Ct.parentNode.removeChild(Ct), Rt; } for (var x = c.view, O = c.viewFrom, B = 0; B < x.length; B++) { var $ = x[B]; if (!$.hidden) if ($.node && $.node.parentNode == g) { for (; m != $.node; ) m = y(m); var ft = p && s != null && s <= O && $.lineNumber; $.changes && (be($.changes, "gutter") > -1 && (ft = !1), zs(o, $, O, u)), ft && (wt($.lineNumber), $.lineNumber.appendChild(document.createTextNode(Bo(o.options, O)))), m = $.node.nextSibling; } else { var dt = Bs(o, $, O, u); g.insertBefore(dt, m); } O += $.size; } for (; m; ) m = y(m); } function Wl(o) { var s = o.gutters.offsetWidth; o.sizer.style.marginLeft = s + "px", bn(o, "gutterChanged", o); } function qa(o, s) { o.display.sizer.style.minHeight = s.docHeight + "px", o.display.heightForcer.style.top = s.docHeight + "px", o.display.gutters.style.height = s.docHeight + o.display.barHeight + lt(o) + "px"; } function oa(o) { var s = o.display, u = s.view; if (s.alignWidgets || s.gutters.firstChild && o.options.fixedGutter) { for (var c = Il(s) - s.scroller.scrollLeft + o.doc.scrollLeft, p = s.gutters.offsetWidth, g = c + "px", m = 0; m < u.length; m++) if (!u[m].hidden) { o.options.fixedGutter && (u[m].gutter && (u[m].gutter.style.left = g), u[m].gutterBackground && (u[m].gutterBackground.style.left = g)); var y = u[m].alignable; if (y) for (var x = 0; x < y.length; x++) y[x].style.left = g; } o.options.fixedGutter && (s.gutters.style.left = c + p + "px"); } } function Zc(o) { if (!o.options.lineNumbers) return !1; var s = o.doc, u = Bo(o.options, s.first + s.size - 1), c = o.display; if (u.length != c.lineNumChars) { var p = c.measure.appendChild(gt("div", [gt("div", u)], "CodeMirror-linenumber CodeMirror-gutter-elt")), g = p.firstChild.offsetWidth, m = p.offsetWidth - g; return c.lineGutter.style.width = "", c.lineNumInnerWidth = Math.max(g, c.lineGutter.offsetWidth - m) + 1, c.lineNumWidth = c.lineNumInnerWidth + m, c.lineNumChars = c.lineNumInnerWidth ? u.length : -1, c.lineGutter.style.width = c.lineNumWidth + "px", Wl(o.display), !0; } return !1; } function Ga(o, s) { for (var u = [], c = !1, p = 0; p < o.length; p++) { var g = o[p], m = null; if (typeof g != "string" && (m = g.style, g = g.className), g == "CodeMirror-linenumbers") { if (!s) continue; c = !0; } u.push({ className: g, style: m }); } return s && !c && u.push({ className: "CodeMirror-linenumbers", style: null }), u; } function Qc(o) { var s = o.gutters, u = o.gutterSpecs; wt(s), o.lineGutter = null; for (var c = 0; c < u.length; ++c) { var p = u[c], g = p.className, m = p.style, y = s.appendChild(gt("div", null, "CodeMirror-gutter " + g)); m && (y.style.cssText = m), g == "CodeMirror-linenumbers" && (o.lineGutter = y, y.style.width = (o.lineNumWidth || 1) + "px"); } s.style.display = u.length ? "" : "none", Wl(o); } function cs(o) { Qc(o.display), Qn(o), oa(o); } function tu(o, s, u, c) { var p = this; this.input = u, p.scrollbarFiller = gt("div", null, "CodeMirror-scrollbar-filler"), p.scrollbarFiller.setAttribute("cm-not-content", "true"), p.gutterFiller = gt("div", null, "CodeMirror-gutter-filler"), p.gutterFiller.setAttribute("cm-not-content", "true"), p.lineDiv = N("div", null, "CodeMirror-code"), p.selectionDiv = gt("div", null, null, "position: relative; z-index: 1"), p.cursorDiv = gt("div", null, "CodeMirror-cursors"), p.measure = gt("div", null, "CodeMirror-measure"), p.lineMeasure = gt("div", null, "CodeMirror-measure"), p.lineSpace = N("div", [p.measure, p.lineMeasure, p.selectionDiv, p.cursorDiv, p.lineDiv], null, "position: relative; outline: none"); var g = N("div", [p.lineSpace], "CodeMirror-lines"); p.mover = gt("div", [g], null, "position: relative"), p.sizer = gt("div", [p.mover], "CodeMirror-sizer"), p.sizerWidth = null, p.heightForcer = gt("div", null, null, "position: absolute; height: " + ge + "px; width: 1px;"), p.gutters = gt("div", null, "CodeMirror-gutters"), p.lineGutter = null, p.scroller = gt("div", [p.sizer, p.heightForcer, p.gutters], "CodeMirror-scroll"), p.scroller.setAttribute("tabIndex", "-1"), p.wrapper = gt("div", [p.scrollbarFiller, p.gutterFiller, p.scroller], "CodeMirror"), p.wrapper.setAttribute("translate", "no"), z && k < 8 && (p.gutters.style.zIndex = -1, p.scroller.style.paddingRight = 0), P || at && xt || (p.scroller.draggable = !0), o && (o.appendChild ? o.appendChild(p.wrapper) : o(p.wrapper)), p.viewFrom = p.viewTo = s.first, p.reportedViewFrom = p.reportedViewTo = s.first, p.view = [], p.renderedView = null, p.externalMeasured = null, p.viewOffset = 0, p.lastWrapHeight = p.lastWrapWidth = 0, p.updateLineNumbers = null, p.nativeBarWidth = p.barHeight = p.barWidth = 0, p.scrollbarsClipped = !1, p.lineNumWidth = p.lineNumInnerWidth = p.lineNumChars = null, p.alignWidgets = !1, p.cachedCharWidth = p.cachedTextHeight = p.cachedPaddingH = null, p.maxLine = null, p.maxLineLength = 0, p.maxLineChanged = !1, p.wheelDX = p.wheelDY = p.wheelStartX = p.wheelStartY = null, p.shift = !1, p.selForContextMenu = null, p.activeTouch = null, p.gutterSpecs = Ga(c.gutters, c.lineNumbers), Qc(p), u.init(p); } $a.prototype.signal = function(o, s) { he(o, s) && this.events.push(arguments); }, $a.prototype.finish = function() { for (var o = 0; o < this.events.length; o++) ut.apply(null, this.events[o]); }; var Ka = 0, Mo = null; function eu(o) { var s = o.wheelDeltaX, u = o.wheelDeltaY; return s == null && o.detail && o.axis == o.HORIZONTAL_AXIS && (s = o.detail), u == null && o.detail && o.axis == o.VERTICAL_AXIS ? u = o.detail : u == null && (u = o.wheelDelta), { x: s, y: u }; } function Dp(o) { var s = eu(o); return s.x *= Mo, s.y *= Mo, s; } function nu(o, s) { M && D >= 102 && (o.display.chromeScrollHack == null ? o.display.sizer.style.pointerEvents = "none" : clearTimeout(o.display.chromeScrollHack), o.display.chromeScrollHack = setTimeout(function() { o.display.chromeScrollHack = null, o.display.sizer.style.pointerEvents = ""; }, 100)); var u = eu(s), c = u.x, p = u.y, g = Mo; s.deltaMode === 0 && (c = s.deltaX, p = s.deltaY, g = 1); var m = o.display, y = m.scroller, x = y.scrollWidth > y.clientWidth, O = y.scrollHeight > y.clientHeight; if (c && x || p && O) { if (p && bt && P) { t: for (var B = s.target, $ = m.view; B != y; B = B.parentNode) for (var ft = 0; ft < $.length; ft++) if ($[ft].node == B) { o.display.currentWheelTarget = B; break t; } } if (c && !at && !ot && g != null) return p && O && Qs(o, Math.max(0, y.scrollTop + p * g)), jo(o, Math.max(0, y.scrollLeft + c * g)), (!p || p && O) && We(s), void (m.wheelStartX = null); if (p && g != null) { var dt = p * g, Ct = o.doc.scrollTop, Rt = Ct + m.wrapper.clientHeight; dt < 0 ? Ct = Math.max(0, Ct + dt - 50) : Rt = Math.min(o.doc.height, Rt + dt + 50), Bl(o, { top: Ct, bottom: Rt }); } Ka < 20 && s.deltaMode !== 0 && (m.wheelStartX == null ? (m.wheelStartX = y.scrollLeft, m.wheelStartY = y.scrollTop, m.wheelDX = c, m.wheelDY = p, setTimeout(function() { if (m.wheelStartX != null) { var $t = y.scrollLeft - m.wheelStartX, re = y.scrollTop - m.wheelStartY, le = re && m.wheelDY && re / m.wheelDY || $t && m.wheelDX && $t / m.wheelDX; m.wheelStartX = m.wheelStartY = null, le && (Mo = (Mo * Ka + le) / (Ka + 1), ++Ka); } }, 200)) : (m.wheelDX += c, m.wheelDY += p)); } } z ? Mo = -0.53 : at ? Mo = 15 : M ? Mo = -0.7 : it && (Mo = -0.3333333333333333); var Ur = function(o, s) { this.ranges = o, this.primIndex = s; }; Ur.prototype.primary = function() { return this.ranges[this.primIndex]; }, Ur.prototype.equals = function(o) { if (o == this) return !0; if (o.primIndex != this.primIndex || o.ranges.length != this.ranges.length) return !1; for (var s = 0; s < this.ranges.length; s++) { var u = this.ranges[s], c = o.ranges[s]; if (!G(u.anchor, c.anchor) || !G(u.head, c.head)) return !1; } return !0; }, Ur.prototype.deepCopy = function() { for (var o = [], s = 0; s < this.ranges.length; s++) o[s] = new tn(Mt(this.ranges[s].anchor), Mt(this.ranges[s].head)); return new Ur(o, this.primIndex); }, Ur.prototype.somethingSelected = function() { for (var o = 0; o < this.ranges.length; o++) if (!this.ranges[o].empty()) return !0; return !1; }, Ur.prototype.contains = function(o, s) { s || (s = o); for (var u = 0; u < this.ranges.length; u++) { var c = this.ranges[u]; if (T(s, c.from()) >= 0 && T(o, c.to()) <= 0) return u; } return -1; }; var tn = function(o, s) { this.anchor = o, this.head = s; }; function Qr(o, s, u) { var c = o && o.options.selectionsMayTouch, p = s[u]; s.sort(function(ft, dt) { return T(ft.from(), dt.from()); }), u = be(s, p); for (var g = 1; g < s.length; g++) { var m = s[g], y = s[g - 1], x = T(y.to(), m.from()); if (c && !m.empty() ? x > 0 : x >= 0) { var O = de(y.from(), m.from()), B = te(y.to(), m.to()), $ = y.empty() ? m.from() == m.head : y.from() == y.head; g <= u && --u, s.splice(--g, 2, new tn($ ? B : O, $ ? O : B)); } } return new Ur(s, u); } function Qo(o, s) { return new Ur([new tn(o, s || o)], 0); } function co(o) { return o.text ? Bt(o.from.line + o.text.length - 1, Zt(o.text).length + (o.text.length == 1 ? o.from.ch : 0)) : o.to; } function ru(o, s) { if (T(o, s.from) < 0) return o; if (T(o, s.to) <= 0) return co(s); var u = o.line + s.text.length - (s.to.line - s.from.line) - 1, c = o.ch; return o.line == s.to.line && (c += co(s).ch - s.to.ch), Bt(u, c); } function Ya(o, s) { for (var u = [], c = 0; c < o.sel.ranges.length; c++) { var p = o.sel.ranges[c]; u.push(new tn(ru(p.anchor, s), ru(p.head, s))); } return Qr(o.cm, u, o.sel.primIndex); } function ou(o, s, u) { return o.line == s.line ? Bt(u.line, o.ch - s.ch + u.ch) : Bt(u.line + (o.line - s.line), o.ch); } function ti(o, s, u) { for (var c = [], p = Bt(o.first, 0), g = p, m = 0; m < s.length; m++) { var y = s[m], x = ou(y.from, p, g), O = ou(co(y), p, g); if (p = y.to, g = O, u == "around") { var B = o.sel.ranges[m], $ = T(B.head, B.anchor) < 0; c[m] = new tn($ ? O : x, $ ? x : O); } else c[m] = new tn(x, x); } return new Ur(c, o.sel.primIndex); } function Xa(o) { o.doc.mode = Jr(o.options, o.doc.modeOption), Lo(o); } function Lo(o) { o.doc.iter(function(s) { s.stateAfter && (s.stateAfter = null), s.styles && (s.styles = null); }), o.doc.modeFrontier = o.doc.highlightFrontier = o.doc.first, ls(o, 100), o.state.modeGen++, o.curOp && Qn(o); } function iu(o, s) { return s.from.ch == 0 && s.to.ch == 0 && Zt(s.text) == "" && (!o.cm || o.cm.options.wholeLineUpdateBefore); } function $l(o, s, u, c) { function p(le) { return u ? u[le] : null; } function g(le, Jt, ye) { Hs(le, Jt, ye, c), bn(le, "change", le, s); } function m(le, Jt) { for (var ye = [], me = le; me < Jt; ++me) ye.push(new Vr(O[me], p(me), c)); return ye; } var y = s.from, x = s.to, O = s.text, B = ve(o, y.line), $ = ve(o, x.line), ft = Zt(O), dt = p(O.length - 1), Ct = x.line - y.line; if (s.full) o.insert(0, m(0, O.length)), o.remove(O.length, o.size - O.length); else if (iu(o, s)) { var Rt = m(0, O.length - 1); g($, $.text, dt), Ct && o.remove(y.line, Ct), Rt.length && o.insert(y.line, Rt); } else if (B == $) if (O.length == 1) g(B, B.text.slice(0, y.ch) + ft + B.text.slice(x.ch), dt); else { var $t = m(1, O.length - 1); $t.push(new Vr(ft + B.text.slice(x.ch), dt, c)), g(B, B.text.slice(0, y.ch) + O[0], p(0)), o.insert(y.line + 1, $t); } else if (O.length == 1) g(B, B.text.slice(0, y.ch) + O[0] + $.text.slice(x.ch), p(0)), o.remove(y.line + 1, Ct); else { g(B, B.text.slice(0, y.ch) + O[0], p(0)), g($, ft + $.text.slice(x.ch), dt); var re = m(1, O.length - 1); Ct > 1 && o.remove(y.line + 1, Ct - 1), o.insert(y.line + 1, re); } bn(o, "change", o, s); } function Do(o, s, u) { function c(p, g, m) { if (p.linked) for (var y = 0; y < p.linked.length; ++y) { var x = p.linked[y]; if (x.doc != g) { var O = m && x.sharedHist; u && !O || (s(x.doc, O), c(x.doc, p, O)); } } } c(o, null, !0); } function su(o, s) { if (s.cm) throw new Error("This document is already in use."); o.doc = s, s.cm = o, Fl(o), Xa(o), Ja(o), o.options.direction = s.direction, o.options.lineWrapping || Rs(o), o.options.mode = s.modeOption, Qn(o); } function Ja(o) { (o.doc.direction == "rtl" ? Qt : nt)(o.display.lineDiv, "CodeMirror-rtl"); } function Np(o) { fr(o, function() { Ja(o), Qn(o); }); } function Za(o) { this.done = [], this.undone = [], this.undoDepth = o ? o.undoDepth : 1 / 0, this.lastModTime = this.lastSelTime = 0, this.lastOp = this.lastSelOp = null, this.lastOrigin = this.lastSelOrigin = null, this.generation = this.maxGeneration = o ? o.maxGeneration : 1; } function ql(o, s) { var u = { from: Mt(s.from), to: co(s), text: rr(o, s.from, s.to) }; return Yl(o, u, s.from.line, s.to.line + 1), Do(o, function(c) { return Yl(c, u, s.from.line, s.to.line + 1); }, !0), u; } function au(o) { for (; o.length && Zt(o).ranges; ) o.pop(); } function Ip(o, s) { return s ? (au(o.done), Zt(o.done)) : o.done.length && !Zt(o.done).ranges ? Zt(o.done) : o.done.length > 1 && !o.done[o.done.length - 2].ranges ? (o.done.pop(), Zt(o.done)) : void 0; } function Gl(o, s, u, c) { var p = o.history; p.undone.length = 0; var g, m, y = +/* @__PURE__ */ new Date(); if ((p.lastOp == c || p.lastOrigin == s.origin && s.origin && (s.origin.charAt(0) == "+" && p.lastModTime > y - (o.cm ? o.cm.options.historyEventDelay : 500) || s.origin.charAt(0) == "*")) && (g = Ip(p, p.lastOp == c))) m = Zt(g.changes), T(s.from, s.to) == 0 && T(s.from, m.to) == 0 ? m.to = co(s) : g.changes.push(ql(o, s)); else { var x = Zt(p.done); for (x && x.ranges || Qa(o.sel, p.done), g = { changes: [ql(o, s)], generation: p.generation }, p.done.push(g); p.done.length > p.undoDepth; ) p.done.shift(), p.done[0].ranges || p.done.shift(); } p.done.push(u), p.generation = ++p.maxGeneration, p.lastModTime = p.lastSelTime = y, p.lastOp = p.lastSelOp = c, p.lastOrigin = p.lastSelOrigin = s.origin, m || ut(o, "historyAdded"); } function Kl(o, s, u, c) { var p = s.charAt(0); return p == "*" || p == "+" && u.ranges.length == c.ranges.length && u.somethingSelected() == c.somethingSelected() && /* @__PURE__ */ new Date() - o.history.lastSelTime <= (o.cm ? o.cm.options.historyEventDelay : 500); } function Fp(o, s, u, c) { var p = o.history, g = c && c.origin; u == p.lastSelOp || g && p.lastSelOrigin == g && (p.lastModTime == p.lastSelTime && p.lastOrigin == g || Kl(o, g, Zt(p.done), s)) ? p.done[p.done.length - 1] = s : Qa(s, p.done), p.lastSelTime = +/* @__PURE__ */ new Date(), p.lastSelOrigin = g, p.lastSelOp = u, c && c.clearRedo !== !1 && au(p.undone); } function Qa(o, s) { var u = Zt(s); u && u.ranges && u.equals(o) || s.push(o); } function Yl(o, s, u, c) { var p = s["spans_" + o.id], g = 0; o.iter(Math.max(o.first, u), Math.min(o.first + o.size, c), function(m) { m.markedSpans && ((p || (p = s["spans_" + o.id] = {}))[g] = m.markedSpans), ++g; }); } function Vp(o) { if (!o) return null; for (var s, u = 0; u < o.length; ++u) o[u].marker.explicitlyCleared ? s || (s = o.slice(0, u)) : s && s.push(o[u]); return s ? s.length ? s : null : o; } function Rp(o, s) { var u = s["spans_" + o.id]; if (!u) return null; for (var c = [], p = 0; p < s.text.length; ++p) c.push(Vp(u[p])); return c; } function Xl(o, s) { var u = Rp(o, s), c = $o(o, s); if (!u) return c; if (!c) return u; for (var p = 0; p < u.length; ++p) { var g = u[p], m = c[p]; if (g && m) t: for (var y = 0; y < m.length; ++y) { for (var x = m[y], O = 0; O < g.length; ++O) if (g[O].marker == x.marker) continue t; g.push(x); } else m && (u[p] = m); } return u; } function us(o, s, u) { for (var c = [], p = 0; p < o.length; ++p) { var g = o[p]; if (g.ranges) c.push(u ? Ur.prototype.deepCopy.call(g) : g); else { var m = g.changes, y = []; c.push({ changes: y }); for (var x = 0; x < m.length; ++x) { var O = m[x], B = void 0; if (y.push({ from: O.from, to: O.to, text: O.text }), s) for (var $ in O) (B = $.match(/^spans_(\d+)$/)) && be(s, Number(B[1])) > -1 && (Zt(y)[$] = O[$], delete O[$]); } } } return c; } function Pi(o, s, u, c) { if (c) { var p = o.anchor; if (u) { var g = T(s, p) < 0; g != T(u, p) < 0 ? (p = s, s = u) : g != T(s, u) < 0 && (s = u); } return new tn(p, s); } return new tn(u || s, s); } function tl(o, s, u, c, p) { p == null && (p = o.cm && (o.cm.display.shift || o.extend)), tr(o, new Ur([Pi(o.sel.primary(), s, u, p)], 0), c); } function lu(o, s, u) { for (var c = [], p = o.cm && (o.cm.display.shift || o.extend), g = 0; g < o.sel.ranges.length; g++) c[g] = Pi(o.sel.ranges[g], s[g], null, p); tr(o, Qr(o.cm, c, o.sel.primIndex), u); } function el(o, s, u, c) { var p = o.sel.ranges.slice(0); p[s] = u, tr(o, Qr(o.cm, p, o.sel.primIndex), c); } function Jl(o, s, u, c) { tr(o, Qo(s, u), c); } function cu(o, s, u) { var c = { ranges: s.ranges, update: function(p) { this.ranges = []; for (var g = 0; g < p.length; g++) this.ranges[g] = new tn(oe(o, p[g].anchor), oe(o, p[g].head)); }, origin: u && u.origin }; return ut(o, "beforeSelectionChange", o, c), o.cm && ut(o.cm, "beforeSelectionChange", o.cm, c), c.ranges != s.ranges ? Qr(o.cm, c.ranges, c.ranges.length - 1) : s; } function Zl(o, s, u) { var c = o.history.done, p = Zt(c); p && p.ranges ? (c[c.length - 1] = s, nl(o, s, u)) : tr(o, s, u); } function tr(o, s, u) { nl(o, s, u), Fp(o, o.sel, o.cm ? o.cm.curOp.id : NaN, u); } function nl(o, s, u) { (he(o, "beforeSelectionChange") || o.cm && he(o.cm, "beforeSelectionChange")) && (s = cu(o, s, u)); var c = u && u.bias || (T(s.primary().head, o.sel.primary().head) < 0 ? -1 : 1); ps(o, Ql(o, s, c, !0)), u && u.scroll === !1 || !o.cm || o.cm.getOption("readOnly") == "nocursor" || ss(o.cm); } function ps(o, s) { s.equals(o.sel) || (o.sel = s, o.cm && (o.cm.curOp.updateInput = 1, o.cm.curOp.selectionChanged = !0, Yt(o.cm)), bn(o, "cursorActivity", o)); } function rl(o) { ps(o, Ql(o, o.sel, null, !1)); } function Ql(o, s, u, c) { for (var p, g = 0; g < s.ranges.length; g++) { var m = s.ranges[g], y = s.ranges.length == o.sel.ranges.length && o.sel.ranges[g], x = ia(o, m.anchor, y && y.anchor, u, c), O = m.head == m.anchor ? x : ia(o, m.head, y && y.head, u, c); (p || x != m.anchor || O != m.head) && (p || (p = s.ranges.slice(0, g)), p[g] = new tn(x, O)); } return p ? Qr(o.cm, p, s.primIndex) : s; } function Ei(o, s, u, c, p) { var g = ve(o, s.line); if (g.markedSpans) for (var m = 0; m < g.markedSpans.length; ++m) { var y = g.markedSpans[m], x = y.marker, O = "selectLeft" in x ? !x.selectLeft : x.inclusiveLeft, B = "selectRight" in x ? !x.selectRight : x.inclusiveRight; if ((y.from == null || (O ? y.from <= s.ch : y.from < s.ch)) && (y.to == null || (B ? y.to >= s.ch : y.to > s.ch))) { if (p && (ut(x, "beforeCursorEnter"), x.explicitlyCleared)) { if (g.markedSpans) { --m; continue; } break; } if (!x.atomic) continue; if (u) { var $ = x.find(c < 0 ? 1 : -1), ft = void 0; if ((c < 0 ? B : O) && ($ = fs(o, $, -c, $ && $.line == s.line ? g : null)), $ && $.line == s.line && (ft = T($, u)) && (c < 0 ? ft < 0 : ft > 0)) return Ei(o, $, s, c, p); } var dt = x.find(c < 0 ? -1 : 1); return (c < 0 ? O : B) && (dt = fs(o, dt, c, dt.line == s.line ? g : null)), dt ? Ei(o, dt, s, c, p) : null; } } return s; } function ia(o, s, u, c, p) { var g = c || 1, m = Ei(o, s, u, g, p) || !p && Ei(o, s, u, g, !0) || Ei(o, s, u, -g, p) || !p && Ei(o, s, u, -g, !0); return m || (o.cantEdit = !0, Bt(o.first, 0)); } function fs(o, s, u, c) { return u < 0 && s.ch == 0 ? s.line > o.first ? oe(o, Bt(s.line - 1)) : null : u > 0 && s.ch == (c || ve(o, s.line)).text.length ? s.line < o.first + o.size - 1 ? Bt(s.line + 1, 0) : null : new Bt(s.line, s.ch + u); } function uu(o) { o.setSelection(Bt(o.firstLine(), 0), Bt(o.lastLine()), ce); } function pu(o, s, u) { var c = { canceled: !1, from: s.from, to: s.to, text: s.text, origin: s.origin, cancel: function() { return c.canceled = !0; } }; return u && (c.update = function(p, g, m, y) { p && (c.from = oe(o, p)), g && (c.to = oe(o, g)), m && (c.text = m), y !== void 0 && (c.origin = y); }), ut(o, "beforeChange", o, c), o.cm && ut(o.cm, "beforeChange", o.cm, c), c.canceled ? (o.cm && (o.cm.curOp.updateInput = 2), null) : { from: c.from, to: c.to, text: c.text, origin: c.origin }; } function Ai(o, s, u) { if (o.cm) { if (!o.cm.curOp) return Gn(o.cm, Ai)(o, s, u); if (o.cm.state.suppressEdits) return; } if (!(he(o, "beforeChange") || o.cm && he(o.cm, "beforeChange")) || (s = pu(o, s, !0))) { var c = Jn && !u && Be(o, s.from, s.to); if (c) for (var p = c.length - 1; p >= 0; --p) fu(o, { from: c[p].from, to: c[p].to, text: p ? [""] : s.text, origin: s.origin }); else fu(o, s); } } function fu(o, s) { if (s.text.length != 1 || s.text[0] != "" || T(s.from, s.to) != 0) { var u = Ya(o, s); Gl(o, s, u, o.cm ? o.cm.curOp.id : NaN), sa(o, s, u, $o(o, s)); var c = []; Do(o, function(p, g) { g || be(c, p.history) != -1 || (hu(p.history, s), c.push(p.history)), sa(p, s, null, $o(p, s)); }); } } function ol(o, s, u) { var c = o.cm && o.cm.state.suppressEdits; if (!c || u) { for (var p, g = o.history, m = o.sel, y = s == "undo" ? g.done : g.undone, x = s == "undo" ? g.undone : g.done, O = 0; O < y.length && (p = y[O], u ? !p.ranges || p.equals(o.sel) : p.ranges); O++) ; if (O != y.length) { for (g.lastOrigin = g.lastSelOrigin = null; ; ) { if (!(p = y.pop()).ranges) { if (c) return void y.push(p); break; } if (Qa(p, x), u && !p.equals(o.sel)) return void tr(o, p, { clearRedo: !1 }); m = p; } var B = []; Qa(m, x), x.push({ changes: B, generation: g.generation }), g.generation = p.generation || ++g.maxGeneration; for (var $ = he(o, "beforeChange") || o.cm && he(o.cm, "beforeChange"), ft = function(Rt) { var $t = p.changes[Rt]; if ($t.origin = s, $ && !pu(o, $t, !1)) return y.length = 0, {}; B.push(ql(o, $t)); var re = Rt ? Ya(o, $t) : Zt(y); sa(o, $t, re, Xl(o, $t)), !Rt && o.cm && o.cm.scrollIntoView({ from: $t.from, to: co($t) }); var le = []; Do(o, function(Jt, ye) { ye || be(le, Jt.history) != -1 || (hu(Jt.history, $t), le.push(Jt.history)), sa(Jt, $t, null, Xl(Jt, $t)); }); }, dt = p.changes.length - 1; dt >= 0; --dt) { var Ct = ft(dt); if (Ct) return Ct.v; } } } } function tc(o, s) { if (s != 0 && (o.first += s, o.sel = new Ur(Ae(o.sel.ranges, function(p) { return new tn(Bt(p.anchor.line + s, p.anchor.ch), Bt(p.head.line + s, p.head.ch)); }), o.sel.primIndex), o.cm)) { Qn(o.cm, o.first, o.first - s, s); for (var u = o.cm.display, c = u.viewFrom; c < u.viewTo; c++) lo(o.cm, c, "gutter"); } } function sa(o, s, u, c) { if (o.cm && !o.cm.curOp) return Gn(o.cm, sa)(o, s, u, c); if (s.to.line < o.first) tc(o, s.text.length - 1 - (s.to.line - s.from.line)); else if (!(s.from.line > o.lastLine())) { if (s.from.line < o.first) { var p = s.text.length - 1 - (o.first - s.from.line); tc(o, p), s = { from: Bt(o.first, 0), to: Bt(s.to.line + p, s.to.ch), text: [Zt(s.text)], origin: s.origin }; } var g = o.lastLine(); s.to.line > g && (s = { from: s.from, to: Bt(g, ve(o, g).text.length), text: [s.text[0]], origin: s.origin }), s.removed = rr(o, s.from, s.to), u || (u = Ya(o, s)), o.cm ? Hp(o.cm, s, c) : $l(o, s, c), nl(o, u, ce), o.cantEdit && ia(o, Bt(o.firstLine(), 0)) && (o.cantEdit = !1); } } function Hp(o, s, u) { var c = o.doc, p = o.display, g = s.from, m = s.to, y = !1, x = g.line; o.options.lineWrapping || (x = Ye(Or(ve(c, g.line))), c.iter(x, m.line + 1, function(dt) { if (dt == p.maxLine) return y = !0, !0; })), c.sel.contains(s.from, s.to) > -1 && Yt(o), $l(c, s, u, Wc(o)), o.options.lineWrapping || (c.iter(x, g.line + s.text.length, function(dt) { var Ct = vi(dt); Ct > p.maxLineLength && (p.maxLine = dt, p.maxLineLength = Ct, p.maxLineChanged = !0, y = !1); }), y && (o.curOp.updateMaxLine = !0)), Is(c, g.line), ls(o, 400); var O = s.text.length - (m.line - g.line) - 1; s.full ? Qn(o) : g.line != m.line || s.text.length != 1 || iu(o.doc, s) ? Qn(o, g.line, m.line + 1, O) : lo(o, g.line, "text"); var B = he(o, "changes"), $ = he(o, "change"); if ($ || B) { var ft = { from: g, to: m, text: s.text, removed: s.removed, origin: s.origin }; $ && bn(o, "change", o, ft), B && (o.curOp.changeObjs || (o.curOp.changeObjs = [])).push(ft); } o.display.selForContextMenu = null; } function ds(o, s, u, c, p) { var g; c || (c = u), T(c, u) < 0 && (u = (g = [c, u])[0], c = g[1]), typeof s == "string" && (s = o.splitLines(s)), Ai(o, { from: u, to: c, text: s, origin: p }); } function du(o, s, u, c) { u < o.line ? o.line += c : s < o.line && (o.line = s, o.ch = 0); } function aa(o, s, u, c) { for (var p = 0; p < o.length; ++p) { var g = o[p], m = !0; if (g.ranges) { g.copied || ((g = o[p] = g.deepCopy()).copied = !0); for (var y = 0; y < g.ranges.length; y++) du(g.ranges[y].anchor, s, u, c), du(g.ranges[y].head, s, u, c); } else { for (var x = 0; x < g.changes.length; ++x) { var O = g.changes[x]; if (u < O.from.line) O.from = Bt(O.from.line + c, O.from.ch), O.to = Bt(O.to.line + c, O.to.ch); else if (s <= O.to.line) { m = !1; break; } } m || (o.splice(0, p + 1), p = 0); } } } function hu(o, s) { var u = s.from.line, c = s.to.line, p = s.text.length - (c - u) - 1; aa(o.done, u, c, p), aa(o.undone, u, c, p); } function la(o, s, u, c) { var p = s, g = s; return typeof s == "number" ? g = ve(o, $e(o, s)) : p = Ye(s), p == null ? null : (c(g, p) && o.cm && lo(o.cm, p, u), g); } function ca(o) { this.lines = o, this.parent = null; for (var s = 0, u = 0; u < o.length; ++u) o[u].parent = this, s += o[u].height; this.height = s; } function hs(o) { this.children = o; for (var s = 0, u = 0, c = 0; c < o.length; ++c) { var p = o[c]; s += p.chunkSize(), u += p.height, p.parent = this; } this.size = s, this.height = u, this.parent = null; } tn.prototype.from = function() { return de(this.anchor, this.head); }, tn.prototype.to = function() { return te(this.anchor, this.head); }, tn.prototype.empty = function() { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; }, ca.prototype = { chunkSize: function() { return this.lines.length; }, removeInner: function(o, s) { for (var u = o, c = o + s; u < c; ++u) { var p = this.lines[u]; this.height -= p.height, ja(p), bn(p, "delete"); } this.lines.splice(o, s); }, collapse: function(o) { o.push.apply(o, this.lines); }, insertInner: function(o, s, u) { this.height += u, this.lines = this.lines.slice(0, o).concat(s).concat(this.lines.slice(o)); for (var c = 0; c < s.length; ++c) s[c].parent = this; }, iterN: function(o, s, u) { for (var c = o + s; o < c; ++o) if (u(this.lines[o])) return !0; } }, hs.prototype = { chunkSize: function() { return this.size; }, removeInner: function(o, s) { this.size -= s; for (var u = 0; u < this.children.length; ++u) { var c = this.children[u], p = c.chunkSize(); if (o < p) { var g = Math.min(s, p - o), m = c.height; if (c.removeInner(o, g), this.height -= m - c.height, p == g && (this.children.splice(u--, 1), c.parent = null), (s -= g) == 0) break; o = 0; } else o -= p; } if (this.size - s < 25 && (this.children.length > 1 || !(this.children[0] instanceof ca))) { var y = []; this.collapse(y), this.children = [new ca(y)], this.children[0].parent = this; } }, collapse: function(o) { for (var s = 0; s < this.children.length; ++s) this.children[s].collapse(o); }, insertInner: function(o, s, u) { this.size += s.length, this.height += u; for (var c = 0; c < this.children.length; ++c) { var p = this.children[c], g = p.chunkSize(); if (o <= g) { if (p.insertInner(o, s, u), p.lines && p.lines.length > 50) { for (var m = p.lines.length % 25 + 25, y = m; y < p.lines.length; ) { var x = new ca(p.lines.slice(y, y += 25)); p.height -= x.height, this.children.splice(++c, 0, x), x.parent = this; } p.lines = p.lines.slice(0, m), this.maybeSpill(); } break; } o -= g; } }, maybeSpill: function() { if (!(this.children.length <= 10)) { var o = this; do { var s = new hs(o.children.splice(o.children.length - 5, 5)); if (o.parent) { o.size -= s.size, o.height -= s.height; var u = be(o.parent.children, o); o.parent.children.splice(u + 1, 0, s); } else { var c = new hs(o.children); c.parent = o, o.children = [c, s], o = c; } s.parent = o.parent; } while (o.children.length > 10); o.parent.maybeSpill(); } }, iterN: function(o, s, u) { for (var c = 0; c < this.children.length; ++c) { var p = this.children[c], g = p.chunkSize(); if (o < g) { var m = Math.min(s, g - o); if (p.iterN(o, m, u)) return !0; if ((s -= m) == 0) break; o = 0; } else o -= g; } } }; var ua = function(o, s, u) { if (u) for (var c in u) u.hasOwnProperty(c) && (this[c] = u[c]); this.doc = o, this.node = s; }; function ec(o, s, u) { Fr(s) < (o.curOp && o.curOp.scrollTop || o.doc.scrollTop) && Wa(o, u); } function nc(o, s, u, c) { var p = new ua(o, u, c), g = o.cm; return g && p.noHScroll && (g.display.alignWidgets = !0), la(o, s, "widget", function(m) { var y = m.widgets || (m.widgets = []); if (p.insertAt == null ? y.push(p) : y.splice(Math.min(y.length, Math.max(0, p.insertAt)), 0, p), p.line = m, g && !Ir(o, m)) { var x = Fr(m) < o.scrollTop; or(m, m.height + _(p)), x && Wa(g, p.height), g.curOp.forceUpdate = !0; } return !0; }), g && bn(g, "lineWidgetAdded", g, p, typeof s == "number" ? s : Ye(s)), p; } ua.prototype.clear = function() { var o = this.doc.cm, s = this.line.widgets, u = this.line, c = Ye(u); if (c != null && s) { for (var p = 0; p < s.length; ++p) s[p] == this && s.splice(p--, 1); s.length || (u.widgets = null); var g = _(this); or(u, Math.max(0, u.height - g)), o && (fr(o, function() { ec(o, u, -g), lo(o, c, "widget"); }), bn(o, "lineWidgetCleared", o, this, c)); } }, ua.prototype.changed = function() { var o = this, s = this.height, u = this.doc.cm, c = this.line; this.height = null; var p = _(this) - s; p && (Ir(this.doc, c) || or(c, c.height + p), u && fr(u, function() { u.curOp.forceUpdate = !0, ec(u, c, p), bn(u, "lineWidgetChanged", u, o, Ye(c)); })); }, Re(ua); var rc = 0, ei = function(o, s) { this.lines = [], this.type = s, this.doc = o, this.id = ++rc; }; function gs(o, s, u, c, p) { if (c && c.shared) return zp(o, s, u, c, p); if (o.cm && !o.cm.curOp) return Gn(o.cm, gs)(o, s, u, c, p); var g = new ei(o, p), m = T(s, u); if (c && De(c, g, !1), m > 0 || m == 0 && g.clearWhenEmpty !== !1) return g; if (g.replacedWith && (g.collapsed = !0, g.widgetNode = N("span", [g.replacedWith], "CodeMirror-widget"), c.handleMouseEvents || g.widgetNode.setAttribute("cm-ignore-events", "true"), c.insertLeft && (g.widgetNode.insertLeft = !0)), g.collapsed) { if (yn(o, s.line, s, u, g) || s.line != u.line && yn(o, u.line, s, u, g)) throw new Error("Inserting collapsed marker partially overlapping an existing one"); Fs(); } g.addToHistory && Gl(o, { from: s, to: u, origin: "markText" }, o.sel, NaN); var y, x = s.line, O = o.cm; if (o.iter(x, u.line + 1, function($) { O && g.collapsed && !O.options.lineWrapping && Or($) == O.display.maxLine && (y = !0), g.collapsed && x != s.line && or($, 0), Vs($, new Cr(g, x == s.line ? s.ch : null, x == u.line ? u.ch : null), o.cm && o.cm.curOp), ++x; }), g.collapsed && o.iter(s.line, u.line + 1, function($) { Ir(o, $) && or($, 0); }), g.clearOnEnter && Kt(g, "beforeCursorEnter", function() { return g.clear(); }), g.readOnly && (fi(), (o.history.done.length || o.history.undone.length) && o.clearHistory()), g.collapsed && (g.id = ++rc, g.atomic = !0), O) { if (y && (O.curOp.updateMaxLine = !0), g.collapsed) Qn(O, s.line, u.line + 1); else if (g.className || g.startStyle || g.endStyle || g.css || g.attributes || g.title) for (var B = s.line; B <= u.line; B++) lo(O, B, "text"); g.atomic && rl(O.doc), bn(O, "markerAdded", O, g); } return g; } ei.prototype.clear = function() { if (!this.explicitlyCleared) { var o = this.doc.cm, s = o && !o.curOp; if (s && Oi(o), he(this, "clear")) { var u = this.find(); u && bn(this, "clear", u.from, u.to); } for (var c = null, p = null, g = 0; g < this.lines.length; ++g) { var m = this.lines[g], y = Oo(m.markedSpans, this); o && !this.collapsed ? lo(o, Ye(m), "text") : o && (y.to != null && (p = Ye(m)), y.from != null && (c = Ye(m))), m.markedSpans = di(m.markedSpans, y), y.from == null && this.collapsed && !Ir(this.doc, m) && o && or(m, ao(o.display)); } if (o && this.collapsed && !o.options.lineWrapping) for (var x = 0; x < this.lines.length; ++x) { var O = Or(this.lines[x]), B = vi(O); B > o.display.maxLineLength && (o.display.maxLine = O, o.display.maxLineLength = B, o.display.maxLineChanged = !0); } c != null && o && this.collapsed && Qn(o, c, p + 1), this.lines.length = 0, this.explicitlyCleared = !0, this.atomic && this.doc.cantEdit && (this.doc.cantEdit = !1, o && rl(o.doc)), o && bn(o, "markerCleared", o, this, c, p), s && Ti(o), this.parent && this.parent.clear(); } }, ei.prototype.find = function(o, s) { var u, c; o == null && this.type == "bookmark" && (o = 1); for (var p = 0; p < this.lines.length; ++p) { var g = this.lines[p], m = Oo(g.markedSpans, this); if (m.from != null && (u = Bt(s ? g : Ye(g), m.from), o == -1)) return u; if (m.to != null && (c = Bt(s ? g : Ye(g), m.to), o == 1)) return c; } return u && { from: u, to: c }; }, ei.prototype.changed = function() { var o = this, s = this.find(-1, !0), u = this, c = this.doc.cm; s && c && fr(c, function() { var p = s.line, g = Ye(s.line), m = ts(c, g); if (m && (Hc(m), c.curOp.selectionChanged = c.curOp.forceUpdate = !0), c.curOp.updateMaxLine = !0, !Ir(u.doc, p) && u.height != null) { var y = u.height; u.height = null; var x = _(u) - y; x && or(p, p.height + x); } bn(c, "markerChanged", c, o); }); }, ei.prototype.attachLine = function(o) { if (!this.lines.length && this.doc.cm) { var s = this.doc.cm.curOp; s.maybeHiddenMarkers && be(s.maybeHiddenMarkers, this) != -1 || (s.maybeUnhiddenMarkers || (s.maybeUnhiddenMarkers = [])).push(this); } this.lines.push(o); }, ei.prototype.detachLine = function(o) { if (this.lines.splice(be(this.lines, o), 1), !this.lines.length && this.doc.cm) { var s = this.doc.cm.curOp; (s.maybeHiddenMarkers || (s.maybeHiddenMarkers = [])).push(this); } }, Re(ei); var pa = function(o, s) { this.markers = o, this.primary = s; for (var u = 0; u < o.length; ++u) o[u].parent = this; }; function zp(o, s, u, c, p) { (c = De(c)).shared = !1; var g = [gs(o, s, u, c, p)], m = g[0], y = c.widgetNode; return Do(o, function(x) { y && (c.widgetNode = y.cloneNode(!0)), g.push(gs(x, oe(x, s), oe(x, u), c, p)); for (var O = 0; O < x.linked.length; ++O) if (x.linked[O].isParent) return; m = Zt(g); }), new pa(g, m); } function gu(o) { return o.findMarks(Bt(o.first, 0), o.clipPos(Bt(o.lastLine())), function(s) { return s.parent; }); } function vu(o, s) { for (var u = 0; u < s.length; u++) { var c = s[u], p = c.find(), g = o.clipPos(p.from), m = o.clipPos(p.to); if (T(g, m)) { var y = gs(o, g, m, c.primary, c.primary.type); c.markers.push(y), y.parent = c; } } } function mu(o) { for (var s = function(c) { var p = o[c], g = [p.primary.doc]; Do(p.primary.doc, function(x) { return g.push(x); }); for (var m = 0; m < p.markers.length; m++) { var y = p.markers[m]; be(g, y.doc) == -1 && (y.parent = null, p.markers.splice(m--, 1)); } }, u = 0; u < o.length; u++) s(u); } pa.prototype.clear = function() { if (!this.explicitlyCleared) { this.explicitlyCleared = !0; for (var o = 0; o < this.markers.length; ++o) this.markers[o].clear(); bn(this, "clear"); } }, pa.prototype.find = function(o, s) { return this.primary.find(o, s); }, Re(pa); var Up = 0, Fn = function(o, s, u, c, p) { if (!(this instanceof Fn)) return new Fn(o, s, u, c, p); u == null && (u = 0), hs.call(this, [new ca([new Vr("", null)])]), this.first = u, this.scrollTop = this.scrollLeft = 0, this.cantEdit = !1, this.cleanGeneration = 1, this.modeFrontier = this.highlightFrontier = u; var g = Bt(u, 0); this.sel = Qo(g), this.history = new Za(null), this.id = ++Up, this.modeOption = s, this.lineSep = c, this.direction = p == "rtl" ? "rtl" : "ltr", this.extend = !1, typeof o == "string" && (o = this.splitLines(o)), $l(this, { from: g, to: g, text: o }), tr(this, Qo(g), ce); }; Fn.prototype = vn(hs.prototype, { constructor: Fn, iter: function(o, s, u) { u ? this.iterN(o - this.first, s - o, u) : this.iterN(this.first, this.first + this.size, o); }, insert: function(o, s) { for (var u = 0, c = 0; c < s.length; ++c) u += s[c].height; this.insertInner(o - this.first, s, u); }, remove: function(o, s) { this.removeInner(o - this.first, s); }, getValue: function(o) { var s = Uo(this, this.first, this.first + this.size); return o === !1 ? s : s.join(o || this.lineSeparator()); }, setValue: Kn(function(o) { var s = Bt(this.first, 0), u = this.first + this.size - 1; Ai(this, { from: s, to: Bt(u, ve(this, u).text.length), text: this.splitLines(o), origin: "setValue", full: !0 }, !0), this.cm && Zs(this.cm, 0, 0), tr(this, Qo(s), ce); }), replaceRange: function(o, s, u, c) { ds(this, o, s = oe(this, s), u = u ? oe(this, u) : s, c); }, getRange: function(o, s, u) { var c = rr(this, oe(this, o), oe(this, s)); return u === !1 ? c : u === "" ? c.join("") : c.join(u || this.lineSeparator()); }, getLine: function(o) { var s = this.getLineHandle(o); return s && s.text; }, getLineHandle: function(o) { if (yo(this, o)) return ve(this, o); }, getLineNumber: function(o) { return Ye(o); }, getLineHandleVisualStart: function(o) { return typeof o == "number" && (o = ve(this, o)), Or(o); }, lineCount: function() { return this.size; }, firstLine: function() { return this.first; }, lastLine: function() { return this.first + this.size - 1; }, clipPos: function(o) { return oe(this, o); }, getCursor: function(o) { var s = this.sel.primary(); return o == null || o == "head" ? s.head : o == "anchor" ? s.anchor : o == "end" || o == "to" || o === !1 ? s.to() : s.from(); }, listSelections: function() { return this.sel.ranges; }, somethingSelected: function() { return this.sel.somethingSelected(); }, setCursor: Kn(function(o, s, u) { Jl(this, oe(this, typeof o == "number" ? Bt(o, s || 0) : o), null, u); }), setSelection: Kn(function(o, s, u) { Jl(this, oe(this, o), oe(this, s || o), u); }), extendSelection: Kn(function(o, s, u) { tl(this, oe(this, o), s && oe(this, s), u); }), extendSelections: Kn(function(o, s) { lu(this, Tn(this, o), s); }), extendSelectionsBy: Kn(function(o, s) { lu(this, Tn(this, Ae(this.sel.ranges, o)), s); }), setSelections: Kn(function(o, s, u) { if (o.length) { for (var c = [], p = 0; p < o.length; p++) c[p] = new tn(oe(this, o[p].anchor), oe(this, o[p].head || o[p].anchor)); s == null && (s = Math.min(o.length - 1, this.sel.primIndex)), tr(this, Qr(this.cm, c, s), u); } }), addSelection: Kn(function(o, s, u) { var c = this.sel.ranges.slice(0); c.push(new tn(oe(this, o), oe(this, s || o))), tr(this, Qr(this.cm, c, c.length - 1), u); }), getSelection: function(o) { for (var s, u = this.sel.ranges, c = 0; c < u.length; c++) { var p = rr(this, u[c].from(), u[c].to()); s = s ? s.concat(p) : p; } return o === !1 ? s : s.join(o || this.lineSeparator()); }, getSelections: function(o) { for (var s = [], u = this.sel.ranges, c = 0; c < u.length; c++) { var p = rr(this, u[c].from(), u[c].to()); o !== !1 && (p = p.join(o || this.lineSeparator())), s[c] = p; } return s; }, replaceSelection: function(o, s, u) { for (var c = [], p = 0; p < this.sel.ranges.length; p++) c[p] = o; this.replaceSelections(c, s, u || "+input"); }, replaceSelections: Kn(function(o, s, u) { for (var c = [], p = this.sel, g = 0; g < p.ranges.length; g++) { var m = p.ranges[g]; c[g] = { from: m.from(), to: m.to(), text: this.splitLines(o[g]), origin: u }; } for (var y = s && s != "end" && ti(this, c, s), x = c.length - 1; x >= 0; x--) Ai(this, c[x]); y ? Zl(this, y) : this.cm && ss(this.cm); }), undo: Kn(function() { ol(this, "undo"); }), redo: Kn(function() { ol(this, "redo"); }), undoSelection: Kn(function() { ol(this, "undo", !0); }), redoSelection: Kn(function() { ol(this, "redo", !0); }), setExtending: function(o) { this.extend = o; }, getExtending: function() { return this.extend; }, historySize: function() { for (var o = this.history, s = 0, u = 0, c = 0; c < o.done.length; c++) o.done[c].ranges || ++s; for (var p = 0; p < o.undone.length; p++) o.undone[p].ranges || ++u; return { undo: s, redo: u }; }, clearHistory: function() { var o = this; this.history = new Za(this.history), Do(this, function(s) { return s.history = o.history; }, !0); }, markClean: function() { this.cleanGeneration = this.changeGeneration(!0); }, changeGeneration: function(o) { return o && (this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null), this.history.generation; }, isClean: function(o) { return this.history.generation == (o || this.cleanGeneration); }, getHistory: function() { return { done: us(this.history.done), undone: us(this.history.undone) }; }, setHistory: function(o) { var s = this.history = new Za(this.history); s.done = us(o.done.slice(0), null, !0), s.undone = us(o.undone.slice(0), null, !0); }, setGutterMarker: Kn(function(o, s, u) { return la(this, o, "gutter", function(c) { var p = c.gutterMarkers || (c.gutterMarkers = {}); return p[s] = u, !u && b(p) && (c.gutterMarkers = null), !0; }); }), clearGutter: Kn(function(o) { var s = this; this.iter(function(u) { u.gutterMarkers && u.gutterMarkers[o] && la(s, u, "gutter", function() { return u.gutterMarkers[o] = null, b(u.gutterMarkers) && (u.gutterMarkers = null), !0; }); }); }), lineInfo: function(o) { var s; if (typeof o == "number") { if (!yo(this, o) || (s = o, !(o = ve(this, o)))) return null; } else if ((s = Ye(o)) == null) return null; return { line: s, handle: o, text: o.text, gutterMarkers: o.gutterMarkers, textClass: o.textClass, bgClass: o.bgClass, wrapClass: o.wrapClass, widgets: o.widgets }; }, addLineClass: Kn(function(o, s, u) { return la(this, o, s == "gutter" ? "gutter" : "class", function(c) { var p = s == "text" ? "textClass" : s == "background" ? "bgClass" : s == "gutter" ? "gutterClass" : "wrapClass"; if (c[p]) { if (V(u).test(c[p])) return !1; c[p] += " " + u; } else c[p] = u; return !0; }); }), removeLineClass: Kn(function(o, s, u) { return la(this, o, s == "gutter" ? "gutter" : "class", function(c) { var p = s == "text" ? "textClass" : s == "background" ? "bgClass" : s == "gutter" ? "gutterClass" : "wrapClass", g = c[p]; if (!g) return !1; if (u == null) c[p] = null; else { var m = g.match(V(u)); if (!m) return !1; var y = m.index + m[0].length; c[p] = g.slice(0, m.index) + (m.index && y != g.length ? " " : "") + g.slice(y) || null; } return !0; }); }), addLineWidget: Kn(function(o, s, u) { return nc(this, o, s, u); }), removeLineWidget: function(o) { o.clear(); }, markText: function(o, s, u) { return gs(this, oe(this, o), oe(this, s), u, u && u.type || "range"); }, setBookmark: function(o, s) { var u = { replacedWith: s && (s.nodeType == null ? s.widget : s), insertLeft: s && s.insertLeft, clearWhenEmpty: !1, shared: s && s.shared, handleMouseEvents: s && s.handleMouseEvents }; return gs(this, o = oe(this, o), o, u, "bookmark"); }, findMarksAt: function(o) { var s = [], u = ve(this, (o = oe(this, o)).line).markedSpans; if (u) for (var c = 0; c < u.length; ++c) { var p = u[c]; (p.from == null || p.from <= o.ch) && (p.to == null || p.to >= o.ch) && s.push(p.marker.parent || p.marker); } return s; }, findMarks: function(o, s, u) { o = oe(this, o), s = oe(this, s); var c = [], p = o.line; return this.iter(o.line, s.line + 1, function(g) { var m = g.markedSpans; if (m) for (var y = 0; y < m.length; y++) { var x = m[y]; x.to != null && p == o.line && o.ch >= x.to || x.from == null && p != o.line || x.from != null && p == s.line && x.from >= s.ch || u && !u(x.marker) || c.push(x.marker.parent || x.marker); } ++p; }), c; }, getAllMarks: function() { var o = []; return this.iter(function(s) { var u = s.markedSpans; if (u) for (var c = 0; c < u.length; ++c) u[c].from != null && o.push(u[c].marker); }), o; }, posFromIndex: function(o) { var s, u = this.first, c = this.lineSeparator().length; return this.iter(function(p) { var g = p.text.length + c; if (g > o) return s = o, !0; o -= g, ++u; }), oe(this, Bt(u, s)); }, indexFromPos: function(o) { var s = (o = oe(this, o)).ch; if (o.line < this.first || o.ch < 0) return 0; var u = this.lineSeparator().length; return this.iter(this.first, o.line, function(c) { s += c.text.length + u; }), s; }, copy: function(o) { var s = new Fn(Uo(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction); return s.scrollTop = this.scrollTop, s.scrollLeft = this.scrollLeft, s.sel = this.sel, s.extend = !1, o && (s.history.undoDepth = this.history.undoDepth, s.setHistory(this.getHistory())), s; }, linkedDoc: function(o) { o || (o = {}); var s = this.first, u = this.first + this.size; o.from != null && o.from > s && (s = o.from), o.to != null && o.to < u && (u = o.to); var c = new Fn(Uo(this, s, u), o.mode || this.modeOption, s, this.lineSep, this.direction); return o.sharedHist && (c.history = this.history), (this.linked || (this.linked = [])).push({ doc: c, sharedHist: o.sharedHist }), c.linked = [{ doc: this, isParent: !0, sharedHist: o.sharedHist }], vu(c, gu(this)), c; }, unlinkDoc: function(o) { if (o instanceof wn && (o = o.doc), this.linked) { for (var s = 0; s < this.linked.length; ++s) if (this.linked[s].doc == o) { this.linked.splice(s, 1), o.unlinkDoc(this), mu(gu(this)); break; } } if (o.history == this.history) { var u = [o.id]; Do(o, function(c) { return u.push(c.id); }, !0), o.history = new Za(null), o.history.done = us(this.history.done, u), o.history.undone = us(this.history.undone, u); } }, iterLinkedDocs: function(o) { Do(this, o); }, getMode: function() { return this.mode; }, getEditor: function() { return this.cm; }, splitLines: function(o) { return this.lineSep ? o.split(this.lineSep) : _o(o); }, lineSeparator: function() { return this.lineSep || ` `; }, setDirection: Kn(function(o) { o != "rtl" && (o = "ltr"), o != this.direction && (this.direction = o, this.iter(function(s) { return s.order = null; }), this.cm && Np(this.cm)); }) }), Fn.prototype.eachLine = Fn.prototype.iter; var yu = 0; function Bp(o) { var s = this; if (wu(s), !yt(s, o) && !A(s.display, o)) { We(o), z && (yu = +/* @__PURE__ */ new Date()); var u = wi(s, o, !0), c = o.dataTransfer.files; if (u && !s.isReadOnly()) if (c && c.length && window.FileReader && window.File) for (var p = c.length, g = Array(p), m = 0, y = function() { ++m == p && Gn(s, function() { var dt = { from: u = oe(s.doc, u), to: u, text: s.doc.splitLines(g.filter(function(Ct) { return Ct != null; }).join(s.doc.lineSeparator())), origin: "paste" }; Ai(s.doc, dt), Zl(s.doc, Qo(oe(s.doc, u), oe(s.doc, co(dt)))); })(); }, x = function(dt, Ct) { if (s.options.allowDropFileTypes && be(s.options.allowDropFileTypes, dt.type) == -1) y(); else { var Rt = new FileReader(); Rt.onerror = function() { return y(); }, Rt.onload = function() { var $t = Rt.result; /[\x00-\x08\x0e-\x1f]{2}/.test($t) || (g[Ct] = $t), y(); }, Rt.readAsText(dt); } }, O = 0; O < c.length; O++) x(c[O], O); else { if (s.state.draggingText && s.doc.sel.contains(u) > -1) return s.state.draggingText(o), void setTimeout(function() { return s.display.input.focus(); }, 20); try { var B = o.dataTransfer.getData("Text"); if (B) { var $; if (s.state.draggingText && !s.state.draggingText.copy && ($ = s.listSelections()), nl(s.doc, Qo(u, u)), $) for (var ft = 0; ft < $.length; ++ft) ds(s.doc, "", $[ft].anchor, $[ft].head, "drag"); s.replaceSelection(B, "around", "paste"), s.display.input.focus(); } } catch { } } } } function bu(o, s) { if (z && (!o.state.draggingText || +/* @__PURE__ */ new Date() - yu < 100)) Ne(s); else if (!yt(o, s) && !A(o.display, s) && (s.dataTransfer.setData("Text", o.getSelection()), s.dataTransfer.effectAllowed = "copyMove", s.dataTransfer.setDragImage && !it)) { var u = gt("img", null, null, "position: fixed; left: 0; top: 0;"); u.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", ot && (u.width = u.height = 1, o.display.wrapper.appendChild(u), u._top = u.offsetTop), s.dataTransfer.setDragImage(u, 0, 0), ot && u.parentNode.removeChild(u); } } function Wp(o, s) { var u = wi(o, s); if (u) { var c = document.createDocumentFragment(); Ks(o, u, c), o.display.dragCursor || (o.display.dragCursor = gt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"), o.display.lineSpace.insertBefore(o.display.dragCursor, o.display.cursorDiv)), rt(o.display.dragCursor, c); } } function wu(o) { o.display.dragCursor && (o.display.lineSpace.removeChild(o.display.dragCursor), o.display.dragCursor = null); } function oc(o) { if (document.getElementsByClassName) { for (var s = document.getElementsByClassName("CodeMirror"), u = [], c = 0; c < s.length; c++) { var p = s[c].CodeMirror; p && u.push(p); } u.length && u[0].operation(function() { for (var g = 0; g < u.length; g++) o(u[g]); }); } } var _u = !1; function Sn() { _u || (xu(), _u = !0); } function xu() { var o; Kt(window, "resize", function() { o == null && (o = setTimeout(function() { o = null, oc(ic); }, 100)); }), Kt(window, "blur", function() { return oc(xi); }); } function ic(o) { var s = o.display; s.cachedCharWidth = s.cachedTextHeight = s.cachedPaddingH = null, s.scrollbarsClipped = !1, o.setSize(); } for (var to = { 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" }, ji = 0; ji < 10; ji++) to[ji + 48] = to[ji + 96] = String(ji); for (var il = 65; il <= 90; il++) to[il] = String.fromCharCode(il); for (var vs = 1; vs <= 12; vs++) to[vs + 111] = to[vs + 63235] = "F" + vs; var uo = {}; function Cu(o) { var s, u, c, p, g = o.split(/-(?!$)/); o = g[g.length - 1]; for (var m = 0; m < g.length - 1; m++) { var y = g[m]; if (/^(cmd|meta|m)$/i.test(y)) p = !0; else if (/^a(lt)?$/i.test(y)) s = !0; else if (/^(c|ctrl|control)$/i.test(y)) u = !0; else { if (!/^s(hift)?$/i.test(y)) throw new Error("Unrecognized modifier name: " + y); c = !0; } } return s && (o = "Alt-" + o), u && (o = "Ctrl-" + o), p && (o = "Cmd-" + o), c && (o = "Shift-" + o), o; } function sl(o) { var s = {}; for (var u in o) if (o.hasOwnProperty(u)) { var c = o[u]; if (/^(name|fallthrough|(de|at)tach)$/.test(u)) continue; if (c == "...") { delete o[u]; continue; } for (var p = Ae(u.split(" "), Cu), g = 0; g < p.length; g++) { var m = void 0, y = void 0; g == p.length - 1 ? (y = p.join(" "), m = c) : (y = p.slice(0, g + 1).join(" "), m = "..."); var x = s[y]; if (x) { if (x != m) throw new Error("Inconsistent bindings for " + y); } else s[y] = m; } delete o[u]; } for (var O in s) o[O] = s[O]; return o; } function Mi(o, s, u, c) { var p = (s = No(s)).call ? s.call(o, c) : s[o]; if (p === !1) return "nothing"; if (p === "...") return "multi"; if (p != null && u(p)) return "handled"; if (s.fallthrough) { if (Object.prototype.toString.call(s.fallthrough) != "[object Array]") return Mi(o, s.fallthrough, u, c); for (var g = 0; g < s.fallthrough.length; g++) { var m = Mi(o, s.fallthrough[g], u, c); if (m) return m; } } } function sc(o) { var s = typeof o == "string" ? o : to[o.keyCode]; return s == "Ctrl" || s == "Alt" || s == "Shift" || s == "Mod"; } function Su(o, s, u) { var c = o; return s.altKey && c != "Alt" && (o = "Alt-" + o), (Q ? s.metaKey : s.ctrlKey) && c != "Ctrl" && (o = "Ctrl-" + o), (Q ? s.ctrlKey : s.metaKey) && c != "Mod" && (o = "Cmd-" + o), !u && s.shiftKey && c != "Shift" && (o = "Shift-" + o), o; } function Ou(o, s) { if (ot && o.keyCode == 34 && o.char) return !1; var u = to[o.keyCode]; return u != null && !o.altGraphKey && (o.keyCode == 3 && o.code && (u = o.code), Su(u, o, s)); } function No(o) { return typeof o == "string" ? uo[o] : o; } function ni(o, s) { for (var u = o.doc.sel.ranges, c = [], p = 0; p < u.length; p++) { for (var g = s(u[p]); c.length && T(g.from, Zt(c).to) <= 0; ) { var m = c.pop(); if (T(m.from, g.from) < 0) { g.from = m.from; break; } } c.push(g); } fr(o, function() { for (var y = c.length - 1; y >= 0; y--) ds(o.doc, "", c[y].from, c[y].to, "+delete"); ss(o); }); } function fa(o, s, u) { var c = ht(o.text, s + u, u); return c < 0 || c > o.text.length ? null : c; } function al(o, s, u) { var c = fa(o, s.ch, u); return c == null ? null : new Bt(s.line, c, u < 0 ? "after" : "before"); } function ll(o, s, u, c, p) { if (o) { s.doc.direction == "rtl" && (p = -p); var g = ze(u, s.doc.direction); if (g) { var m, y = p < 0 ? Zt(g) : g[0], x = p < 0 == (y.level == 1) ? "after" : "before"; if (y.level > 0 || s.doc.direction == "rtl") { var O = Eo(s, u); m = p < 0 ? u.text.length - 1 : 0; var B = Hr(s, O, m).top; m = kt(function($) { return Hr(s, O, $).top == B; }, p < 0 == (y.level == 1) ? y.from : y.to - 1, m), x == "before" && (m = fa(u, m, 1)); } else m = p < 0 ? y.to : y.from; return new Bt(c, m, x); } } return new Bt(c, p < 0 ? u.text.length : 0, p < 0 ? "before" : "after"); } function Tu(o, s, u, c) { var p = ze(s, o.doc.direction); if (!p) return al(s, u, c); u.ch >= s.text.length ? (u.ch = s.text.length, u.sticky = "before") : u.ch <= 0 && (u.ch = 0, u.sticky = "after"); var g = ke(p, u.ch, u.sticky), m = p[g]; if (o.doc.direction == "ltr" && m.level % 2 == 0 && (c > 0 ? m.to > u.ch : m.from < u.ch)) return al(s, u, c); var y, x = function(re, le) { return fa(s, re instanceof Bt ? re.ch : re, le); }, O = function(re) { return o.options.lineWrapping ? (y = y || Eo(o, s), Bc(o, s, y, re)) : { begin: 0, end: s.text.length }; }, B = O(u.sticky == "before" ? x(u, -1) : u.ch); if (o.doc.direction == "rtl" || m.level == 1) { var $ = m.level == 1 == c < 0, ft = x(u, $ ? 1 : -1); if (ft != null && ($ ? ft <= m.to && ft <= B.end : ft >= m.from && ft >= B.begin)) { var dt = $ ? "before" : "after"; return new Bt(u.line, ft, dt); } } var Ct = function(re, le, Jt) { for (var ye = function(an, gr) { return gr ? new Bt(u.line, x(an, 1), "before") : new Bt(u.line, an, "after"); }; re >= 0 && re < p.length; re += le) { var me = p[re], Ce = le > 0 == (me.level != 1), sn = Ce ? Jt.begin : x(Jt.end, -1); if (me.from <= sn && sn < me.to || (sn = Ce ? me.from : x(me.to, -1), Jt.begin <= sn && sn < Jt.end)) return ye(sn, Ce); } }, Rt = Ct(g + c, c, B); if (Rt) return Rt; var $t = c > 0 ? B.end : x(B.begin, -1); return $t == null || c > 0 && $t == s.text.length || !(Rt = Ct(c > 0 ? 0 : p.length - 1, c, O($t))) ? null : Rt; } uo.basic = { Left: "goCharLeft", Right: "goCharRight", Up: "goLineUp", Down: "goLineDown", End: "goLineEnd", Home: "goLineStartSmart", PageUp: "goPageUp", PageDown: "goPageDown", Delete: "delCharAfter", Backspace: "delCharBefore", "Shift-Backspace": "delCharBefore", Tab: "defaultTab", "Shift-Tab": "indentAuto", Enter: "newlineAndIndent", Insert: "toggleOverwrite", Esc: "singleSelection" }, uo.pcDefault = { "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", fallthrough: "basic" }, uo.emacsy = { "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", "Ctrl-O": "openLine" }, uo.macDefault = { "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", fallthrough: ["basic", "emacsy"] }, uo.default = bt ? uo.macDefault : uo.pcDefault; var ms = { selectAll: uu, singleSelection: function(o) { return o.setSelection(o.getCursor("anchor"), o.getCursor("head"), ce); }, killLine: function(o) { return ni(o, function(s) { if (s.empty()) { var u = ve(o.doc, s.head.line).text.length; return s.head.ch == u && s.head.line < o.lastLine() ? { from: s.head, to: Bt(s.head.line + 1, 0) } : { from: s.head, to: Bt(s.head.line, u) }; } return { from: s.from(), to: s.to() }; }); }, deleteLine: function(o) { return ni(o, function(s) { return { from: Bt(s.from().line, 0), to: oe(o.doc, Bt(s.to().line + 1, 0)) }; }); }, delLineLeft: function(o) { return ni(o, function(s) { return { from: Bt(s.from().line, 0), to: s.from() }; }); }, delWrappedLineLeft: function(o) { return ni(o, function(s) { var u = o.charCoords(s.head, "div").top + 5; return { from: o.coordsChar({ left: 0, top: u }, "div"), to: s.from() }; }); }, delWrappedLineRight: function(o) { return ni(o, function(s) { var u = o.charCoords(s.head, "div").top + 5, c = o.coordsChar({ left: o.display.lineDiv.offsetWidth + 100, top: u }, "div"); return { from: s.from(), to: c }; }); }, undo: function(o) { return o.undo(); }, redo: function(o) { return o.redo(); }, undoSelection: function(o) { return o.undoSelection(); }, redoSelection: function(o) { return o.redoSelection(); }, goDocStart: function(o) { return o.extendSelection(Bt(o.firstLine(), 0)); }, goDocEnd: function(o) { return o.extendSelection(Bt(o.lastLine())); }, goLineStart: function(o) { return o.extendSelectionsBy(function(s) { return da(o, s.head.line); }, { origin: "+move", bias: 1 }); }, goLineStartSmart: function(o) { return o.extendSelectionsBy(function(s) { return Pu(o, s.head); }, { origin: "+move", bias: 1 }); }, goLineEnd: function(o) { return o.extendSelectionsBy(function(s) { return ku(o, s.head.line); }, { origin: "+move", bias: -1 }); }, goLineRight: function(o) { return o.extendSelectionsBy(function(s) { var u = o.cursorCoords(s.head, "div").top + 5; return o.coordsChar({ left: o.display.lineDiv.offsetWidth + 100, top: u }, "div"); }, Xt); }, goLineLeft: function(o) { return o.extendSelectionsBy(function(s) { var u = o.cursorCoords(s.head, "div").top + 5; return o.coordsChar({ left: 0, top: u }, "div"); }, Xt); }, goLineLeftSmart: function(o) { return o.extendSelectionsBy(function(s) { var u = o.cursorCoords(s.head, "div").top + 5, c = o.coordsChar({ left: 0, top: u }, "div"); return c.ch < o.getLine(c.line).search(/\S/) ? Pu(o, s.head) : c; }, Xt); }, goLineUp: function(o) { return o.moveV(-1, "line"); }, goLineDown: function(o) { return o.moveV(1, "line"); }, goPageUp: function(o) { return o.moveV(-1, "page"); }, goPageDown: function(o) { return o.moveV(1, "page"); }, goCharLeft: function(o) { return o.moveH(-1, "char"); }, goCharRight: function(o) { return o.moveH(1, "char"); }, goColumnLeft: function(o) { return o.moveH(-1, "column"); }, goColumnRight: function(o) { return o.moveH(1, "column"); }, goWordLeft: function(o) { return o.moveH(-1, "word"); }, goGroupRight: function(o) { return o.moveH(1, "group"); }, goGroupLeft: function(o) { return o.moveH(-1, "group"); }, goWordRight: function(o) { return o.moveH(1, "word"); }, delCharBefore: function(o) { return o.deleteH(-1, "codepoint"); }, delCharAfter: function(o) { return o.deleteH(1, "char"); }, delWordBefore: function(o) { return o.deleteH(-1, "word"); }, delWordAfter: function(o) { return o.deleteH(1, "word"); }, delGroupBefore: function(o) { return o.deleteH(-1, "group"); }, delGroupAfter: function(o) { return o.deleteH(1, "group"); }, indentAuto: function(o) { return o.indentSelection("smart"); }, indentMore: function(o) { return o.indentSelection("add"); }, indentLess: function(o) { return o.indentSelection("subtract"); }, insertTab: function(o) { return o.replaceSelection(" "); }, insertSoftTab: function(o) { for (var s = [], u = o.listSelections(), c = o.options.tabSize, p = 0; p < u.length; p++) { var g = u[p].from(), m = xe(o.getLine(g.line), g.ch, c); s.push(ae(c - m % c)); } o.replaceSelections(s); }, defaultTab: function(o) { o.somethingSelected() ? o.indentSelection("add") : o.execCommand("insertTab"); }, transposeChars: function(o) { return fr(o, function() { for (var s = o.listSelections(), u = [], c = 0; c < s.length; c++) if (s[c].empty()) { var p = s[c].head, g = ve(o.doc, p.line).text; if (g) { if (p.ch == g.length && (p = new Bt(p.line, p.ch - 1)), p.ch > 0) p = new Bt(p.line, p.ch + 1), o.replaceRange(g.charAt(p.ch - 1) + g.charAt(p.ch - 2), Bt(p.line, p.ch - 2), p, "+transpose"); else if (p.line > o.doc.first) { var m = ve(o.doc, p.line - 1).text; m && (p = new Bt(p.line, 1), o.replaceRange(g.charAt(0) + o.doc.lineSeparator() + m.charAt(m.length - 1), Bt(p.line - 1, m.length - 1), p, "+transpose")); } } u.push(new tn(p, p)); } o.setSelections(u); }); }, newlineAndIndent: function(o) { return fr(o, function() { for (var s = o.listSelections(), u = s.length - 1; u >= 0; u--) o.replaceRange(o.doc.lineSeparator(), s[u].anchor, s[u].head, "+input"); s = o.listSelections(); for (var c = 0; c < s.length; c++) o.indentLine(s[c].from().line, null, !0); ss(o); }); }, openLine: function(o) { return o.replaceSelection(` `, "start"); }, toggleOverwrite: function(o) { return o.toggleOverwrite(); } }; function da(o, s) { var u = ve(o.doc, s), c = Or(u); return c != u && (s = Ye(c)), ll(!0, o, c, s, 1); } function ku(o, s) { var u = ve(o.doc, s), c = $i(u); return c != u && (s = Ye(c)), ll(!0, o, u, s, -1); } function Pu(o, s) { var u = da(o, s.line), c = ve(o.doc, u.line), p = ze(c, o.doc.direction); if (!p || p[0].level == 0) { var g = Math.max(u.ch, c.text.search(/\S/)), m = s.line == u.line && s.ch <= g && s.ch; return Bt(u.line, m ? 0 : g, u.sticky); } return u; } function cl(o, s, u) { if (typeof s == "string" && !(s = ms[s])) return !1; o.display.input.ensurePolled(); var c = o.display.shift, p = !1; try { o.isReadOnly() && (o.state.suppressEdits = !0), u && (o.display.shift = !1), p = s(o) != pe; } finally { o.display.shift = c, o.state.suppressEdits = !1; } return p; } function $p(o, s, u) { for (var c = 0; c < o.state.keyMaps.length; c++) { var p = Mi(s, o.state.keyMaps[c], u, o); if (p) return p; } return o.options.extraKeys && Mi(s, o.options.extraKeys, u, o) || Mi(s, o.options.keyMap, u, o); } var qp = new Te(); function ha(o, s, u, c) { var p = o.state.keySeq; if (p) { if (sc(s)) return "handled"; if (/\'$/.test(s) ? o.state.keySeq = null : qp.set(50, function() { o.state.keySeq == p && (o.state.keySeq = null, o.display.input.reset()); }), ys(o, p + " " + s, u, c)) return !0; } return ys(o, s, u, c); } function ys(o, s, u, c) { var p = $p(o, s, c); return p == "multi" && (o.state.keySeq = s), p == "handled" && bn(o, "keyHandled", o, s, u), p != "handled" && p != "multi" || (We(u), is(o)), !!p; } function ac(o, s) { var u = Ou(s, !0); return !!u && (s.shiftKey && !o.state.keySeq ? ha(o, "Shift-" + u, s, function(c) { return cl(o, c, !0); }) || ha(o, u, s, function(c) { if (typeof c == "string" ? /^go[A-Z]/.test(c) : c.motion) return cl(o, c); }) : ha(o, u, s, function(c) { return cl(o, c); })); } function Io(o, s, u) { return ha(o, "'" + u + "'", s, function(c) { return cl(o, c, !0); }); } var lc = null; function cc(o) { var s = this; if (!(o.target && o.target != s.display.input.getField() || (s.curOp.focus = Tt(), yt(s, o)))) { z && k < 11 && o.keyCode == 27 && (o.returnValue = !1); var u = o.keyCode; s.display.shift = u == 16 || o.shiftKey; var c = ac(s, o); ot && (lc = c ? u : null, c || u != 88 || xo || !(bt ? o.metaKey : o.ctrlKey) || s.replaceSelection("", null, "cut")), at && !bt && !c && u == 46 && o.shiftKey && !o.ctrlKey && document.execCommand && document.execCommand("cut"), u != 18 || /\bCodeMirror-crosshair\b/.test(s.display.lineDiv.className) || Eu(s); } } function Eu(o) { var s = o.display.lineDiv; function u(c) { c.keyCode != 18 && c.altKey || (nt(s, "CodeMirror-crosshair"), tt(document, "keyup", u), tt(document, "mouseover", u)); } Qt(s, "CodeMirror-crosshair"), Kt(document, "keyup", u), Kt(document, "mouseover", u); } function Au(o) { o.keyCode == 16 && (this.doc.sel.shift = !1), yt(this, o); } function ju(o) { var s = this; if (!(o.target && o.target != s.display.input.getField() || A(s.display, o) || yt(s, o) || o.ctrlKey && !o.altKey || bt && o.metaKey)) { var u = o.keyCode, c = o.charCode; if (ot && u == lc) return lc = null, void We(o); if (!ot || o.which && !(o.which < 10) || !ac(s, o)) { var p = String.fromCharCode(c ?? u); p != "\b" && (Io(s, o, p) || s.display.input.onKeyPress(o)); } } } var ga, va, Gp = 400, ul = function(o, s, u) { this.time = o, this.pos = s, this.button = u; }; function pl(o, s) { var u = +/* @__PURE__ */ new Date(); return va && va.compare(u, o, s) ? (ga = va = null, "triple") : ga && ga.compare(u, o, s) ? (va = new ul(u, o, s), ga = null, "double") : (ga = new ul(u, o, s), va = null, "single"); } function Mu(o) { var s = this, u = s.display; if (!(yt(s, o) || u.activeTouch && u.input.supportsTouch())) { if (u.input.ensurePolled(), u.shift = o.shiftKey, A(u, o)) P || (u.scroller.draggable = !1, setTimeout(function() { return u.scroller.draggable = !0; }, 100)); else if (!pc(s, o)) { var c = wi(s, o), p = Yn(o), g = c ? pl(c, p) : "single"; window.focus(), p == 1 && s.state.selectingText && s.state.selectingText(o), c && Lu(s, p, c, g, o) || (p == 1 ? c ? Kp(s, c, g, o) : Ar(o) == u.scroller && We(o) : p == 2 ? (c && tl(s.doc, c), setTimeout(function() { return u.input.focus(); }, 20)) : p == 3 && (j ? s.display.input.onContextMenu(o) : Vl(s))); } } } function Lu(o, s, u, c, p) { var g = "Click"; return c == "double" ? g = "Double" + g : c == "triple" && (g = "Triple" + g), ha(o, Su(g = (s == 1 ? "Left" : s == 2 ? "Middle" : "Right") + g, p), p, function(m) { if (typeof m == "string" && (m = ms[m]), !m) return !1; var y = !1; try { o.isReadOnly() && (o.state.suppressEdits = !0), y = m(o, u) != pe; } finally { o.state.suppressEdits = !1; } return y; }); } function Du(o, s, u) { var c = o.getOption("configureMouse"), p = c ? c(o, s, u) : {}; if (p.unit == null) { var g = Wt ? u.shiftKey && u.metaKey : u.altKey; p.unit = g ? "rectangle" : s == "single" ? "char" : s == "double" ? "word" : "line"; } return (p.extend == null || o.doc.extend) && (p.extend = o.doc.extend || u.shiftKey), p.addNew == null && (p.addNew = bt ? u.metaKey : u.ctrlKey), p.moveOnDrag == null && (p.moveOnDrag = !(bt ? u.altKey : u.ctrlKey)), p; } function Kp(o, s, u, c) { z ? setTimeout(_e(qc, o), 0) : o.curOp.focus = Tt(); var p, g = Du(o, u, c), m = o.doc.sel; o.options.dragDrop && _n && !o.isReadOnly() && u == "single" && (p = m.contains(s)) > -1 && (T((p = m.ranges[p]).from(), s) < 0 || s.xRel > 0) && (T(p.to(), s) > 0 || s.xRel < 0) ? Yp(o, c, s, g) : ma(o, c, s, g); } function Yp(o, s, u, c) { var p = o.display, g = !1, m = Gn(o, function(O) { P && (p.scroller.draggable = !1), o.state.draggingText = !1, o.state.delayingBlurEvent && (o.hasFocus() ? o.state.delayingBlurEvent = !1 : Vl(o)), tt(p.wrapper.ownerDocument, "mouseup", m), tt(p.wrapper.ownerDocument, "mousemove", y), tt(p.scroller, "dragstart", x), tt(p.scroller, "drop", m), g || (We(O), c.addNew || tl(o.doc, u, null, null, c.extend), P && !it || z && k == 9 ? setTimeout(function() { p.wrapper.ownerDocument.body.focus({ preventScroll: !0 }), p.input.focus(); }, 20) : p.input.focus()); }), y = function(O) { g = g || Math.abs(s.clientX - O.clientX) + Math.abs(s.clientY - O.clientY) >= 10; }, x = function() { return g = !0; }; P && (p.scroller.draggable = !0), o.state.draggingText = m, m.copy = !c.moveOnDrag, Kt(p.wrapper.ownerDocument, "mouseup", m), Kt(p.wrapper.ownerDocument, "mousemove", y), Kt(p.scroller, "dragstart", x), Kt(p.scroller, "drop", m), o.state.delayingBlurEvent = !0, setTimeout(function() { return p.input.focus(); }, 20), p.scroller.dragDrop && p.scroller.dragDrop(); } function Nu(o, s, u) { if (u == "char") return new tn(s, s); if (u == "word") return o.findWordAt(s); if (u == "line") return new tn(Bt(s.line, 0), oe(o.doc, Bt(s.line + 1, 0))); var c = u(o, s); return new tn(c.from, c.to); } function ma(o, s, u, c) { z && Vl(o); var p = o.display, g = o.doc; We(s); var m, y, x = g.sel, O = x.ranges; if (c.addNew && !c.extend ? (y = g.sel.contains(u), m = y > -1 ? O[y] : new tn(u, u)) : (m = g.sel.primary(), y = g.sel.primIndex), c.unit == "rectangle") c.addNew || (m = new tn(u, u)), u = wi(o, s, !0, !0), y = -1; else { var B = Nu(o, u, c.unit); m = c.extend ? Pi(m, B.anchor, B.head, c.extend) : B; } c.addNew ? y == -1 ? (y = O.length, tr(g, Qr(o, O.concat([m]), y), { scroll: !1, origin: "*mouse" })) : O.length > 1 && O[y].empty() && c.unit == "char" && !c.extend ? (tr(g, Qr(o, O.slice(0, y).concat(O.slice(y + 1)), 0), { scroll: !1, origin: "*mouse" }), x = g.sel) : el(g, y, m, st) : (y = 0, tr(g, new Ur([m], 0), st), x = g.sel); var $ = u; function ft(Jt) { if (T($, Jt) != 0) if ($ = Jt, c.unit == "rectangle") { for (var ye = [], me = o.options.tabSize, Ce = xe(ve(g, u.line).text, u.ch, me), sn = xe(ve(g, Jt.line).text, Jt.ch, me), an = Math.min(Ce, sn), gr = Math.max(Ce, sn), hn = Math.min(u.line, Jt.line), sr = Math.min(o.lastLine(), Math.max(u.line, Jt.line)); hn <= sr; hn++) { var vr = ve(g, hn).text, xn = qt(vr, an, me); an == gr ? ye.push(new tn(Bt(hn, xn), Bt(hn, xn))) : vr.length > xn && ye.push(new tn(Bt(hn, xn), Bt(hn, qt(vr, gr, me)))); } ye.length || ye.push(new tn(u, u)), tr(g, Qr(o, x.ranges.slice(0, y).concat(ye), y), { origin: "*mouse", scroll: !1 }), o.scrollIntoView(Jt); } else { var En, dr = m, Vn = Nu(o, Jt, c.unit), An = dr.anchor; T(Vn.anchor, An) > 0 ? (En = Vn.head, An = de(dr.from(), Vn.anchor)) : (En = Vn.anchor, An = te(dr.to(), Vn.head)); var jn = x.ranges.slice(0); jn[y] = fl(o, new tn(oe(g, An), En)), tr(g, Qr(o, jn, y), st); } } var dt = p.wrapper.getBoundingClientRect(), Ct = 0; function Rt(Jt) { var ye = ++Ct, me = wi(o, Jt, !0, c.unit == "rectangle"); if (me) if (T(me, $) != 0) { o.curOp.focus = Tt(), ft(me); var Ce = Js(p, g); (me.line >= Ce.to || me.line < Ce.from) && setTimeout(Gn(o, function() { Ct == ye && Rt(Jt); }), 150); } else { var sn = Jt.clientY < dt.top ? -20 : Jt.clientY > dt.bottom ? 20 : 0; sn && setTimeout(Gn(o, function() { Ct == ye && (p.scroller.scrollTop += sn, Rt(Jt)); }), 50); } } function $t(Jt) { o.state.selectingText = !1, Ct = 1 / 0, Jt && (We(Jt), p.input.focus()), tt(p.wrapper.ownerDocument, "mousemove", re), tt(p.wrapper.ownerDocument, "mouseup", le), g.history.lastSelOrigin = null; } var re = Gn(o, function(Jt) { Jt.buttons !== 0 && Yn(Jt) ? Rt(Jt) : $t(Jt); }), le = Gn(o, $t); o.state.selectingText = le, Kt(p.wrapper.ownerDocument, "mousemove", re), Kt(p.wrapper.ownerDocument, "mouseup", le); } function fl(o, s) { var u = s.anchor, c = s.head, p = ve(o.doc, u.line); if (T(u, c) == 0 && u.sticky == c.sticky) return s; var g = ze(p); if (!g) return s; var m = ke(g, u.ch, u.sticky), y = g[m]; if (y.from != u.ch && y.to != u.ch) return s; var x, O = m + (y.from == u.ch == (y.level != 1) ? 0 : 1); if (O == 0 || O == g.length) return s; if (c.line != u.line) x = (c.line - u.line) * (o.doc.direction == "ltr" ? 1 : -1) > 0; else { var B = ke(g, c.ch, c.sticky), $ = B - m || (c.ch - u.ch) * (y.level == 1 ? -1 : 1); x = B == O - 1 || B == O ? $ < 0 : $ > 0; } var ft = g[O + (x ? -1 : 0)], dt = x == (ft.level == 1), Ct = dt ? ft.from : ft.to, Rt = dt ? "after" : "before"; return u.ch == Ct && u.sticky == Rt ? s : new tn(new Bt(u.line, Ct, Rt), c); } function uc(o, s, u, c) { var p, g; if (s.touches) p = s.touches[0].clientX, g = s.touches[0].clientY; else try { p = s.clientX, g = s.clientY; } catch { return !1; } if (p >= Math.floor(o.display.gutters.getBoundingClientRect().right)) return !1; c && We(s); var m = o.display, y = m.lineDiv.getBoundingClientRect(); if (g > y.bottom || !he(o, u)) return pn(s); g -= y.top - m.viewOffset; for (var x = 0; x < o.display.gutterSpecs.length; ++x) { var O = m.gutters.childNodes[x]; if (O && O.getBoundingClientRect().right >= p) return ut(o, u, o, In(o.doc, g), o.display.gutterSpecs[x].className, s), pn(s); } } function pc(o, s) { return uc(o, s, "gutterClick", !0); } function Iu(o, s) { A(o.display, s) || Xp(o, s) || yt(o, s, "contextmenu") || j || o.display.input.onContextMenu(s); } function Xp(o, s) { return !!he(o, "gutterContextMenu") && uc(o, s, "gutterContextMenu", !1); } function fc(o) { o.display.wrapper.className = o.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + o.options.theme.replace(/(^|\s)\s*/g, " cm-s-"), Xo(o); } ul.prototype.compare = function(o, s, u) { return this.time + Gp > o && T(s, this.pos) == 0 && u == this.button; }; var bs = { toString: function() { return "CodeMirror.Init"; } }, Fu = {}, ws = {}; function Vu(o) { var s = o.optionHandlers; function u(c, p, g, m) { o.defaults[c] = p, g && (s[c] = m ? function(y, x, O) { O != bs && g(y, x, O); } : g); } o.defineOption = u, o.Init = bs, u("value", "", function(c, p) { return c.setValue(p); }, !0), u("mode", null, function(c, p) { c.doc.modeOption = p, Xa(c); }, !0), u("indentUnit", 2, Xa, !0), u("indentWithTabs", !1), u("smartIndent", !0), u("tabSize", 4, function(c) { Lo(c), Xo(c), Qn(c); }, !0), u("lineSeparator", null, function(c, p) { if (c.doc.lineSep = p, p) { var g = [], m = c.doc.first; c.doc.iter(function(x) { for (var O = 0; ; ) { var B = x.text.indexOf(p, O); if (B == -1) break; O = B + p.length, g.push(Bt(m, B)); } m++; }); for (var y = g.length - 1; y >= 0; y--) ds(c.doc, p, g[y], Bt(g[y].line, g[y].ch + p.length)); } }), u("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function(c, p, g) { c.state.specialChars = new RegExp(p.source + (p.test(" ") ? "" : "| "), "g"), g != bs && c.refresh(); }), u("specialCharPlaceholder", La, function(c) { return c.refresh(); }, !0), u("electricChars", !0), u("inputStyle", xt ? "contenteditable" : "textarea", function() { throw new Error("inputStyle can not (yet) be changed in a running editor"); }, !0), u("spellcheck", !1, function(c, p) { return c.getInputField().spellcheck = p; }, !0), u("autocorrect", !1, function(c, p) { return c.getInputField().autocorrect = p; }, !0), u("autocapitalize", !1, function(c, p) { return c.getInputField().autocapitalize = p; }, !0), u("rtlMoveVisually", !Ft), u("wholeLineUpdateBefore", !0), u("theme", "default", function(c) { fc(c), cs(c); }, !0), u("keyMap", "default", function(c, p, g) { var m = No(p), y = g != bs && No(g); y && y.detach && y.detach(c, m), m.attach && m.attach(c, y || null); }), u("extraKeys", null), u("configureMouse", null), u("lineWrapping", !1, Zp, !0), u("gutters", [], function(c, p) { c.display.gutterSpecs = Ga(p, c.options.lineNumbers), cs(c); }, !0), u("fixedGutter", !0, function(c, p) { c.display.gutters.style.left = p ? Il(c.display) + "px" : "0", c.refresh(); }, !0), u("coverGutterNextToScrollbar", !1, function(c) { return as(c); }, !0), u("scrollbarStyle", "native", function(c) { Yc(c), as(c), c.display.scrollbars.setScrollTop(c.doc.scrollTop), c.display.scrollbars.setScrollLeft(c.doc.scrollLeft); }, !0), u("lineNumbers", !1, function(c, p) { c.display.gutterSpecs = Ga(c.options.gutters, p), cs(c); }, !0), u("firstLineNumber", 1, cs, !0), u("lineNumberFormatter", function(c) { return c; }, cs, !0), u("showCursorWhenSelecting", !1, qs, !0), u("resetSelectionOnContextMenu", !0), u("lineWiseCopyCut", !0), u("pasteLinesPerSelection", !0), u("selectionsMayTouch", !1), u("readOnly", !1, function(c, p) { p == "nocursor" && (xi(c), c.display.input.blur()), c.display.input.readOnlyChanged(p); }), u("screenReaderLabel", null, function(c, p) { p = p === "" ? null : p, c.display.input.screenReaderLabelChanged(p); }), u("disableInput", !1, function(c, p) { p || c.display.input.reset(); }, !0), u("dragDrop", !0, Jp), u("allowDropFileTypes", null), u("cursorBlinkRate", 530), u("cursorScrollMargin", 0), u("cursorHeight", 1, qs, !0), u("singleCursorHeightPerLine", !0, qs, !0), u("workTime", 100), u("workDelay", 100), u("flattenSpans", !0, Lo, !0), u("addModeClass", !1, Lo, !0), u("pollInterval", 100), u("undoDepth", 200, function(c, p) { return c.doc.history.undoDepth = p; }), u("historyEventDelay", 1250), u("viewportMargin", 10, function(c) { return c.refresh(); }, !0), u("maxHighlightLength", 1e4, Lo, !0), u("moveInputWithCursor", !0, function(c, p) { p || c.display.input.resetPosition(); }), u("tabindex", null, function(c, p) { return c.display.input.getField().tabIndex = p || ""; }), u("autofocus", null), u("direction", "ltr", function(c, p) { return c.doc.setDirection(p); }, !0), u("phrases", null); } function Jp(o, s, u) { if (!s != !(u && u != bs)) { var c = o.display.dragFunctions, p = s ? Kt : tt; p(o.display.scroller, "dragstart", c.start), p(o.display.scroller, "dragenter", c.enter), p(o.display.scroller, "dragover", c.over), p(o.display.scroller, "dragleave", c.leave), p(o.display.scroller, "drop", c.drop); } } function Zp(o) { o.options.lineWrapping ? (Qt(o.display.wrapper, "CodeMirror-wrap"), o.display.sizer.style.minWidth = "", o.display.sizerWidth = null) : (nt(o.display.wrapper, "CodeMirror-wrap"), Rs(o)), Fl(o), Qn(o), Xo(o), setTimeout(function() { return as(o); }, 100); } function wn(o, s) { var u = this; if (!(this instanceof wn)) return new wn(o, s); this.options = s = s ? De(s) : {}, De(Fu, s, !1); var c = s.value; typeof c == "string" ? c = new Fn(c, s.mode, null, s.lineSeparator, s.direction) : s.mode && (c.modeOption = s.mode), this.doc = c; var p = new wn.inputStyles[s.inputStyle](this), g = this.display = new tu(o, c, p, s); for (var m in g.wrapper.CodeMirror = this, fc(this), s.lineWrapping && (this.display.wrapper.className += " CodeMirror-wrap"), Yc(this), this.state = { keyMaps: [], overlays: [], modeGen: 0, overwrite: !1, delayingBlurEvent: !1, focused: !1, suppressEdits: !1, pasteIncoming: -1, cutIncoming: -1, selectingText: !1, draggingText: !1, highlight: new Te(), keySeq: null, specialChars: null }, s.autofocus && !xt && g.input.focus(), z && k < 11 && setTimeout(function() { return u.display.input.reset(!0); }, 20), Qp(this), Sn(), Oi(this), this.curOp.forceUpdate = !0, su(this, c), s.autofocus && !xt || this.hasFocus() ? setTimeout(function() { u.hasFocus() && !u.state.focused && Rl(u); }, 20) : xi(this), ws) ws.hasOwnProperty(m) && ws[m](this, s[m], bs); Zc(this), s.finishInit && s.finishInit(this); for (var y = 0; y < dc.length; ++y) dc[y](this); Ti(this), P && s.lineWrapping && getComputedStyle(g.lineDiv).textRendering == "optimizelegibility" && (g.lineDiv.style.textRendering = "auto"); } function Qp(o) { var s = o.display; Kt(s.scroller, "mousedown", Gn(o, Mu)), Kt(s.scroller, "dblclick", z && k < 11 ? Gn(o, function(x) { if (!yt(o, x)) { var O = wi(o, x); if (O && !pc(o, x) && !A(o.display, x)) { We(x); var B = o.findWordAt(O); tl(o.doc, B.anchor, B.head); } } }) : function(x) { return yt(o, x) || We(x); }), Kt(s.scroller, "contextmenu", function(x) { return Iu(o, x); }), Kt(s.input.getField(), "contextmenu", function(x) { s.scroller.contains(x.target) || Iu(o, x); }); var u, c = { end: 0 }; function p() { s.activeTouch && (u = setTimeout(function() { return s.activeTouch = null; }, 1e3), (c = s.activeTouch).end = +/* @__PURE__ */ new Date()); } function g(x) { if (x.touches.length != 1) return !1; var O = x.touches[0]; return O.radiusX <= 1 && O.radiusY <= 1; } function m(x, O) { if (O.left == null) return !0; var B = O.left - x.left, $ = O.top - x.top; return B * B + $ * $ > 400; } Kt(s.scroller, "touchstart", function(x) { if (!yt(o, x) && !g(x) && !pc(o, x)) { s.input.ensurePolled(), clearTimeout(u); var O = +/* @__PURE__ */ new Date(); s.activeTouch = { start: O, moved: !1, prev: O - c.end <= 300 ? c : null }, x.touches.length == 1 && (s.activeTouch.left = x.touches[0].pageX, s.activeTouch.top = x.touches[0].pageY); } }), Kt(s.scroller, "touchmove", function() { s.activeTouch && (s.activeTouch.moved = !0); }), Kt(s.scroller, "touchend", function(x) { var O = s.activeTouch; if (O && !A(s, x) && O.left != null && !O.moved && /* @__PURE__ */ new Date() - O.start < 300) { var B, $ = o.coordsChar(s.activeTouch, "page"); B = !O.prev || m(O, O.prev) ? new tn($, $) : !O.prev.prev || m(O, O.prev.prev) ? o.findWordAt($) : new tn(Bt($.line, 0), oe(o.doc, Bt($.line + 1, 0))), o.setSelection(B.anchor, B.head), o.focus(), We(x); } p(); }), Kt(s.scroller, "touchcancel", p), Kt(s.scroller, "scroll", function() { s.scroller.clientHeight && (Qs(o, s.scroller.scrollTop), jo(o, s.scroller.scrollLeft, !0), ut(o, "scroll", o)); }), Kt(s.scroller, "mousewheel", function(x) { return nu(o, x); }), Kt(s.scroller, "DOMMouseScroll", function(x) { return nu(o, x); }), Kt(s.wrapper, "scroll", function() { return s.wrapper.scrollTop = s.wrapper.scrollLeft = 0; }), s.dragFunctions = { enter: function(x) { yt(o, x) || Ne(x); }, over: function(x) { yt(o, x) || (Wp(o, x), Ne(x)); }, start: function(x) { return bu(o, x); }, drop: Gn(o, Bp), leave: function(x) { yt(o, x) || wu(o); } }; var y = s.input.getField(); Kt(y, "keyup", function(x) { return Au.call(o, x); }), Kt(y, "keydown", Gn(o, cc)), Kt(y, "keypress", Gn(o, ju)), Kt(y, "focus", function(x) { return Rl(o, x); }), Kt(y, "blur", function(x) { return xi(o, x); }); } wn.defaults = Fu, wn.optionHandlers = ws; var dc = []; function ya(o, s, u, c) { var p, g = o.doc; u == null && (u = "add"), u == "smart" && (g.mode.indent ? p = bo(o, s).state : u = "prev"); var m = o.options.tabSize, y = ve(g, s), x = xe(y.text, null, m); y.stateAfter && (y.stateAfter = null); var O, B = y.text.match(/^\s*/)[0]; if (c || /\S/.test(y.text)) { if (u == "smart" && ((O = g.mode.indent(p, y.text.slice(B.length), y.text)) == pe || O > 150)) { if (!c) return; u = "prev"; } } else O = 0, u = "not"; u == "prev" ? O = s > g.first ? xe(ve(g, s - 1).text, null, m) : 0 : u == "add" ? O = x + o.options.indentUnit : u == "subtract" ? O = x - o.options.indentUnit : typeof u == "number" && (O = x + u), O = Math.max(0, O); var $ = "", ft = 0; if (o.options.indentWithTabs) for (var dt = Math.floor(O / m); dt; --dt) ft += m, $ += " "; if (ft < O && ($ += ae(O - ft)), $ != B) return ds(g, $, Bt(s, 0), Bt(s, B.length), "+input"), y.stateAfter = null, !0; for (var Ct = 0; Ct < g.sel.ranges.length; Ct++) { var Rt = g.sel.ranges[Ct]; if (Rt.head.line == s && Rt.head.ch < B.length) { var $t = Bt(s, B.length); el(g, Ct, new tn($t, $t)); break; } } } wn.defineInitHook = function(o) { return dc.push(o); }; var po = null; function dl(o) { po = o; } function hc(o, s, u, c, p) { var g = o.doc; o.display.shift = !1, c || (c = g.sel); var m = +/* @__PURE__ */ new Date() - 200, y = p == "paste" || o.state.pasteIncoming > m, x = _o(s), O = null; if (y && c.ranges.length > 1) if (po && po.text.join(` `) == s) { if (c.ranges.length % po.text.length == 0) { O = []; for (var B = 0; B < po.text.length; B++) O.push(g.splitLines(po.text[B])); } } else x.length == c.ranges.length && o.options.pasteLinesPerSelection && (O = Ae(x, function(re) { return [re]; })); for (var $ = o.curOp.updateInput, ft = c.ranges.length - 1; ft >= 0; ft--) { var dt = c.ranges[ft], Ct = dt.from(), Rt = dt.to(); dt.empty() && (u && u > 0 ? Ct = Bt(Ct.line, Ct.ch - u) : o.state.overwrite && !y ? Rt = Bt(Rt.line, Math.min(ve(g, Rt.line).text.length, Rt.ch + Zt(x).length)) : y && po && po.lineWise && po.text.join(` `) == x.join(` `) && (Ct = Rt = Bt(Ct.line, 0))); var $t = { from: Ct, to: Rt, text: O ? O[ft % O.length] : x, origin: p || (y ? "paste" : o.state.cutIncoming > m ? "cut" : "+input") }; Ai(o.doc, $t), bn(o, "inputRead", o, $t); } s && !y && gc(o, s), ss(o), o.curOp.updateInput < 2 && (o.curOp.updateInput = $), o.curOp.typing = !0, o.state.pasteIncoming = o.state.cutIncoming = -1; } function Ru(o, s) { var u = o.clipboardData && o.clipboardData.getData("Text"); if (u) return o.preventDefault(), s.isReadOnly() || s.options.disableInput || !s.hasFocus() || fr(s, function() { return hc(s, u, 0, null, "paste"); }), !0; } function gc(o, s) { if (o.options.electricChars && o.options.smartIndent) for (var u = o.doc.sel, c = u.ranges.length - 1; c >= 0; c--) { var p = u.ranges[c]; if (!(p.head.ch > 100 || c && u.ranges[c - 1].head.line == p.head.line)) { var g = o.getModeAt(p.head), m = !1; if (g.electricChars) { for (var y = 0; y < g.electricChars.length; y++) if (s.indexOf(g.electricChars.charAt(y)) > -1) { m = ya(o, p.head.line, "smart"); break; } } else g.electricInput && g.electricInput.test(ve(o.doc, p.head.line).text.slice(0, p.head.ch)) && (m = ya(o, p.head.line, "smart")); m && bn(o, "electricInput", o, p.head.line); } } } function Hu(o) { for (var s = [], u = [], c = 0; c < o.doc.sel.ranges.length; c++) { var p = o.doc.sel.ranges[c].head.line, g = { anchor: Bt(p, 0), head: Bt(p + 1, 0) }; u.push(g), s.push(o.getRange(g.anchor, g.head)); } return { text: s, ranges: u }; } function zu(o, s, u, c) { o.setAttribute("autocorrect", u ? "" : "off"), o.setAttribute("autocapitalize", c ? "" : "off"), o.setAttribute("spellcheck", !!s); } function Uu() { var o = gt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"), s = gt("div", [o], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); return P ? o.style.width = "1000px" : o.setAttribute("wrap", "off"), Dt && (o.style.border = "1px solid black"), zu(o), s; } function vc(o) { var s = o.optionHandlers, u = o.helpers = {}; o.prototype = { constructor: o, focus: function() { window.focus(), this.display.input.focus(); }, setOption: function(c, p) { var g = this.options, m = g[c]; g[c] == p && c != "mode" || (g[c] = p, s.hasOwnProperty(c) && Gn(this, s[c])(this, p, m), ut(this, "optionChange", this, c)); }, getOption: function(c) { return this.options[c]; }, getDoc: function() { return this.doc; }, addKeyMap: function(c, p) { this.state.keyMaps[p ? "push" : "unshift"](No(c)); }, removeKeyMap: function(c) { for (var p = this.state.keyMaps, g = 0; g < p.length; ++g) if (p[g] == c || p[g].name == c) return p.splice(g, 1), !0; }, addOverlay: ir(function(c, p) { var g = c.token ? c : o.getMode(this.options, c); if (g.startState) throw new Error("Overlays may not be stateful."); Ke(this.state.overlays, { mode: g, modeSpec: c, opaque: p && p.opaque, priority: p && p.priority || 0 }, function(m) { return m.priority; }), this.state.modeGen++, Qn(this); }), removeOverlay: ir(function(c) { for (var p = this.state.overlays, g = 0; g < p.length; ++g) { var m = p[g].modeSpec; if (m == c || typeof c == "string" && m.name == c) return p.splice(g, 1), this.state.modeGen++, void Qn(this); } }), indentLine: ir(function(c, p, g) { typeof p != "string" && typeof p != "number" && (p = p == null ? this.options.smartIndent ? "smart" : "prev" : p ? "add" : "subtract"), yo(this.doc, c) && ya(this, c, p, g); }), indentSelection: ir(function(c) { for (var p = this.doc.sel.ranges, g = -1, m = 0; m < p.length; m++) { var y = p[m]; if (y.empty()) y.head.line > g && (ya(this, y.head.line, c, !0), g = y.head.line, m == this.doc.sel.primIndex && ss(this)); else { var x = y.from(), O = y.to(), B = Math.max(g, x.line); g = Math.min(this.lastLine(), O.line - (O.ch ? 0 : 1)) + 1; for (var $ = B; $ < g; ++$) ya(this, $, c); var ft = this.doc.sel.ranges; x.ch == 0 && p.length == ft.length && ft[m].from().ch > 0 && el(this.doc, m, new tn(x, ft[m].to()), ce); } } }), getTokenAt: function(c, p) { return Wo(this, c, p); }, getLineTokens: function(c, p) { return Wo(this, Bt(c), p, !0); }, getTokenTypeAt: function(c) { c = oe(this.doc, c); var p, g = xr(this, ve(this.doc, c.line)), m = 0, y = (g.length - 1) / 2, x = c.ch; if (x == 0) p = g[2]; else for (; ; ) { var O = m + y >> 1; if ((O ? g[2 * O - 1] : 0) >= x) y = O; else { if (!(g[2 * O + 1] < x)) { p = g[2 * O + 2]; break; } m = O + 1; } } var B = p ? p.indexOf("overlay ") : -1; return B < 0 ? p : B == 0 ? null : p.slice(0, B - 1); }, getModeAt: function(c) { var p = this.doc.mode; return p.innerMode ? o.innerMode(p, this.getTokenAt(c).state).mode : p; }, getHelper: function(c, p) { return this.getHelpers(c, p)[0]; }, getHelpers: function(c, p) { var g = []; if (!u.hasOwnProperty(p)) return g; var m = u[p], y = this.getModeAt(c); if (typeof y[p] == "string") m[y[p]] && g.push(m[y[p]]); else if (y[p]) for (var x = 0; x < y[p].length; x++) { var O = m[y[p][x]]; O && g.push(O); } else y.helperType && m[y.helperType] ? g.push(m[y.helperType]) : m[y.name] && g.push(m[y.name]); for (var B = 0; B < m._global.length; B++) { var $ = m._global[B]; $.pred(y, this) && be(g, $.val) == -1 && g.push($.val); } return g; }, getStateAfter: function(c, p) { var g = this.doc; return bo(this, (c = $e(g, c ?? g.first + g.size - 1)) + 1, p).state; }, cursorCoords: function(c, p) { var g = this.doc.sel.primary(); return kr(this, c == null ? g.head : typeof c == "object" ? oe(this.doc, c) : c ? g.from() : g.to(), p || "page"); }, charCoords: function(c, p) { return Ha(this, oe(this.doc, c), p || "page"); }, coordsChar: function(c, p) { return Ll(this, (c = jl(this, c, p || "page")).left, c.top); }, lineAtHeight: function(c, p) { return c = jl(this, { top: c, left: 0 }, p || "page").top, In(this.doc, c + this.display.viewOffset); }, heightAtLine: function(c, p, g) { var m, y = !1; if (typeof c == "number") { var x = this.doc.first + this.doc.size - 1; c < this.doc.first ? c = this.doc.first : c > x && (c = x, y = !0), m = ve(this.doc, c); } else m = c; return Ra(this, m, { top: 0, left: 0 }, p || "page", g || y).top + (y ? this.doc.height - Fr(m) : 0); }, defaultTextHeight: function() { return ao(this.display); }, defaultCharWidth: function() { return Jo(this.display); }, getViewport: function() { return { from: this.display.viewFrom, to: this.display.viewTo }; }, addWidget: function(c, p, g, m, y) { var x = this.display, O = (c = kr(this, oe(this.doc, c))).bottom, B = c.left; if (p.style.position = "absolute", p.setAttribute("cm-ignore-events", "true"), this.display.input.setUneditable(p), x.sizer.appendChild(p), m == "over") O = c.top; else if (m == "above" || m == "near") { var $ = Math.max(x.wrapper.clientHeight, this.doc.height), ft = Math.max(x.sizer.clientWidth, x.lineSpace.clientWidth); (m == "above" || c.bottom + p.offsetHeight > $) && c.top > p.offsetHeight ? O = c.top - p.offsetHeight : c.bottom + p.offsetHeight <= $ && (O = c.bottom), B + p.offsetWidth > ft && (B = ft - p.offsetWidth); } p.style.top = O + "px", p.style.left = p.style.right = "", y == "right" ? (B = x.sizer.clientWidth - p.offsetWidth, p.style.right = "0px") : (y == "left" ? B = 0 : y == "middle" && (B = (x.sizer.clientWidth - p.offsetWidth) / 2), p.style.left = B + "px"), g && Cp(this, { left: B, top: O, right: B + p.offsetWidth, bottom: O + p.offsetHeight }); }, triggerOnKeyDown: ir(cc), triggerOnKeyPress: ir(ju), triggerOnKeyUp: Au, triggerOnMouseDown: ir(Mu), execCommand: function(c) { if (ms.hasOwnProperty(c)) return ms[c].call(null, this); }, triggerElectric: ir(function(c) { gc(this, c); }), findPosH: function(c, p, g, m) { var y = 1; p < 0 && (y = -1, p = -p); for (var x = oe(this.doc, c), O = 0; O < p && !(x = hl(this.doc, x, y, g, m)).hitSide; ++O) ; return x; }, moveH: ir(function(c, p) { var g = this; this.extendSelectionsBy(function(m) { return g.display.shift || g.doc.extend || m.empty() ? hl(g.doc, m.head, c, p, g.options.rtlMoveVisually) : c < 0 ? m.from() : m.to(); }, Xt); }), deleteH: ir(function(c, p) { var g = this.doc.sel, m = this.doc; g.somethingSelected() ? m.replaceSelection("", null, "+delete") : ni(this, function(y) { var x = hl(m, y.head, c, p, !1); return c < 0 ? { from: x, to: y.head } : { from: y.head, to: x }; }); }), findPosV: function(c, p, g, m) { var y = 1, x = m; p < 0 && (y = -1, p = -p); for (var O = oe(this.doc, c), B = 0; B < p; ++B) { var $ = kr(this, O, "div"); if (x == null ? x = $.left : $.left = x, (O = gl(this, $, y, g)).hitSide) break; } return O; }, moveV: ir(function(c, p) { var g = this, m = this.doc, y = [], x = !this.display.shift && !m.extend && m.sel.somethingSelected(); if (m.extendSelectionsBy(function(B) { if (x) return c < 0 ? B.from() : B.to(); var $ = kr(g, B.head, "div"); B.goalColumn != null && ($.left = B.goalColumn), y.push($.left); var ft = gl(g, $, c, p); return p == "page" && B == m.sel.primary() && Wa(g, Ha(g, ft, "div").top - $.top), ft; }, Xt), y.length) for (var O = 0; O < m.sel.ranges.length; O++) m.sel.ranges[O].goalColumn = y[O]; }), findWordAt: function(c) { var p = ve(this.doc, c.line).text, g = c.ch, m = c.ch; if (p) { var y = this.getHelper(c, "wordChars"); c.sticky != "before" && m != p.length || !g ? ++m : --g; for (var x = p.charAt(g), O = zt(x, y) ? function(B) { return zt(B, y); } : /\s/.test(x) ? function(B) { return /\s/.test(B); } : function(B) { return !/\s/.test(B) && !zt(B); }; g > 0 && O(p.charAt(g - 1)); ) --g; for (; m < p.length && O(p.charAt(m)); ) ++m; } return new tn(Bt(c.line, g), Bt(c.line, m)); }, toggleOverwrite: function(c) { c != null && c == this.state.overwrite || ((this.state.overwrite = !this.state.overwrite) ? Qt(this.display.cursorDiv, "CodeMirror-overwrite") : nt(this.display.cursorDiv, "CodeMirror-overwrite"), ut(this, "overwriteToggle", this, this.state.overwrite)); }, hasFocus: function() { return this.display.input.getField() == Tt(); }, isReadOnly: function() { return !(!this.options.readOnly && !this.doc.cantEdit); }, scrollTo: ir(function(c, p) { Zs(this, c, p); }), getScrollInfo: function() { var c = this.display.scroller; return { left: c.scrollLeft, top: c.scrollTop, height: c.scrollHeight - lt(this) - this.display.barHeight, width: c.scrollWidth - lt(this) - this.display.barWidth, clientHeight: Gt(this), clientWidth: Nt(this) }; }, scrollIntoView: ir(function(c, p) { c == null ? (c = { from: this.doc.sel.primary().head, to: null }, p == null && (p = this.options.cursorScrollMargin)) : typeof c == "number" ? c = { from: Bt(c, 0), to: null } : c.from == null && (c = { from: c, to: null }), c.to || (c.to = c.from), c.margin = p || 0, c.from.line != null ? Sp(this, c) : Gc(this, c.from, c.to, c.margin); }), setSize: ir(function(c, p) { var g = this, m = function(x) { return typeof x == "number" || /^\d+$/.test(String(x)) ? x + "px" : x; }; c != null && (this.display.wrapper.style.width = m(c)), p != null && (this.display.wrapper.style.height = m(p)), this.options.lineWrapping && es(this); var y = this.display.viewFrom; this.doc.iter(y, this.display.viewTo, function(x) { if (x.widgets) { for (var O = 0; O < x.widgets.length; O++) if (x.widgets[O].noHScroll) { lo(g, y, "widget"); break; } } ++y; }), this.curOp.forceUpdate = !0, ut(this, "refresh", this); }), operation: function(c) { return fr(this, c); }, startOperation: function() { return Oi(this); }, endOperation: function() { return Ti(this); }, refresh: ir(function() { var c = this.display.cachedTextHeight; Qn(this), this.curOp.forceUpdate = !0, Xo(this), Zs(this, this.doc.scrollLeft, this.doc.scrollTop), Wl(this.display), (c == null || Math.abs(c - ao(this.display)) > 0.5 || this.options.lineWrapping) && Fl(this), ut(this, "refresh", this); }), swapDoc: ir(function(c) { var p = this.doc; return p.cm = null, this.state.selectingText && this.state.selectingText(), su(this, c), Xo(this), this.display.input.reset(), Zs(this, c.scrollLeft, c.scrollTop), this.curOp.forceScroll = !0, bn(this, "swapDoc", this, p), p; }), phrase: function(c) { var p = this.options.phrases; return p && Object.prototype.hasOwnProperty.call(p, c) ? p[c] : c; }, getInputField: function() { return this.display.input.getField(); }, getWrapperElement: function() { return this.display.wrapper; }, getScrollerElement: function() { return this.display.scroller; }, getGutterElement: function() { return this.display.gutters; } }, Re(o), o.registerHelper = function(c, p, g) { u.hasOwnProperty(c) || (u[c] = o[c] = { _global: [] }), u[c][p] = g; }, o.registerGlobalHelper = function(c, p, g, m) { o.registerHelper(c, p, m), u[c]._global.push({ pred: g, val: m }); }; } function hl(o, s, u, c, p) { var g = s, m = u, y = ve(o, s.line), x = p && o.direction == "rtl" ? -u : u; function O() { var le = s.line + x; return !(le < o.first || le >= o.first + o.size) && (s = new Bt(le, s.ch, s.sticky), y = ve(o, le)); } function B(le) { var Jt; if (c == "codepoint") { var ye = y.text.charCodeAt(s.ch + (u > 0 ? 0 : -1)); if (isNaN(ye)) Jt = null; else { var me = u > 0 ? ye >= 55296 && ye < 56320 : ye >= 56320 && ye < 57343; Jt = new Bt(s.line, Math.max(0, Math.min(y.text.length, s.ch + u * (me ? 2 : 1))), -u); } } else Jt = p ? Tu(o.cm, y, s, u) : al(y, s, u); if (Jt == null) { if (le || !O()) return !1; s = ll(p, o.cm, y, s.line, x); } else s = Jt; return !0; } if (c == "char" || c == "codepoint") B(); else if (c == "column") B(!0); else if (c == "word" || c == "group") for (var $ = null, ft = c == "group", dt = o.cm && o.cm.getHelper(s, "wordChars"), Ct = !0; !(u < 0) || B(!Ct); Ct = !1) { var Rt = y.text.charAt(s.ch) || ` `, $t = zt(Rt, dt) ? "w" : ft && Rt == ` ` ? "n" : !ft || /\s/.test(Rt) ? null : "p"; if (!ft || Ct || $t || ($t = "s"), $ && $ != $t) { u < 0 && (u = 1, B(), s.sticky = "after"); break; } if ($t && ($ = $t), u > 0 && !B(!Ct)) break; } var re = ia(o, s, g, m, !0); return G(g, re) && (re.hitSide = !0), re; } function gl(o, s, u, c) { var p, g, m = o.doc, y = s.left; if (c == "page") { var x = Math.min(o.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight), O = Math.max(x - 0.5 * ao(o.display), 3); p = (u > 0 ? s.bottom : s.top) + u * O; } else c == "line" && (p = u > 0 ? s.bottom + 3 : s.top - 3); for (; (g = Ll(o, y, p)).outside; ) { if (u < 0 ? p <= 0 : p >= m.height) { g.hitSide = !0; break; } p += 5 * u; } return g; } var rn = function(o) { this.cm = o, this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null, this.polling = new Te(), this.composing = null, this.gracePeriod = !1, this.readDOMTimeout = null; }; function mc(o, s) { var u = ts(o, s.line); if (!u || u.hidden) return null; var c = ve(o.doc, s.line), p = He(u, c, s.line), g = ze(c, o.doc.direction), m = "left"; g && (m = ke(g, s.ch) % 2 ? "right" : "left"); var y = Ws(p.map, s.ch, m); return y.offset = y.collapse == "right" ? y.end : y.start, y; } function tf(o) { for (var s = o; s; s = s.parentNode) if (/CodeMirror-gutter-wrapper/.test(s.className)) return !0; return !1; } function _s(o, s) { return s && (o.bad = !0), o; } function yc(o, s, u, c, p) { var g = "", m = !1, y = o.doc.lineSeparator(), x = !1; function O(dt) { return function(Ct) { return Ct.id == dt; }; } function B() { m && (g += y, x && (g += y), m = x = !1); } function $(dt) { dt && (B(), g += dt); } function ft(dt) { if (dt.nodeType == 1) { var Ct = dt.getAttribute("cm-text"); if (Ct) return void $(Ct); var Rt, $t = dt.getAttribute("cm-marker"); if ($t) { var re = o.findMarks(Bt(c, 0), Bt(p + 1, 0), O(+$t)); return void (re.length && (Rt = re[0].find(0)) && $(rr(o.doc, Rt.from, Rt.to).join(y))); } if (dt.getAttribute("contenteditable") == "false") return; var le = /^(pre|div|p|li|table|br)$/i.test(dt.nodeName); if (!/^br$/i.test(dt.nodeName) && dt.textContent.length == 0) return; le && B(); for (var Jt = 0; Jt < dt.childNodes.length; Jt++) ft(dt.childNodes[Jt]); /^(pre|p)$/i.test(dt.nodeName) && (x = !0), le && (m = !0); } else dt.nodeType == 3 && $(dt.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); } for (; ft(s), s != u; ) s = s.nextSibling, x = !1; return g; } function vl(o, s, u) { var c; if (s == o.display.lineDiv) { if (!(c = o.display.lineDiv.childNodes[u])) return _s(o.clipPos(Bt(o.display.viewTo - 1)), !0); s = null, u = 0; } else for (c = s; ; c = c.parentNode) { if (!c || c == o.display.lineDiv) return null; if (c.parentNode && c.parentNode == o.display.lineDiv) break; } for (var p = 0; p < o.display.view.length; p++) { var g = o.display.view[p]; if (g.node == c) return ef(g, s, u); } } function ef(o, s, u) { var c = o.text.firstChild, p = !1; if (!s || !Lt(c, s)) return _s(Bt(Ye(o.line), 0), !0); if (s == c && (p = !0, s = c.childNodes[u], u = 0, !s)) { var g = o.rest ? Zt(o.rest) : o.line; return _s(Bt(Ye(g), g.text.length), p); } var m = s.nodeType == 3 ? s : null, y = s; for (m || s.childNodes.length != 1 || s.firstChild.nodeType != 3 || (m = s.firstChild, u && (u = m.nodeValue.length)); y.parentNode != c; ) y = y.parentNode; var x = o.measure, O = x.maps; function B($t, re, le) { for (var Jt = -1; Jt < (O ? O.length : 0); Jt++) for (var ye = Jt < 0 ? x.map : O[Jt], me = 0; me < ye.length; me += 3) { var Ce = ye[me + 2]; if (Ce == $t || Ce == re) { var sn = Ye(Jt < 0 ? o.line : o.rest[Jt]), an = ye[me] + le; return (le < 0 || Ce != $t) && (an = ye[me + (le ? 1 : 0)]), Bt(sn, an); } } } var $ = B(m, y, u); if ($) return _s($, p); for (var ft = y.nextSibling, dt = m ? m.nodeValue.length - u : 0; ft; ft = ft.nextSibling) { if ($ = B(ft, ft.firstChild, 0)) return _s(Bt($.line, $.ch - dt), p); dt += ft.textContent.length; } for (var Ct = y.previousSibling, Rt = u; Ct; Ct = Ct.previousSibling) { if ($ = B(Ct, Ct.firstChild, -1)) return _s(Bt($.line, $.ch + Rt), p); Rt += Ct.textContent.length; } } rn.prototype.init = function(o) { var s = this, u = this, c = u.cm, p = u.div = o.lineDiv; function g(y) { for (var x = y.target; x; x = x.parentNode) { if (x == p) return !0; if (/\bCodeMirror-(?:line)?widget\b/.test(x.className)) break; } return !1; } function m(y) { if (g(y) && !yt(c, y)) { if (c.somethingSelected()) dl({ lineWise: !1, text: c.getSelections() }), y.type == "cut" && c.replaceSelection("", null, "cut"); else { if (!c.options.lineWiseCopyCut) return; var x = Hu(c); dl({ lineWise: !0, text: x.text }), y.type == "cut" && c.operation(function() { c.setSelections(x.ranges, 0, ce), c.replaceSelection("", null, "cut"); }); } if (y.clipboardData) { y.clipboardData.clearData(); var O = po.text.join(` `); if (y.clipboardData.setData("Text", O), y.clipboardData.getData("Text") == O) return void y.preventDefault(); } var B = Uu(), $ = B.firstChild; c.display.lineSpace.insertBefore(B, c.display.lineSpace.firstChild), $.value = po.text.join(` `); var ft = Tt(); Se($), setTimeout(function() { c.display.lineSpace.removeChild(B), ft.focus(), ft == p && u.showPrimarySelection(); }, 50); } } p.contentEditable = !0, zu(p, c.options.spellcheck, c.options.autocorrect, c.options.autocapitalize), Kt(p, "paste", function(y) { !g(y) || yt(c, y) || Ru(y, c) || k <= 11 && setTimeout(Gn(c, function() { return s.updateFromDOM(); }), 20); }), Kt(p, "compositionstart", function(y) { s.composing = { data: y.data, done: !1 }; }), Kt(p, "compositionupdate", function(y) { s.composing || (s.composing = { data: y.data, done: !1 }); }), Kt(p, "compositionend", function(y) { s.composing && (y.data != s.composing.data && s.readFromDOMSoon(), s.composing.done = !0); }), Kt(p, "touchstart", function() { return u.forceCompositionEnd(); }), Kt(p, "input", function() { s.composing || s.readFromDOMSoon(); }), Kt(p, "copy", m), Kt(p, "cut", m); }, rn.prototype.screenReaderLabelChanged = function(o) { o ? this.div.setAttribute("aria-label", o) : this.div.removeAttribute("aria-label"); }, rn.prototype.prepareSelection = function() { var o = Gs(this.cm, !1); return o.focus = Tt() == this.div, o; }, rn.prototype.showSelection = function(o, s) { o && this.cm.display.view.length && ((o.focus || s) && this.showPrimarySelection(), this.showMultipleSelections(o)); }, rn.prototype.getSelection = function() { return this.cm.display.wrapper.ownerDocument.getSelection(); }, rn.prototype.showPrimarySelection = function() { var o = this.getSelection(), s = this.cm, u = s.doc.sel.primary(), c = u.from(), p = u.to(); if (s.display.viewTo == s.display.viewFrom || c.line >= s.display.viewTo || p.line < s.display.viewFrom) o.removeAllRanges(); else { var g = vl(s, o.anchorNode, o.anchorOffset), m = vl(s, o.focusNode, o.focusOffset); if (!g || g.bad || !m || m.bad || T(de(g, m), c) != 0 || T(te(g, m), p) != 0) { var y = s.display.view, x = c.line >= s.display.viewFrom && mc(s, c) || { node: y[0].measure.map[2], offset: 0 }, O = p.line < s.display.viewTo && mc(s, p); if (!O) { var B = y[y.length - 1].measure, $ = B.maps ? B.maps[B.maps.length - 1] : B.map; O = { node: $[$.length - 1], offset: $[$.length - 2] - $[$.length - 3] }; } if (x && O) { var ft, dt = o.rangeCount && o.getRangeAt(0); try { ft = Y(x.node, x.offset, O.offset, O.node); } catch { } ft && (!at && s.state.focused ? (o.collapse(x.node, x.offset), ft.collapsed || (o.removeAllRanges(), o.addRange(ft))) : (o.removeAllRanges(), o.addRange(ft)), dt && o.anchorNode == null ? o.addRange(dt) : at && this.startGracePeriod()), this.rememberSelection(); } else o.removeAllRanges(); } } }, rn.prototype.startGracePeriod = function() { var o = this; clearTimeout(this.gracePeriod), this.gracePeriod = setTimeout(function() { o.gracePeriod = !1, o.selectionChanged() && o.cm.operation(function() { return o.cm.curOp.selectionChanged = !0; }); }, 20); }, rn.prototype.showMultipleSelections = function(o) { rt(this.cm.display.cursorDiv, o.cursors), rt(this.cm.display.selectionDiv, o.selection); }, rn.prototype.rememberSelection = function() { var o = this.getSelection(); this.lastAnchorNode = o.anchorNode, this.lastAnchorOffset = o.anchorOffset, this.lastFocusNode = o.focusNode, this.lastFocusOffset = o.focusOffset; }, rn.prototype.selectionInEditor = function() { var o = this.getSelection(); if (!o.rangeCount) return !1; var s = o.getRangeAt(0).commonAncestorContainer; return Lt(this.div, s); }, rn.prototype.focus = function() { this.cm.options.readOnly != "nocursor" && (this.selectionInEditor() && Tt() == this.div || this.showSelection(this.prepareSelection(), !0), this.div.focus()); }, rn.prototype.blur = function() { this.div.blur(); }, rn.prototype.getField = function() { return this.div; }, rn.prototype.supportsTouch = function() { return !0; }, rn.prototype.receivedFocus = function() { var o = this, s = this; function u() { s.cm.state.focused && (s.pollSelection(), s.polling.set(s.cm.options.pollInterval, u)); } this.selectionInEditor() ? setTimeout(function() { return o.pollSelection(); }, 20) : fr(this.cm, function() { return s.cm.curOp.selectionChanged = !0; }), this.polling.set(this.cm.options.pollInterval, u); }, rn.prototype.selectionChanged = function() { var o = this.getSelection(); return o.anchorNode != this.lastAnchorNode || o.anchorOffset != this.lastAnchorOffset || o.focusNode != this.lastFocusNode || o.focusOffset != this.lastFocusOffset; }, rn.prototype.pollSelection = function() { if (this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) { var o = this.getSelection(), s = this.cm; if (ee && M && this.cm.display.gutterSpecs.length && tf(o.anchorNode)) return this.cm.triggerOnKeyDown({ type: "keydown", keyCode: 8, preventDefault: Math.abs }), this.blur(), void this.focus(); if (!this.composing) { this.rememberSelection(); var u = vl(s, o.anchorNode, o.anchorOffset), c = vl(s, o.focusNode, o.focusOffset); u && c && fr(s, function() { tr(s.doc, Qo(u, c), ce), (u.bad || c.bad) && (s.curOp.selectionChanged = !0); }); } } }, rn.prototype.pollContent = function() { this.readDOMTimeout != null && (clearTimeout(this.readDOMTimeout), this.readDOMTimeout = null); var o, s, u, c = this.cm, p = c.display, g = c.doc.sel.primary(), m = g.from(), y = g.to(); if (m.ch == 0 && m.line > c.firstLine() && (m = Bt(m.line - 1, ve(c.doc, m.line - 1).length)), y.ch == ve(c.doc, y.line).text.length && y.line < c.lastLine() && (y = Bt(y.line + 1, 0)), m.line < p.viewFrom || y.line > p.viewTo - 1) return !1; m.line == p.viewFrom || (o = _i(c, m.line)) == 0 ? (s = Ye(p.view[0].line), u = p.view[0].node) : (s = Ye(p.view[o].line), u = p.view[o - 1].node.nextSibling); var x, O, B = _i(c, y.line); if (B == p.view.length - 1 ? (x = p.viewTo - 1, O = p.lineDiv.lastChild) : (x = Ye(p.view[B + 1].line) - 1, O = p.view[B + 1].node.previousSibling), !u) return !1; for (var $ = c.doc.splitLines(yc(c, u, O, s, x)), ft = rr(c.doc, Bt(s, 0), Bt(x, ve(c.doc, x).text.length)); $.length > 1 && ft.length > 1; ) if (Zt($) == Zt(ft)) $.pop(), ft.pop(), x--; else { if ($[0] != ft[0]) break; $.shift(), ft.shift(), s++; } for (var dt = 0, Ct = 0, Rt = $[0], $t = ft[0], re = Math.min(Rt.length, $t.length); dt < re && Rt.charCodeAt(dt) == $t.charCodeAt(dt); ) ++dt; for (var le = Zt($), Jt = Zt(ft), ye = Math.min(le.length - ($.length == 1 ? dt : 0), Jt.length - (ft.length == 1 ? dt : 0)); Ct < ye && le.charCodeAt(le.length - Ct - 1) == Jt.charCodeAt(Jt.length - Ct - 1); ) ++Ct; if ($.length == 1 && ft.length == 1 && s == m.line) for (; dt && dt > m.ch && le.charCodeAt(le.length - Ct - 1) == Jt.charCodeAt(Jt.length - Ct - 1); ) dt--, Ct++; $[$.length - 1] = le.slice(0, le.length - Ct).replace(/^\u200b+/, ""), $[0] = $[0].slice(dt).replace(/\u200b+$/, ""); var me = Bt(s, dt), Ce = Bt(x, ft.length ? Zt(ft).length - Ct : 0); return $.length > 1 || $[0] || T(me, Ce) ? (ds(c.doc, $, me, Ce, "+input"), !0) : void 0; }, rn.prototype.ensurePolled = function() { this.forceCompositionEnd(); }, rn.prototype.reset = function() { this.forceCompositionEnd(); }, rn.prototype.forceCompositionEnd = function() { this.composing && (clearTimeout(this.readDOMTimeout), this.composing = null, this.updateFromDOM(), this.div.blur(), this.div.focus()); }, rn.prototype.readFromDOMSoon = function() { var o = this; this.readDOMTimeout == null && (this.readDOMTimeout = setTimeout(function() { if (o.readDOMTimeout = null, o.composing) { if (!o.composing.done) return; o.composing = null; } o.updateFromDOM(); }, 80)); }, rn.prototype.updateFromDOM = function() { var o = this; !this.cm.isReadOnly() && this.pollContent() || fr(this.cm, function() { return Qn(o.cm); }); }, rn.prototype.setUneditable = function(o) { o.contentEditable = "false"; }, rn.prototype.onKeyPress = function(o) { o.charCode == 0 || this.composing || (o.preventDefault(), this.cm.isReadOnly() || Gn(this.cm, hc)(this.cm, String.fromCharCode(o.charCode == null ? o.keyCode : o.charCode), 0)); }, rn.prototype.readOnlyChanged = function(o) { this.div.contentEditable = String(o != "nocursor"); }, rn.prototype.onContextMenu = function() { }, rn.prototype.resetPosition = function() { }, rn.prototype.needsContentAttribute = !0; var Pn = function(o) { this.cm = o, this.prevInput = "", this.pollingFast = !1, this.polling = new Te(), this.hasSelection = !1, this.composing = null; }; function nf(o, s) { if ((s = s ? De(s) : {}).value = o.value, !s.tabindex && o.tabIndex && (s.tabindex = o.tabIndex), !s.placeholder && o.placeholder && (s.placeholder = o.placeholder), s.autofocus == null) { var u = Tt(); s.autofocus = u == o || o.getAttribute("autofocus") != null && u == document.body; } function c() { o.value = y.getValue(); } var p; if (o.form && (Kt(o.form, "submit", c), !s.leaveSubmitMethodAlone)) { var g = o.form; p = g.submit; try { var m = g.submit = function() { c(), g.submit = p, g.submit(), g.submit = m; }; } catch { } } s.finishInit = function(x) { x.save = c, x.getTextArea = function() { return o; }, x.toTextArea = function() { x.toTextArea = isNaN, c(), o.parentNode.removeChild(x.getWrapperElement()), o.style.display = "", o.form && (tt(o.form, "submit", c), s.leaveSubmitMethodAlone || typeof o.form.submit != "function" || (o.form.submit = p)); }; }, o.style.display = "none"; var y = wn(function(x) { return o.parentNode.insertBefore(x, o.nextSibling); }, s); return y; } function rf(o) { o.off = tt, o.on = Kt, o.wheelEventPixels = Dp, o.Doc = Fn, o.splitLines = _o, o.countColumn = xe, o.findColumn = qt, o.isWordChar = mt, o.Pass = pe, o.signal = ut, o.Line = Vr, o.changeEnd = co, o.scrollbarModel = Kc, o.Pos = Bt, o.cmpPos = T, o.modes = ur, o.mimeModes = ln, o.resolveMode = Co, o.getMode = Jr, o.modeExtensions = Wn, o.extendMode = Nn, o.copyState = $n, o.startState = mo, o.innerMode = zo, o.commands = ms, o.keyMap = uo, o.keyName = Ou, o.isModifierKey = sc, o.lookupKey = Mi, o.normalizeKeyMap = sl, o.StringStream = qe, o.SharedTextMarker = pa, o.TextMarker = ei, o.LineWidget = ua, o.e_preventDefault = We, o.e_stopPropagation = Ln, o.e_stop = Ne, o.addClass = Qt, o.contains = Lt, o.rmClass = nt, o.keyNames = to; } Pn.prototype.init = function(o) { var s = this, u = this, c = this.cm; this.createField(o); var p = this.textarea; function g(m) { if (!yt(c, m)) { if (c.somethingSelected()) dl({ lineWise: !1, text: c.getSelections() }); else { if (!c.options.lineWiseCopyCut) return; var y = Hu(c); dl({ lineWise: !0, text: y.text }), m.type == "cut" ? c.setSelections(y.ranges, null, ce) : (u.prevInput = "", p.value = y.text.join(` `), Se(p)); } m.type == "cut" && (c.state.cutIncoming = +/* @__PURE__ */ new Date()); } } o.wrapper.insertBefore(this.wrapper, o.wrapper.firstChild), Dt && (p.style.width = "0px"), Kt(p, "input", function() { z && k >= 9 && s.hasSelection && (s.hasSelection = null), u.poll(); }), Kt(p, "paste", function(m) { yt(c, m) || Ru(m, c) || (c.state.pasteIncoming = +/* @__PURE__ */ new Date(), u.fastPoll()); }), Kt(p, "cut", g), Kt(p, "copy", g), Kt(o.scroller, "paste", function(m) { if (!A(o, m) && !yt(c, m)) { if (!p.dispatchEvent) return c.state.pasteIncoming = +/* @__PURE__ */ new Date(), void u.focus(); var y = new Event("paste"); y.clipboardData = m.clipboardData, p.dispatchEvent(y); } }), Kt(o.lineSpace, "selectstart", function(m) { A(o, m) || We(m); }), Kt(p, "compositionstart", function() { var m = c.getCursor("from"); u.composing && u.composing.range.clear(), u.composing = { start: m, range: c.markText(m, c.getCursor("to"), { className: "CodeMirror-composing" }) }; }), Kt(p, "compositionend", function() { u.composing && (u.poll(), u.composing.range.clear(), u.composing = null); }); }, Pn.prototype.createField = function(o) { this.wrapper = Uu(), this.textarea = this.wrapper.firstChild; }, Pn.prototype.screenReaderLabelChanged = function(o) { o ? this.textarea.setAttribute("aria-label", o) : this.textarea.removeAttribute("aria-label"); }, Pn.prototype.prepareSelection = function() { var o = this.cm, s = o.display, u = o.doc, c = Gs(o); if (o.options.moveInputWithCursor) { var p = kr(o, u.sel.primary().head, "div"), g = s.wrapper.getBoundingClientRect(), m = s.lineDiv.getBoundingClientRect(); c.teTop = Math.max(0, Math.min(s.wrapper.clientHeight - 10, p.top + m.top - g.top)), c.teLeft = Math.max(0, Math.min(s.wrapper.clientWidth - 10, p.left + m.left - g.left)); } return c; }, Pn.prototype.showSelection = function(o) { var s = this.cm.display; rt(s.cursorDiv, o.cursors), rt(s.selectionDiv, o.selection), o.teTop != null && (this.wrapper.style.top = o.teTop + "px", this.wrapper.style.left = o.teLeft + "px"); }, Pn.prototype.reset = function(o) { if (!this.contextMenuPending && !this.composing) { var s = this.cm; if (s.somethingSelected()) { this.prevInput = ""; var u = s.getSelection(); this.textarea.value = u, s.state.focused && Se(this.textarea), z && k >= 9 && (this.hasSelection = u); } else o || (this.prevInput = this.textarea.value = "", z && k >= 9 && (this.hasSelection = null)); } }, Pn.prototype.getField = function() { return this.textarea; }, Pn.prototype.supportsTouch = function() { return !1; }, Pn.prototype.focus = function() { if (this.cm.options.readOnly != "nocursor" && (!xt || Tt() != this.textarea)) try { this.textarea.focus(); } catch { } }, Pn.prototype.blur = function() { this.textarea.blur(); }, Pn.prototype.resetPosition = function() { this.wrapper.style.top = this.wrapper.style.left = 0; }, Pn.prototype.receivedFocus = function() { this.slowPoll(); }, Pn.prototype.slowPoll = function() { var o = this; this.pollingFast || this.polling.set(this.cm.options.pollInterval, function() { o.poll(), o.cm.state.focused && o.slowPoll(); }); }, Pn.prototype.fastPoll = function() { var o = !1, s = this; function u() { s.poll() || o ? (s.pollingFast = !1, s.slowPoll()) : (o = !0, s.polling.set(60, u)); } s.pollingFast = !0, s.polling.set(20, u); }, Pn.prototype.poll = function() { var o = this, s = this.cm, u = this.textarea, c = this.prevInput; if (this.contextMenuPending || !s.state.focused || Vo(u) && !c && !this.composing || s.isReadOnly() || s.options.disableInput || s.state.keySeq) return !1; var p = u.value; if (p == c && !s.somethingSelected()) return !1; if (z && k >= 9 && this.hasSelection === p || bt && /[\uf700-\uf7ff]/.test(p)) return s.display.input.reset(), !1; if (s.doc.sel == s.display.selForContextMenu) { var g = p.charCodeAt(0); if (g != 8203 || c || (c = "​"), g == 8666) return this.reset(), this.cm.execCommand("undo"); } for (var m = 0, y = Math.min(c.length, p.length); m < y && c.charCodeAt(m) == p.charCodeAt(m); ) ++m; return fr(s, function() { hc(s, p.slice(m), c.length - m, null, o.composing ? "*compose" : null), p.length > 1e3 || p.indexOf(` `) > -1 ? u.value = o.prevInput = "" : o.prevInput = p, o.composing && (o.composing.range.clear(), o.composing.range = s.markText(o.composing.start, s.getCursor("to"), { className: "CodeMirror-composing" })); }), !0; }, Pn.prototype.ensurePolled = function() { this.pollingFast && this.poll() && (this.pollingFast = !1); }, Pn.prototype.onKeyPress = function() { z && k >= 9 && (this.hasSelection = null), this.fastPoll(); }, Pn.prototype.onContextMenu = function(o) { var s = this, u = s.cm, c = u.display, p = s.textarea; s.contextMenuPending && s.contextMenuPending(); var g = wi(u, o), m = c.scroller.scrollTop; if (g && !ot) { u.options.resetSelectionOnContextMenu && u.doc.sel.contains(g) == -1 && Gn(u, tr)(u.doc, Qo(g), ce); var y, x = p.style.cssText, O = s.wrapper.style.cssText, B = s.wrapper.offsetParent.getBoundingClientRect(); if (s.wrapper.style.cssText = "position: static", p.style.cssText = `position: absolute; width: 30px; height: 30px; top: ` + (o.clientY - B.top - 5) + "px; left: " + (o.clientX - B.left - 5) + `px; z-index: 1000; background: ` + (z ? "rgba(255, 255, 255, .05)" : "transparent") + `; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`, P && (y = window.scrollY), c.input.focus(), P && window.scrollTo(null, y), c.input.reset(), u.somethingSelected() || (p.value = s.prevInput = " "), s.contextMenuPending = dt, c.selForContextMenu = u.doc.sel, clearTimeout(c.detectingSelectAll), z && k >= 9 && ft(), j) { Ne(o); var $ = function() { tt(window, "mouseup", $), setTimeout(dt, 20); }; Kt(window, "mouseup", $); } else setTimeout(dt, 50); } function ft() { if (p.selectionStart != null) { var Ct = u.somethingSelected(), Rt = "​" + (Ct ? p.value : ""); p.value = "⇚", p.value = Rt, s.prevInput = Ct ? "" : "​", p.selectionStart = 1, p.selectionEnd = Rt.length, c.selForContextMenu = u.doc.sel; } } function dt() { if (s.contextMenuPending == dt && (s.contextMenuPending = !1, s.wrapper.style.cssText = O, p.style.cssText = x, z && k < 9 && c.scrollbars.setScrollTop(c.scroller.scrollTop = m), p.selectionStart != null)) { (!z || z && k < 9) && ft(); var Ct = 0, Rt = function() { c.selForContextMenu == u.doc.sel && p.selectionStart == 0 && p.selectionEnd > 0 && s.prevInput == "​" ? Gn(u, uu)(u) : Ct++ < 10 ? c.detectingSelectAll = setTimeout(Rt, 500) : (c.selForContextMenu = null, c.input.reset()); }; c.detectingSelectAll = setTimeout(Rt, 200); } } }, Pn.prototype.readOnlyChanged = function(o) { o || this.reset(), this.textarea.disabled = o == "nocursor", this.textarea.readOnly = !!o; }, Pn.prototype.setUneditable = function() { }, Pn.prototype.needsContentAttribute = !1, Vu(wn), vc(wn); var Bu = "iter insert remove copy getEditor constructor".split(" "); for (var xs in Fn.prototype) Fn.prototype.hasOwnProperty(xs) && be(Bu, xs) < 0 && (wn.prototype[xs] = function(o) { return function() { return o.apply(this.doc, arguments); }; }(Fn.prototype[xs])); return Re(Fn), wn.inputStyles = { textarea: Pn, contenteditable: rn }, wn.defineMode = function(o) { wn.defaults.mode || o == "null" || (wn.defaults.mode = o), Ho.apply(this, arguments); }, wn.defineMIME = Lr, wn.defineMode("null", function() { return { token: function(o) { return o.skipToEnd(); } }; }), wn.defineMIME("text/plain", "null"), wn.defineExtension = function(o, s) { wn.prototype[o] = s; }, wn.defineDocExtension = function(o, s) { Fn.prototype[o] = s; }, wn.fromTextArea = nf, rf(wn), wn.version = "5.65.6", wn; }(); }, 629: (S, H, pt) => { (function(at) { function _t(j) { for (var V = {}, Y = 0; Y < j.length; ++Y) V[j[Y].toLowerCase()] = !0; return V; } at.defineMode("css", function(j, V) { var Y = V.inline; V.propertyKeywords || (V = at.resolveMode("text/css")); var nt, wt, rt = j.indentUnit, gt = V.tokenHooks, N = V.documentTypes || {}, Lt = V.mediaTypes || {}, Tt = V.mediaFeatures || {}, Qt = V.mediaValueKeywords || {}, Oe = V.propertyKeywords || {}, Se = V.nonStandardPropertyKeywords || {}, _e = V.fontProperties || {}, De = V.counterDescriptors || {}, xe = V.colorKeywords || {}, Te = V.valueKeywords || {}, be = V.allowNested, ge = V.lineComment, pe = V.supportsAtComponent === !0, ce = j.highlightNonStandardPropertyKeywords !== !1; function st(mt, zt) { return nt = zt, mt; } function Xt(mt, zt) { var b = mt.next(); if (gt[b]) { var I = gt[b](mt, zt); if (I !== !1) return I; } return b == "@" ? (mt.eatWhile(/[\w\\\-]/), st("def", mt.current())) : b == "=" || (b == "~" || b == "|") && mt.eat("=") ? st(null, "compare") : b == '"' || b == "'" ? (zt.tokenize = qt(b), zt.tokenize(mt, zt)) : b == "#" ? (mt.eatWhile(/[\w\\\-]/), st("atom", "hash")) : b == "!" ? (mt.match(/^\s*\w*/), st("keyword", "important")) : /\d/.test(b) || b == "." && mt.eat(/\d/) ? (mt.eatWhile(/[\w.%]/), st("number", "unit")) : b !== "-" ? /[,+>*\/]/.test(b) ? st(null, "select-op") : b == "." && mt.match(/^-?[_a-z][_a-z0-9-]*/i) ? st("qualifier", "qualifier") : /[:;{}\[\]\(\)]/.test(b) ? st(null, b) : mt.match(/^[\w-.]+(?=\()/) ? (/^(url(-prefix)?|domain|regexp)$/i.test(mt.current()) && (zt.tokenize = ne), st("variable callee", "variable")) : /[\w\\\-]/.test(b) ? (mt.eatWhile(/[\w\\\-]/), st("property", "word")) : st(null, null) : /[\d.]/.test(mt.peek()) ? (mt.eatWhile(/[\w.%]/), st("number", "unit")) : mt.match(/^-[\w\\\-]*/) ? (mt.eatWhile(/[\w\\\-]/), mt.match(/^\s*:/, !1) ? st("variable-2", "variable-definition") : st("variable-2", "variable")) : mt.match(/^\w+-/) ? st("meta", "meta") : void 0; } function qt(mt) { return function(zt, b) { for (var I, U = !1; (I = zt.next()) != null; ) { if (I == mt && !U) { mt == ")" && zt.backUp(1); break; } U = !U && I == "\\"; } return (I == mt || !U && mt != ")") && (b.tokenize = null), st("string", "string"); }; } function ne(mt, zt) { return mt.next(), mt.match(/^\s*[\"\')]/, !1) ? zt.tokenize = null : zt.tokenize = qt(")"), st(null, "("); } function ae(mt, zt, b) { this.type = mt, this.indent = zt, this.prev = b; } function Zt(mt, zt, b, I) { return mt.context = new ae(b, zt.indentation() + (I === !1 ? 0 : rt), mt.context), b; } function Ae(mt) { return mt.context.prev && (mt.context = mt.context.prev), mt.context.type; } function Ke(mt, zt, b) { return Rn[b.context.type](mt, zt, b); } function Xe(mt, zt, b, I) { for (var U = I || 1; U > 0; U--) b.context = b.context.prev; return Ke(mt, zt, b); } function vn(mt) { var zt = mt.current().toLowerCase(); wt = Te.hasOwnProperty(zt) ? "atom" : xe.hasOwnProperty(zt) ? "keyword" : "variable"; } var Rn = { top: function(mt, zt, b) { if (mt == "{") return Zt(b, zt, "block"); if (mt == "}" && b.context.prev) return Ae(b); if (pe && /@component/i.test(mt)) return Zt(b, zt, "atComponentBlock"); if (/^@(-moz-)?document$/i.test(mt)) return Zt(b, zt, "documentTypes"); if (/^@(media|supports|(-moz-)?document|import)$/i.test(mt)) return Zt(b, zt, "atBlock"); if (/^@(font-face|counter-style)/i.test(mt)) return b.stateArg = mt, "restricted_atBlock_before"; if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(mt)) return "keyframes"; if (mt && mt.charAt(0) == "@") return Zt(b, zt, "at"); if (mt == "hash") wt = "builtin"; else if (mt == "word") wt = "tag"; else { if (mt == "variable-definition") return "maybeprop"; if (mt == "interpolation") return Zt(b, zt, "interpolation"); if (mt == ":") return "pseudo"; if (be && mt == "(") return Zt(b, zt, "parens"); } return b.context.type; }, block: function(mt, zt, b) { if (mt == "word") { var I = zt.current().toLowerCase(); return Oe.hasOwnProperty(I) ? (wt = "property", "maybeprop") : Se.hasOwnProperty(I) ? (wt = ce ? "string-2" : "property", "maybeprop") : be ? (wt = zt.match(/^\s*:(?:\s|$)/, !1) ? "property" : "tag", "block") : (wt += " error", "maybeprop"); } return mt == "meta" ? "block" : be || mt != "hash" && mt != "qualifier" ? Rn.top(mt, zt, b) : (wt = "error", "block"); }, maybeprop: function(mt, zt, b) { return mt == ":" ? Zt(b, zt, "prop") : Ke(mt, zt, b); }, prop: function(mt, zt, b) { if (mt == ";") return Ae(b); if (mt == "{" && be) return Zt(b, zt, "propBlock"); if (mt == "}" || mt == "{") return Xe(mt, zt, b); if (mt == "(") return Zt(b, zt, "parens"); if (mt != "hash" || /^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(zt.current())) { if (mt == "word") vn(zt); else if (mt == "interpolation") return Zt(b, zt, "interpolation"); } else wt += " error"; return "prop"; }, propBlock: function(mt, zt, b) { return mt == "}" ? Ae(b) : mt == "word" ? (wt = "property", "maybeprop") : b.context.type; }, parens: function(mt, zt, b) { return mt == "{" || mt == "}" ? Xe(mt, zt, b) : mt == ")" ? Ae(b) : mt == "(" ? Zt(b, zt, "parens") : mt == "interpolation" ? Zt(b, zt, "interpolation") : (mt == "word" && vn(zt), "parens"); }, pseudo: function(mt, zt, b) { return mt == "meta" ? "pseudo" : mt == "word" ? (wt = "variable-3", b.context.type) : Ke(mt, zt, b); }, documentTypes: function(mt, zt, b) { return mt == "word" && N.hasOwnProperty(zt.current()) ? (wt = "tag", b.context.type) : Rn.atBlock(mt, zt, b); }, atBlock: function(mt, zt, b) { if (mt == "(") return Zt(b, zt, "atBlock_parens"); if (mt == "}" || mt == ";") return Xe(mt, zt, b); if (mt == "{") return Ae(b) && Zt(b, zt, be ? "block" : "top"); if (mt == "interpolation") return Zt(b, zt, "interpolation"); if (mt == "word") { var I = zt.current().toLowerCase(); wt = I == "only" || I == "not" || I == "and" || I == "or" ? "keyword" : Lt.hasOwnProperty(I) ? "attribute" : Tt.hasOwnProperty(I) ? "property" : Qt.hasOwnProperty(I) ? "keyword" : Oe.hasOwnProperty(I) ? "property" : Se.hasOwnProperty(I) ? ce ? "string-2" : "property" : Te.hasOwnProperty(I) ? "atom" : xe.hasOwnProperty(I) ? "keyword" : "error"; } return b.context.type; }, atComponentBlock: function(mt, zt, b) { return mt == "}" ? Xe(mt, zt, b) : mt == "{" ? Ae(b) && Zt(b, zt, be ? "block" : "top", !1) : (mt == "word" && (wt = "error"), b.context.type); }, atBlock_parens: function(mt, zt, b) { return mt == ")" ? Ae(b) : mt == "{" || mt == "}" ? Xe(mt, zt, b, 2) : Rn.atBlock(mt, zt, b); }, restricted_atBlock_before: function(mt, zt, b) { return mt == "{" ? Zt(b, zt, "restricted_atBlock") : mt == "word" && b.stateArg == "@counter-style" ? (wt = "variable", "restricted_atBlock_before") : Ke(mt, zt, b); }, restricted_atBlock: function(mt, zt, b) { return mt == "}" ? (b.stateArg = null, Ae(b)) : mt == "word" ? (wt = b.stateArg == "@font-face" && !_e.hasOwnProperty(zt.current().toLowerCase()) || b.stateArg == "@counter-style" && !De.hasOwnProperty(zt.current().toLowerCase()) ? "error" : "property", "maybeprop") : "restricted_atBlock"; }, keyframes: function(mt, zt, b) { return mt == "word" ? (wt = "variable", "keyframes") : mt == "{" ? Zt(b, zt, "top") : Ke(mt, zt, b); }, at: function(mt, zt, b) { return mt == ";" ? Ae(b) : mt == "{" || mt == "}" ? Xe(mt, zt, b) : (mt == "word" ? wt = "tag" : mt == "hash" && (wt = "builtin"), "at"); }, interpolation: function(mt, zt, b) { return mt == "}" ? Ae(b) : mt == "{" || mt == ";" ? Xe(mt, zt, b) : (mt == "word" ? wt = "variable" : mt != "variable" && mt != "(" && mt != ")" && (wt = "error"), "interpolation"); } }; return { startState: function(mt) { return { tokenize: null, state: Y ? "block" : "top", stateArg: null, context: new ae(Y ? "block" : "top", mt || 0, null) }; }, token: function(mt, zt) { if (!zt.tokenize && mt.eatSpace()) return null; var b = (zt.tokenize || Xt)(mt, zt); return b && typeof b == "object" && (nt = b[1], b = b[0]), wt = b, nt != "comment" && (zt.state = Rn[zt.state](nt, mt, zt)), wt; }, indent: function(mt, zt) { var b = mt.context, I = zt && zt.charAt(0), U = b.indent; return b.type != "prop" || I != "}" && I != ")" || (b = b.prev), b.prev && (I != "}" || b.type != "block" && b.type != "top" && b.type != "interpolation" && b.type != "restricted_atBlock" ? (I != ")" || b.type != "parens" && b.type != "atBlock_parens") && (I != "{" || b.type != "at" && b.type != "atBlock") || (U = Math.max(0, b.indent - rt)) : U = (b = b.prev).indent), U; }, electricChars: "}", blockCommentStart: "/*", blockCommentEnd: "*/", blockCommentContinue: " * ", lineComment: ge, fold: "brace" }; }); var J = ["domain", "regexp", "url", "url-prefix"], W = _t(J), z = ["all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed"], k = _t(z), P = ["width", "min-width", "max-width", "height", "min-height", "max-height", "device-width", "min-device-width", "max-device-width", "device-height", "min-device-height", "max-device-height", "aspect-ratio", "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", "max-color", "color-index", "min-color-index", "max-color-index", "monochrome", "min-monochrome", "max-monochrome", "resolution", "min-resolution", "max-resolution", "scan", "grid", "orientation", "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio", "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme", "dynamic-range", "video-dynamic-range"], E = _t(P), M = ["landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", "interlace", "progressive", "dark", "light", "standard", "high"], D = _t(M), ot = ["align-content", "align-items", "align-self", "alignment-adjust", "alignment-baseline", "all", "anchor-point", "animation", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timing-function", "appearance", "azimuth", "backdrop-filter", "backface-visibility", "background", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "baseline-shift", "binding", "bleed", "block-size", "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target", "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius", "border-bottom-style", "border-bottom-width", "border-collapse", "border-color", "border-image", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width", "border-left", "border-left-color", "border-left-style", "border-left-width", "border-radius", "border-right", "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-style", "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-style", "border-top-width", "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count", "column-fill", "column-gap", "column-rule", "column-rule-color", "column-rule-style", "column-rule-width", "column-span", "column-width", "columns", "contain", "content", "counter-increment", "counter-reset", "crop", "cue", "cue-after", "cue-before", "cursor", "direction", "display", "dominant-baseline", "drop-initial-after-adjust", "drop-initial-after-align", "drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size", "drop-initial-value", "elevation", "empty-cells", "fit", "fit-content", "fit-position", "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into", "font", "font-family", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-synthesis", "font-variant", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position", "font-variation-settings", "font-weight", "gap", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap", "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns", "grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon", "image-orientation", "image-rendering", "image-resolution", "inline-box-align", "inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline", "inset-inline-end", "inset-inline-start", "isolation", "justify-content", "justify-items", "justify-self", "left", "letter-spacing", "line-break", "line-height", "line-height-step", "line-stacking", "line-stacking-ruby", "line-stacking-shift", "line-stacking-strategy", "list-style", "list-style-image", "list-style-position", "list-style-type", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "marks", "marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed", "marquee-style", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "max-block-size", "max-height", "max-inline-size", "max-width", "min-block-size", "min-height", "min-inline-size", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index", "nav-left", "nav-right", "nav-up", "object-fit", "object-position", "offset", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "opacity", "order", "orphans", "outline", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", "page", "page-break-after", "page-break-before", "page-break-inside", "page-policy", "pause", "pause-after", "pause-before", "perspective", "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position", "presentation-level", "punctuation-trim", "quotes", "region-break-after", "region-break-before", "region-break-inside", "region-fragment", "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", "right", "rotate", "rotation", "rotation-point", "row-gap", "ruby-align", "ruby-overhang", "ruby-position", "ruby-span", "scale", "scroll-behavior", "scroll-margin", "scroll-margin-block", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom", "scroll-margin-inline", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right", "scroll-margin-top", "scroll-padding", "scroll-padding-block", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end", "scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right", "scroll-padding-top", "scroll-snap-align", "scroll-snap-type", "shape-image-threshold", "shape-inside", "shape-margin", "shape-outside", "size", "speak", "speak-as", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", "tab-size", "table-layout", "target", "target-name", "target-new", "target-position", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-color", "text-decoration-line", "text-decoration-skip", "text-decoration-skip-ink", "text-decoration-style", "text-emphasis", "text-emphasis-color", "text-emphasis-position", "text-emphasis-style", "text-height", "text-indent", "text-justify", "text-orientation", "text-outline", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", "text-wrap", "top", "touch-action", "transform", "transform-origin", "transform-style", "transition", "transition-delay", "transition-duration", "transition-property", "transition-timing-function", "translate", "unicode-bidi", "user-select", "vertical-align", "visibility", "voice-balance", "voice-duration", "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", "voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", "color-interpolation", "color-interpolation-filters", "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", "marker", "marker-end", "marker-mid", "marker-start", "paint-order", "shape-rendering", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", "glyph-orientation-vertical", "text-anchor", "writing-mode"], it = _t(ot), Et = ["accent-color", "aspect-ratio", "border-block", "border-block-color", "border-block-end", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-block-start", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-style", "border-block-width", "border-inline", "border-inline-color", "border-inline-end", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width", "border-inline-start", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-style", "border-inline-width", "content-visibility", "margin-block", "margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end", "margin-inline-start", "overflow-anchor", "overscroll-behavior", "padding-block", "padding-block-end", "padding-block-start", "padding-inline", "padding-inline-end", "padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color", "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", "scrollbar-track-color", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", "shape-inside", "zoom"], jt = _t(Et), Dt = _t(["font-display", "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", "font-stretch", "font-weight", "font-style"]), ee = _t(["additive-symbols", "fallback", "negative", "pad", "prefix", "range", "speak-as", "suffix", "symbols", "system"]), xt = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"], bt = _t(xt), Wt = ["above", "absolute", "activeborder", "additive", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page", "avoid-region", "axis-pan", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "blink", "block", "block-axis", "blur", "bold", "bolder", "border", "border-box", "both", "bottom", "break", "break-all", "break-word", "brightness", "bullets", "button", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian", "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse", "compact", "condensed", "conic-gradient", "contain", "content", "contents", "content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop", "cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal", "decimal-leading-zero", "default", "default-button", "dense", "destination-atop", "destination-in", "destination-out", "destination-over", "devanagari", "difference", "disc", "discard", "disclosure-closed", "disclosure-open", "document", "dot-dash", "dot-dot-dash", "dotted", "double", "down", "drop-shadow", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fill-box", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes", "forwards", "from", "geometricPrecision", "georgian", "grayscale", "graytext", "grid", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew", "help", "hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "hue-rotate", "icon", "ignore", "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "japanese-formal", "japanese-informal", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten", "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "manipulation", "match", "matrix", "matrix3d", "media-play-button", "media-slider", "media-sliderthumb", "media-volume-slider", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button", "menutext", "message-box", "middle", "min-intrinsic", "mix", "mongolian", "monospace", "move", "multiple", "multiple_mask_images", "multiply", "myanmar", "n-resize", "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote", "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", "painted", "page", "paused", "persian", "perspective", "pinch-zoom", "plus-darker", "plus-lighter", "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", "radial-gradient", "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", "relative", "repeat", "repeating-linear-gradient", "repeating-radial-gradient", "repeating-conic-gradient", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running", "s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen", "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end", "semi-condensed", "semi-expanded", "separate", "sepia", "serif", "show", "sidama", "simp-chinese-formal", "simp-chinese-informal", "single", "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali", "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "stroke-box", "sub", "subpixel-antialiased", "svg_masks", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row", "table-row-group", "tamil", "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", "trad-chinese-formal", "trad-chinese-informal", "transform", "translate", "translate3d", "translateX", "translateY", "translateZ", "transparent", "ultra-condensed", "ultra-expanded", "underline", "unidirectional-pan", "unset", "up", "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", "var", "vertical", "vertical-text", "view-box", "visible", "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor", "xx-large", "xx-small"], Ft = _t(Wt), Ht = J.concat(z).concat(P).concat(M).concat(ot).concat(Et).concat(xt).concat(Wt); function Q(j, V) { for (var Y, nt = !1; (Y = j.next()) != null; ) { if (nt && Y == "/") { V.tokenize = null; break; } nt = Y == "*"; } return ["comment", "comment"]; } at.registerHelper("hintWords", "css", Ht), at.defineMIME("text/css", { documentTypes: W, mediaTypes: k, mediaFeatures: E, mediaValueKeywords: D, propertyKeywords: it, nonStandardPropertyKeywords: jt, fontProperties: Dt, counterDescriptors: ee, colorKeywords: bt, valueKeywords: Ft, tokenHooks: { "/": function(j, V) { return !!j.eat("*") && (V.tokenize = Q, Q(j, V)); } }, name: "css" }), at.defineMIME("text/x-scss", { mediaTypes: k, mediaFeatures: E, mediaValueKeywords: D, propertyKeywords: it, nonStandardPropertyKeywords: jt, colorKeywords: bt, valueKeywords: Ft, fontProperties: Dt, allowNested: !0, lineComment: "//", tokenHooks: { "/": function(j, V) { return j.eat("/") ? (j.skipToEnd(), ["comment", "comment"]) : j.eat("*") ? (V.tokenize = Q, Q(j, V)) : ["operator", "operator"]; }, ":": function(j) { return !!j.match(/^\s*\{/, !1) && [null, null]; }, $: function(j) { return j.match(/^[\w-]+/), j.match(/^\s*:/, !1) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"]; }, "#": function(j) { return !!j.eat("{") && [null, "interpolation"]; } }, name: "css", helperType: "scss" }), at.defineMIME("text/x-less", { mediaTypes: k, mediaFeatures: E, mediaValueKeywords: D, propertyKeywords: it, nonStandardPropertyKeywords: jt, colorKeywords: bt, valueKeywords: Ft, fontProperties: Dt, allowNested: !0, lineComment: "//", tokenHooks: { "/": function(j, V) { return j.eat("/") ? (j.skipToEnd(), ["comment", "comment"]) : j.eat("*") ? (V.tokenize = Q, Q(j, V)) : ["operator", "operator"]; }, "@": function(j) { return j.eat("{") ? [null, "interpolation"] : !j.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, !1) && (j.eatWhile(/[\w\\\-]/), j.match(/^\s*:/, !1) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"]); }, "&": function() { return ["atom", "atom"]; } }, name: "css", helperType: "less" }), at.defineMIME("text/x-gss", { documentTypes: W, mediaTypes: k, mediaFeatures: E, propertyKeywords: it, nonStandardPropertyKeywords: jt, fontProperties: Dt, counterDescriptors: ee, colorKeywords: bt, valueKeywords: Ft, supportsAtComponent: !0, tokenHooks: { "/": function(j, V) { return !!j.eat("*") && (V.tokenize = Q, Q(j, V)); } }, name: "css", helperType: "gss" }); })(pt(631)); }, 531: (S, H, pt) => { (function(at) { var _t = { script: [["lang", /(javascript|babel)/i, "javascript"], ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"], ["type", /./, "text/plain"], [null, null, "javascript"]], style: [["lang", /^css$/i, "css"], ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"], ["type", /./, "text/plain"], [null, null, "css"]] }; function J(D, ot, it) { var Et = D.current(), jt = Et.search(ot); return jt > -1 ? D.backUp(Et.length - jt) : Et.match(/<\/?$/) && (D.backUp(Et.length), D.match(ot, !1) || D.match(Et)), it; } var W = {}; function z(D) { var ot = W[D]; return ot || (W[D] = new RegExp("\\s+" + D + `\\s*=\\s*('|")?([^'"]+)('|")?\\s*`)); } function k(D, ot) { var it = D.match(z(ot)); return it ? /^\s*(.*?)\s*$/.exec(it[2])[1] : ""; } function P(D, ot) { return new RegExp((ot ? "^" : "") + "", "i"); } function E(D, ot) { for (var it in D) for (var Et = ot[it] || (ot[it] = []), jt = D[it], Dt = jt.length - 1; Dt >= 0; Dt--) Et.unshift(jt[Dt]); } function M(D, ot) { for (var it = 0; it < D.length; it++) { var Et = D[it]; if (!Et[0] || Et[1].test(k(ot, Et[0]))) return Et[2]; } } at.defineMode("htmlmixed", function(D, ot) { var it = at.getMode(D, { name: "xml", htmlMode: !0, multilineTagIndentFactor: ot.multilineTagIndentFactor, multilineTagIndentPastTag: ot.multilineTagIndentPastTag, allowMissingTagName: ot.allowMissingTagName }), Et = {}, jt = ot && ot.tags, Dt = ot && ot.scriptTypes; if (E(_t, Et), jt && E(jt, Et), Dt) for (var ee = Dt.length - 1; ee >= 0; ee--) Et.script.unshift(["type", Dt[ee].matches, Dt[ee].mode]); function xt(bt, Wt) { var Ft, Ht = it.token(bt, Wt.htmlState), Q = /\btag\b/.test(Ht); if (Q && !/[<>\s\/]/.test(bt.current()) && (Ft = Wt.htmlState.tagName && Wt.htmlState.tagName.toLowerCase()) && Et.hasOwnProperty(Ft)) Wt.inTag = Ft + " "; else if (Wt.inTag && Q && />$/.test(bt.current())) { var j = /^([\S]+) (.*)/.exec(Wt.inTag); Wt.inTag = null; var V = bt.current() == ">" && M(Et[j[1]], j[2]), Y = at.getMode(D, V), nt = P(j[1], !0), wt = P(j[1], !1); Wt.token = function(rt, gt) { return rt.match(nt, !1) ? (gt.token = xt, gt.localState = gt.localMode = null, null) : J(rt, wt, gt.localMode.token(rt, gt.localState)); }, Wt.localMode = Y, Wt.localState = at.startState(Y, it.indent(Wt.htmlState, "", "")); } else Wt.inTag && (Wt.inTag += bt.current(), bt.eol() && (Wt.inTag += " ")); return Ht; } return { startState: function() { return { token: xt, inTag: null, localMode: null, localState: null, htmlState: at.startState(it) }; }, copyState: function(bt) { var Wt; return bt.localState && (Wt = at.copyState(bt.localMode, bt.localState)), { token: bt.token, inTag: bt.inTag, localMode: bt.localMode, localState: Wt, htmlState: at.copyState(it, bt.htmlState) }; }, token: function(bt, Wt) { return Wt.token(bt, Wt); }, indent: function(bt, Wt, Ft) { return !bt.localMode || /^\s*<\//.test(Wt) ? it.indent(bt.htmlState, Wt, Ft) : bt.localMode.indent ? bt.localMode.indent(bt.localState, Wt, Ft) : at.Pass; }, innerMode: function(bt) { return { state: bt.localState || bt.htmlState, mode: bt.localMode || it }; } }; }, "xml", "javascript", "css"), at.defineMIME("text/html", "htmlmixed"); })(pt(631), pt(589), pt(876), pt(629)); }, 876: (S, H, pt) => { (function(at) { at.defineMode("javascript", function(_t, J) { var W, z, k = _t.indentUnit, P = J.statementIndent, E = J.jsonld, M = J.json || E, D = J.trackScope !== !1, ot = J.typescript, it = J.wordCharacters || /[\w$\xa1-\uffff]/, Et = function() { function T(Hn) { return { type: Hn, style: "keyword" }; } var G = T("keyword a"), Mt = T("keyword b"), te = T("keyword c"), de = T("keyword d"), $e = T("operator"), oe = { type: "atom", style: "atom" }; return { if: T("if"), while: G, with: G, else: Mt, do: Mt, try: Mt, finally: Mt, return: de, break: de, continue: de, new: T("new"), delete: te, void: te, throw: te, debugger: T("debugger"), var: T("var"), const: T("var"), let: T("var"), function: T("function"), catch: T("catch"), for: T("for"), switch: T("switch"), case: T("case"), default: T("default"), in: $e, typeof: $e, instanceof: $e, true: oe, false: oe, null: oe, undefined: oe, NaN: oe, Infinity: oe, this: T("this"), class: T("class"), super: T("atom"), yield: te, export: T("export"), import: T("import"), extends: te, await: te }; }(), jt = /[+\-*&%=<>!?|~^@]/, Dt = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; function ee(T) { for (var G, Mt = !1, te = !1; (G = T.next()) != null; ) { if (!Mt) { if (G == "/" && !te) return; G == "[" ? te = !0 : te && G == "]" && (te = !1); } Mt = !Mt && G == "\\"; } } function xt(T, G, Mt) { return W = T, z = Mt, G; } function bt(T, G) { var Mt = T.next(); if (Mt == '"' || Mt == "'") return G.tokenize = Wt(Mt), G.tokenize(T, G); if (Mt == "." && T.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) return xt("number", "number"); if (Mt == "." && T.match("..")) return xt("spread", "meta"); if (/[\[\]{}\(\),;\:\.]/.test(Mt)) return xt(Mt); if (Mt == "=" && T.eat(">")) return xt("=>", "operator"); if (Mt == "0" && T.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) return xt("number", "number"); if (/\d/.test(Mt)) return T.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/), xt("number", "number"); if (Mt == "/") return T.eat("*") ? (G.tokenize = Ft, Ft(T, G)) : T.eat("/") ? (T.skipToEnd(), xt("comment", "comment")) : Bt(T, G, 1) ? (ee(T), T.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/), xt("regexp", "string-2")) : (T.eat("="), xt("operator", "operator", T.current())); if (Mt == "`") return G.tokenize = Ht, Ht(T, G); if (Mt == "#" && T.peek() == "!") return T.skipToEnd(), xt("meta", "meta"); if (Mt == "#" && T.eatWhile(it)) return xt("variable", "property"); if (Mt == "<" && T.match("!--") || Mt == "-" && T.match("->") && !/\S/.test(T.string.slice(0, T.start))) return T.skipToEnd(), xt("comment", "comment"); if (jt.test(Mt)) return Mt == ">" && G.lexical && G.lexical.type == ">" || (T.eat("=") ? Mt != "!" && Mt != "=" || T.eat("=") : /[<>*+\-|&?]/.test(Mt) && (T.eat(Mt), Mt == ">" && T.eat(Mt))), Mt == "?" && T.eat(".") ? xt(".") : xt("operator", "operator", T.current()); if (it.test(Mt)) { T.eatWhile(it); var te = T.current(); if (G.lastType != ".") { if (Et.propertyIsEnumerable(te)) { var de = Et[te]; return xt(de.type, de.style, te); } if (te == "async" && T.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, !1)) return xt("async", "keyword", te); } return xt("variable", "variable", te); } } function Wt(T) { return function(G, Mt) { var te, de = !1; if (E && G.peek() == "@" && G.match(Dt)) return Mt.tokenize = bt, xt("jsonld-keyword", "meta"); for (; (te = G.next()) != null && (te != T || de); ) de = !de && te == "\\"; return de || (Mt.tokenize = bt), xt("string", "string"); }; } function Ft(T, G) { for (var Mt, te = !1; Mt = T.next(); ) { if (Mt == "/" && te) { G.tokenize = bt; break; } te = Mt == "*"; } return xt("comment", "comment"); } function Ht(T, G) { for (var Mt, te = !1; (Mt = T.next()) != null; ) { if (!te && (Mt == "`" || Mt == "$" && T.eat("{"))) { G.tokenize = bt; break; } te = !te && Mt == "\\"; } return xt("quasi", "string-2", T.current()); } var Q = "([{}])"; function j(T, G) { G.fatArrowAt && (G.fatArrowAt = null); var Mt = T.string.indexOf("=>", T.start); if (!(Mt < 0)) { if (ot) { var te = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(T.string.slice(T.start, Mt)); te && (Mt = te.index); } for (var de = 0, $e = !1, oe = Mt - 1; oe >= 0; --oe) { var Hn = T.string.charAt(oe), Tn = Q.indexOf(Hn); if (Tn >= 0 && Tn < 3) { if (!de) { ++oe; break; } if (--de == 0) { Hn == "(" && ($e = !0); break; } } else if (Tn >= 3 && Tn < 6) ++de; else if (it.test(Hn)) $e = !0; else if (/["'\/`]/.test(Hn)) for (; ; --oe) { if (oe == 0) return; if (T.string.charAt(oe - 1) == Hn && T.string.charAt(oe - 2) != "\\") { oe--; break; } } else if ($e && !de) { ++oe; break; } } $e && !de && (G.fatArrowAt = oe); } } var V = { atom: !0, number: !0, variable: !0, string: !0, regexp: !0, this: !0, import: !0, "jsonld-keyword": !0 }; function Y(T, G, Mt, te, de, $e) { this.indented = T, this.column = G, this.type = Mt, this.prev = de, this.info = $e, te != null && (this.align = te); } function nt(T, G) { if (!D) return !1; for (var Mt = T.localVars; Mt; Mt = Mt.next) if (Mt.name == G) return !0; for (var te = T.context; te; te = te.prev) for (Mt = te.vars; Mt; Mt = Mt.next) if (Mt.name == G) return !0; } function wt(T, G, Mt, te, de) { var $e = T.cc; for (rt.state = T, rt.stream = de, rt.marked = null, rt.cc = $e, rt.style = G, T.lexical.hasOwnProperty("align") || (T.lexical.align = !0); ; ) if (($e.length ? $e.pop() : M ? qt : st)(Mt, te)) { for (; $e.length && $e[$e.length - 1].lex; ) $e.pop()(); return rt.marked ? rt.marked : Mt == "variable" && nt(T, te) ? "variable-2" : G; } } var rt = { state: null, column: null, marked: null, cc: null }; function gt() { for (var T = arguments.length - 1; T >= 0; T--) rt.cc.push(arguments[T]); } function N() { return gt.apply(null, arguments), !0; } function Lt(T, G) { for (var Mt = G; Mt; Mt = Mt.next) if (Mt.name == T) return !0; return !1; } function Tt(T) { var G = rt.state; if (rt.marked = "def", D) { if (G.context) { if (G.lexical.info == "var" && G.context && G.context.block) { var Mt = Qt(T, G.context); if (Mt != null) return void (G.context = Mt); } else if (!Lt(T, G.localVars)) return void (G.localVars = new _e(T, G.localVars)); } J.globalVars && !Lt(T, G.globalVars) && (G.globalVars = new _e(T, G.globalVars)); } } function Qt(T, G) { if (G) { if (G.block) { var Mt = Qt(T, G.prev); return Mt ? Mt == G.prev ? G : new Se(Mt, G.vars, !0) : null; } return Lt(T, G.vars) ? G : new Se(G.prev, new _e(T, G.vars), !1); } return null; } function Oe(T) { return T == "public" || T == "private" || T == "protected" || T == "abstract" || T == "readonly"; } function Se(T, G, Mt) { this.prev = T, this.vars = G, this.block = Mt; } function _e(T, G) { this.name = T, this.next = G; } var De = new _e("this", new _e("arguments", null)); function xe() { rt.state.context = new Se(rt.state.context, rt.state.localVars, !1), rt.state.localVars = De; } function Te() { rt.state.context = new Se(rt.state.context, rt.state.localVars, !0), rt.state.localVars = null; } function be() { rt.state.localVars = rt.state.context.vars, rt.state.context = rt.state.context.prev; } function ge(T, G) { var Mt = function() { var te = rt.state, de = te.indented; if (te.lexical.type == "stat") de = te.lexical.indented; else for (var $e = te.lexical; $e && $e.type == ")" && $e.align; $e = $e.prev) de = $e.indented; te.lexical = new Y(de, rt.stream.column(), T, null, te.lexical, G); }; return Mt.lex = !0, Mt; } function pe() { var T = rt.state; T.lexical.prev && (T.lexical.type == ")" && (T.indented = T.lexical.indented), T.lexical = T.lexical.prev); } function ce(T) { function G(Mt) { return Mt == T ? N() : T == ";" || Mt == "}" || Mt == ")" || Mt == "]" ? gt() : N(G); } return G; } function st(T, G) { return T == "var" ? N(ge("vardef", G), fn, ce(";"), pe) : T == "keyword a" ? N(ge("form"), ae, st, pe) : T == "keyword b" ? N(ge("form"), st, pe) : T == "keyword d" ? rt.stream.match(/^\s*$/, !1) ? N() : N(ge("stat"), Ae, ce(";"), pe) : T == "debugger" ? N(ce(";")) : T == "{" ? N(ge("}"), Te, Qe, pe, be) : T == ";" ? N() : T == "if" ? (rt.state.lexical.info == "else" && rt.state.cc[rt.state.cc.length - 1] == pe && rt.state.cc.pop()(), N(ge("form"), ae, st, pe, Vo)) : T == "function" ? N(ur) : T == "for" ? N(ge("form"), Te, xo, st, be, pe) : T == "class" || ot && G == "interface" ? (rt.marked = "keyword", N(ge("form", T == "class" ? T : G), Jr, pe)) : T == "variable" ? ot && G == "declare" ? (rt.marked = "keyword", N(st)) : ot && (G == "module" || G == "enum" || G == "type") && rt.stream.match(/^\s*\w/, !1) ? (rt.marked = "keyword", G == "enum" ? N(In) : G == "type" ? N(Ho, ce("operator"), yt, ce(";")) : N(ge("form"), _n, ce("{"), ge("}"), Qe, pe, pe)) : ot && G == "namespace" ? (rt.marked = "keyword", N(ge("form"), qt, st, pe)) : ot && G == "abstract" ? (rt.marked = "keyword", N(st)) : N(ge("stat"), ht) : T == "switch" ? N(ge("form"), ae, ce("{"), ge("}", "switch"), Te, Qe, pe, pe, be) : T == "case" ? N(qt, ce(":")) : T == "default" ? N(ce(":")) : T == "catch" ? N(ge("form"), xe, Xt, st, pe, be) : T == "export" ? N(ge("stat"), zo, pe) : T == "import" ? N(ge("stat"), qe, pe) : T == "async" ? N(st) : G == "@" ? N(qt, st) : gt(ge("stat"), qt, ce(";"), pe); } function Xt(T) { if (T == "(") return N(Lr, ce(")")); } function qt(T, G) { return Zt(T, G, !1); } function ne(T, G) { return Zt(T, G, !0); } function ae(T) { return T != "(" ? gt() : N(ge(")"), Ae, ce(")"), pe); } function Zt(T, G, Mt) { if (rt.state.fatArrowAt == rt.stream.start) { var te = Mt ? zt : mt; if (T == "(") return N(xe, ge(")"), Ve(Lr, ")"), pe, ce("=>"), te, be); if (T == "variable") return gt(xe, _n, ce("=>"), te, be); } var de = Mt ? Xe : Ke; return V.hasOwnProperty(T) ? N(de) : T == "function" ? N(ur, de) : T == "class" || ot && G == "interface" ? (rt.marked = "keyword", N(ge("form"), Co, pe)) : T == "keyword c" || T == "async" ? N(Mt ? ne : qt) : T == "(" ? N(ge(")"), Ae, ce(")"), pe, de) : T == "operator" || T == "spread" ? N(Mt ? ne : qt) : T == "[" ? N(ge("]"), Ye, pe, de) : T == "{" ? ze(Ot, "}", null, de) : T == "quasi" ? gt(vn, de) : T == "new" ? N(b(Mt)) : N(); } function Ae(T) { return T.match(/[;\}\)\],]/) ? gt() : gt(qt); } function Ke(T, G) { return T == "," ? N(Ae) : Xe(T, G, !1); } function Xe(T, G, Mt) { var te = Mt == 0 ? Ke : Xe, de = Mt == 0 ? qt : ne; return T == "=>" ? N(xe, Mt ? zt : mt, be) : T == "operator" ? /\+\+|--/.test(G) || ot && G == "!" ? N(te) : ot && G == "<" && rt.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, !1) ? N(ge(">"), Ve(yt, ">"), pe, te) : G == "?" ? N(qt, ce(":"), de) : N(de) : T == "quasi" ? gt(vn, te) : T != ";" ? T == "(" ? ze(ne, ")", "call", te) : T == "." ? N(kt, te) : T == "[" ? N(ge("]"), Ae, ce("]"), pe, te) : ot && G == "as" ? (rt.marked = "keyword", N(yt, te)) : T == "regexp" ? (rt.state.lastType = rt.marked = "operator", rt.stream.backUp(rt.stream.pos - rt.stream.start - 1), N(de)) : void 0 : void 0; } function vn(T, G) { return T != "quasi" ? gt() : G.slice(G.length - 2) != "${" ? N(vn) : N(Ae, Rn); } function Rn(T) { if (T == "}") return rt.marked = "string-2", rt.state.tokenize = Ht, N(vn); } function mt(T) { return j(rt.stream, rt.state), gt(T == "{" ? st : qt); } function zt(T) { return j(rt.stream, rt.state), gt(T == "{" ? st : ne); } function b(T) { return function(G) { return G == "." ? N(T ? U : I) : G == "variable" && ot ? N(Ar, T ? Xe : Ke) : gt(T ? ne : qt); }; } function I(T, G) { if (G == "target") return rt.marked = "keyword", N(Ke); } function U(T, G) { if (G == "target") return rt.marked = "keyword", N(Xe); } function ht(T) { return T == ":" ? N(pe, st) : gt(Ke, ce(";"), pe); } function kt(T) { if (T == "variable") return rt.marked = "property", N(); } function Ot(T, G) { return T == "async" ? (rt.marked = "property", N(Ot)) : T == "variable" || rt.style == "keyword" ? (rt.marked = "property", G == "get" || G == "set" ? N(fe) : (ot && rt.state.fatArrowAt == rt.stream.start && (Mt = rt.stream.match(/^\s*:\s*/, !1)) && (rt.state.fatArrowAt = rt.stream.pos + Mt[0].length), N(ke))) : T == "number" || T == "string" ? (rt.marked = E ? "property" : rt.style + " property", N(ke)) : T == "jsonld-keyword" ? N(ke) : ot && Oe(G) ? (rt.marked = "keyword", N(Ot)) : T == "[" ? N(qt, Kt, ce("]"), ke) : T == "spread" ? N(ne, ke) : G == "*" ? (rt.marked = "keyword", N(Ot)) : T == ":" ? gt(ke) : void 0; var Mt; } function fe(T) { return T != "variable" ? gt(ke) : (rt.marked = "property", N(ur)); } function ke(T) { return T == ":" ? N(ne) : T == "(" ? gt(ur) : void 0; } function Ve(T, G, Mt) { function te(de, $e) { if (Mt ? Mt.indexOf(de) > -1 : de == ",") { var oe = rt.state.lexical; return oe.info == "call" && (oe.pos = (oe.pos || 0) + 1), N(function(Hn, Tn) { return Hn == G || Tn == G ? gt() : gt(T); }, te); } return de == G || $e == G ? N() : Mt && Mt.indexOf(";") > -1 ? gt(T) : N(ce(G)); } return function(de, $e) { return de == G || $e == G ? N() : gt(T, te); }; } function ze(T, G, Mt) { for (var te = 3; te < arguments.length; te++) rt.cc.push(arguments[te]); return N(ge(G, Mt), Ve(T, G), pe); } function Qe(T) { return T == "}" ? N() : gt(st, Qe); } function Kt(T, G) { if (ot) { if (T == ":") return N(yt); if (G == "?") return N(Kt); } } function R(T, G) { if (ot && (T == ":" || G == "in")) return N(yt); } function tt(T) { if (ot && T == ":") return rt.stream.match(/^\s*\w+\s+is\b/, !1) ? N(qt, ut, yt) : N(yt); } function ut(T, G) { if (G == "is") return rt.marked = "keyword", N(); } function yt(T, G) { return G == "keyof" || G == "typeof" || G == "infer" || G == "readonly" ? (rt.marked = "keyword", N(G == "typeof" ? ne : yt)) : T == "variable" || G == "void" ? (rt.marked = "type", N(Ne)) : G == "|" || G == "&" ? N(yt) : T == "string" || T == "number" || T == "atom" ? N(Ne) : T == "[" ? N(ge("]"), Ve(yt, "]", ","), pe, Ne) : T == "{" ? N(ge("}"), he, pe, Ne) : T == "(" ? N(Ve(pn, ")"), Yt, Ne) : T == "<" ? N(Ve(yt, ">"), yt) : T == "quasi" ? gt(We, Ne) : void 0; } function Yt(T) { if (T == "=>") return N(yt); } function he(T) { return T.match(/[\}\)\]]/) ? N() : T == "," || T == ";" ? N(he) : gt(Re, he); } function Re(T, G) { return T == "variable" || rt.style == "keyword" ? (rt.marked = "property", N(Re)) : G == "?" || T == "number" || T == "string" ? N(Re) : T == ":" ? N(yt) : T == "[" ? N(ce("variable"), R, ce("]"), Re) : T == "(" ? gt(ln, Re) : T.match(/[;\}\)\],]/) ? void 0 : N(); } function We(T, G) { return T != "quasi" ? gt() : G.slice(G.length - 2) != "${" ? N(We) : N(yt, Ln); } function Ln(T) { if (T == "}") return rt.marked = "string-2", rt.state.tokenize = Ht, N(We); } function pn(T, G) { return T == "variable" && rt.stream.match(/^\s*[?:]/, !1) || G == "?" ? N(pn) : T == ":" ? N(yt) : T == "spread" ? N(pn) : gt(yt); } function Ne(T, G) { return G == "<" ? N(ge(">"), Ve(yt, ">"), pe, Ne) : G == "|" || T == "." || G == "&" ? N(yt) : T == "[" ? N(yt, ce("]"), Ne) : G == "extends" || G == "implements" ? (rt.marked = "keyword", N(yt)) : G == "?" ? N(yt, ce(":"), yt) : void 0; } function Ar(T, G) { if (G == "<") return N(ge(">"), Ve(yt, ">"), pe, Ne); } function Yn() { return gt(yt, jr); } function jr(T, G) { if (G == "=") return N(yt); } function fn(T, G) { return G == "enum" ? (rt.marked = "keyword", N(In)) : gt(_n, Kt, Dn, _o); } function _n(T, G) { return ot && Oe(G) ? (rt.marked = "keyword", N(_n)) : T == "variable" ? (Tt(G), N()) : T == "spread" ? N(_n) : T == "[" ? ze(Mr, "]") : T == "{" ? ze(Bn, "}") : void 0; } function Bn(T, G) { return T != "variable" || rt.stream.match(/^\s*:/, !1) ? (T == "variable" && (rt.marked = "property"), T == "spread" ? N(_n) : T == "}" ? gt() : T == "[" ? N(qt, ce("]"), ce(":"), Bn) : N(ce(":"), _n, Dn)) : (Tt(G), N(Dn)); } function Mr() { return gt(_n, Dn); } function Dn(T, G) { if (G == "=") return N(ne); } function _o(T) { if (T == ",") return N(fn); } function Vo(T, G) { if (T == "keyword b" && G == "else") return N(ge("form", "else"), st, pe); } function xo(T, G) { return G == "await" ? N(xo) : T == "(" ? N(ge(")"), Ro, pe) : void 0; } function Ro(T) { return T == "var" ? N(fn, ro) : T == "variable" ? N(ro) : gt(ro); } function ro(T, G) { return T == ")" ? N() : T == ";" ? N(ro) : G == "in" || G == "of" ? (rt.marked = "keyword", N(qt, ro)) : gt(qt, ro); } function ur(T, G) { return G == "*" ? (rt.marked = "keyword", N(ur)) : T == "variable" ? (Tt(G), N(ur)) : T == "(" ? N(xe, ge(")"), Ve(Lr, ")"), pe, tt, st, be) : ot && G == "<" ? N(ge(">"), Ve(Yn, ">"), pe, ur) : void 0; } function ln(T, G) { return G == "*" ? (rt.marked = "keyword", N(ln)) : T == "variable" ? (Tt(G), N(ln)) : T == "(" ? N(xe, ge(")"), Ve(Lr, ")"), pe, tt, be) : ot && G == "<" ? N(ge(">"), Ve(Yn, ">"), pe, ln) : void 0; } function Ho(T, G) { return T == "keyword" || T == "variable" ? (rt.marked = "type", N(Ho)) : G == "<" ? N(ge(">"), Ve(Yn, ">"), pe) : void 0; } function Lr(T, G) { return G == "@" && N(qt, Lr), T == "spread" ? N(Lr) : ot && Oe(G) ? (rt.marked = "keyword", N(Lr)) : ot && T == "this" ? N(Kt, Dn) : gt(_n, Kt, Dn); } function Co(T, G) { return T == "variable" ? Jr(T, G) : Wn(T, G); } function Jr(T, G) { if (T == "variable") return Tt(G), N(Wn); } function Wn(T, G) { return G == "<" ? N(ge(">"), Ve(Yn, ">"), pe, Wn) : G == "extends" || G == "implements" || ot && T == "," ? (G == "implements" && (rt.marked = "keyword"), N(ot ? yt : qt, Wn)) : T == "{" ? N(ge("}"), Nn, pe) : void 0; } function Nn(T, G) { return T == "async" || T == "variable" && (G == "static" || G == "get" || G == "set" || ot && Oe(G)) && rt.stream.match(/^\s+[\w$\xa1-\uffff]/, !1) ? (rt.marked = "keyword", N(Nn)) : T == "variable" || rt.style == "keyword" ? (rt.marked = "property", N($n, Nn)) : T == "number" || T == "string" ? N($n, Nn) : T == "[" ? N(qt, Kt, ce("]"), $n, Nn) : G == "*" ? (rt.marked = "keyword", N(Nn)) : ot && T == "(" ? gt(ln, Nn) : T == ";" || T == "," ? N(Nn) : T == "}" ? N() : G == "@" ? N(qt, Nn) : void 0; } function $n(T, G) { if (G == "!" || G == "?") return N($n); if (T == ":") return N(yt, Dn); if (G == "=") return N(ne); var Mt = rt.state.lexical.prev; return gt(Mt && Mt.info == "interface" ? ln : ur); } function zo(T, G) { return G == "*" ? (rt.marked = "keyword", N(or, ce(";"))) : G == "default" ? (rt.marked = "keyword", N(qt, ce(";"))) : T == "{" ? N(Ve(mo, "}"), or, ce(";")) : gt(st); } function mo(T, G) { return G == "as" ? (rt.marked = "keyword", N(ce("variable"))) : T == "variable" ? gt(ne, mo) : void 0; } function qe(T) { return T == "string" ? N() : T == "(" ? gt(qt) : T == "." ? gt(Ke) : gt(ve, rr, or); } function ve(T, G) { return T == "{" ? ze(ve, "}") : (T == "variable" && Tt(G), G == "*" && (rt.marked = "keyword"), N(Uo)); } function rr(T) { if (T == ",") return N(ve, rr); } function Uo(T, G) { if (G == "as") return rt.marked = "keyword", N(ve); } function or(T, G) { if (G == "from") return rt.marked = "keyword", N(qt); } function Ye(T) { return T == "]" ? N() : gt(Ve(ne, "]")); } function In() { return gt(ge("form"), _n, ce("{"), ge("}"), Ve(yo, "}"), pe, pe); } function yo() { return gt(_n, Dn); } function Bo(T, G) { return T.lastType == "operator" || T.lastType == "," || jt.test(G.charAt(0)) || /[,.]/.test(G.charAt(0)); } function Bt(T, G, Mt) { return G.tokenize == bt && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(G.lastType) || G.lastType == "quasi" && /\{\s*$/.test(T.string.slice(0, T.pos - (Mt || 0))); } return xe.lex = Te.lex = !0, be.lex = !0, pe.lex = !0, { startState: function(T) { var G = { tokenize: bt, lastType: "sof", cc: [], lexical: new Y((T || 0) - k, 0, "block", !1), localVars: J.localVars, context: J.localVars && new Se(null, null, !1), indented: T || 0 }; return J.globalVars && typeof J.globalVars == "object" && (G.globalVars = J.globalVars), G; }, token: function(T, G) { if (T.sol() && (G.lexical.hasOwnProperty("align") || (G.lexical.align = !1), G.indented = T.indentation(), j(T, G)), G.tokenize != Ft && T.eatSpace()) return null; var Mt = G.tokenize(T, G); return W == "comment" ? Mt : (G.lastType = W != "operator" || z != "++" && z != "--" ? W : "incdec", wt(G, Mt, W, z, T)); }, indent: function(T, G) { if (T.tokenize == Ft || T.tokenize == Ht) return at.Pass; if (T.tokenize != bt) return 0; var Mt, te = G && G.charAt(0), de = T.lexical; if (!/^\s*else\b/.test(G)) for (var $e = T.cc.length - 1; $e >= 0; --$e) { var oe = T.cc[$e]; if (oe == pe) de = de.prev; else if (oe != Vo && oe != be) break; } for (; (de.type == "stat" || de.type == "form") && (te == "}" || (Mt = T.cc[T.cc.length - 1]) && (Mt == Ke || Mt == Xe) && !/^[,\.=+\-*:?[\(]/.test(G)); ) de = de.prev; P && de.type == ")" && de.prev.type == "stat" && (de = de.prev); var Hn = de.type, Tn = te == Hn; return Hn == "vardef" ? de.indented + (T.lastType == "operator" || T.lastType == "," ? de.info.length + 1 : 0) : Hn == "form" && te == "{" ? de.indented : Hn == "form" ? de.indented + k : Hn == "stat" ? de.indented + (Bo(T, G) ? P || k : 0) : de.info != "switch" || Tn || J.doubleIndentSwitch == 0 ? de.align ? de.column + (Tn ? 0 : 1) : de.indented + (Tn ? 0 : k) : de.indented + (/^(?:case|default)\b/.test(G) ? k : 2 * k); }, electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, blockCommentStart: M ? null : "/*", blockCommentEnd: M ? null : "*/", blockCommentContinue: M ? null : " * ", lineComment: M ? null : "//", fold: "brace", closeBrackets: "()[]{}''\"\"``", helperType: M ? "json" : "javascript", jsonldMode: E, jsonMode: M, expressionAllowed: Bt, skipExpression: function(T) { wt(T, "atom", "atom", "true", new at.StringStream("", 2, null)); } }; }), at.registerHelper("wordChars", "javascript", /[\w$]/), at.defineMIME("text/javascript", "javascript"), at.defineMIME("text/ecmascript", "javascript"), at.defineMIME("application/javascript", "javascript"), at.defineMIME("application/x-javascript", "javascript"), at.defineMIME("application/ecmascript", "javascript"), at.defineMIME("application/json", { name: "javascript", json: !0 }), at.defineMIME("application/x-json", { name: "javascript", json: !0 }), at.defineMIME("application/manifest+json", { name: "javascript", json: !0 }), at.defineMIME("application/ld+json", { name: "javascript", jsonld: !0 }), at.defineMIME("text/typescript", { name: "javascript", typescript: !0 }), at.defineMIME("application/typescript", { name: "javascript", typescript: !0 }); })(pt(631)); }, 589: (S, H, pt) => { (function(at) { var _t = { autoSelfClosers: { area: !0, base: !0, br: !0, col: !0, command: !0, embed: !0, frame: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0, menuitem: !0 }, implicitlyClosed: { dd: !0, li: !0, optgroup: !0, option: !0, p: !0, rp: !0, rt: !0, tbody: !0, td: !0, tfoot: !0, th: !0, tr: !0 }, contextGrabbers: { dd: { dd: !0, dt: !0 }, dt: { dd: !0, dt: !0 }, li: { li: !0 }, option: { option: !0, optgroup: !0 }, optgroup: { optgroup: !0 }, p: { address: !0, article: !0, aside: !0, blockquote: !0, dir: !0, div: !0, dl: !0, fieldset: !0, footer: !0, form: !0, h1: !0, h2: !0, h3: !0, h4: !0, h5: !0, h6: !0, header: !0, hgroup: !0, hr: !0, menu: !0, nav: !0, ol: !0, p: !0, pre: !0, section: !0, table: !0, ul: !0 }, rp: { rp: !0, rt: !0 }, rt: { rp: !0, rt: !0 }, tbody: { tbody: !0, tfoot: !0 }, td: { td: !0, th: !0 }, tfoot: { tbody: !0 }, th: { td: !0, th: !0 }, thead: { tbody: !0, tfoot: !0 }, tr: { tr: !0 } }, doNotIndent: { pre: !0 }, allowUnquoted: !0, allowMissing: !0, caseFold: !0 }, J = { autoSelfClosers: {}, implicitlyClosed: {}, contextGrabbers: {}, doNotIndent: {}, allowUnquoted: !1, allowMissing: !1, allowMissingTagName: !1, caseFold: !1 }; at.defineMode("xml", function(W, z) { var k, P, E = W.indentUnit, M = {}, D = z.htmlMode ? _t : J; for (var ot in D) M[ot] = D[ot]; for (var ot in z) M[ot] = z[ot]; function it(N, Lt) { function Tt(Oe) { return Lt.tokenize = Oe, Oe(N, Lt); } var Qt = N.next(); return Qt == "<" ? N.eat("!") ? N.eat("[") ? N.match("CDATA[") ? Tt(Dt("atom", "]]>")) : null : N.match("--") ? Tt(Dt("comment", "-->")) : N.match("DOCTYPE", !0, !0) ? (N.eatWhile(/[\w\._\-]/), Tt(ee(1))) : null : N.eat("?") ? (N.eatWhile(/[\w\._\-]/), Lt.tokenize = Dt("meta", "?>"), "meta") : (k = N.eat("/") ? "closeTag" : "openTag", Lt.tokenize = Et, "tag bracket") : Qt == "&" ? (N.eat("#") ? N.eat("x") ? N.eatWhile(/[a-fA-F\d]/) && N.eat(";") : N.eatWhile(/[\d]/) && N.eat(";") : N.eatWhile(/[\w\.\-:]/) && N.eat(";")) ? "atom" : "error" : (N.eatWhile(/[^&<]/), null); } function Et(N, Lt) { var Tt = N.next(); if (Tt == ">" || Tt == "/" && N.eat(">")) return Lt.tokenize = it, k = Tt == ">" ? "endTag" : "selfcloseTag", "tag bracket"; if (Tt == "=") return k = "equals", null; if (Tt == "<") { Lt.tokenize = it, Lt.state = Ht, Lt.tagName = Lt.tagStart = null; var Qt = Lt.tokenize(N, Lt); return Qt ? Qt + " tag error" : "tag error"; } return /[\'\"]/.test(Tt) ? (Lt.tokenize = jt(Tt), Lt.stringStartCol = N.column(), Lt.tokenize(N, Lt)) : (N.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/), "word"); } function jt(N) { var Lt = function(Tt, Qt) { for (; !Tt.eol(); ) if (Tt.next() == N) { Qt.tokenize = Et; break; } return "string"; }; return Lt.isInAttribute = !0, Lt; } function Dt(N, Lt) { return function(Tt, Qt) { for (; !Tt.eol(); ) { if (Tt.match(Lt)) { Qt.tokenize = it; break; } Tt.next(); } return N; }; } function ee(N) { return function(Lt, Tt) { for (var Qt; (Qt = Lt.next()) != null; ) { if (Qt == "<") return Tt.tokenize = ee(N + 1), Tt.tokenize(Lt, Tt); if (Qt == ">") { if (N == 1) { Tt.tokenize = it; break; } return Tt.tokenize = ee(N - 1), Tt.tokenize(Lt, Tt); } } return "meta"; }; } function xt(N) { return N && N.toLowerCase(); } function bt(N, Lt, Tt) { this.prev = N.context, this.tagName = Lt || "", this.indent = N.indented, this.startOfLine = Tt, (M.doNotIndent.hasOwnProperty(Lt) || N.context && N.context.noIndent) && (this.noIndent = !0); } function Wt(N) { N.context && (N.context = N.context.prev); } function Ft(N, Lt) { for (var Tt; ; ) { if (!N.context || (Tt = N.context.tagName, !M.contextGrabbers.hasOwnProperty(xt(Tt)) || !M.contextGrabbers[xt(Tt)].hasOwnProperty(xt(Lt)))) return; Wt(N); } } function Ht(N, Lt, Tt) { return N == "openTag" ? (Tt.tagStart = Lt.column(), Q) : N == "closeTag" ? j : Ht; } function Q(N, Lt, Tt) { return N == "word" ? (Tt.tagName = Lt.current(), P = "tag", nt) : M.allowMissingTagName && N == "endTag" ? (P = "tag bracket", nt(N, Lt, Tt)) : (P = "error", Q); } function j(N, Lt, Tt) { if (N == "word") { var Qt = Lt.current(); return Tt.context && Tt.context.tagName != Qt && M.implicitlyClosed.hasOwnProperty(xt(Tt.context.tagName)) && Wt(Tt), Tt.context && Tt.context.tagName == Qt || M.matchClosing === !1 ? (P = "tag", V) : (P = "tag error", Y); } return M.allowMissingTagName && N == "endTag" ? (P = "tag bracket", V(N, Lt, Tt)) : (P = "error", Y); } function V(N, Lt, Tt) { return N != "endTag" ? (P = "error", V) : (Wt(Tt), Ht); } function Y(N, Lt, Tt) { return P = "error", V(N, Lt, Tt); } function nt(N, Lt, Tt) { if (N == "word") return P = "attribute", wt; if (N == "endTag" || N == "selfcloseTag") { var Qt = Tt.tagName, Oe = Tt.tagStart; return Tt.tagName = Tt.tagStart = null, N == "selfcloseTag" || M.autoSelfClosers.hasOwnProperty(xt(Qt)) ? Ft(Tt, Qt) : (Ft(Tt, Qt), Tt.context = new bt(Tt, Qt, Oe == Tt.indented)), Ht; } return P = "error", nt; } function wt(N, Lt, Tt) { return N == "equals" ? rt : (M.allowMissing || (P = "error"), nt(N, Lt, Tt)); } function rt(N, Lt, Tt) { return N == "string" ? gt : N == "word" && M.allowUnquoted ? (P = "string", nt) : (P = "error", nt(N, Lt, Tt)); } function gt(N, Lt, Tt) { return N == "string" ? gt : nt(N, Lt, Tt); } return it.isInText = !0, { startState: function(N) { var Lt = { tokenize: it, state: Ht, indented: N || 0, tagName: null, tagStart: null, context: null }; return N != null && (Lt.baseIndent = N), Lt; }, token: function(N, Lt) { if (!Lt.tagName && N.sol() && (Lt.indented = N.indentation()), N.eatSpace()) return null; k = null; var Tt = Lt.tokenize(N, Lt); return (Tt || k) && Tt != "comment" && (P = null, Lt.state = Lt.state(k || Tt, N, Lt), P && (Tt = P == "error" ? Tt + " error" : P)), Tt; }, indent: function(N, Lt, Tt) { var Qt = N.context; if (N.tokenize.isInAttribute) return N.tagStart == N.indented ? N.stringStartCol + 1 : N.indented + E; if (Qt && Qt.noIndent) return at.Pass; if (N.tokenize != Et && N.tokenize != it) return Tt ? Tt.match(/^(\s*)/)[0].length : 0; if (N.tagName) return M.multilineTagIndentPastTag !== !1 ? N.tagStart + N.tagName.length + 2 : N.tagStart + E * (M.multilineTagIndentFactor || 1); if (M.alignCDATA && /$/, blockCommentStart: "", configuration: M.htmlMode ? "html" : "xml", helperType: M.htmlMode ? "html" : "xml", skipAttribute: function(N) { N.state == rt && (N.state = nt); }, xmlCurrentTag: function(N) { return N.tagName ? { name: N.tagName, close: N.type == "closeTag" } : null; }, xmlCurrentContext: function(N) { for (var Lt = [], Tt = N.context; Tt; Tt = Tt.prev) Lt.push(Tt.tagName); return Lt.reverse(); } }; }), at.defineMIME("text/xml", "xml"), at.defineMIME("application/xml", "xml"), at.mimeModes.hasOwnProperty("text/html") || at.defineMIME("text/html", { name: "xml", htmlMode: !0 }); })(pt(631)); }, 858: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => at }); const at = { run: function(_t) { _t.DomComponents.clear(), _t.CssComposer.clear(); } }; }, 884: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => W }); var at = pt(50), _t = pt(163), J = pt(668); const W = { run: function(z) { (0, at.bindAll)(this, "onKeyUp", "enableDragger", "disableDragger"), this.editor = z, this.canvasModel = this.canvas.getCanvasView().model, this.toggleMove(1); }, stop: function(z) { this.toggleMove(), this.disableDragger(); }, onKeyUp: function(z) { (0, _t.getKeyChar)(z) === " " && this.editor.stopCommand(this.id); }, enableDragger: function(z) { this.toggleDragger(1, z); }, disableDragger: function(z) { this.toggleDragger(0, z); }, toggleDragger: function(z, k) { var P = this.canvasModel, E = this.em, M = this.dragger, D = z ? "add" : "remove"; this.getCanvas().classList[D]("".concat(this.ppfx, "is__grabbing")), M || (M = new J.Z({ getPosition: function() { return { x: P.get("x"), y: P.get("y") }; }, setPosition: function(ot) { var it = ot.x, Et = ot.y; P.set({ x: it, y: Et }); }, onStart: function(ot, it) { E.trigger("canvas:move:start", it); }, onDrag: function(ot, it) { E.trigger("canvas:move", it); }, onEnd: function(ot, it) { E.trigger("canvas:move:end", it); } }), this.dragger = M), z ? M.start(k) : M.stop(); }, toggleMove: function(z) { var k = this.ppfx, P = z ? "add" : "remove", E = z ? "on" : "off", M = { on: _t.on, off: _t.off }, D = this.getCanvas(), ot = ["".concat(k, "is__grab")]; !z && ot.push("".concat(k, "is__grabbing")), ot.forEach(function(it) { return D.classList[P](it); }), M[E](document, "keyup", this.onKeyUp), M[E](D, "mousedown", this.enableDragger), M[E](document, "mouseup", this.disableDragger); } }; }, 790: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => z, defineCommand: () => W }); var at, _t = pt(346), J = (at = function(k, P) { return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(E, M) { E.__proto__ = M; } || function(E, M) { for (var D in M) Object.prototype.hasOwnProperty.call(M, D) && (E[D] = M[D]); }, at(k, P); }, function(k, P) { if (typeof P != "function" && P !== null) throw new TypeError("Class extends value " + String(P) + " is not a constructor or null"); function E() { this.constructor = k; } at(k, P), k.prototype = P === null ? Object.create(P) : (E.prototype = P.prototype, new E()); }); function W(k) { return k; } const z = function(k) { function P(E) { var M = k.call(this, 0) || this; M.config = E || {}, M.em = M.config.em || {}; var D = M.config.stylePrefix; return M.pfx = D, M.ppfx = M.config.pStylePrefix, M.hoverClass = "".concat(D, "hover"), M.badgeClass = "".concat(D, "badge"), M.plhClass = "".concat(D, "placeholder"), M.freezClass = "".concat(M.ppfx, "freezed"), M.canvas = M.em.Canvas, M.init(M.config), M; } return J(P, k), P.prototype.onFrameScroll = function(E) { }, P.prototype.getCanvas = function() { return this.canvas.getElement(); }, P.prototype.getCanvasBody = function() { return this.canvas.getBody(); }, P.prototype.getCanvasTools = function() { return this.canvas.getToolsEl(); }, P.prototype.offset = function(E) { var M = E.getBoundingClientRect(); return { top: M.top + E.ownerDocument.body.scrollTop, left: M.left + E.ownerDocument.body.scrollLeft }; }, P.prototype.init = function(E) { }, P.prototype.callRun = function(E, M) { M === void 0 && (M = {}); var D = this.id; if (E.trigger("run:".concat(D, ":before"), M), !M || !M.abort) { var ot = M.sender || E, it = this.run(E, ot, M); return E.trigger("run:".concat(D), it, M), E.trigger("run", D, it, M), it; } E.trigger("abort:".concat(D), M); }, P.prototype.callStop = function(E, M) { M === void 0 && (M = {}); var D = this.id, ot = M.sender || E; E.trigger("stop:".concat(D, ":before"), M); var it = this.stop(E, ot, M); return E.trigger("stop:".concat(D), it, M), E.trigger("stop", D, it, M), it; }, P.prototype.stopCommand = function(E) { this.em.Commands.stop(this.id, E); }, P.prototype.run = function(E, M, D) { }, P.prototype.stop = function(E, M, D) { }, P; }(_t.Hn); }, 180: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => J }); var at = pt(50), _t = function(W, z, k) { if (k || arguments.length === 2) for (var P, E = 0, M = z.length; E < M; E++) !P && E in z || (P || (P = Array.prototype.slice.call(z, 0, E)), P[E] = z[E]); return W.concat(P || Array.prototype.slice.call(z)); }; const J = { run: function(W, z, k) { var P = this; k === void 0 && (k = {}); var E = [], M = k.component || W.getSelectedAll(); return (M = (0, at.isArray)(M) ? _t([], M, !0) : [M]).filter(Boolean).forEach(function(D) { if (!D.get("removable")) return E.push(D), P.em.logWarning("The element is not removable", { component: D }); D.remove(); }), W.select(E), M; } }; }, 544: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => z }); var at = pt(50), _t = pt(668), J = function() { return J = Object.assign || function(k) { for (var P, E = 1, M = arguments.length; E < M; E++) for (var D in P = arguments[E]) Object.prototype.hasOwnProperty.call(P, D) && (k[D] = P[D]); return k; }, J.apply(this, arguments); }, W = "dmode"; const z = { run: function(k, P, E) { var M = this; E === void 0 && (E = {}), (0, at.bindAll)(this, "setPosition", "onStart", "onDrag", "onEnd", "getPosition", "getGuidesStatic", "renderGuide", "getGuidesTarget"); var D = E.target, ot = E.event, it = E.mode, Et = E.dragger, jt = Et === void 0 ? {} : Et, Dt = D.getEl(), ee = J({ doc: Dt.ownerDocument, onStart: this.onStart, onEnd: this.onEnd, onDrag: this.onDrag, getPosition: this.getPosition, setPosition: this.setPosition, guidesStatic: function() { return M.guidesStatic; }, guidesTarget: function() { return M.guidesTarget; } }, jt); this.setupGuides(), this.opts = E, this.editor = k, this.em = k.getModel(), this.target = D, this.isTran = it == "translate", this.guidesContainer = this.getGuidesContainer(), this.guidesTarget = this.getGuidesTarget(), this.guidesStatic = this.getGuidesStatic(); var xt = this.dragger; return xt ? xt.setOptions(ee) : (xt = new _t.Z(ee), this.dragger = xt), ot && xt.start(ot), this.toggleDrag(1), this.em.trigger("".concat(W, ":start"), this.getEventOpts()), xt; }, getEventOpts: function() { return { mode: this.opts.mode, target: this.target, guidesTarget: this.guidesTarget, guidesStatic: this.guidesStatic }; }, stop: function() { this.toggleDrag(); }, setupGuides: function() { (this.guides || []).forEach(function(k) { var P = k.guide; P && P.parentNode.removeChild(P); }), this.guides = []; }, getGuidesContainer: function() { var k = this, P = this.guidesEl; if (!P) { var E = this, M = E.editor, D = E.em, ot = E.opts, it = M.getConfig().stylePrefix, Et = document.createElement("div"), jt = document.createElement("div"), Dt = '
`); (P = document.createElement("div")).className = "".concat(it, "guides"), Et.className = "".concat(it, "guide-info ").concat(it, "guide-info__x"), jt.className = "".concat(it, "guide-info ").concat(it, "guide-info__y"), Et.innerHTML = Dt, jt.innerHTML = Dt, P.appendChild(Et), P.appendChild(jt), M.Canvas.getGlobalToolsEl().appendChild(P), this.guidesEl = P, this.elGuideInfoX = Et, this.elGuideInfoY = jt, this.elGuideInfoContentX = Et.querySelector(".".concat(it, "guide-info__content")), this.elGuideInfoContentY = jt.querySelector(".".concat(it, "guide-info__content")), D.on("canvas:update frame:scroll", (0, at.debounce)(function() { var ee; k.updateGuides(), ot.debug && ((ee = k.guides) === null || ee === void 0 || ee.forEach(function(xt) { return k.renderGuide(xt); })); }, 200)); } return P; }, getGuidesStatic: function() { var k = this, P = [], E = this.target.getEl(), M = E.parentNode, D = M === void 0 ? {} : M; return (0, at.each)(D.children, function(ot) { return P = P.concat(E !== ot ? k.getElementGuides(ot) : []); }), P.concat(this.getElementGuides(D)); }, getGuidesTarget: function() { return this.getElementGuides(this.target.getEl()); }, updateGuides: function(k) { var P, E, M = this; (k || this.guides).forEach(function(D) { var ot = D.origin, it = P === ot ? E : M.getElementPos(ot); P = ot, E = it, (0, at.each)(M.getGuidePosUpdate(D, it), function(Et, jt) { return D[jt] = Et; }), D.originRect = it; }); }, getGuidePosUpdate: function(k, P) { var E = {}, M = P.top, D = P.height, ot = P.left, it = P.width; switch (k.type) { case "t": E.y = M; break; case "b": E.y = M + D; break; case "l": E.x = ot; break; case "r": E.x = ot + it; break; case "x": E.x = ot + it / 2; break; case "y": E.y = M + D / 2; } return E; }, renderGuide: function(k) { k === void 0 && (k = {}); var P = k.guide || document.createElement("div"), E = "px", M = k.active ? 2 : 1, D = P.children[0]; return P.style = "position: absolute; background-color: ".concat(k.active ? "green" : "red", ";"), P.children.length || ((D = document.createElement("div")).style = "position: absolute; color: red; padding: 5px; top: 0; left: 0;", P.appendChild(D)), k.y ? (P.style.width = "100%", P.style.height = "".concat(M).concat(E), P.style.top = "".concat(k.y).concat(E), P.style.left = 0) : (P.style.width = "".concat(M).concat(E), P.style.height = "100%", P.style.left = "".concat(k.x).concat(E), P.style.top = "0".concat(E)), !k.guide && this.guidesContainer.appendChild(P), P; }, getElementPos: function(k) { return this.editor.Canvas.getElementPos(k, { noScroll: 1 }); }, getElementGuides: function(k) { var P = this, E = this.opts, M = this.getElementPos(k), D = M.top, ot = M.height, it = M.left, Et = M.width, jt = [{ type: "t", y: D }, { type: "b", y: D + ot }, { type: "l", x: it }, { type: "r", x: it + Et }, { type: "x", x: it + Et / 2 }, { type: "y", y: D + ot / 2 }].map(function(Dt) { return J(J({}, Dt), { origin: k, originRect: M, guide: E.debug && P.renderGuide(Dt) }); }); return jt.forEach(function(Dt) { var ee; return (ee = P.guides) === null || ee === void 0 ? void 0 : ee.push(Dt); }), jt; }, getTranslate: function(k, P) { P === void 0 && (P = "x"); var E = 0; return (k || "").split(" ").forEach(function(M) { var D = M.trim(), ot = "translate".concat(P.toUpperCase(), "("); D.indexOf(ot) === 0 && (E = parseFloat(D.replace(ot, ""))); }), E; }, setTranslate: function(k, P, E) { var M = "translate".concat(P.toUpperCase(), "("), D = "".concat(M).concat(E, ")"), ot = (k || "").split(" ").map(function(it) { return it.trim().indexOf(M) === 0 && (it = D), it; }).join(" "); return ot.indexOf(M) < 0 && (ot += " ".concat(D)), ot; }, getPosition: function() { var k = this.target, P = this.isTran, E = k.getStyle(), M = E.left, D = E.top, ot = E.transform, it = 0, Et = 0; return P ? (it = this.getTranslate(ot), Et = this.getTranslate(ot, "y")) : (it = parseFloat(M || 0), Et = parseFloat(D || 0)), { x: it, y: Et }; }, setPosition: function(k) { var P = k.x, E = k.y, M = k.end, D = k.position, ot = k.width, it = k.height, Et = this, jt = Et.target, Dt = Et.isTran, ee = Et.em, xt = "px", bt = !M, Wt = "".concat(parseInt(P, 10)).concat(xt), Ft = "".concat(parseInt(E, 10)).concat(xt), Ht = {}; if (Dt) { var Q = jt.getStyle().transform || ""; Q = this.setTranslate(Q, "x", Wt), Ht = { transform: Q = this.setTranslate(Q, "y", Ft), __p: bt }, jt.addStyle(Ht, { avoidStore: !M }); } else { var j = { position: D, width: ot, height: it }, V = { left: Wt, top: Ft, __p: bt }; (0, at.keys)(j).forEach(function(Y) { var nt = j[Y]; nt && (V[Y] = nt); }), Ht = V, jt.addStyle(Ht, { avoidStore: !M }); } ee == null || ee.Styles.__emitCmpStyleUpdate(Ht, { components: ee.getSelected() }); }, _getDragData: function() { var k = this.target; return { target: k, parent: k.parent(), index: k.index() }; }, onStart: function(k) { var P = this, E = P.target, M = P.editor, D = P.isTran, ot = P.opts, it = ot.center, Et = ot.onStart, jt = M.Canvas, Dt = E.getStyle(), ee = "absolute", xt = [ee, "relative"]; if (Et && Et(this._getDragData()), !D && Dt.position !== ee) { var bt = jt.offset(E.getEl()), Wt = bt.left, Ft = bt.top, Ht = bt.width, Q = bt.height, j = E.parent(), V = void 0; do { var Y = j.getStyle(); V = xt.indexOf(Y.position) >= 0 ? j : null, j = j.parent(); } while (j && !V); if (it) { var nt = jt.getMouseRelativeCanvas(k); Wt = nt.x, Ft = nt.y; } else if (V) { var wt = jt.offset(V.getEl()); Wt -= wt.left, Ft -= wt.top; } this.setPosition({ x: Wt, y: Ft, width: "".concat(Ht, "px"), height: "".concat(Q, "px"), position: ee }); } }, onDrag: function() { for (var k = this, P = [], E = 0; E < arguments.length; E++) P[E] = arguments[E]; var M = this, D = M.guidesTarget, ot = M.opts, it = ot.onDrag; this.updateGuides(D), ot.debug && D.forEach(function(Et) { return k.renderGuide(Et); }), ot.guidesInfo && this.renderGuideInfo(D.filter(function(Et) { return Et.active; })), it && it(this._getDragData()); }, onEnd: function(k, P, E) { E === void 0 && (E = {}); var M = this, D = M.editor, ot = M.opts, it = M.id, Et = ot.onEnd; Et && Et(k, E, J(J({ event: k }, E), this._getDragData())), D.stopCommand(it), this.hideGuidesInfo(), this.em.trigger("".concat(W, ":end"), this.getEventOpts()); }, hideGuidesInfo: function() { var k = this; ["X", "Y"].forEach(function(P) { var E = k["elGuideInfo".concat(P)]; E && (E.style.display = "none"); }); }, renderGuideInfo: function(k) { var P = this; k === void 0 && (k = []); var E = this.guidesStatic; this.hideGuidesInfo(), k.forEach(function(M) { var D = M.origin, ot = M.x, it = P.getElementPos(D), Et = (0, at.isUndefined)(ot) ? "y" : "x", jt = Et === "y", Dt = it[jt ? "left" : "top"], ee = it.rect[jt ? "left" : "top"], xt = jt ? Dt + it.width : Dt + it.height, bt = jt ? ee + it.rect.width : ee + it.rect.height, Wt = P["elGuideInfo".concat(Et.toUpperCase())], Ft = P["elGuideInfoContent".concat(Et.toUpperCase())], Ht = Wt.style, Q = E == null ? void 0 : E.filter(function(Te) { return Te.type === M.type; }).map(function(Te) { var be = Te.originRect, ge = be.left, pe = be.width, ce = be.top, st = be.height, Xt = jt ? ge + pe : ce + st; return { gap: Xt < Dt ? Dt - Xt : (jt ? ge : ce) - xt, guide: Te }; }).filter(function(Te) { return Te.gap > 0; }).sort(function(Te, be) { return Te.gap - be.gap; }).map(function(Te) { return Te.guide; })[0]; if (Q) { var j = Q.originRect, V = j.left, Y = j.width, nt = j.top, wt = j.height, rt = j.rect, gt = jt ? V < it.left : nt < it.top, N = jt ? V : nt, Lt = jt ? rt.left : rt.top, Tt = jt ? V + Y : nt + wt, Qt = jt ? rt.left + rt.width : rt.top + rt.height, Oe = jt ? M.y : M.x, Se = gt ? Tt : xt, _e = "".concat(Oe, "px"), De = gt ? Dt - Tt : N - xt, xe = gt ? ee - Qt : Lt - bt; Ht.display = "", Ht[jt ? "top" : "left"] = _e, Ht[jt ? "left" : "top"] = "".concat(Se, "px"), Ht[jt ? "width" : "height"] = "".concat(De, "px"), Ft.innerHTML = "".concat(Math.round(xe), "px"), P.em.trigger("".concat(W, ":active"), J(J({}, P.getEventOpts()), { guide: M, guidesStatic: E, matched: Q, posFirst: Oe, posSecond: Se, size: De, sizeRaw: xe, elGuideInfo: Wt, elGuideInfoCnt: Ft })); } }); }, toggleDrag: function(k) { var P = this.ppfx, E = this.editor, M = k ? "add" : "remove", D = ["".concat(P, "is__grabbing")], ot = E.Canvas, it = ot.getBody(); D.forEach(function(Et) { return it.classList[M](Et); }), ot[k ? "startAutoscroll" : "stopAutoscroll"](); } }; }, 236: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => at }); const at = { run: function(_t) { if (_t.Canvas.hasFocus()) { var J = []; _t.getSelectedAll().forEach(function(W) { var z = W.components(), k = z && z.filter(function(P) { return P.get("selectable"); })[0]; k && J.push(k); }), J.length && _t.select(J); } } }; }, 368: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => at }); const at = { run: function(_t, J, W) { if (W === void 0 && (W = {}), _t.Canvas.hasFocus() || W.force) { var z = []; _t.getSelectedAll().forEach(function(k) { for (var P = k.parent(); P && !P.get("selectable"); ) P = P.parent(); P && z.push(P); }), z.length && _t.select(z); } } }; }, 243: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => at }); const at = { run: function(_t) { if (_t.Canvas.hasFocus()) { var J = []; _t.getSelectedAll().forEach(function(W) { var z = W.parent(); if (z) { var k, P = z.components().length, E = 0, M = 0; do E++, k = (M = W.index() + E) <= P ? z.getChildAt(M) : null; while (k && !k.get("selectable")); J.push(k || W); } }), J.length && _t.select(J); } } }; }, 400: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => at }); const at = { run: function(_t) { if (_t.Canvas.hasFocus()) { var J = []; _t.getSelectedAll().forEach(function(W) { var z = W.parent(); if (z) { var k, P = 0, E = 0; do P++, k = (E = W.index() - P) >= 0 ? z.getChildAt(E) : null; while (k && !k.get("selectable")); J.push(k || W); } }), J.length && _t.select(J); } } }; }, 910: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(50); const _t = { run: function(J, W, z) { z === void 0 && (z = {}); var k = z.target, P = []; if (!k.get("styles")) return P; var E = k.get("type"), M = J.Pages.getAllWrappers(); if (!(0, at.flatten)(M.map(function(ot) { return ot.findType(E); })).length) { var D = J.CssComposer.getAll(); P = D.filter(function(ot) { return ot.get("group") === "cmp:".concat(E); }), D.remove(P); } return P; } }; }, 744: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = function(J, W, z) { if (z || arguments.length === 2) for (var k, P = 0, E = W.length; P < E; P++) !k && P in W || (k || (k = Array.prototype.slice.call(W, 0, P)), k[P] = W[P]); return J.concat(k || Array.prototype.slice.call(W)); }; const _t = { run: function(J) { var W = J.getModel(), z = at([], J.getSelectedAll(), !0); z.length && W.set("clipboard", z); } }; }, 517: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => W }); var at = pt(50), _t = pt(895), J = pt(407); const W = (0, at.extend)({}, J.default, { init: function() { (0, at.bindAll)(this, "startDelete", "stopDelete", "onDelete"), this.hoverClass = this.pfx + "hover-delete", this.badgeClass = this.pfx + "badge-red"; }, enable: function() { this.$el.find("*").mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete); }, startDelete: function(z) { z.stopPropagation(); var k = (0, _t.default)(z.target); k.data("model").get("removable") && (k.addClass(this.hoverClass), this.attachBadge(k.get(0))); }, stopDelete: function(z) { z.stopPropagation(), (0, _t.default)(z.target).removeClass(this.hoverClass), this.badge && this.badge.css({ left: -1e3, top: -1e3 }); }, onDelete: function(z) { z.stopPropagation(); var k = (0, _t.default)(z.target); k.data("model").get("removable") && (k.data("model").destroy(), this.removeBadge(), this.clean()); }, updateBadgeLabel: function(z) { this.badge.html("Remove " + z.getName()); } }); }, 457: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(895); const _t = { run: function(J, W, z) { var k = this; z === void 0 && (z = {}), W && W.set && W.set("active", 0); var P = J.getConfig(), E = J.Modal, M = P.stylePrefix; if (this.cm = J.CodeManager || null, !this.$editors) { var D = this.buildEditor("htmlmixed", "hopscotch", "HTML"), ot = this.buildEditor("css", "hopscotch", "CSS"); this.htmlEditor = D.el, this.cssEditor = ot.el; var it = (0, at.default)('
')); it.append(D.$el).append(ot.$el), this.$editors = it; } E.open({ title: P.textViewCode, content: this.$editors }).getModel().once("change:open", function() { return J.stopCommand("".concat(k.id)); }), this.htmlEditor.setContent(J.getHtml(z.optsHtml)), this.cssEditor.setContent(J.getCss(z.optsCss)); }, stop: function(J) { var W = J.Modal; W && W.close(); }, buildEditor: function(J, W, z) { var k = document.createElement("textarea"); !this.codeMirror && (this.codeMirror = this.cm.getViewer("CodeMirror")); var P = this.codeMirror.clone().set({ label: z, codeName: J, theme: W, input: k }), E = new this.cm.EditorView({ model: P, config: this.cm.getConfig() }).render().$el; return P.init(k), { el: P, $el: E }; } }; }, 975: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(50); const _t = { isEnabled: function() { var J = document; return !!(J.fullscreenElement || J.webkitFullscreenElement || J.mozFullScreenElement); }, enable: function(J) { var W = ""; return J.requestFullscreen ? J.requestFullscreen() : J.webkitRequestFullscreen ? (W = "webkit", J.webkitRequestFullscreen()) : J.mozRequestFullScreen ? (W = "moz", J.mozRequestFullScreen()) : J.msRequestFullscreen && J.msRequestFullscreen(), W; }, disable: function() { var J = document; this.isEnabled() && (J.exitFullscreen ? J.exitFullscreen() : J.webkitExitFullscreen ? J.webkitExitFullscreen() : J.mozCancelFullScreen ? J.mozCancelFullScreen() : J.msExitFullscreen && J.msExitFullscreen()); }, fsChanged: function(J) { this.isEnabled() || (this.stopCommand({ sender: this.sender }), document.removeEventListener("".concat(J || "", "fullscreenchange"), this.fsChanged)); }, run: function(J, W, z) { z === void 0 && (z = {}), this.sender = W; var k = z.target, P = (0, at.isElement)(k) ? k : document.querySelector(k), E = this.enable(P || J.getContainer()); this.fsChanged = this.fsChanged.bind(this, E), document.addEventListener(E + "fullscreenchange", this.fsChanged), J.trigger("change:canvasOffset"); }, stop: function(J, W) { W && W.set && W.set("active", !1), this.disable(), J && J.trigger("change:canvasOffset"); } }; }, 191: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => k }); var at = pt(50), _t = pt(895), J = pt(163), W = pt(407), z = pt(189); const k = (0, at.extend)({}, z.default, W.default, { init: function(P) { W.default.init.apply(this, arguments), (0, at.bindAll)(this, "initSorter", "rollback", "onEndMove"), this.opt = P, this.hoverClass = this.ppfx + "highlighter-warning", this.badgeClass = this.ppfx + "badge-warning", this.noSelClass = this.ppfx + "no-select"; }, enable: function() { for (var P = [], E = 0; E < arguments.length; E++) P[E] = arguments[E]; W.default.enable.apply(this, P), this.getBadgeEl().addClass(this.badgeClass), this.getHighlighterEl().addClass(this.hoverClass); var M = this.$wrapper; M.css("cursor", "move"), M.on("mousedown", this.initSorter), M.addClass(this.noSelClass); }, toggleClipboard: function() { }, initSorter: function(P) { var E = (0, _t.default)(P.target).data("model").get("draggable"); E && (this.cacheEl = null, this.startSelectPosition(P.target, this.frameEl.contentDocument), this.sorter.draggable = E, this.sorter.onEndMove = this.onEndMove.bind(this), this.stopSelectComponent(), this.$wrapper.off("mousedown", this.initSorter), (0, J.on)(this.getContentWindow(), "keydown", this.rollback)); }, initSorterFromModel: function(P) { var E = P.get("draggable"); if (E) { this.cacheEl = null; var M = P.view.el; this.startSelectPosition(M, this.frameEl.contentDocument), this.sorter.draggable = E, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, J.on)(this.getContentWindow(), "keydown", this.rollback); } }, initSorterFromModels: function(P) { this.cacheEl = null; var E = P[P.length - 1], M = (this.em.get("currentFrame") || {}).model, D = E.getEl(M), ot = D.ownerDocument; this.startSelectPosition(D, ot, { onStart: this.onStart }), this.sorter.draggable = E.get("draggable"), this.sorter.toMove = P, this.sorter.onMoveClb = this.onDrag, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, J.on)(this.getContentWindow(), "keydown", this.rollback); }, onEndMoveFromModel: function() { (0, J.off)(this.getContentWindow(), "keydown", this.rollback); }, onEndMove: function() { this.enable(), (0, J.off)(this.getContentWindow(), "keydown", this.rollback); }, onSelect: function(P, E) { }, rollback: function(P, E) { ((P.which || P.keyCode) == 27 || E) && (this.sorter.moved = !1, this.sorter.endMove()); }, getBadgeEl: function() { return this.$badge || (this.$badge = (0, _t.default)(this.getBadge())), this.$badge; }, getHighlighterEl: function() { return this.$hl || (this.$hl = (0, _t.default)(this.canvas.getHighlighter())), this.$hl; }, stop: function() { for (var P = [], E = 0; E < arguments.length; E++) P[E] = arguments[E]; W.default.stop.apply(this, P), this.getBadgeEl().removeClass(this.badgeClass), this.getHighlighterEl().removeClass(this.hoverClass); var M = this.$wrapper; M.css("cursor", "").unbind().removeClass(this.noSelClass); } }); }, 912: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => J }); var at = pt(50), _t = pt(491); const J = { open: function(W) { var z = this, k = this, P = k.editor, E = k.title, M = k.config, D = k.am, ot = M.custom; if ((0, at.isFunction)(ot.open)) return ot.open(D.__customData()); P.Modal.open({ title: E, content: W }).onceClose(function() { return P.stopCommand(z.id); }); }, close: function() { var W = this.config.custom; if ((0, at.isFunction)(W.close)) return W.close(this.am.__customData()); var z = this.editor.Modal; z && z.close(); }, run: function(W, z, k) { k === void 0 && (k = {}); var P = W.AssetManager, E = P.getConfig(), M = k.types, D = M === void 0 ? [] : M, ot = k.accept, it = k.select; if (this.title = k.modalTitle || W.t("assetManager.modalTitle") || "", this.editor = W, this.config = E, this.am = P, P.setTarget(k.target), P.onClick(k.onClick), P.onDblClick(k.onDblClick), P.onSelect(k.onSelect), P.__behaviour({ select: it, types: D, options: k }), E.custom) this.rendered = this.rendered || (0, _t.ut)("div"), this.rendered.className = "".concat(E.stylePrefix, "custom-wrp"), P.__behaviour({ container: this.rendered }), P.__trgCustom(); else { if (!this.rendered || D) { var Et = P.getAll().filter(function(Dt) { return Dt; }); D && D.length && (Et = Et.filter(function(Dt) { return D.indexOf(Dt.get("type")) !== -1; })), P.render(Et), this.rendered = P.getContainer(); } if (ot) { var jt = this.rendered.querySelector("input#".concat(E.stylePrefix, "uploadFile")); jt && jt.setAttribute("accept", ot); } } return this.open(this.rendered), this; }, stop: function(W) { this.editor = W, this.close(this.rendered); } }; }, 117: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => J }); var at = pt(50), _t = pt(491); const J = { open: function() { var W = this, z = W.container, k = W.editor, P = W.bm, E = W.config, M = E.custom, D = E.appendTo; if ((0, at.isFunction)(M.open)) return M.open(P.__customData()); if (this.firstRender && !D) { var ot = "views-container", it = k.Panels; (it.getPanel(ot) || it.addPanel({ id: ot })).set("appendContent", z).trigger("change:appendContent"), M || z.appendChild(P.render()); } z && (z.style.display = "block"); }, close: function() { var W = this.container, z = this.config.custom; if ((0, at.isFunction)(z.close)) return z.close(this.bm.__customData()); W && (W.style.display = "none"); }, run: function(W) { var z = W.Blocks; this.config = z.getConfig(), this.firstRender = !this.container, this.container = this.container || (0, _t.ut)("div"), this.editor = W, this.bm = z; var k = this.container; z.__behaviour({ container: k }), this.config.custom && z.__trgCustom(), this.open(); }, stop: function() { this.close(); } }; }, 614: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => at }); const at = { run: function(_t) { var J = _t.LayerManager, W = _t.Panels, z = J.getConfig(); if (!z.appendTo) { if (!this.layers) { var k = "views-container", P = document.createElement("div"), E = W.getPanel(k) || W.addPanel({ id: k }); z.custom ? J.__trgCustom({ container: P }) : P.appendChild(J.render()), E.set("appendContent", P).trigger("change:appendContent"), this.layers = P; } this.layers.style.display = "block"; } }, stop: function() { var _t = this.layers; _t && (_t.style.display = "none"); } }; }, 801: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(895); const _t = { run: function(J, W) { if (this.sender = W, !this.$cn) { var z = J.getConfig(), k = J.Panels, P = "change:appendContent"; this.$cn = (0, at.default)("
"), this.$cn2 = (0, at.default)("
"), this.$cn.append(this.$cn2); var E = J.DeviceManager; if (E && z.showDevices) { var M = k.addPanel({ id: "devices-c" }), D = E.render(); M.set("appendContent", D).trigger(P); } var ot = J.SelectorManager; this.slm = ot; var it = ot.getConfig(); it.custom ? ot.__trgCustom({ container: this.$cn2.get(0) }) : it.appendTo || this.$cn2.append(ot.render([])); var Et = J.StyleManager; this.sm = Et; var jt = Et.getConfig(), Dt = jt.stylePrefix; this.$header = (0, at.default)('
').concat(J.t("styleManager.empty"), "
")), this.$cn.append(this.$header), jt.custom ? Et.__trgCustom({ container: this.$cn2.get(0) }) : jt.appendTo || this.$cn2.append(Et.render()); var ee = "views-container"; this.panel = k.getPanel(ee), this.panel || (this.panel = k.addPanel({ id: ee })), this.panel.set("appendContent", this.$cn).trigger(P), this.em = J.getModel(), this.listenTo(this.em, Et.events.target, this.toggleSm); } this.toggleSm(); }, toggleSm: function() { var J, W, z, k, P = this.sender, E = this.sm; P && P.get && !P.get("active") || !E || (E.getSelected() ? ((J = this.$cn2) === null || J === void 0 || J.show(), (W = this.$header) === null || W === void 0 || W.hide()) : ((z = this.$cn2) === null || z === void 0 || z.hide(), (k = this.$header) === null || k === void 0 || k.show())); }, stop: function() { var J, W; (J = this.$cn2) === null || J === void 0 || J.hide(), (W = this.$header) === null || W === void 0 || W.hide(); } }; }, 395: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(895); const _t = { run: function(J, W) { this.sender = W; var z, k = J.getModel(), P = J.Config.stylePrefix, E = J.TraitManager, M = E.getConfig(); if (!M.appendTo) { if (!this.$cn) { this.$cn = (0, at.default)("
"), this.$cn2 = (0, at.default)("
"), this.$cn.append(this.$cn2), this.$header = (0, at.default)("
").append('
').concat(k.t("traitManager.empty"), "
")), this.$cn.append(this.$header), this.$cn2.append('
').concat(k.t("traitManager.label"), "
")), this.$cn2.append(E.render()); var D = J.Panels; (z = D.getPanel("views-container") ? D.getPanel("views-container") : D.addPanel({ id: "views-container" })) == null || z.set("appendContent", this.$cn.get(0)).trigger("change:appendContent"), this.target = J.getModel(), this.listenTo(this.target, "component:toggled", this.toggleTm); } this.toggleTm(); } }, toggleTm: function() { var J = this.sender; J && J.get && !J.get("active") || (this.target.getSelectedAll().length === 1 ? (this.$cn2.show(), this.$header.hide()) : (this.$cn2.hide(), this.$header.show())); }, stop: function() { this.$cn2 && this.$cn2.hide(), this.$header && this.$header.hide(); } }; }, 98: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(50); const _t = { run: function(J, W, z) { z === void 0 && (z = {}); var k = J.getModel().get("clipboard"), P = J.getSelected(); k && P && (J.getSelectedAll().forEach(function(E) { var M = E.collection; if (M) { var D, ot = { at: E.index() + 1, action: z.action || "paste-component" }; if ((0, at.contains)(k, E) && E.get("copyable")) D = M.add(E.clone(), ot); else { var it = k.filter(function(Et) { return Et.get("copyable"); }).filter(function(Et) { return J.Components.canMove(E.parent(), Et).result; }); D = M.add(it.map(function(Et) { return Et.clone(); }), ot); } (D = (0, at.isArray)(D) ? D : [D]).forEach(function(Et) { return J.trigger("component:paste", Et); }); } }), P.emitUpdate()); } }; }, 129: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => W }); var at = pt(50), _t = function(z, k, P) { if (P || arguments.length === 2) for (var E, M = 0, D = k.length; M < D; M++) !E && M in k || (E || (E = Array.prototype.slice.call(k, 0, M)), E[M] = k[M]); return z.concat(E || Array.prototype.slice.call(k)); }, J = "core:component-outline"; const W = { getPanels: function(z) { return this.panels || (this.panels = z.Panels.getPanels()), this.panels; }, preventDrag: function(z) { z.abort = 1; }, tglEffects: function(z) { var k = this.em, P = z ? "on" : "off"; if (k) { var E = k.Canvas, M = E.getBody(), D = E.getToolbarEl(); D && (D.style.display = z ? "none" : ""); var ot = M.querySelectorAll(".".concat(this.ppfx, "no-pointer")); (0, at.each)(ot, function(it) { return it.style.pointerEvents = z ? "all" : ""; }), k[P]("run:tlb-move:before", this.preventDrag); } }, run: function(z, k) { var P = this; this.sender = k, this.selected = _t([], z.getSelectedAll(), !0), z.select(), this.shouldRunSwVisibility || (this.shouldRunSwVisibility = z.Commands.isActive(J)), this.shouldRunSwVisibility && z.stopCommand(J), z.getModel().stopDefault(); var E = this.getPanels(z), M = z.Canvas.getElement(), D = z.getEl(), ot = z.Config.stylePrefix; if (!this.helper) { var it = document.createElement("span"); it.className = "".concat(ot, "off-prv fa fa-eye-slash"), D.appendChild(it), it.onclick = function() { return P.stopCommand(); }, this.helper = it; } this.helper.style.display = "inline-block", E.forEach(function(jt) { return jt.set("visible", !1); }); var Et = M.style; Et.width = "100%", Et.height = "100%", Et.top = "0", Et.left = "0", Et.padding = "0", Et.margin = "0", z.refresh(), this.tglEffects(1); }, stop: function(z) { var k = this.sender, P = k === void 0 ? {} : k, E = this.selected; P.set && P.set("active", 0); var M = this.getPanels(z); this.shouldRunSwVisibility && (z.runCommand(J), this.shouldRunSwVisibility = !1), z.getModel().runDefault(), M.forEach(function(D) { return D.set("visible", !0); }), z.Canvas.getElement().setAttribute("style", ""), E && z.select(E), delete this.selected, this.helper && (this.helper.style.display = "none"), z.refresh(), this.tglEffects(); } }; }, 116: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = function() { return at = Object.assign || function(J) { for (var W, z = 1, k = arguments.length; z < k; z++) for (var P in W = arguments[z]) Object.prototype.hasOwnProperty.call(W, P) && (J[P] = W[P]); return J; }, at.apply(this, arguments); }; const _t = { run: function(J, W, z) { var k = z || {}, P = J.Canvas, E = P.getCanvasView(), M = at({ appendTo: P.getResizerEl(), prefix: J.getConfig().stylePrefix, posFetcher: E.getElementPos.bind(E), mousePosFetcher: P.getMouseRelativePos }, k.options || {}), D = this.canvasResizer; return D && !k.forceNew || (this.canvasResizer = new J.Utils.Resizer(M), D = this.canvasResizer), D.setOptions(M, !0), D.blur(), D.focus(k.el), D; }, stop: function() { var J; (J = this.canvasResizer) === null || J === void 0 || J.blur(); } }; }, 407: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => Ht }); var at, _t = pt(50), J = pt(895), W = pt(346), z = (at = function(Q, j) { return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(V, Y) { V.__proto__ = Y; } || function(V, Y) { for (var nt in Y) Object.prototype.hasOwnProperty.call(Y, nt) && (V[nt] = Y[nt]); }, at(Q, j); }, function(Q, j) { if (typeof j != "function" && j !== null) throw new TypeError("Class extends value " + String(j) + " is not a constructor or null"); function V() { this.constructor = Q; } at(Q, j), Q.prototype = j === null ? Object.create(j) : (V.prototype = j.prototype, new V()); }); const k = function(Q) { function j() { return Q !== null && Q.apply(this, arguments) || this; } return z(j, Q), j.prototype.defaults = function() { return { command: "", attributes: {} }; }, j; }(W.Hn); var P = function() { var Q = function(j, V) { return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(Y, nt) { Y.__proto__ = nt; } || function(Y, nt) { for (var wt in nt) Object.prototype.hasOwnProperty.call(nt, wt) && (Y[wt] = nt[wt]); }, Q(j, V); }; return function(j, V) { if (typeof V != "function" && V !== null) throw new TypeError("Class extends value " + String(V) + " is not a constructor or null"); function Y() { this.constructor = j; } Q(j, V), j.prototype = V === null ? Object.create(V) : (Y.prototype = V.prototype, new Y()); }; }(), E = function(Q) { function j() { return Q !== null && Q.apply(this, arguments) || this; } return P(j, Q), j; }(W.FE); const M = E; E.prototype.model = k; var D = pt(330), ot = function() { var Q = function(j, V) { return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(Y, nt) { Y.__proto__ = nt; } || function(Y, nt) { for (var wt in nt) Object.prototype.hasOwnProperty.call(nt, wt) && (Y[wt] = nt[wt]); }, Q(j, V); }; return function(j, V) { if (typeof V != "function" && V !== null) throw new TypeError("Class extends value " + String(V) + " is not a constructor or null"); function Y() { this.constructor = j; } Q(j, V), j.prototype = V === null ? Object.create(V) : (Y.prototype = V.prototype, new Y()); }; }(), it = function() { return it = Object.assign || function(Q) { for (var j, V = 1, Y = arguments.length; V < Y; V++) for (var nt in j = arguments[V]) Object.prototype.hasOwnProperty.call(j, nt) && (Q[nt] = j[nt]); return Q; }, it.apply(this, arguments); }; const Et = function(Q) { function j(V) { var Y = Q.call(this, V) || this; return Y.em = V.config.em, Y; } return ot(j, Q), j.prototype.events = function() { return this.model.get("events") || { mousedown: "handleClick" }; }, j.prototype.attributes = function() { return this.model.get("attributes"); }, j.prototype.handleClick = function(V) { V.preventDefault(), V.stopPropagation(); var Y = this.em, nt = Y.Canvas.getFrameEl().getBoundingClientRect(), wt = nt.left, rt = nt.top, gt = it(it({}, V), { clientX: V.clientX - wt, clientY: V.clientY - rt }); Y.trigger("toolbar:run:before", { event: gt }), this.execCommand(gt); }, j.prototype.execCommand = function(V) { var Y = this.em, nt = { event: V }, wt = this.model.get("command"), rt = Y.Editor; (0, _t.isFunction)(wt) && wt(rt, null, nt), (0, _t.isString)(wt) && rt.runCommand(wt, nt); }, j.prototype.render = function() { var V = this, Y = V.em, nt = V.$el, wt = V.model, rt = wt.get("id"), gt = wt.get("label"), N = Y.getConfig().stylePrefix; return nt.addClass("".concat(N, "toolbar-item")), rt && nt.addClass("".concat(N, "toolbar-item__").concat(rt)), gt && nt.append(gt), this; }, j; }(W.G7); var jt = function() { var Q = function(j, V) { return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(Y, nt) { Y.__proto__ = nt; } || function(Y, nt) { for (var wt in nt) Object.prototype.hasOwnProperty.call(nt, wt) && (Y[wt] = nt[wt]); }, Q(j, V); }; return function(j, V) { if (typeof V != "function" && V !== null) throw new TypeError("Class extends value " + String(V) + " is not a constructor or null"); function Y() { this.constructor = j; } Q(j, V), j.prototype = V === null ? Object.create(V) : (Y.prototype = V.prototype, new Y()); }; }(), Dt = function(Q) { function j(V) { var Y = Q.call(this, V) || this, nt = V.em; return Y.em = nt, Y.config = { em: nt }, Y.listenTo(Y.collection, "reset", Y.render), Y; } return jt(j, Q), j.prototype.onRender = function() { var V = this.em.config.stylePrefix; this.el.className = "".concat(V, "toolbar-items"); }, j; }(D.Z); const ee = Dt; Dt.prototype.itemView = Et; var xt, bt = pt(491), Wt = pt(163), Ft = function() { return Ft = Object.assign || function(Q) { for (var j, V = 1, Y = arguments.length; V < Y; V++) for (var nt in j = arguments[V]) Object.prototype.hasOwnProperty.call(j, nt) && (Q[nt] = j[nt]); return Q; }, Ft.apply(this, arguments); }; const Ht = { init: function(Q) { (0, _t.bindAll)(this, "onHover", "onOut", "onClick", "onFrameScroll", "onFrameUpdated", "onContainerChange"); }, enable: function() { this.frameOff = this.canvasOff = this.adjScroll = null, this.startSelectComponent(), xt = !0; }, startSelectComponent: function() { this.toggleSelectComponent(1), this.em.getSelected() && this.onSelect(); }, stopSelectComponent: function() { this.toggleSelectComponent(); }, toggleSelectComponent: function(Q) { var j = this, V = this.em, Y = V.getConfig().listenToEl, nt = V.getContainer().parentNode, wt = Q ? "on" : "off", rt = { on: Wt.on, off: Wt.off }; !Y.length && nt && Y.push(nt), rt[wt](window, "resize", this.onFrameUpdated), rt[wt](Y, "scroll", this.onContainerChange), V[wt]("component:toggled component:update undo redo", this.onSelect, this), V[wt]("change:componentHovered", this.onHovered, this), V[wt]("component:resize styleable:change component:input", this.updateGlobalPos, this), V[wt]("component:update:toolbar", this._upToolbar, this), V[wt]("change:canvasOffset", this.updateAttached, this), V[wt]("frame:updated", this.onFrameUpdated, this), V[wt]("canvas:updateTools", this.onFrameUpdated, this), V.Canvas.getFrames().forEach(function(gt) { var N = gt.view, Lt = N == null ? void 0 : N.getWindow(); Lt && function(Tt, Qt) { rt[wt](Qt, "mouseover", j.onHover), rt[wt](Qt, "mouseleave", j.onOut), rt[wt](Qt, "click", j.onClick), rt[wt](Tt, "scroll", j.onFrameScroll, !0); }(Lt, N == null ? void 0 : N.getBody()); }); }, onHover: function(Q) { Q.stopPropagation(); var j = this.em, V = Q.target, Y = (0, Wt.getViewEl)(V), nt = Y && Y._getFrame(), wt = (0, J.default)(V), rt = wt.data("model"); if (!rt) for (var gt = wt.parent(); !rt && gt.length && !(0, bt.Mx)(gt[0]); ) rt = gt.data("model"), gt = gt.parent(); this.currentDoc = V.ownerDocument, j.setHovered(rt, { useValid: !0 }), nt && j.set("currentFrame", nt); }, onFrameUpdated: function() { this.updateLocalPos(), this.updateGlobalPos(); }, onHovered: function(Q, j) { var V, Y = this, nt = {}; j ? (V = j.views) === null || V === void 0 || V.forEach(function(wt) { var rt = wt.el, gt = Y.getElementPos(rt); nt = { el: rt, pos: gt, component: j, view: (0, Wt.getViewEl)(rt) }, Y.updateToolsLocal(nt), rt.ownerDocument === Y.currentDoc && (Y.elHovered = nt); }) : (this.currentDoc = null, this.elHovered = 0, this.updateToolsLocal(), this.canvas.getFrames().forEach(function(wt) { var rt = wt.view, gt = rt && rt.getToolsEl(); gt && Y.toggleToolsEl(0, 0, { el: gt }); })); }, onSelect: (0, _t.debounce)(function() { var Q = this.em, j = Q.getSelected(), V = Q.get("currentFrame") || {}, Y = j && j.getView(V.model), nt = Y && Y.el, wt = {}; nt && (0, bt.pn)(nt) && (wt = { el: nt, pos: this.getElementPos(nt), component: j, view: (0, Wt.getViewEl)(nt) }), this.elSelected = wt, this.updateToolsGlobal(), this.updateLocalPos(wt), this.initResize(j); }, 0), updateGlobalPos: function() { var Q = this.getElSelected(); Q.el && (Q.pos = this.getElementPos(Q.el), this.updateToolsGlobal()); }, updateLocalPos: function(Q) { var j = this.getElHovered(); j.el && (j.pos = this.getElementPos(j.el), this.updateToolsLocal(Q)); }, getElHovered: function() { return this.elHovered || {}; }, getElSelected: function() { return this.elSelected || {}; }, onOut: function() { this.em.setHovered(0); }, toggleToolsEl: function(Q, j, V) { V === void 0 && (V = {}); var Y = V.el || this.canvas.getToolsEl(j); return Y && (Y.style.display = Q ? "" : "none"), Y || {}; }, showElementOffset: function(Q, j, V) { V === void 0 && (V = {}), xt && this.editor.runCommand("show-offset", { el: Q, elPos: j, view: V.view, force: 1, top: 0, left: 0 }); }, hideElementOffset: function(Q) { this.editor.stopCommand("show-offset", { view: Q }); }, showFixedElementOffset: function(Q, j) { this.editor.runCommand("show-offset", { el: Q, elPos: j, state: "Fixed" }); }, hideFixedElementOffset: function() { this.editor && this.editor.stopCommand("show-offset", { state: "Fixed" }); }, hideHighlighter: function(Q) { this.canvas.getHighlighter(Q).style.opacity = 0; }, onClick: function(Q) { Q.stopPropagation(), Q.preventDefault(); var j = this.em; if (j.get("_cmpDrag")) return j.set("_cmpDrag"); var V = (0, J.default)(Q.target), Y = V.data("model"); if (!Y) for (var nt = V.parent(); !Y && nt.length && !(0, bt.Mx)(nt[0]); ) Y = nt.data("model"), nt = nt.parent(); if (Y) { if (j.isEditing() && !Y.get("textable") && Y.isChildOf("text")) return; this.select(Y, Q); } }, select: function(Q, j) { j === void 0 && (j = {}), Q && (this.editor.select(Q, { event: j, useValid: !0 }), this.initResize(Q)); }, updateBadge: function(Q, j, V) { V === void 0 && (V = {}); var Y = this.canvas, nt = (0, J.default)(Q).data("model"); if (nt && nt.get("badgable")) { var wt = this.getBadge(V); if (!V.posOnly) { var rt = this.canvas.getConfig(), gt = nt.getIcon(), N = rt.pStylePrefix || "", Lt = "".concat(N, "badge"), Tt = rt.customBadgeLabel, Qt = "".concat(gt ? '
').concat(gt, "
") : "", `
').concat(nt.getName(), "
"); wt.innerHTML = Tt ? Tt(nt) : Qt; } var Oe = "px", Se = wt.style; Se.display = "block"; var _e = Y.getTargetToElementFixed(Q, wt, { pos: j }).top, De = V.leftOff < 0 ? -V.leftOff : 0; Se.top = _e + Oe, Se.left = De + Oe; } }, showHighlighter: function(Q) { this.canvas.getHighlighter(Q).style.opacity = ""; }, initResize: function(Q) { var j, V = this.em, Y = this.canvas, nt = V == null ? void 0 : V.Editor, wt = (V == null ? void 0 : V.config).stylePrefix || "", rt = "".concat(wt, "resizing"), gt = !(0, _t.isElement)(Q) && (0, Wt.isTaggableNode)(Q) ? Q : V.getSelected(), N = gt && gt.get("resizable"), Lt = {}, Tt = function(Oe, Se, _e) { var De = _e.docs; De && De.forEach(function(xe) { var Te = xe.body, be = Te.className || ""; Te.className = (Oe == "add" ? "".concat(be, " ").concat(rt) : be.replace(rt, "")).trim(); }); }; if (nt && N) { var Qt = (0, _t.isElement)(Q) ? Q : gt.getEl(); Lt = { onStart: function(Oe, Se) { Se === void 0 && (Se = {}); var _e = Se.el, De = Se.config, xe = Se.resizer, Te = De.keyHeight, be = De.keyWidth, ge = De.currentUnit, pe = De.keepAutoHeight, ce = De.keepAutoWidth; Tt("add", 0, Se), j = V.Styles.getModelToStyle(gt), Y.toggleFramesEvents(!1); var st = getComputedStyle(_e), Xt = j.getStyle(), qt = Xt[be]; De.autoWidth = ce && qt === "auto", isNaN(parseFloat(qt)) && (qt = st[be]); var ne = Xt[Te]; De.autoHeight = pe && ne === "auto", isNaN(parseFloat(ne)) && (ne = st[Te]), xe.startDim.w = parseFloat(qt), xe.startDim.h = parseFloat(ne), xt = !1, ge && (De.unitHeight = (0, Wt.getUnitFromValue)(ne), De.unitWidth = (0, Wt.getUnitFromValue)(qt)); }, onMove: function() { nt.trigger("component:resize"); }, onEnd: function(Oe, Se) { Tt("remove", 0, Se), nt.trigger("component:resize"), Y.toggleFramesEvents(!0), xt = !0; }, updateTarget: function(Oe, Se, _e) { if (_e === void 0 && (_e = {}), j) { var De = _e.store, xe = _e.selectedHandler, Te = _e.config, be = Te.keyHeight, ge = Te.keyWidth, pe = Te.autoHeight, ce = Te.autoWidth, st = Te.unitWidth, Xt = Te.unitHeight, qt = ["tc", "bc"].indexOf(xe) >= 0, ne = ["cl", "cr"].indexOf(xe) >= 0, ae = {}; if (!qt) { var Zt = Y.getBody().offsetWidth, Ae = Se.w < Zt ? Se.w : Zt; ae[ge] = ce ? "auto" : "".concat(Ae).concat(st); } ne || (ae[be] = pe ? "auto" : "".concat(Se.h).concat(Xt)), V.getDragMode(gt) && (ae.top = "".concat(Se.t).concat(Xt), ae.left = "".concat(Se.l).concat(st)); var Ke = Ft(Ft({}, ae), { __p: !De }); j.addStyle(Ke, { avoidStore: !De }), V.Styles.__emitCmpStyleUpdate(Ke, { components: V.getSelected() }); } } }, typeof N == "object" && (Lt = Ft(Ft(Ft({}, Lt), N), { parent: Lt })), this.resizer = nt.runCommand("resize", { el: Qt, options: Lt, force: 1 }); } else nt.stopCommand("resize"), this.resizer = null; }, updateToolbar: function(Q) { var j = this.config.em, V = Q == j ? j.getSelected() : Q, Y = this.canvas.getToolbarEl(), nt = Y.style, wt = V.get("toolbar"), rt = j.config.showToolbar; if (V && rt && wt && wt.length) { if (nt.display = "", !this.toolbar) { Y.innerHTML = "", this.toolbar = new M(wt); var gt = new ee({ collection: this.toolbar, em: j }); Y.appendChild(gt.render().el); } this.toolbar.reset(wt), nt.top = "-100px", nt.left = "0"; } else nt.display = "none"; }, updateToolbarPos: function(Q) { var j = "px", V = this.canvas.getToolbarEl().style; V.top = "".concat(Q.top).concat(j), V.left = "".concat(Q.left).concat(j), V.opacity = ""; }, getCanvasPosition: function() { return this.canvas.getCanvasView().getPosition(); }, getBadge: function(Q) { return Q === void 0 && (Q = {}), this.canvas.getBadgeEl(Q.view); }, onFrameScroll: function() { this.updateTools(); }, updateTools: function() { this.updateLocalPos(), this.updateGlobalPos(); }, isCompSelected: function(Q) { return Q && Q.get("status") === "selected"; }, updateToolsLocal: function(Q) { var j = this.em.getConfig(), V = Q || this.getElHovered(), Y = V.el, nt = V.pos, wt = V.view, rt = V.component; if (Y) { var gt = rt.get("hoverable"), N = this.lastHovered !== Y, Lt = N ? {} : { posOnly: 1 }; N && gt && (this.lastHovered = Y, this.showHighlighter(wt), this.showElementOffset(Y, nt, { view: wt })), this.isCompSelected(rt) && (this.hideHighlighter(wt), !j.showOffsetsSelected && this.hideElementOffset(wt)); var Tt = "px", Qt = this.toggleToolsEl(1, wt), Oe = Qt.style, Se = this.canvas.canvasRectOffset(Y, nt), _e = Se.top, De = Se.left; this.updateBadge(Y, nt, Ft(Ft({}, Lt), { view: wt, topOff: _e, leftOff: De })), Oe.top = _e + Tt, Oe.left = De + Tt, Oe.width = nt.width + Tt, Oe.height = nt.height + Tt, this._trgToolUp("local", { component: rt, el: Qt, top: _e, left: De, width: nt.width, height: nt.height }); } else this.lastHovered = 0; }, _upToolbar: (0, _t.debounce)(function() { this.updateToolsGlobal({ force: 1 }); }, 0), _trgToolUp: function(Q, j) { j === void 0 && (j = {}), this.em.trigger("canvas:tools:update", Ft({ type: Q }, j)); }, updateToolsGlobal: function(Q) { Q === void 0 && (Q = {}); var j = this.getElSelected(), V = j.el, Y = j.pos, nt = j.component; if (!V) return this.toggleToolsEl(), void (this.lastSelected = 0); var wt = this.canvas; (this.lastSelected !== V || Q.force) && (this.lastSelected = V, this.updateToolbar(nt)); var rt = "px", gt = this.toggleToolsEl(1), N = gt.style, Lt = wt.getTargetToElementFixed(V, wt.getToolbarEl(), { pos: Y }), Tt = Lt.canvasOffsetTop, Qt = Lt.canvasOffsetLeft; N.top = Tt + rt, N.left = Qt + rt, N.width = Y.width + rt, N.height = Y.height + rt, this.updateToolbarPos({ top: Lt.top, left: Lt.left }), this._trgToolUp("global", { component: nt, el: gt, top: Tt, left: Qt, width: Y.width, height: Y.height }); }, updateAttached: (0, _t.debounce)(function() { this.updateGlobalPos(); }, 0), onContainerChange: (0, _t.debounce)(function() { this.em.refreshCanvas(); }, 150), getElementPos: function(Q) { return this.canvas.getCanvasView().getElementPos(Q, { noScroll: !0 }); }, hideBadge: function() { this.getBadge().style.display = "none"; }, cleanPrevious: function(Q) { Q && Q.set({ status: "", state: "" }); }, getContentWindow: function() { return this.canvas.getWindow(); }, run: function(Q) { (0, Wt.hasWin)() && (this.editor = Q && Q.get("Editor"), this.enable()); }, stop: function(Q, j, V) { if (V === void 0 && (V = {}), (0, Wt.hasWin)()) { var Y = this.em, nt = this.editor; this.onHovered(), this.stopSelectComponent(), !V.preserveSelected && Y.setSelected(), this.toggleToolsEl(), nt && nt.stopCommand("resize"); } } }; }, 189: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(895); const _t = { startSelectPosition: function(J, W, z) { var k = this; z === void 0 && (z = {}), this.isPointed = !1; var P = this.em.Utils, E = J.ownerDocument.body; P && !this.sorter && (this.sorter = new P.Sorter({ container: E, placer: this.canvas.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: this.ppfx, direction: "a", document: W, wmargin: 1, nested: 1, em: this.em, canvasRelative: 1, scale: function() { return k.em.getZoomDecimal(); } })), z.onStart && (this.sorter.onStart = z.onStart), J && this.sorter.startSort(J, { container: E }); }, getOffsetDim: function() { var J = this.offset(this.canvas.getFrameEl()), W = this.offset(this.canvas.getElement()); return { top: J.top - W.top, left: J.left - W.left }; }, stopSelectPosition: function() { this.posTargetCollection = null, this.posIndex = this.posMethod == "after" && this.cDim.length !== 0 ? this.posIndex + 1 : this.posIndex, this.sorter && (this.sorter.moved = 0, this.sorter.endMove()), this.cDim && (this.posIsLastEl = this.cDim.length !== 0 && this.posMethod == "after" && this.posIndex == this.cDim.length, this.posTargetEl = this.cDim.length === 0 ? (0, at.default)(this.outsideElem) : !this.posIsLastEl && this.cDim[this.posIndex] ? (0, at.default)(this.cDim[this.posIndex][5]).parent() : (0, at.default)(this.outsideElem), this.posTargetModel = this.posTargetEl.data("model"), this.posTargetCollection = this.posTargetEl.data("model-comp")); }, enable: function() { this.startSelectPosition(); }, nearFloat: function(J, W, z) { var k = J || 0, P = W || "before", E = z.length, M = E !== 0 && P == "after" && k == E; return E !== 0 && (!M && !z[k][4] || z[k - 1] && !z[k - 1][4] || M && !z[k - 1][4]) ? 1 : 0; }, run: function() { this.enable(); }, stop: function() { this.stopSelectPosition(), this.$wrapper.css("cursor", ""), this.$wrapper.unbind(); } }; }, 804: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => z }); var at = pt(50), _t = pt(895), J = pt(163), W = function() { return W = Object.assign || function(k) { for (var P, E = 1, M = arguments.length; E < M; E++) for (var D in P = arguments[E]) Object.prototype.hasOwnProperty.call(P, D) && (k[D] = P[D]); return k; }, W.apply(this, arguments); }; const z = { getOffsetMethod: function(k) { return "get" + (k || "") + "OffsetViewerEl"; }, run: function(k, P, E) { var M = E || {}, D = M.state || "", ot = k.getConfig(), it = this.em.getZoomDecimal(), Et = M.el || ""; if (!ot.showOffsets || (0, J.isTextNode)(Et) || !ot.showOffsetsSelected && D == "Fixed") k.stopCommand("".concat(this.id), E); else { var jt = k.Canvas, Dt = W({}, M.elPos || jt.getElementPos(Et)); (0, at.isUndefined)(M.top) || (Dt.top = M.top), (0, at.isUndefined)(M.left) || (Dt.left = M.left); var ee = window.getComputedStyle(Et), xt = this.ppfx, bt = D + "State", Wt = jt[this.getOffsetMethod(D)](E.view); Wt.style.opacity = ""; var Ft = this["marginT" + D], Ht = this["marginB" + D], Q = this["marginL" + D], j = this["marginR" + D], V = this["padT" + D], Y = this["padB" + D], nt = this["padL" + D], wt = this["padR" + D]; if (Wt.childNodes.length && (this[bt] = "1", Ft = Wt.querySelector("[data-offset-m-t]"), Ht = Wt.querySelector("[data-offset-m-b]"), Q = Wt.querySelector("[data-offset-m-l]"), j = Wt.querySelector("[data-offset-m-r]"), V = Wt.querySelector("[data-offset-p-t]"), Y = Wt.querySelector("[data-offset-p-b]"), nt = Wt.querySelector("[data-offset-p-l]"), wt = Wt.querySelector("[data-offset-p-r]")), !this[bt]) { var rt = D.toLowerCase(), gt = rt + "margin-v", N = rt + "padding-v", Lt = (0, _t.default)('
')).get(0), Tt = (0, _t.default)('
')).get(0), Qt = xt + N + "-el", Oe = "".concat(xt + gt + "-el", " ").concat(xt + gt), Se = "".concat(Qt, " ").concat(xt + N); Ft = (0, _t.default)('
')).get(0), Ht = (0, _t.default)('
')).get(0), Q = (0, _t.default)('
')).get(0), j = (0, _t.default)('
')).get(0), V = (0, _t.default)('
')).get(0), Y = (0, _t.default)('
')).get(0), nt = (0, _t.default)('
')).get(0), wt = (0, _t.default)('
')).get(0), this["marginT" + D] = Ft, this["marginB" + D] = Ht, this["marginL" + D] = Q, this["marginR" + D] = j, this["padT" + D] = V, this["padB" + D] = Y, this["padL" + D] = nt, this["padR" + D] = wt, Lt.appendChild(Ft), Lt.appendChild(Ht), Lt.appendChild(Q), Lt.appendChild(j), Tt.appendChild(V), Tt.appendChild(Y), Tt.appendChild(nt), Tt.appendChild(wt), Wt.appendChild(Lt), Wt.appendChild(Tt), this[bt] = "1"; } var _e = "px", De = parseFloat(ee.marginLeft.replace(_e, "")) * it, xe = parseFloat(ee.marginRight.replace(_e, "")) * it, Te = parseFloat(ee.marginTop.replace(_e, "")) * it, be = parseFloat(ee.marginBottom.replace(_e, "")) * it, ge = Ft.style, pe = Ht.style, ce = Q.style, st = j.style, Xt = V.style, qt = Y.style, ne = nt.style, ae = wt.style, Zt = parseFloat(Dt.left), Ae = parseFloat(ee.width) * it + _e; ge.height = Te + _e, ge.width = Ae, ge.top = Dt.top - Te + _e, ge.left = Zt + _e, pe.height = be + _e, pe.width = Ae, pe.top = Dt.top + Dt.height + _e, pe.left = Zt + _e; var Ke = Dt.height + Te + be + _e, Xe = Dt.top - Te + _e; ce.height = Ke, ce.width = De + _e, ce.top = Xe, ce.left = Zt - De + _e, st.height = Ke, st.width = xe + _e, st.top = Xe, st.left = Zt + Dt.width + _e; var vn = parseFloat(ee.paddingTop) * it; Xt.height = vn + _e; var Rn = parseFloat(ee.paddingBottom) * it; qt.height = Rn + _e; var mt = Dt.height - Rn - vn + _e, zt = Dt.top + vn + _e; ne.height = mt, ne.width = parseFloat(ee.paddingLeft) * it + _e, ne.top = zt; var b = parseFloat(ee.paddingRight) * it; ae.height = mt, ae.width = b + _e, ae.top = zt; } }, stop: function(k, P, E) { E === void 0 && (E = {}); var M = (E || {}).state || "", D = this.getOffsetMethod(M); k.Canvas[D](E.view).style.opacity = 0; } }; }, 434: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => _t }); var at = pt(50); const _t = { init: function() { (0, at.bindAll)(this, "_onFramesChange"); }, run: function(J) { this.toggleVis(J); }, stop: function(J) { this.toggleVis(J, 0); }, toggleVis: function(J, W) { var z = this; if (W === void 0 && (W = 1), !J.Commands.isActive("preview")) { var k = J.Canvas, P = W ? "on" : "off"; k.getFrames().forEach(function(E) { return z._upFrame(E, W); }), k.getModel()[P]("change:frames", this._onFramesChange); } }, _onFramesChange: function(J, W) { var z = this; W.forEach(function(k) { return k.once("loaded", function() { return z._upFrame(k, !0); }); }); }, _upFrame: function(J, W) { var z, k = W ? "add" : "remove"; (z = J.view) === null || z === void 0 || z.getBody().classList[k]("".concat(this.ppfx, "dashed")); } }; }, 346: (S, H, pt) => { pt.d(H, { FE: () => k, G7: () => P, Hn: () => z }); var at, _t = pt(316), J = pt.n(_t), W = (at = function(E, M) { return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(D, ot) { D.__proto__ = ot; } || function(D, ot) { for (var it in ot) Object.prototype.hasOwnProperty.call(ot, it) && (D[it] = ot[it]); }, at(E, M); }, function(E, M) { if (typeof M != "function" && M !== null) throw new TypeError("Class extends value " + String(M) + " is not a constructor or null"); function D() { this.constructor = E; } at(E, M), E.prototype = M === null ? Object.create(M) : (D.prototype = M.prototype, new D()); }), z = function(E) { function M() { return E !== null && E.apply(this, arguments) || this; } return W(M, E), M; }(J().Model), k = function(E) { function M() { return E !== null && E.apply(this, arguments) || this; } return W(M, E), M; }(J().Collection), P = function(E) { function M() { return E !== null && E.apply(this, arguments) || this; } return W(M, E), M; }(J().View); }, 330: (S, H, pt) => { pt.d(H, { Z: () => k }); var at, _t = pt(50), J = pt(346), W = (at = function(P, E) { return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(M, D) { M.__proto__ = D; } || function(M, D) { for (var ot in D) Object.prototype.hasOwnProperty.call(D, ot) && (M[ot] = D[ot]); }, at(P, E); }, function(P, E) { if (typeof E != "function" && E !== null) throw new TypeError("Class extends value " + String(E) + " is not a constructor or null"); function M() { this.constructor = P; } at(P, E), P.prototype = E === null ? Object.create(E) : (M.prototype = E.prototype, new M()); }), z = function(P) { function E(M, D, ot) { M === void 0 && (M = {}), ot === void 0 && (ot = !1); var it = P.call(this, M) || this; return it.itemsView = "", it.itemType = "type", it.reuseView = !1, it.config = D || M.config || {}, ot && it.listenTo(it.collection, "add", it.addTo), it.items = [], it; } return W(E, P), E.prototype.addTo = function(M) { this.add(M); }, E.prototype.itemViewNotFound = function(M) { var D = this.config, ot = this.ns, it = D.em, Et = "".concat(ot ? "[".concat(ot, "]: ") : "", "'").concat(M, "' type not found"); it && it.logWarning(Et); }, E.prototype.add = function(M, D) { var ot, it = this, Et = it.config, jt = it.reuseView, Dt = it.items, ee = this.itemsView || {}, xt = D || null, bt = this.itemView, Wt = M.get(this.itemType); ee[Wt] ? bt = ee[Wt] : !Wt || ee[Wt] || (0, _t.includes)(["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"], Wt) || this.itemViewNotFound(Wt), ot = M.view && jt ? M.view : new bt({ model: M, config: Et }, Et), Dt && Dt.push(ot); var Ft = ot.render().el; xt ? xt.appendChild(Ft) : this.$el.append(Ft); }, E.prototype.render = function() { var M = document.createDocumentFragment(); return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each(function(D) { this.add(D, M); }, this), this.$el.append(M), this.onRender(), this; }, E.prototype.onRender = function() { }, E.prototype.onRemoveBefore = function(M, D) { }, E.prototype.onRemove = function(M, D) { }, E.prototype.remove = function(M) { M === void 0 && (M = {}); var D = this.items; return this.onRemoveBefore(D, M), this.clearItems(), P.prototype.remove.call(this), this.onRemove(D, M), this; }, E.prototype.clearItems = function() { this.items; }, E; }(J.G7); const k = z; z.prototype.itemView = ""; }, 668: (S, H, pt) => { pt.d(H, { Z: () => z }); var at = pt(50), _t = pt(163), J = function() { return J = Object.assign || function(k) { for (var P, E = 1, M = arguments.length; E < M; E++) for (var D in P = arguments[E]) Object.prototype.hasOwnProperty.call(P, D) && (k[D] = P[D]); return k; }, J.apply(this, arguments); }, W = ["x", "y"]; const z = function() { function k(P) { return P === void 0 && (P = {}), this.opts = { snapOffset: 5, scale: 1 }, (0, at.bindAll)(this, "drag", "stop", "keyHandle", "handleScroll"), this.setOptions(P), this.delta = { x: 0, y: 0 }, this.lastScroll = { x: 0, y: 0 }, this.lastScrollDiff = { x: 0, y: 0 }, this.startPointer = { x: 0, y: 0 }, this.startPosition = { x: 0, y: 0 }, this.globScrollDiff = { x: 0, y: 0 }, this.currentPointer = { x: 0, y: 0 }, this.position = { x: 0, y: 0 }, this.guidesStatic = [], this.guidesTarget = [], this.docs = [], this; } return k.prototype.setOptions = function(P) { P === void 0 && (P = {}), this.opts = J(J({}, this.opts), P); }, k.prototype.toggleDrag = function(P) { var E = this.getDocumentEl(), M = this.getContainerEl(), D = this.getWindowEl(), ot = P ? "on" : "off", it = { on: _t.on, off: _t.off }; it[ot](M, "mousemove dragover", this.drag), it[ot](E, "mouseup dragend touchend", this.stop), it[ot](E, "keydown", this.keyHandle), it[ot](D, "scroll", this.handleScroll); }, k.prototype.handleScroll = function() { var P = this.lastScroll, E = this.delta, M = this.getScrollInfo(), D = { x: M.x - P.x, y: M.y - P.y }; this.move(E.x + D.x, E.y + D.y), this.lastScrollDiff = D; }, k.prototype.start = function(P) { var E = this.opts, M = E.onStart; this.toggleDrag(!0), this.startPointer = this.getPointerPos(P), this.guidesStatic = (0, at.result)(E, "guidesStatic") || [], this.guidesTarget = (0, at.result)(E, "guidesTarget") || [], (0, at.isFunction)(M) && M(P, this), this.startPosition = this.getStartPosition(), this.lastScrollDiff = { x: 0, y: 0 }, this.globScrollDiff = { x: 0, y: 0 }, this.drag(P); }, k.prototype.drag = function(P) { var E = this, M = this, D = M.opts, ot = M.lastScrollDiff, it = M.globScrollDiff, Et = D.onDrag, jt = this.startPointer, Dt = this.getPointerPos(P), ee = { x: it.x + ot.x, y: it.y + ot.y }; this.globScrollDiff = ee; var xt = { x: Dt.x - jt.x + ee.x, y: Dt.y - jt.y + ee.y }; this.lastScrollDiff = { x: 0, y: 0 }; var bt = this.lockedAxis; (bt = P.shiftKey ? !bt && this.detectAxisLock(xt.x, xt.y) : null) === "x" ? xt.x = jt.x : bt === "y" && (xt.y = jt.y); var Wt = function(Y) { W.forEach(function(nt) { return Y[nt] = Y[nt] * (0, at.result)(D, "scale"); }), E.delta = Y, E.move(Y.x, Y.y), (0, at.isFunction)(Et) && Et(P, E); }, Ft = J({}, xt); if (this.currentPointer = Dt, this.lockedAxis = bt, this.lastScroll = this.getScrollInfo(), Wt(xt), this.guidesTarget.length) { var Ht = this.snapGuides(Ft), Q = Ht.newDelta, j = Ht.trgX, V = Ht.trgY; (j || V) && Wt(Q); } P.which === 0 && this.stop(P); }, k.prototype.snapGuides = function(P) { var E = this, M = P, D = this.trgX, ot = this.trgY; return this.guidesTarget.forEach(function(it) { it.x && E.trgX || it.y && E.trgY || (it.active = !1, E.guidesStatic.forEach(function(Et) { if (!(it.y && Et.x || it.x && Et.y)) { var jt = it.y && Et.y, Dt = jt ? "y" : "x", ee = it[Dt], xt = Et[Dt], bt = P[Dt], Wt = jt ? ot : D; if (E.isPointIn(ee, xt) && (0, at.isUndefined)(Wt)) { var Ft = bt - (ee - xt); E.setGuideLock(it, Ft); } } })); }), D = this.trgX, ot = this.trgY, W.forEach(function(it) { var Et = it.toUpperCase(), jt = E["trg".concat(Et)]; jt && !E.isPointIn(P[it], jt.lock) && (E.setGuideLock(jt, null), jt = null), jt && !(0, at.isUndefined)(jt.lock) && (M[it] = jt.lock); }), { newDelta: M, trgX: this.trgX, trgY: this.trgY }; }, k.prototype.isPointIn = function(P, E, M) { var D = (M === void 0 ? {} : M).offset || this.opts.snapOffset || 0; return P >= E && P <= E + D || P <= E && P >= E - D; }, k.prototype.setGuideLock = function(P, E) { var M = (0, at.isUndefined)(P.x) ? "Y" : "X", D = "trg".concat(M); return E !== null ? (P.active = !0, P.lock = E, this[D] = P) : (delete P.active, delete P.lock, delete this[D]), P; }, k.prototype.stop = function(P, E) { E === void 0 && (E = {}); var M = this.delta, D = !!E.cancel, ot = D ? 0 : M.x, it = D ? 0 : M.y; this.toggleDrag(), this.lockedAxis = null, this.move(ot, it, !0); var Et = this.opts.onEnd; (0, at.isFunction)(Et) && Et(P, this, { cancelled: D }); }, k.prototype.keyHandle = function(P) { (0, _t.isEscKey)(P) && this.stop(P, { cancel: !0 }); }, k.prototype.move = function(P, E, M) { var D = this.el, ot = this.opts, it = this.startPosition; if (it) { var Et = ot.setPosition, jt = it.x + P, Dt = it.y + E; this.position = { x: jt, y: Dt, end: M }, (0, at.isFunction)(Et) && Et(this.position), D && (D.style.left = "".concat(jt, "px"), D.style.top = "".concat(Dt, "px")); } }, k.prototype.getContainerEl = function() { var P = this.opts.container; return P ? [P] : this.getDocumentEl(); }, k.prototype.getWindowEl = function() { return this.getContainerEl().map(function(P) { var E = P.ownerDocument || P; return E.defaultView || E.parentWindow; }); }, k.prototype.getDocumentEl = function(P) { var E = this.opts.doc; if (P = P || this.el, !this.docs.length) { var M = [document]; P && M.push(P.ownerDocument), E && M.push(E), this.docs = M; } return this.docs; }, k.prototype.getPointerPos = function(P) { var E = this.opts.getPointerPosition, M = (0, _t.getPointerEvent)(P); return E ? E(P) : { x: M.clientX, y: M.clientY }; }, k.prototype.getStartPosition = function() { var P = this.el, E = this.opts.getPosition, M = { x: 0, y: 0 }; return (0, at.isFunction)(E) ? M = E() : P && (M = { x: parseFloat(P.style.left), y: parseFloat(P.style.top) }), M; }, k.prototype.getScrollInfo = function() { var P = this.opts.doc, E = P && P.body; return { y: E ? E.scrollTop : 0, x: E ? E.scrollLeft : 0 }; }, k.prototype.detectAxisLock = function(P, E) { var M = P, D = E, ot = Math.abs(M), it = Math.abs(D); return D >= ot || D <= -ot ? "x" : M > it || M < -it ? "y" : void 0; }, k; }(); }, 895: (S, H, pt) => { pt.r(H), pt.d(H, { default: () => Kt }); var at = typeof document < "u" ? document : null, _t = typeof window < "u" ? window : null, J = Array.prototype, W = J.filter, z = J.indexOf, k = J.map, P = J.push, E = J.reverse, M = J.slice, D = J.splice, ot = /^#[\w-]*$/, it = /^\.[\w-]*$/, Et = /<.+>/, jt = /^\w+$/; function Dt(R, tt) { return tt === void 0 && (tt = at), it.test(R) ? tt.getElementsByClassName(R.slice(1)) : jt.test(R) ? tt.getElementsByTagName(R) : tt.querySelectorAll(R); } function ee(R, tt) { if (tt === void 0 && (tt = at), R) { if (R.__cash) return R; var ut = R; if (nt(R)) { if (tt.__cash && (tt = tt[0]), !(ut = ot.test(R) ? tt.getElementById(R.slice(1)) : Et.test(R) ? Ve(R) : Dt(R, tt))) return; } else if (Y(R)) return this.ready(R); (ut.nodeType || ut === _t) && (ut = [ut]), this.length = ut.length; for (var yt = 0, Yt = this.length; yt < Yt; yt++) this[yt] = ut[yt]; } } function xt(R, tt) { return new ee(R, tt); } var bt = xt.fn = xt.prototype = ee.prototype = { constructor: xt, __cash: !0, length: 0, splice: D }; bt.get = function(R) { return R === void 0 ? M.call(this) : this[R < 0 ? R + this.length : R]; }, bt.eq = function(R) { return xt(this.get(R)); }, bt.first = function() { return this.eq(0); }, bt.last = function() { return this.eq(-1); }, bt.map = function(R) { return xt(k.call(this, function(tt, ut) { return R.call(tt, ut, tt); })); }, bt.slice = function() { return xt(M.apply(this, arguments)); }; var Wt = /(?:^\w|[A-Z]|\b\w)/g, Ft = /[\s-_]+/g; function Ht(R) { return R.replace(Wt, function(tt, ut) { return tt[ut ? "toUpperCase" : "toLowerCase"](); }).replace(Ft, ""); } function Q(R, tt) { for (var ut = 0, yt = R.length; ut < yt && tt.call(R[ut], R[ut], ut, R) !== !1; ut++) ; } xt.camelCase = Ht, xt.each = Q, bt.each = function(R) { return Q(this, function(tt, ut) { return R.call(tt, ut, tt); }), this; }, bt.removeProp = function(R) { return this.each(function(tt, ut) { delete ut[R]; }); }, xt.extend = bt.extend = function(R) { R === void 0 && (R = this); for (var tt = arguments, ut = tt.length, yt = ut < 2 ? 0 : 1; yt < ut; yt++) for (var Yt in tt[yt]) R[Yt] = tt[yt][Yt]; return R; }; var j = 1; function V(R, tt) { var ut = R && (R.matches || R.webkitMatchesSelector || R.mozMatchesSelector || R.msMatchesSelector || R.oMatchesSelector); return !!ut && ut.call(R, tt); } function Y(R) { return typeof R == "function"; } function nt(R) { return typeof R == "string"; } function wt(R) { return !isNaN(parseFloat(R)) && isFinite(R); } xt.guid = j, xt.matches = V, xt.isFunction = Y, xt.isString = nt, xt.isNumeric = wt; var rt = Array.isArray; function gt(R) { return nt(R) ? function(tt, ut) { return V(ut, R); } : R.__cash ? function(tt, ut) { return R.is(ut); } : function(tt, ut, yt) { return ut === yt; }; } xt.isArray = rt, bt.prop = function(R, tt) { if (R) { if (nt(R)) return arguments.length < 2 ? this[0] && this[0][R] : this.each(function(yt, Yt) { Yt[R] = tt; }); for (var ut in R) this.prop(ut, R[ut]); return this; } }, bt.filter = function(R) { if (!R) return xt(); var tt = Y(R) ? R : gt(R); return xt(W.call(this, function(ut, yt) { return tt.call(ut, yt, ut, R); })); }; var N = /\S+/g; function Lt(R) { return nt(R) && R.match(N) || []; } function Tt(R) { return R.filter(function(tt, ut, yt) { return yt.indexOf(tt) === ut; }); } function Qt(R, tt, ut) { if (R.nodeType === 1) { var yt = _t.getComputedStyle(R, null); return tt ? ut ? yt.getPropertyValue(tt) : yt[tt] : yt; } } function Oe(R, tt) { return parseInt(Qt(R, tt), 10) || 0; } bt.hasClass = function(R) { var tt = Lt(R), ut = !1; return tt.length && this.each(function(yt, Yt) { return !(ut = Yt.classList.contains(tt[0])); }), ut; }, bt.removeAttr = function(R) { var tt = Lt(R); return tt.length ? this.each(function(ut, yt) { Q(tt, function(Yt) { yt.removeAttribute(Yt); }); }) : this; }, bt.attr = function(R, tt) { if (R) { if (nt(R)) { if (arguments.length < 2) { if (!this[0]) return; var ut = this[0].getAttribute(R); return ut === null ? void 0 : ut; } return tt === null ? this.removeAttr(R) : this.each(function(Yt, he) { he.setAttribute(R, tt); }); } for (var yt in R) this.attr(yt, R[yt]); return this; } }, bt.toggleClass = function(R, tt) { var ut = Lt(R), yt = tt !== void 0; return ut.length ? this.each(function(Yt, he) { Q(ut, function(Re) { yt ? tt ? he.classList.add(Re) : he.classList.remove(Re) : he.classList.toggle(Re); }); }) : this; }, bt.addClass = function(R) { return this.toggleClass(R, !0); }, bt.removeClass = function(R) { return arguments.length ? this.toggleClass(R, !1) : this.attr("class", ""); }, xt.unique = Tt, bt.add = function(R, tt) { return xt(Tt(this.get().concat(xt(R, tt).get()))); }; var Se = /^--/; function _e(R) { return Se.test(R); } var De = {}, xe = at && at.createElement("div"), Te = xe ? xe.style : {}, be = ["webkit", "moz", "ms", "o"]; function ge(R, tt) { if (tt === void 0 && (tt = _e(R)), tt) return R; if (!De[R]) { var ut = Ht(R), yt = "" + ut.charAt(0).toUpperCase() + ut.slice(1); Q((ut + " " + be.join(yt + " ") + yt).split(" "), function(Yt) { if (Yt in Te) return De[R] = Yt, !1; }); } return De[R]; } xt.prefixedProp = ge; var pe = { animationIterationCount: !0, columnCount: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0 }; function ce(R, tt, ut) { return ut === void 0 && (ut = _e(R)), ut || pe[R] || !wt(tt) ? tt : tt + "px"; } bt.css = function(R, tt) { if (nt(R)) { var ut = _e(R); return R = ge(R, ut), arguments.length < 2 ? this[0] && Qt(this[0], R, ut) : R ? (tt = ce(R, tt, ut), this.each(function(Yt, he) { he.nodeType === 1 && (ut ? he.style.setProperty(R, tt) : he.style[R] = tt); })) : this; } for (var yt in R) this.css(yt, R[yt]); return this; }; var st = "__cashData", Xt = /^data-(.*)/; function qt(R) { return R[st] = R[st] || {}; } function ne(R, tt) { var ut = qt(R); if (tt) { if (!(tt in ut)) { var yt = R.dataset ? R.dataset[tt] || R.dataset[Ht(tt)] : xt(R).attr("data-" + tt); if (yt !== void 0) { try { yt = JSON.parse(yt); } catch { } ut[tt] = yt; } } return ut[tt]; } return ut; } function ae(R, tt) { return Oe(R, "border" + (tt ? "Left" : "Top") + "Width") + Oe(R, "padding" + (tt ? "Left" : "Top")) + Oe(R, "padding" + (tt ? "Right" : "Bottom")) + Oe(R, "border" + (tt ? "Right" : "Bottom") + "Width"); } function Zt(R, tt) { for (var ut = 0, yt = tt.length; ut < yt; ut++) if (R.indexOf(tt[ut]) < 0) return !1; return !0; } function Ae(R, tt, ut) { Q(R[ut], function(yt) { yt[0]; var Yt = yt[1]; tt.removeEventListener(ut, Yt); }), delete R[ut]; } xt.hasData = function(R) { return st in R; }, bt.data = function(R, tt) { var ut = this; if (!R) return this[0] ? (Q(this[0].attributes, function(Yt) { var he = Yt.name.match(Xt); he && ut.data(he[1]); }), ne(this[0])) : void 0; if (nt(R)) return tt === void 0 ? this[0] && ne(this[0], R) : this.each(function(Yt, he) { return function(Re, We, Ln) { qt(Re)[We] = Ln; }(he, R, tt); }); for (var yt in R) this.data(yt, R[yt]); return this; }, bt.removeData = function(R) { return this.each(function(tt, ut) { return function(yt, Yt) { Yt === void 0 ? delete yt[st] : delete qt(yt)[Yt]; }(ut, R); }); }, Q(["Width", "Height"], function(R) { bt["inner" + R] = function() { if (this[0]) return this[0] === _t ? _t["inner" + R] : this[0]["client" + R]; }; }), Q(["width", "height"], function(R, tt) { bt[R] = function(ut) { return this[0] ? arguments.length ? (ut = parseInt(ut, 10), this.each(function(yt, Yt) { if (Yt.nodeType === 1) { var he = Qt(Yt, "boxSizing"); Yt.style[R] = ce(R, ut + (he === "border-box" ? ae(Yt, !tt) : 0)); } })) : this[0] === _t ? this[0][Ht("outer-" + R)] : this[0].getBoundingClientRect()[R] - ae(this[0], !tt) : ut === void 0 ? void 0 : this; }; }), Q(["Width", "Height"], function(R, tt) { bt["outer" + R] = function(ut) { if (this[0]) return this[0] === _t ? _t["outer" + R] : this[0]["offset" + R] + (ut ? Oe(this[0], "margin" + (tt ? "Top" : "Left")) + Oe(this[0], "margin" + (tt ? "Bottom" : "Right")) : 0); }; }); var Ke = "__cashEvents", Xe = "."; function vn(R) { return R[Ke] = R[Ke] || {}; } function Rn(R) { var tt = R.split(Xe); return [tt[0], tt.slice(1).sort()]; } function mt(R, tt, ut, yt) { var Yt = vn(R); if (tt) { var he = Yt[tt]; if (!he) return; yt && (yt.guid = yt.guid || j++), Yt[tt] = he.filter(function(Re) { var We = Re[0], Ln = Re[1]; if (yt && Ln.guid !== yt.guid || !Zt(We, ut)) return !0; R.removeEventListener(tt, Ln); }); } else if (ut && ut.length) for (tt in Yt) mt(R, tt, ut, yt); else for (tt in Yt) Ae(Yt, R, tt); } bt.off = function(R, tt) { var ut = this; return R === void 0 ? this.each(function(yt, Yt) { return mt(Yt); }) : Q(Lt(R), function(yt) { var Yt = Rn(yt), he = Yt[0], Re = Yt[1]; ut.each(function(We, Ln) { return mt(Ln, he, Re, tt); }); }), this; }, bt.on = function(R, tt, ut, yt) { var Yt = this; if (!nt(R)) { for (var he in R) this.on(he, tt, R[he]); return this; } return Y(tt) && (ut = tt, tt = !1), Q(Lt(R), function(Re) { var We = Rn(Re), Ln = We[0], pn = We[1]; Yt.each(function(Ne, Ar) { var Yn = function jr(fn) { if (!fn.namespace || Zt(pn, fn.namespace.split(Xe))) { var _n = Ar; if (tt) { for (var Bn = fn.target; !V(Bn, tt); ) if (Bn === Ar || !(Bn = Bn.parentNode)) return; _n = Bn; } fn.namespace = fn.namespace || ""; var Mr = ut.call(_n, fn, fn.data); yt && mt(Ar, Ln, pn, jr), Mr === !1 && (fn.preventDefault(), fn.stopPropagation()); } }; Yn.guid = ut.guid = ut.guid || j++, function(jr, fn, _n, Bn) { Bn.guid = Bn.guid || j++; var Mr = vn(jr); Mr[fn] = Mr[fn] || [], Mr[fn].push([_n, Bn]), jr.addEventListener(fn, Bn); }(Ar, Ln, pn, Yn); }); }), this; }, bt.one = function(R, tt, ut) { return this.on(R, tt, ut, !0); }, bt.ready = function(R) { var tt = function() { return R(xt); }; return at.readyState !== "loading" ? setTimeout(tt) : at.addEventListener("DOMContentLoaded", tt), this; }, bt.trigger = function(R, tt) { var ut = R; if (nt(R)) { var yt = Rn(R), Yt = yt[0], he = yt[1]; (ut = at.createEvent("HTMLEvents")).initEvent(Yt, !0, !0), ut.namespace = he.join(Xe); } return ut.data = tt, this.each(function(Re, We) { We.dispatchEvent(ut); }); }; var zt = /select-one/i, b = /select-multiple/i; function I(R) { var tt = R.type; return zt.test(tt) ? function(ut) { return ut.selectedIndex < 0 ? null : ut.options[ut.selectedIndex].value; }(R) : b.test(tt) ? function(ut) { var yt = []; return Q(ut.options, function(Yt) { !Yt.selected || Yt.disabled || Yt.parentNode.disabled || yt.push(Yt.value); }), yt; }(R) : R.value; } var U = /%20/g, ht = /file|reset|submit|button|image/i, kt = /radio|checkbox/i; bt.serialize = function() { var R = ""; return this.each(function(tt, ut) { Q(ut.elements || [ut], function(yt) { if (!yt.disabled && yt.name && yt.tagName !== "FIELDSET" && !ht.test(yt.type) && (!kt.test(yt.type) || yt.checked)) { var Yt = I(yt); Yt !== void 0 && Q(rt(Yt) ? Yt : [Yt], function(he) { R += function(Re, We) { return "&" + encodeURIComponent(Re) + "=" + encodeURIComponent(We).replace(U, "+"); }(yt.name, he); }); } }); }), R.substr(1); }, bt.val = function(R) { return R === void 0 ? this[0] && I(this[0]) : this.each(function(tt, ut) { var yt = b.test(ut.type), Yt = R === null ? yt ? [] : "" : R; yt && rt(Yt) ? Q(ut.options, function(he) { he.selected = Yt.indexOf(he.value) >= 0; }) : ut.value = Yt; }); }, bt.clone = function() { return this.map(function(R, tt) { return tt.cloneNode(!0); }); }, bt.detach = function() { return this.each(function(R, tt) { tt.parentNode && tt.parentNode.removeChild(tt); }); }; var Ot, fe = /^\s*<(\w+)[^>]*>/, ke = /^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/; function Ve(R) { if (function() { if (!Ot) { var yt = at.createElement("table"), Yt = at.createElement("tr"); Ot = { "*": at.createElement("div"), tr: at.createElement("tbody"), td: Yt, th: Yt, thead: yt, tbody: yt, tfoot: yt }; } }(), !nt(R)) return []; if (ke.test(R)) return [at.createElement(RegExp.$1)]; var tt = fe.test(R) && RegExp.$1, ut = Ot[tt] || Ot["*"]; return ut.innerHTML = R, xt(ut.childNodes).detach().get(); } function ze(R, tt, ut) { if (tt !== void 0) { var yt = nt(tt); !yt && tt.length ? Q(tt, function(Yt) { return ze(R, Yt, ut); }) : Q(R, yt ? function(Yt) { Yt.insertAdjacentHTML(ut ? "afterbegin" : "beforeend", tt); } : function(Yt, he) { return function(Re, We, Ln) { Ln ? Re.insertBefore(We, Re.childNodes[0]) : Re.appendChild(We); }(Yt, he ? tt.cloneNode(!0) : tt, ut); }); } } xt.parseHTML = Ve, bt.empty = function() { var R = this[0]; if (R) for (; R.firstChild; ) R.removeChild(R.firstChild); return this; }, bt.append = function() { var R = this; return Q(arguments, function(tt) { ze(R, tt); }), this; }, bt.appendTo = function(R) { return ze(xt(R), this), this; }, bt.html = function(R) { if (R === void 0) return this[0] && this[0].innerHTML; var tt = R.nodeType ? R[0].outerHTML : R; return this.each(function(ut, yt) { yt.innerHTML = tt; }); }, bt.insertAfter = function(R) { var tt = this; return xt(R).each(function(ut, yt) { var Yt = yt.parentNode; tt.each(function(he, Re) { Yt.insertBefore(ut ? Re.cloneNode(!0) : Re, yt.nextSibling); }); }), this; }, bt.after = function() { var R = this; return Q(E.apply(arguments), function(tt) { E.apply(xt(tt).slice()).insertAfter(R); }), this; }, bt.insertBefore = function(R) { var tt = this; return xt(R).each(function(ut, yt) { var Yt = yt.parentNode; tt.each(function(he, Re) { Yt.insertBefore(ut ? Re.cloneNode(!0) : Re, yt); }); }), this; }, bt.before = function() { var R = this; return Q(arguments, function(tt) { xt(tt).insertBefore(R); }), this; }, bt.prepend = function() { var R = this; return Q(arguments, function(tt) { ze(R, tt, !0); }), this; }, bt.prependTo = function(R) { return ze(xt(R), E.apply(this.slice()), !0), this; }, bt.remove = function() { return this.detach().off(); }, bt.replaceWith = function(R) { var tt = this; return this.each(function(ut, yt) { var Yt = yt.parentNode; if (Yt) { var he = ut ? xt(R).clone() : xt(R); if (!he[0]) return tt.remove(), !1; Yt.replaceChild(he[0], yt), xt(he[0]).after(he.slice(1)); } }); }, bt.replaceAll = function(R) { return xt(R).replaceWith(this), this; }, bt.text = function(R) { return R === void 0 ? this[0] ? this[0].textContent : "" : this.each(function(tt, ut) { ut.textContent = R; }); }; var Qe = at && at.documentElement; bt.offset = function() { var R = this[0]; if (R) { var tt = R.getBoundingClientRect(); return { top: tt.top + _t.pageYOffset - Qe.clientTop, left: tt.left + _t.pageXOffset - Qe.clientLeft }; } }, bt.offsetParent = function() { return xt(this[0] && this[0].offsetParent); }, bt.position = function() { var R = this[0]; if (R) return { left: R.offsetLeft, top: R.offsetTop }; }, bt.children = function(R) { var tt = []; return this.each(function(ut, yt) { P.apply(tt, yt.children); }), tt = xt(Tt(tt)), R ? tt.filter(function(ut, yt) { return V(yt, R); }) : tt; }, bt.contents = function() { var R = []; return this.each(function(tt, ut) { P.apply(R, ut.tagName === "IFRAME" ? [ut.contentDocument] : ut.childNodes); }), xt(R.length && Tt(R)); }, bt.find = function(R) { for (var tt = [], ut = 0, yt = this.length; ut < yt; ut++) { var Yt = Dt(R, this[ut]); Yt.length && P.apply(tt, Yt); } return xt(tt.length && Tt(tt)); }, bt.has = function(R) { var tt = nt(R) ? function(ut, yt) { return !!Dt(R, yt).length; } : function(ut, yt) { return yt.contains(R); }; return this.filter(tt); }, bt.is = function(R) { if (!R || !this[0]) return !1; var tt = gt(R), ut = !1; return this.each(function(yt, Yt) { return !(ut = tt(yt, Yt, R)); }), ut; }, bt.next = function() { return xt(this[0] && this[0].nextElementSibling); }, bt.not = function(R) { if (!R || !this[0]) return this; var tt = gt(R); return this.filter(function(ut, yt) { return !tt(ut, yt, R); }); }, bt.parent = function() { var R = []; return this.each(function(tt, ut) { ut && ut.parentNode && R.push(ut.parentNode); }), xt(Tt(R)); }, bt.index = function(R) { var tt = R ? xt(R)[0] : this[0], ut = R ? this : xt(tt).parent().children(); return z.call(ut, tt); }, bt.closest = function(R) { return R && this[0] ? this.is(R) ? this.filter(R) : this.parent().closest(R) : xt(); }, bt.parents = function(R) { var tt, ut = []; return this.each(function(yt, Yt) { for (tt = Yt; tt && tt.parentNode && tt !== at.body.parentNode; ) tt = tt.parentNode, (!R || R && V(tt, R)) && ut.push(tt); }), xt(Tt(ut)); }, bt.prev = function() { return xt(this[0] && this[0].previousElementSibling); }, bt.siblings = function() { var R = this[0]; return this.parent().children().filter(function(tt, ut) { return ut !== R; }); }; const Kt = xt; }, 491: (S, H, pt) => { pt.d(H, { $Q: () => Et, FW: () => D, G1: () => z, GX: () => Wt, L_: () => P, Mx: () => k, R3: () => jt, SJ: () => bt, cx: () => E, dL: () => it, pn: () => ot, rw: () => ee, sE: () => M, t3: () => xt, ut: () => Dt }); var at = pt(50), _t = function(Ft, Ht, Q) { if (Q || arguments.length === 2) for (var j, V = 0, Y = Ht.length; V < Y; V++) !j && V in Ht || (j || (j = Array.prototype.slice.call(Ht, 0, V)), j[V] = Ht[V]); return Ft.concat(j || Array.prototype.slice.call(Ht)); }, J = "tag", W = "attributes", z = "transitionend oTransitionEnd transitionend webkitTransitionEnd", k = function(Ft) { return Ft && Ft.nodeType === 9; }, P = function(Ft) { var Ht = Ft && Ft.parentNode; Ht && Ht.removeChild(Ft); }; function E() { for (var Ft = [], Ht = 0; Ht < arguments.length; Ht++) Ft[Ht] = arguments[Ht]; var Q = Array.isArray(Ft[0]) ? Ft[0] : _t([], Ft, !0); return Q.filter(Boolean).join(" "); } var M = function(Ft, Ht) { return Ft.querySelectorAll(Ht); }, D = function(Ft, Ht) { return Ht === void 0 && (Ht = {}), Ft && Ft.setAttribute && (0, at.each)(Ht, function(Q, j) { return Ft.setAttribute(j, Q); }); }, ot = function(Ft) { return Ft && !!(Ft.offsetWidth || Ft.offsetHeight || Ft.getClientRects().length); }, it = function(Ft, Ht) { var Q; (Q = Ft.parentNode) === null || Q === void 0 || Q.replaceChild(Ht, Ft); }, Et = function(Ft, Ht, Q) { var j = Ft.childNodes, V = j.length, Y = (0, at.isUndefined)(Q) ? V : Q; (0, at.isString)(Ht) && (Ft.insertAdjacentHTML("beforeEnd", Ht), Ht = Ft.lastChild, Ft.removeChild(Ht)), Y >= V ? Ft.appendChild(Ht) : Ft.insertBefore(Ht, j[Y]); }, jt = function(Ft, Ht) { return Et(Ft, Ht); }, Dt = function(Ft, Ht, Q) { Ht === void 0 && (Ht = {}); var j = document.createElement(Ft); return Ht && (0, at.each)(Ht, function(V, Y) { return j.setAttribute(Y, V); }), Q && ((0, at.isString)(Q) ? j.innerHTML = Q : j.appendChild(Q)), j; }, ee = function(Ft) { return document.createTextNode(Ft); }, xt = function(Ft, Ht) { var Q, j = Ft.type; try { Q = new window[Ht](j, Ft); } catch { (Q = document.createEvent(Ht)).initEvent(j, !0, !0); } return Q._parentEvent = Ft, j.indexOf("key") === 0 && (Q.keyCodeVal = Ft.keyCode, ["keyCode", "which"].forEach(function(V) { Object.defineProperty(Q, V, { get: function() { return this.keyCodeVal; } }); })), Q; }, bt = function(Ft, Ht) { Ht === void 0 && (Ht = []), (Array.isArray(Ht) ? Ht : [Ht]).forEach(function(Q) { var j = Q[J] || "div", V = Q[W] || {}, Y = document.createElement(j); (0, at.each)(V, function(nt, wt) { Y.setAttribute(wt, nt); }), Ft.appendChild(Y); }); }, Wt = function(Ft) { var Ht = (Ft == null ? void 0 : Ft.ownerDocument) || document, Q = Ht.documentElement, j = Ht.defaultView || window; return { x: (j.pageXOffset || Q.scrollLeft || 0) - (Q.clientLeft || 0), y: (j.pageYOffset || Q.scrollTop || 0) - (Q.clientTop || 0) }; }; }, 163: (S, H, pt) => { pt.r(H), pt.d(H, { appendStyles: () => ot, buildBase64UrlFromSvg: () => ce, camelCase: () => xt, capitalize: () => De, createId: () => pe, deepMerge: () => wt, escape: () => Y, escapeNodeContent: () => nt, find: () => V, getElRect: () => gt, getElement: () => Ft, getGlobal: () => k, getKeyChar: () => Tt, getKeyCode: () => Lt, getModel: () => rt, getPointerEvent: () => N, getUiClass: () => D, getUnitFromValue: () => Dt, getViewEl: () => be, hasDnd: () => Wt, hasWin: () => z, isCommentNode: () => Q, isComponent: () => xe, isDef: () => W, isEmptyObj: () => _e, isEnterKey: () => Oe, isEscKey: () => Qt, isObject: () => Se, isRule: () => Te, isTaggableNode: () => j, isTextNode: () => Ht, matches: () => M, normalizeFloat: () => bt, off: () => jt, on: () => Et, setViewEl: () => ge, shallowDiff: () => it, toLowerCase: () => P, upFirst: () => ee }); var at = pt(50), _t = function() { return _t = Object.assign || function(st) { for (var Xt, qt = 1, ne = arguments.length; qt < ne; qt++) for (var ae in Xt = arguments[qt]) Object.prototype.hasOwnProperty.call(Xt, ae) && (st[ae] = Xt[ae]); return st; }, _t.apply(this, arguments); }, J = function(st, Xt, qt) { if (qt || arguments.length === 2) for (var ne, ae = 0, Zt = Xt.length; ae < Zt; ae++) !ne && ae in Xt || (ne || (ne = Array.prototype.slice.call(Xt, 0, ae)), ne[ae] = Xt[ae]); return st.concat(ne || Array.prototype.slice.call(Xt)); }, W = function(st) { return st !== void 0; }, z = function() { return typeof window < "u"; }, k = function() { return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : pt.g; }, P = function(st) { return (st || "").toLowerCase(); }, E = z() ? window.Element.prototype : {}, M = E.matches || E.webkitMatchesSelector || E.mozMatchesSelector || E.msMatchesSelector, D = function(st, Xt) { var qt = st.getConfig(), ne = qt.stylePrefix; return [qt.customUI && "".concat(ne, "cui"), Xt].filter(function(ae) { return ae; }).join(" "); }, ot = function(st, Xt) { Xt === void 0 && (Xt = {}); var qt = (0, at.isArray)(st) ? J([], st, !0) : [st]; if (qt.length) { var ne = qt.shift(); if (ne && (!Xt.unique || !document.querySelector('link[href="'.concat(ne, '"]')))) { var ae = document.head, Zt = document.createElement("link"); Zt.href = ne, Zt.rel = "stylesheet", Xt.prepand ? ae.insertBefore(Zt, ae.firstChild) : ae.appendChild(Zt); } ot(qt); } }, it = function(st, Xt) { var qt = {}, ne = (0, at.keys)(Xt); for (var ae in st) if (st.hasOwnProperty(ae)) { var Zt = st[ae], Ae = Xt[ae]; ne.indexOf(ae) >= 0 ? Zt !== Ae && (qt[ae] = Ae) : qt[ae] = null; } for (var ae in Xt) Xt.hasOwnProperty(ae) && (0, at.isUndefined)(st[ae]) && (qt[ae] = Xt[ae]); return qt; }, Et = function(st, Xt, qt, ne) { var ae = Xt.split(/\s+/); st = st instanceof Array ? st : [st]; for (var Zt = function(Ke) { st.forEach(function(Xe) { return Xe && Xe.addEventListener(ae[Ke], qt, ne); }); }, Ae = 0; Ae < ae.length; ++Ae) Zt(Ae); }, jt = function(st, Xt, qt, ne) { var ae = Xt.split(/\s+/); st = st instanceof Array ? st : [st]; for (var Zt = function(Ke) { st.forEach(function(Xe) { return Xe && Xe.removeEventListener(ae[Ke], qt, ne); }); }, Ae = 0; Ae < ae.length; ++Ae) Zt(Ae); }, Dt = function(st) { return st.replace(parseFloat(st), ""); }, ee = function(st) { return st[0].toUpperCase() + st.toLowerCase().slice(1); }, xt = function(st) { return st.replace(/-./g, function(Xt) { return Xt[1].toUpperCase(); }); }, bt = function(st, Xt, qt) { Xt === void 0 && (Xt = 1), qt === void 0 && (qt = 0); var ne = 0; if (isNaN(st)) return qt; if (st = parseFloat(st), Math.floor(st) !== st) { var ae = Xt.toString().split(".")[1]; ne = ae ? ae.length : 0; } return ne ? parseFloat(st.toFixed(ne)) : st; }, Wt = function(st) { return "draggable" in document.createElement("i") && (!st || st.config.nativeDnD); }, Ft = function(st) { return (0, at.isElement)(st) || Ht(st) ? st : st && st.getEl ? st.getEl() : void 0; }, Ht = function(st) { return st && st.nodeType === 3; }, Q = function(st) { return st && st.nodeType === 8; }, j = function(st) { return st && !Ht(st) && !Q(st); }, V = function(st, Xt) { var qt = null; return st.some(function(ne, ae) { return Xt(ne, ae, st) ? (qt = ne, 1) : 0; }), qt; }, Y = function(st) { return st === void 0 && (st = ""), "".concat(st).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`"); }, nt = function(st) { return st === void 0 && (st = ""), "".concat(st).replace(/&/g, "&").replace(//g, ">"); }, wt = function() { for (var st = [], Xt = 0; Xt < arguments.length; Xt++) st[Xt] = arguments[Xt]; for (var qt = _t({}, st[0]), ne = 1; ne < st.length; ne++) { var ae = _t({}, st[ne]); for (var Zt in ae) { var Ae = qt[Zt], Ke = ae[Zt]; Se(Ae) && Se(Ke) ? qt[Zt] = wt(Ae, Ke) : qt[Zt] = Ke; } } return qt; }, rt = function(st, Xt) { var qt = st; return !Xt && st && st.__cashData ? qt = st.__cashData.model : (0, at.isElement)(st) && (qt = Xt(st).data("model")), qt; }, gt = function(st) { var Xt, qt = { top: 0, left: 0, width: 0, height: 0 }; if (!st) return qt; if (Ht(st)) { var ne = document.createRange(); ne.selectNode(st), Xt = ne.getBoundingClientRect(), ne.detach(); } return Xt || (st.getBoundingClientRect ? st.getBoundingClientRect() : qt); }, N = function(st) { return st.touches && st.touches[0] ? st.touches[0] : st; }, Lt = function(st) { return st.which || st.keyCode; }, Tt = function(st) { return String.fromCharCode(Lt(st)); }, Qt = function(st) { return Lt(st) === 27; }, Oe = function(st) { return Lt(st) === 13; }, Se = function(st) { return st !== null && !Array.isArray(st) && typeof st == "object"; }, _e = function(st) { return Object.keys(st).length <= 0; }, De = function(st) { return st === void 0 && (st = ""), st && st.charAt(0).toUpperCase() + st.substring(1); }, xe = function(st) { return st && st.toHTML; }, Te = function(st) { return st && st.toCSS; }, be = function(st) { return st.__gjsv; }, ge = function(st, Xt) { st.__gjsv = Xt; }, pe = function(st) { st === void 0 && (st = 16); for (var Xt = "", qt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ne = qt.length, ae = 0; ae < st; ae++) Xt += qt.charAt(Math.floor(Math.random() * ne)); return Xt; }, ce = function(st) { if (st && st.substr(0, 4) === " { var at = { "./CanvasClear": 858, "./CanvasClear.ts": 858, "./CanvasMove": 884, "./CanvasMove.ts": 884, "./CommandAbstract": 790, "./CommandAbstract.ts": 790, "./ComponentDelete": 180, "./ComponentDelete.ts": 180, "./ComponentDrag": 544, "./ComponentDrag.ts": 544, "./ComponentEnter": 236, "./ComponentEnter.ts": 236, "./ComponentExit": 368, "./ComponentExit.ts": 368, "./ComponentNext": 243, "./ComponentNext.ts": 243, "./ComponentPrev": 400, "./ComponentPrev.ts": 400, "./ComponentStyleClear": 910, "./ComponentStyleClear.ts": 910, "./CopyComponent": 744, "./CopyComponent.ts": 744, "./DeleteComponent": 517, "./DeleteComponent.ts": 517, "./ExportTemplate": 457, "./ExportTemplate.ts": 457, "./Fullscreen": 975, "./Fullscreen.ts": 975, "./MoveComponent": 191, "./MoveComponent.ts": 191, "./OpenAssets": 912, "./OpenAssets.ts": 912, "./OpenBlocks": 117, "./OpenBlocks.ts": 117, "./OpenLayers": 614, "./OpenLayers.ts": 614, "./OpenStyleManager": 801, "./OpenStyleManager.ts": 801, "./OpenTraitManager": 395, "./OpenTraitManager.ts": 395, "./PasteComponent": 98, "./PasteComponent.ts": 98, "./Preview": 129, "./Preview.ts": 129, "./Resize": 116, "./Resize.ts": 116, "./SelectComponent": 407, "./SelectComponent.ts": 407, "./SelectPosition": 189, "./SelectPosition.ts": 189, "./ShowOffset": 804, "./ShowOffset.ts": 804, "./SwitchVisibility": 434, "./SwitchVisibility.ts": 434 }; function _t(W) { var z = J(W); return pt(z); } function J(W) { if (!pt.o(at, W)) { var z = new Error("Cannot find module '" + W + "'"); throw z.code = "MODULE_NOT_FOUND", z; } return at[W]; } _t.keys = function() { return Object.keys(at); }, _t.resolve = J, S.exports = _t, _t.id = 828; }, 50: (S, H, pt) => { pt.r(H), pt.d(H, { VERSION: () => _t, after: () => Cr, all: () => $i, allKeys: () => Kt, any: () => gi, assign: () => Dn, before: () => Oo, bind: () => io, bindAll: () => Wo, chain: () => Ds, chunk: () => Yo, clone: () => Ro, collect: () => Sr, compact: () => Xi, compose: () => Fs, constant: () => Ae, contains: () => pr, countBy: () => La, create: () => xo, debounce: () => Jn, default: () => Al, defaults: () => _o, defer: () => zi, delay: () => So, detect: () => hr, difference: () => ko, drop: () => Tr, each: () => mn, escape: () => Bt, every: () => $i, extend: () => Mr, extendOwn: () => Dn, filter: () => yn, find: () => hr, findIndex: () => hi, findKey: () => Vs, findLastIndex: () => $o, findWhere: () => qn, first: () => so, flatten: () => Ji, foldl: () => Dr, foldr: () => Wi, forEach: () => mn, functions: () => _n, get: () => Lr, groupBy: () => Go, has: () => Co, head: () => so, identity: () => Jr, include: () => pr, includes: () => pr, indexBy: () => Gi, indexOf: () => Zn, initial: () => Yi, inject: () => Dr, intersection: () => Ko, invert: () => fn, invoke: () => Nr, isArguments: () => ne, isArray: () => st, isArrayBuffer: () => Se, isBoolean: () => nt, isDataView: () => ce, isDate: () => Lt, isElement: () => wt, isEmpty: () => ht, isEqual: () => Qe, isError: () => Qt, isFinite: () => ae, isFunction: () => xe, isMap: () => Ln, isMatch: () => kt, isNaN: () => Zt, isNull: () => V, isNumber: () => N, isObject: () => j, isRegExp: () => Tt, isSet: () => Ne, isString: () => gt, isSymbol: () => Oe, isTypedArray: () => zt, isUndefined: () => Y, isWeakMap: () => pn, isWeakSet: () => Ar, iteratee: () => mo, keys: () => U, last: () => mi, lastIndexOf: () => Bi, map: () => Sr, mapObject: () => ve, matcher: () => Wn, matches: () => Wn, max: () => Fr, memoize: () => Ns, methods: () => _n, min: () => vi, mixin: () => Bs, negate: () => fi, noop: () => rr, now: () => In, object: () => Ia, omit: () => Ki, once: () => di, pairs: () => jr, partial: () => oo, partition: () => Da, pick: () => To, pluck: () => Ir, property: () => Nn, propertyOf: () => Uo, random: () => Ye, range: () => Zi, reduce: () => Dr, reduceRight: () => Wi, reject: () => Or, rest: () => Tr, restArguments: () => Q, result: () => Tn, sample: () => Hs, select: () => yn, shuffle: () => ja, size: () => Na, some: () => gi, sortBy: () => Ma, sortedIndex: () => Ui, tail: () => Tr, take: () => so, tap: () => ro, template: () => Hn, templateSettings: () => G, throttle: () => Is, times: () => or, toArray: () => Vr, toPath: () => ur, transpose: () => yi, unescape: () => T, union: () => zs, uniq: () => Po, unique: () => Po, uniqueId: () => _r, unzip: () => yi, values: () => Yn, where: () => kn, without: () => bn, wrap: () => Zr, zip: () => Us }); var at = {}; pt.r(at), pt.d(at, { VERSION: () => _t, after: () => Cr, all: () => $i, allKeys: () => Kt, any: () => gi, assign: () => Dn, before: () => Oo, bind: () => io, bindAll: () => Wo, chain: () => Ds, chunk: () => Yo, clone: () => Ro, collect: () => Sr, compact: () => Xi, compose: () => Fs, constant: () => Ae, contains: () => pr, countBy: () => La, create: () => xo, debounce: () => Jn, default: () => Fa, defaults: () => _o, defer: () => zi, delay: () => So, detect: () => hr, difference: () => ko, drop: () => Tr, each: () => mn, escape: () => Bt, every: () => $i, extend: () => Mr, extendOwn: () => Dn, filter: () => yn, find: () => hr, findIndex: () => hi, findKey: () => Vs, findLastIndex: () => $o, findWhere: () => qn, first: () => so, flatten: () => Ji, foldl: () => Dr, foldr: () => Wi, forEach: () => mn, functions: () => _n, get: () => Lr, groupBy: () => Go, has: () => Co, head: () => so, identity: () => Jr, include: () => pr, includes: () => pr, indexBy: () => Gi, indexOf: () => Zn, initial: () => Yi, inject: () => Dr, intersection: () => Ko, invert: () => fn, invoke: () => Nr, isArguments: () => ne, isArray: () => st, isArrayBuffer: () => Se, isBoolean: () => nt, isDataView: () => ce, isDate: () => Lt, isElement: () => wt, isEmpty: () => ht, isEqual: () => Qe, isError: () => Qt, isFinite: () => ae, isFunction: () => xe, isMap: () => Ln, isMatch: () => kt, isNaN: () => Zt, isNull: () => V, isNumber: () => N, isObject: () => j, isRegExp: () => Tt, isSet: () => Ne, isString: () => gt, isSymbol: () => Oe, isTypedArray: () => zt, isUndefined: () => Y, isWeakMap: () => pn, isWeakSet: () => Ar, iteratee: () => mo, keys: () => U, last: () => mi, lastIndexOf: () => Bi, map: () => Sr, mapObject: () => ve, matcher: () => Wn, matches: () => Wn, max: () => Fr, memoize: () => Ns, methods: () => _n, min: () => vi, mixin: () => Bs, negate: () => fi, noop: () => rr, now: () => In, object: () => Ia, omit: () => Ki, once: () => di, pairs: () => jr, partial: () => oo, partition: () => Da, pick: () => To, pluck: () => Ir, property: () => Nn, propertyOf: () => Uo, random: () => Ye, range: () => Zi, reduce: () => Dr, reduceRight: () => Wi, reject: () => Or, rest: () => Tr, restArguments: () => Q, result: () => Tn, sample: () => Hs, select: () => yn, shuffle: () => ja, size: () => Na, some: () => gi, sortBy: () => Ma, sortedIndex: () => Ui, tail: () => Tr, take: () => so, tap: () => ro, template: () => Hn, templateSettings: () => G, throttle: () => Is, times: () => or, toArray: () => Vr, toPath: () => ur, transpose: () => yi, unescape: () => T, union: () => zs, uniq: () => Po, unique: () => Po, uniqueId: () => _r, unzip: () => yi, values: () => Yn, where: () => kn, without: () => bn, wrap: () => Zr, zip: () => Us }); var _t = "1.13.4", J = typeof self == "object" && self.self === self && self || typeof Ic == "object" && Ic.global === Ic && Ic || Function("return this")() || {}, W = Array.prototype, z = Object.prototype, k = typeof Symbol < "u" ? Symbol.prototype : null, P = W.push, E = W.slice, M = z.toString, D = z.hasOwnProperty, ot = typeof ArrayBuffer < "u", it = typeof DataView < "u", Et = Array.isArray, jt = Object.keys, Dt = Object.create, ee = ot && ArrayBuffer.isView, xt = isNaN, bt = isFinite, Wt = !{ toString: null }.propertyIsEnumerable("toString"), Ft = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"], Ht = Math.pow(2, 53) - 1; function Q(_, A) { return A = A == null ? _.length - 1 : +A, function() { for (var K = Math.max(arguments.length - A, 0), Z = Array(K), vt = 0; vt < K; vt++) Z[vt] = arguments[vt + A]; switch (A) { case 0: return _.call(this, Z); case 1: return _.call(this, arguments[0], Z); case 2: return _.call(this, arguments[0], arguments[1], Z); } var lt = Array(A + 1); for (vt = 0; vt < A; vt++) lt[vt] = arguments[vt]; return lt[A] = Z, _.apply(this, lt); }; } function j(_) { var A = typeof _; return A === "function" || A === "object" && !!_; } function V(_) { return _ === null; } function Y(_) { return _ === void 0; } function nt(_) { return _ === !0 || _ === !1 || M.call(_) === "[object Boolean]"; } function wt(_) { return !(!_ || _.nodeType !== 1); } function rt(_) { var A = "[object " + _ + "]"; return function(K) { return M.call(K) === A; }; } const gt = rt("String"), N = rt("Number"), Lt = rt("Date"), Tt = rt("RegExp"), Qt = rt("Error"), Oe = rt("Symbol"), Se = rt("ArrayBuffer"); var _e = rt("Function"), De = J.document && J.document.childNodes; typeof Int8Array != "object" && typeof De != "function" && (_e = function(_) { return typeof _ == "function" || !1; }); const xe = _e, Te = rt("Object"); var be = it && Te(new DataView(new ArrayBuffer(8))), ge = typeof Map < "u" && Te(/* @__PURE__ */ new Map()), pe = rt("DataView"); const ce = be ? function(_) { return _ != null && xe(_.getInt8) && Se(_.buffer); } : pe, st = Et || rt("Array"); function Xt(_, A) { return _ != null && D.call(_, A); } var qt = rt("Arguments"); (function() { qt(arguments) || (qt = function(_) { return Xt(_, "callee"); }); })(); const ne = qt; function ae(_) { return !Oe(_) && bt(_) && !isNaN(parseFloat(_)); } function Zt(_) { return N(_) && xt(_); } function Ae(_) { return function() { return _; }; } function Ke(_) { return function(A) { var K = _(A); return typeof K == "number" && K >= 0 && K <= Ht; }; } function Xe(_) { return function(A) { return A == null ? void 0 : A[_]; }; } const vn = Xe("byteLength"), Rn = Ke(vn); var mt = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; const zt = ot ? function(_) { return ee ? ee(_) && !ce(_) : Rn(_) && mt.test(M.call(_)); } : Ae(!1), b = Xe("length"); function I(_, A) { A = function(Nt) { for (var Gt = {}, je = Nt.length, He = 0; He < je; ++He) Gt[Nt[He]] = !0; return { contains: function(cn) { return Gt[cn] === !0; }, push: function(cn) { return Gt[cn] = !0, Nt.push(cn); } }; }(A); var K = Ft.length, Z = _.constructor, vt = xe(Z) && Z.prototype || z, lt = "constructor"; for (Xt(_, lt) && !A.contains(lt) && A.push(lt); K--; ) (lt = Ft[K]) in _ && _[lt] !== vt[lt] && !A.contains(lt) && A.push(lt); } function U(_) { if (!j(_)) return []; if (jt) return jt(_); var A = []; for (var K in _) Xt(_, K) && A.push(K); return Wt && I(_, A), A; } function ht(_) { if (_ == null) return !0; var A = b(_); return typeof A == "number" && (st(_) || gt(_) || ne(_)) ? A === 0 : b(U(_)) === 0; } function kt(_, A) { var K = U(A), Z = K.length; if (_ == null) return !Z; for (var vt = Object(_), lt = 0; lt < Z; lt++) { var Nt = K[lt]; if (A[Nt] !== vt[Nt] || !(Nt in vt)) return !1; } return !0; } function Ot(_) { return _ instanceof Ot ? _ : this instanceof Ot ? void (this._wrapped = _) : new Ot(_); } function fe(_) { return new Uint8Array(_.buffer || _, _.byteOffset || 0, vn(_)); } Ot.VERSION = _t, Ot.prototype.value = function() { return this._wrapped; }, Ot.prototype.valueOf = Ot.prototype.toJSON = Ot.prototype.value, Ot.prototype.toString = function() { return String(this._wrapped); }; var ke = "[object DataView]"; function Ve(_, A, K, Z) { if (_ === A) return _ !== 0 || 1 / _ == 1 / A; if (_ == null || A == null) return !1; if (_ != _) return A != A; var vt = typeof _; return (vt === "function" || vt === "object" || typeof A == "object") && ze(_, A, K, Z); } function ze(_, A, K, Z) { _ instanceof Ot && (_ = _._wrapped), A instanceof Ot && (A = A._wrapped); var vt = M.call(_); if (vt !== M.call(A)) return !1; if (be && vt == "[object Object]" && ce(_)) { if (!ce(A)) return !1; vt = ke; } switch (vt) { case "[object RegExp]": case "[object String]": return "" + _ == "" + A; case "[object Number]": return +_ != +_ ? +A != +A : +_ == 0 ? 1 / +_ == 1 / A : +_ == +A; case "[object Date]": case "[object Boolean]": return +_ == +A; case "[object Symbol]": return k.valueOf.call(_) === k.valueOf.call(A); case "[object ArrayBuffer]": case ke: return ze(fe(_), fe(A), K, Z); } var lt = vt === "[object Array]"; if (!lt && zt(_)) { if (vn(_) !== vn(A)) return !1; if (_.buffer === A.buffer && _.byteOffset === A.byteOffset) return !0; lt = !0; } if (!lt) { if (typeof _ != "object" || typeof A != "object") return !1; var Nt = _.constructor, Gt = A.constructor; if (Nt !== Gt && !(xe(Nt) && Nt instanceof Nt && xe(Gt) && Gt instanceof Gt) && "constructor" in _ && "constructor" in A) return !1; } Z = Z || []; for (var je = (K = K || []).length; je--; ) if (K[je] === _) return Z[je] === A; if (K.push(_), Z.push(A), lt) { if ((je = _.length) !== A.length) return !1; for (; je--; ) if (!Ve(_[je], A[je], K, Z)) return !1; } else { var He, cn = U(_); if (je = cn.length, U(A).length !== je) return !1; for (; je--; ) if (!Xt(A, He = cn[je]) || !Ve(_[He], A[He], K, Z)) return !1; } return K.pop(), Z.pop(), !0; } function Qe(_, A) { return Ve(_, A); } function Kt(_) { if (!j(_)) return []; var A = []; for (var K in _) A.push(K); return Wt && I(_, A), A; } function R(_) { var A = b(_); return function(K) { if (K == null) return !1; var Z = Kt(K); if (b(Z)) return !1; for (var vt = 0; vt < A; vt++) if (!xe(K[_[vt]])) return !1; return _ !== Re || !xe(K[tt]); }; } var tt = "forEach", ut = "has", yt = ["clear", "delete"], Yt = ["get", ut, "set"], he = yt.concat(tt, Yt), Re = yt.concat(Yt), We = ["add"].concat(yt, tt, ut); const Ln = ge ? R(he) : rt("Map"), pn = ge ? R(Re) : rt("WeakMap"), Ne = ge ? R(We) : rt("Set"), Ar = rt("WeakSet"); function Yn(_) { for (var A = U(_), K = A.length, Z = Array(K), vt = 0; vt < K; vt++) Z[vt] = _[A[vt]]; return Z; } function jr(_) { for (var A = U(_), K = A.length, Z = Array(K), vt = 0; vt < K; vt++) Z[vt] = [A[vt], _[A[vt]]]; return Z; } function fn(_) { for (var A = {}, K = U(_), Z = 0, vt = K.length; Z < vt; Z++) A[_[K[Z]]] = K[Z]; return A; } function _n(_) { var A = []; for (var K in _) xe(_[K]) && A.push(K); return A.sort(); } function Bn(_, A) { return function(K) { var Z = arguments.length; if (A && (K = Object(K)), Z < 2 || K == null) return K; for (var vt = 1; vt < Z; vt++) for (var lt = arguments[vt], Nt = _(lt), Gt = Nt.length, je = 0; je < Gt; je++) { var He = Nt[je]; A && K[He] !== void 0 || (K[He] = lt[He]); } return K; }; } const Mr = Bn(Kt), Dn = Bn(U), _o = Bn(Kt, !0); function Vo(_) { if (!j(_)) return {}; if (Dt) return Dt(_); var A = function() { }; A.prototype = _; var K = new A(); return A.prototype = null, K; } function xo(_, A) { var K = Vo(_); return A && Dn(K, A), K; } function Ro(_) { return j(_) ? st(_) ? _.slice() : Mr({}, _) : _; } function ro(_, A) { return A(_), _; } function ur(_) { return st(_) ? _ : [_]; } function ln(_) { return Ot.toPath(_); } function Ho(_, A) { for (var K = A.length, Z = 0; Z < K; Z++) { if (_ == null) return; _ = _[A[Z]]; } return K ? _ : void 0; } function Lr(_, A, K) { var Z = Ho(_, ln(A)); return Y(Z) ? K : Z; } function Co(_, A) { for (var K = (A = ln(A)).length, Z = 0; Z < K; Z++) { var vt = A[Z]; if (!Xt(_, vt)) return !1; _ = _[vt]; } return !!K; } function Jr(_) { return _; } function Wn(_) { return _ = Dn({}, _), function(A) { return kt(A, _); }; } function Nn(_) { return _ = ln(_), function(A) { return Ho(A, _); }; } function $n(_, A, K) { if (A === void 0) return _; switch (K ?? 3) { case 1: return function(Z) { return _.call(A, Z); }; case 3: return function(Z, vt, lt) { return _.call(A, Z, vt, lt); }; case 4: return function(Z, vt, lt, Nt) { return _.call(A, Z, vt, lt, Nt); }; } return function() { return _.apply(A, arguments); }; } function zo(_, A, K) { return _ == null ? Jr : xe(_) ? $n(_, A, K) : j(_) && !st(_) ? Wn(_) : Nn(_); } function mo(_, A) { return zo(_, A, 1 / 0); } function qe(_, A, K) { return Ot.iteratee !== mo ? Ot.iteratee(_, A) : zo(_, A, K); } function ve(_, A, K) { A = qe(A, K); for (var Z = U(_), vt = Z.length, lt = {}, Nt = 0; Nt < vt; Nt++) { var Gt = Z[Nt]; lt[Gt] = A(_[Gt], Gt, _); } return lt; } function rr() { } function Uo(_) { return _ == null ? rr : function(A) { return Lr(_, A); }; } function or(_, A, K) { var Z = Array(Math.max(0, _)); A = $n(A, K, 1); for (var vt = 0; vt < _; vt++) Z[vt] = A(vt); return Z; } function Ye(_, A) { return A == null && (A = _, _ = 0), _ + Math.floor(Math.random() * (A - _ + 1)); } Ot.toPath = ur, Ot.iteratee = mo; const In = Date.now || function() { return (/* @__PURE__ */ new Date()).getTime(); }; function yo(_) { var A = function(lt) { return _[lt]; }, K = "(?:" + U(_).join("|") + ")", Z = RegExp(K), vt = RegExp(K, "g"); return function(lt) { return lt = lt == null ? "" : "" + lt, Z.test(lt) ? lt.replace(vt, A) : lt; }; } const Bo = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }, Bt = yo(Bo), T = yo(fn(Bo)), G = Ot.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; var Mt = /(.)^/, te = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029" }, de = /\\|'|\r|\n|\u2028|\u2029/g; function $e(_) { return "\\" + te[_]; } var oe = /^\s*(\w|\$)+\s*$/; function Hn(_, A, K) { !A && K && (A = K), A = _o({}, A, Ot.templateSettings); var Z = RegExp([(A.escape || Mt).source, (A.interpolate || Mt).source, (A.evaluate || Mt).source].join("|") + "|$", "g"), vt = 0, lt = "__p+='"; _.replace(Z, function(He, cn, Rr, ts, Eo) { return lt += _.slice(vt, Eo).replace(de, $e), vt = Eo + He.length, cn ? lt += `'+ ((__t=(` + cn + `))==null?'':_.escape(__t))+ '` : Rr ? lt += `'+ ((__t=(` + Rr + `))==null?'':__t)+ '` : ts && (lt += `'; ` + ts + ` __p+='`), He; }), lt += `'; `; var Nt, Gt = A.variable; if (Gt) { if (!oe.test(Gt)) throw new Error("variable is not a bare identifier: " + Gt); } else lt = `with(obj||{}){ ` + lt + `} `, Gt = "obj"; lt = `var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');}; ` + lt + `return __p; `; try { Nt = new Function(Gt, "_", lt); } catch (He) { throw He.source = lt, He; } var je = function(He) { return Nt.call(this, He, Ot); }; return je.source = "function(" + Gt + `){ ` + lt + "}", je; } function Tn(_, A, K) { var Z = (A = ln(A)).length; if (!Z) return xe(K) ? K.call(_) : K; for (var vt = 0; vt < Z; vt++) { var lt = _ == null ? void 0 : _[A[vt]]; lt === void 0 && (lt = K, vt = Z), _ = xe(lt) ? lt.call(_) : lt; } return _; } var Hi = 0; function _r(_) { var A = ++Hi + ""; return _ ? _ + A : A; } function Ds(_) { var A = Ot(_); return A._chain = !0, A; } function xr(_, A, K, Z, vt) { if (!(Z instanceof A)) return _.apply(K, vt); var lt = Vo(_.prototype), Nt = _.apply(lt, vt); return j(Nt) ? Nt : lt; } var bo = Q(function(_, A) { var K = bo.placeholder, Z = function() { for (var vt = 0, lt = A.length, Nt = Array(lt), Gt = 0; Gt < lt; Gt++) Nt[Gt] = A[Gt] === K ? arguments[vt++] : A[Gt]; for (; vt < arguments.length; ) Nt.push(arguments[vt++]); return xr(_, Z, this, this, Nt); }; return Z; }); bo.placeholder = Ot; const oo = bo, io = Q(function(_, A, K) { if (!xe(_)) throw new TypeError("Bind must be called on a function"); var Z = Q(function(vt) { return xr(_, Z, A, this, K.concat(vt)); }); return Z; }), Xn = Ke(b); function wo(_, A, K, Z) { if (Z = Z || [], A || A === 0) { if (A <= 0) return Z.concat(_); } else A = 1 / 0; for (var vt = Z.length, lt = 0, Nt = b(_); lt < Nt; lt++) { var Gt = _[lt]; if (Xn(Gt) && (st(Gt) || ne(Gt))) if (A > 1) wo(Gt, A - 1, K, Z), vt = Z.length; else for (var je = 0, He = Gt.length; je < He; ) Z[vt++] = Gt[je++]; else K || (Z[vt++] = Gt); } return Z; } const Wo = Q(function(_, A) { var K = (A = wo(A, !1, !1)).length; if (K < 1) throw new Error("bindAll must be passed function names"); for (; K--; ) { var Z = A[K]; _[Z] = io(_[Z], _); } return _; }); function Ns(_, A) { var K = function(Z) { var vt = K.cache, lt = "" + (A ? A.apply(this, arguments) : Z); return Xt(vt, lt) || (vt[lt] = _.apply(this, arguments)), vt[lt]; }; return K.cache = {}, K; } const So = Q(function(_, A, K) { return setTimeout(function() { return _.apply(null, K); }, A); }), zi = oo(So, Ot, 1); function Is(_, A, K) { var Z, vt, lt, Nt, Gt = 0; K || (K = {}); var je = function() { Gt = K.leading === !1 ? 0 : In(), Z = null, Nt = _.apply(vt, lt), Z || (vt = lt = null); }, He = function() { var cn = In(); Gt || K.leading !== !1 || (Gt = cn); var Rr = A - (cn - Gt); return vt = this, lt = arguments, Rr <= 0 || Rr > A ? (Z && (clearTimeout(Z), Z = null), Gt = cn, Nt = _.apply(vt, lt), Z || (vt = lt = null)) : Z || K.trailing === !1 || (Z = setTimeout(je, Rr)), Nt; }; return He.cancel = function() { clearTimeout(Z), Gt = 0, Z = vt = lt = null; }, He; } function Jn(_, A, K) { var Z, vt, lt, Nt, Gt, je = function() { var cn = In() - vt; A > cn ? Z = setTimeout(je, A - cn) : (Z = null, K || (Nt = _.apply(Gt, lt)), Z || (lt = Gt = null)); }, He = Q(function(cn) { return Gt = this, lt = cn, vt = In(), Z || (Z = setTimeout(je, A), K && (Nt = _.apply(Gt, lt))), Nt; }); return He.cancel = function() { clearTimeout(Z), Z = lt = Gt = null; }, He; } function Zr(_, A) { return oo(A, _); } function fi(_) { return function() { return !_.apply(this, arguments); }; } function Fs() { var _ = arguments, A = _.length - 1; return function() { for (var K = A, Z = _[A].apply(this, arguments); K--; ) Z = _[K].call(this, Z); return Z; }; } function Cr(_, A) { return function() { if (--_ < 1) return A.apply(this, arguments); }; } function Oo(_, A) { var K; return function() { return --_ > 0 && (K = A.apply(this, arguments)), _ <= 1 && (A = null), K; }; } const di = oo(Oo, 2); function Vs(_, A, K) { A = qe(A, K); for (var Z, vt = U(_), lt = 0, Nt = vt.length; lt < Nt; lt++) if (A(_[Z = vt[lt]], Z, _)) return Z; } function Aa(_) { return function(A, K, Z) { K = qe(K, Z); for (var vt = b(A), lt = _ > 0 ? 0 : vt - 1; lt >= 0 && lt < vt; lt += _) if (K(A[lt], lt, A)) return lt; return -1; }; } const hi = Aa(1), $o = Aa(-1); function Ui(_, A, K, Z) { for (var vt = (K = qe(K, Z, 1))(A), lt = 0, Nt = b(_); lt < Nt; ) { var Gt = Math.floor((lt + Nt) / 2); K(_[Gt]) < vt ? lt = Gt + 1 : Nt = Gt; } return lt; } function Be(_, A, K) { return function(Z, vt, lt) { var Nt = 0, Gt = b(Z); if (typeof lt == "number") _ > 0 ? Nt = lt >= 0 ? lt : Math.max(lt + Gt, Nt) : Gt = lt >= 0 ? Math.min(lt + 1, Gt) : lt + Gt + 1; else if (K && lt && Gt) return Z[lt = K(Z, vt)] === vt ? lt : -1; if (vt != vt) return (lt = A(E.call(Z, Nt, Gt), Zt)) >= 0 ? lt + Nt : -1; for (lt = _ > 0 ? Nt : Gt - 1; lt >= 0 && lt < Gt; lt += _) if (Z[lt] === vt) return lt; return -1; }; } const Zn = Be(1, hi, Ui), Bi = Be(-1, $o); function hr(_, A, K) { var Z = (Xn(_) ? hi : Vs)(_, A, K); if (Z !== void 0 && Z !== -1) return _[Z]; } function qn(_, A) { return hr(_, Wn(A)); } function mn(_, A, K) { var Z, vt; if (A = $n(A, K), Xn(_)) for (Z = 0, vt = _.length; Z < vt; Z++) A(_[Z], Z, _); else { var lt = U(_); for (Z = 0, vt = lt.length; Z < vt; Z++) A(_[lt[Z]], lt[Z], _); } return _; } function Sr(_, A, K) { A = qe(A, K); for (var Z = !Xn(_) && U(_), vt = (Z || _).length, lt = Array(vt), Nt = 0; Nt < vt; Nt++) { var Gt = Z ? Z[Nt] : Nt; lt[Nt] = A(_[Gt], Gt, _); } return lt; } function qo(_) { var A = function(K, Z, vt, lt) { var Nt = !Xn(K) && U(K), Gt = (Nt || K).length, je = _ > 0 ? 0 : Gt - 1; for (lt || (vt = K[Nt ? Nt[je] : je], je += _); je >= 0 && je < Gt; je += _) { var He = Nt ? Nt[je] : je; vt = Z(vt, K[He], He, K); } return vt; }; return function(K, Z, vt, lt) { var Nt = arguments.length >= 3; return A(K, $n(Z, lt, 4), vt, Nt); }; } const Dr = qo(1), Wi = qo(-1); function yn(_, A, K) { var Z = []; return A = qe(A, K), mn(_, function(vt, lt, Nt) { A(vt, lt, Nt) && Z.push(vt); }), Z; } function Or(_, A, K) { return yn(_, fi(qe(A)), K); } function $i(_, A, K) { A = qe(A, K); for (var Z = !Xn(_) && U(_), vt = (Z || _).length, lt = 0; lt < vt; lt++) { var Nt = Z ? Z[lt] : lt; if (!A(_[Nt], Nt, _)) return !1; } return !0; } function gi(_, A, K) { A = qe(A, K); for (var Z = !Xn(_) && U(_), vt = (Z || _).length, lt = 0; lt < vt; lt++) { var Nt = Z ? Z[lt] : lt; if (A(_[Nt], Nt, _)) return !0; } return !1; } function pr(_, A, K, Z) { return Xn(_) || (_ = Yn(_)), (typeof K != "number" || Z) && (K = 0), Zn(_, A, K) >= 0; } const Nr = Q(function(_, A, K) { var Z, vt; return xe(A) ? vt = A : (A = ln(A), Z = A.slice(0, -1), A = A[A.length - 1]), Sr(_, function(lt) { var Nt = vt; if (!Nt) { if (Z && Z.length && (lt = Ho(lt, Z)), lt == null) return; Nt = lt[A]; } return Nt == null ? Nt : Nt.apply(lt, K); }); }); function Ir(_, A) { return Sr(_, Nn(A)); } function kn(_, A) { return yn(_, Wn(A)); } function Fr(_, A, K) { var Z, vt, lt = -1 / 0, Nt = -1 / 0; if (A == null || typeof A == "number" && typeof _[0] != "object" && _ != null) for (var Gt = 0, je = (_ = Xn(_) ? _ : Yn(_)).length; Gt < je; Gt++) (Z = _[Gt]) != null && Z > lt && (lt = Z); else A = qe(A, K), mn(_, function(He, cn, Rr) { ((vt = A(He, cn, Rr)) > Nt || vt === -1 / 0 && lt === -1 / 0) && (lt = He, Nt = vt); }); return lt; } function vi(_, A, K) { var Z, vt, lt = 1 / 0, Nt = 1 / 0; if (A == null || typeof A == "number" && typeof _[0] != "object" && _ != null) for (var Gt = 0, je = (_ = Xn(_) ? _ : Yn(_)).length; Gt < je; Gt++) (Z = _[Gt]) != null && Z < lt && (lt = Z); else A = qe(A, K), mn(_, function(He, cn, Rr) { ((vt = A(He, cn, Rr)) < Nt || vt === 1 / 0 && lt === 1 / 0) && (lt = He, Nt = vt); }); return lt; } var Rs = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; function Vr(_) { return _ ? st(_) ? E.call(_) : gt(_) ? _.match(Rs) : Xn(_) ? Sr(_, Jr) : Yn(_) : []; } function Hs(_, A, K) { if (A == null || K) return Xn(_) || (_ = Yn(_)), _[Ye(_.length - 1)]; var Z = Vr(_), vt = b(Z); A = Math.max(Math.min(A, vt), 0); for (var lt = vt - 1, Nt = 0; Nt < A; Nt++) { var Gt = Ye(Nt, lt), je = Z[Nt]; Z[Nt] = Z[Gt], Z[Gt] = je; } return Z.slice(0, A); } function ja(_) { return Hs(_, 1 / 0); } function Ma(_, A, K) { var Z = 0; return A = qe(A, K), Ir(Sr(_, function(vt, lt, Nt) { return { value: vt, index: Z++, criteria: A(vt, lt, Nt) }; }).sort(function(vt, lt) { var Nt = vt.criteria, Gt = lt.criteria; if (Nt !== Gt) { if (Nt > Gt || Nt === void 0) return 1; if (Nt < Gt || Gt === void 0) return -1; } return vt.index - lt.index; }), "value"); } function qi(_, A) { return function(K, Z, vt) { var lt = A ? [[], []] : {}; return Z = qe(Z, vt), mn(K, function(Nt, Gt) { var je = Z(Nt, Gt, K); _(lt, Nt, je); }), lt; }; } const Go = qi(function(_, A, K) { Xt(_, K) ? _[K].push(A) : _[K] = [A]; }), Gi = qi(function(_, A, K) { _[K] = A; }), La = qi(function(_, A, K) { Xt(_, K) ? _[K]++ : _[K] = 1; }), Da = qi(function(_, A, K) { _[K ? 0 : 1].push(A); }, !0); function Na(_) { return _ == null ? 0 : Xn(_) ? _.length : U(_).length; } function El(_, A, K) { return A in K; } const To = Q(function(_, A) { var K = {}, Z = A[0]; if (_ == null) return K; xe(Z) ? (A.length > 1 && (Z = $n(Z, A[1])), A = Kt(_)) : (Z = El, A = wo(A, !1, !1), _ = Object(_)); for (var vt = 0, lt = A.length; vt < lt; vt++) { var Nt = A[vt], Gt = _[Nt]; Z(Gt, Nt, _) && (K[Nt] = Gt); } return K; }), Ki = Q(function(_, A) { var K, Z = A[0]; return xe(Z) ? (Z = fi(Z), A.length > 1 && (K = A[1])) : (A = Sr(wo(A, !1, !1), String), Z = function(vt, lt) { return !pr(A, lt); }), To(_, Z, K); }); function Yi(_, A, K) { return E.call(_, 0, Math.max(0, _.length - (A == null || K ? 1 : A))); } function so(_, A, K) { return _ == null || _.length < 1 ? A == null || K ? void 0 : [] : A == null || K ? _[0] : Yi(_, _.length - A); } function Tr(_, A, K) { return E.call(_, A == null || K ? 1 : A); } function mi(_, A, K) { return _ == null || _.length < 1 ? A == null || K ? void 0 : [] : A == null || K ? _[_.length - 1] : Tr(_, Math.max(0, _.length - A)); } function Xi(_) { return yn(_, Boolean); } function Ji(_, A) { return wo(_, A, !1); } const ko = Q(function(_, A) { return A = wo(A, !0, !0), yn(_, function(K) { return !pr(A, K); }); }), bn = Q(function(_, A) { return ko(_, A); }); function Po(_, A, K, Z) { nt(A) || (Z = K, K = A, A = !1), K != null && (K = qe(K, Z)); for (var vt = [], lt = [], Nt = 0, Gt = b(_); Nt < Gt; Nt++) { var je = _[Nt], He = K ? K(je, Nt, _) : je; A && !K ? (Nt && lt === He || vt.push(je), lt = He) : K ? pr(lt, He) || (lt.push(He), vt.push(je)) : pr(vt, je) || vt.push(je); } return vt; } const zs = Q(function(_) { return Po(wo(_, !0, !0)); }); function Ko(_) { for (var A = [], K = arguments.length, Z = 0, vt = b(_); Z < vt; Z++) { var lt = _[Z]; if (!pr(A, lt)) { var Nt; for (Nt = 1; Nt < K && pr(arguments[Nt], lt); Nt++) ; Nt === K && A.push(lt); } } return A; } function yi(_) { for (var A = _ && Fr(_, b).length || 0, K = Array(A), Z = 0; Z < A; Z++) K[Z] = Ir(_, Z); return K; } const Us = Q(yi); function Ia(_, A) { for (var K = {}, Z = 0, vt = b(_); Z < vt; Z++) A ? K[_[Z]] = A[Z] : K[_[Z][0]] = _[Z][1]; return K; } function Zi(_, A, K) { A == null && (A = _ || 0, _ = 0), K || (K = A < _ ? -1 : 1); for (var Z = Math.max(Math.ceil((A - _) / K), 0), vt = Array(Z), lt = 0; lt < Z; lt++, _ += K) vt[lt] = _; return vt; } function Yo(_, A) { if (A == null || A < 1) return []; for (var K = [], Z = 0, vt = _.length; Z < vt; ) K.push(E.call(_, Z, Z += A)); return K; } function bi(_, A) { return _._chain ? Ot(A).chain() : A; } function Bs(_) { return mn(_n(_), function(A) { var K = Ot[A] = _[A]; Ot.prototype[A] = function() { var Z = [this._wrapped]; return P.apply(Z, arguments), bi(this, K.apply(Ot, Z)); }; }), Ot; } mn(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(_) { var A = W[_]; Ot.prototype[_] = function() { var K = this._wrapped; return K != null && (A.apply(K, arguments), _ !== "shift" && _ !== "splice" || K.length !== 0 || delete K[0]), bi(this, K); }; }), mn(["concat", "join", "slice"], function(_) { var A = W[_]; Ot.prototype[_] = function() { var K = this._wrapped; return K != null && (K = A.apply(K, arguments)), bi(this, K); }; }); const Fa = Ot; var Qi = Bs(at); Qi._ = Qi; const Al = Qi; } }, Fc = {}; function gn(S) { var H = Fc[S]; if (H !== void 0) return H.exports; var pt = Fc[S] = { exports: {} }; return Uf[S].call(pt.exports, pt, pt.exports, gn), pt.exports; } gn.n = (S) => { var H = S && S.__esModule ? () => S.default : () => S; return gn.d(H, { a: H }), H; }, gn.d = (S, H) => { for (var pt in H) gn.o(H, pt) && !gn.o(S, pt) && Object.defineProperty(S, pt, { enumerable: !0, get: H[pt] }); }, gn.g = function() { if (typeof globalThis == "object") return globalThis; try { return this || new Function("return this")(); } catch { if (typeof window == "object") return window; } }(), gn.o = (S, H) => Object.prototype.hasOwnProperty.call(S, H), gn.r = (S) => { typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(S, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(S, "__esModule", { value: !0 }); }; var mp = {}; return (() => { gn.d(mp, { default: () => lm }); var S = gn(50), H = gn(163); function pt(a) { for (var r = [], t = 1; t < arguments.length; t++) r[t - 1] = arguments[t]; var e = a.raw; return e.reduce(function(n, i, l) { var f = r[l - 1], d = e[l - 1]; return Array.isArray(f) ? f = f.join("") : d && d.slice(-1) === "$" ? n = n.slice(0, -1) : f = (0, H.escape)(f), n + f + i; }); } const at = { stylePrefix: "gjs-", components: "", style: "", fromElement: !1, projectData: void 0, noticeOnUnload: !0, showOffsets: !1, showOffsetsSelected: !1, forceClass: !0, height: "900px", width: "100%", log: ["warning", "error"], baseCss: "", protectedCss: "* { box-sizing: border-box; } body {margin: 0;}", canvasCss: "", defaultCommand: "select-comp", showToolbar: !0, showDevices: !0, devicePreviewMode: !1, mediaCondition: "max-width", tagVarStart: "{[ ", tagVarEnd: " ]}", keepEmptyTextNodes: !1, jsInHtml: !0, nativeDnD: !0, multipleSelection: !0, optsHtml: {}, optsCss: {}, avoidInlineStyle: !0, avoidDefaults: !0, clearStyles: !1, listenToEl: [], cssIcons: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css", icons: { close: '', move: '', plus: '', caret: '', delete: '', copy: '', arrowUp: '', chevron: '', eye: '', eyeOff: '' }, i18n: {}, undoManager: {}, assetManager: {}, canvas: {}, layerManager: {}, storageManager: {}, richTextEditor: {}, domComponents: {}, modal: {}, codeManager: {}, panels: {}, commands: {}, cssComposer: {}, selectorManager: {}, deviceManager: {}, styleManager: {}, blockManager: {}, traitManager: {}, textViewCode: "Code", keepUnusedStyles: !1, multiFrames: !1, customUI: !1 }; var _t = gn(316), J = gn.n(_t), W = gn(895), z, k = gn(346), P = (z = function(a, r) { return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }, z(a, r); }, function(a, r) { if (typeof r != "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); function t() { this.constructor = a; } z(a, r), a.prototype = r === null ? Object.create(r) : (t.prototype = r.prototype, new t()); }), E = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return P(r, a), r; }(k.Hn); const M = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return P(r, a), r.prototype.getByComponent = function(t) { var e = this; return this.filter(function(n) { return e.getComponent(n) === t; })[0]; }, r.prototype.addComponent = function(t, e) { var n = this, i = ((0, S.isArray)(t) ? t : [t]).filter(function(l) { return !n.hasComponent(l); }).map(function(l) { return new E({ component: l }); })[0]; return this.push(i, e); }, r.prototype.getComponent = function(t) { return t.get("component"); }, r.prototype.hasComponent = function(t) { var e = this.getByComponent(t); return e && this.contains(e); }, r.prototype.lastComponent = function() { var t = this.last(); return t ? this.getComponent(t) : void 0; }, r.prototype.allComponents = function() { var t = this; return this.map(function(e) { return t.getComponent(e); }).filter(function(e) { return e; }); }, r.prototype.removeComponent = function(t, e) { var n = this, i = ((0, S.isArray)(t) ? t : [t]).map(function(l) { return n.getByComponent(l); }); return this.remove(i, e); }, r; }(k.FE); var D = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ot = function() { return ot = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ot.apply(this, arguments); }, it = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, Et = function() { function a(r, t, e) { this.cls = [], this._em = r, this._name = t; var n = this.name.charAt(0).toLowerCase() + this.name.slice(1), i = (0, S.isUndefined)(r.config[n]) ? r.config[this.name] : r.config[n], l = i === !0 ? {} : i || {}; l.pStylePrefix = r.config.pStylePrefix || "", (0, S.isUndefined)(i) || i || (l._disable = 1), l.em = r, this._config = (0, H.deepMerge)(e || {}, l); } return Object.defineProperty(a.prototype, "em", { get: function() { return this._em; }, enumerable: !1, configurable: !0 }), Object.defineProperty(a.prototype, "config", { get: function() { return this._config; }, enumerable: !1, configurable: !0 }), a.prototype.render = function(r) { }, a.prototype.postLoad = function(r) { }, Object.defineProperty(a.prototype, "name", { get: function() { return this._name; }, enumerable: !1, configurable: !0 }), a.prototype.getConfig = function(r) { return r ? this.config[r] : this.config; }, a.prototype.__logWarn = function(r, t) { t === void 0 && (t = {}), this.em.logWarning("[".concat(this.name, "]: ").concat(r), t); }, a.prototype.__appendTo = function() { var r = this.getConfig().appendTo; if (r) { var t = (0, S.isElement)(r) ? r : document.querySelector(r); if (!t) return this.__logWarn('"appendTo" element not found'); t.appendChild(this.render()); } }, a; }(); const jt = Et; var Dt = function(a) { function r(t, e, n, i, l, f) { f === void 0 && (f = {}); var d = a.call(this, t, e, l) || this; return d.cls = [], d.private = !1, d.all = n, d.events = i, !f.skipListen && d.__initListen(), d; } return D(r, a), r.prototype.postLoad = function(t) { }, r.prototype.render = function(t) { }, r.prototype.getProjectData = function(t) { var e = {}, n = this.storageKey; return n && (e[n] = t || this.getAll()), e; }, r.prototype.loadProjectData = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}); var n = e.all, i = e.onResult, l = e.reset, f = this.storageKey, d = { action: "load" }, v = n || this.all, h = t[f]; if (typeof h == "string") try { h = JSON.parse(h); } catch { this.__logWarn("Data parsing failed", { input: h }); } return l && h && v.reset(void 0, d), i ? h && i(h, d) : h && (0, H.isDef)(h.length) && v.reset(h, d), h; }, r.prototype.clear = function(t) { t === void 0 && (t = {}); var e = this.all; return e && e.reset(void 0, t), this; }, r.prototype.getAll = function() { return it([], this.all.models, !0); }, r.prototype.getAllMap = function() { return this.getAll().reduce(function(t, e) { return t[e.get(e.idAttribute)] = e, t; }, {}); }, r.prototype.__initListen = function(t) { t === void 0 && (t = {}); var e = this, n = e.all, i = e.em, l = e.events; n && i && n.on("add", function(f, d, v) { return i.trigger(l.add, f, v); }).on("remove", function(f, d, v) { return i.trigger(l.remove, f, v); }).on("change", function(f, d) { return i.trigger(l.update, f, f.changedAttributes(), d); }).on("all", this.__catchAllEvent, this), this.cls = [n].concat(t.collections || []), (t.propagate || []).forEach(function(f) { var d = f.entity, v = f.event; d.on("all", function(h, w, C, L) { var F = ot({ event: h }, L || C); [i, n].map(function(q) { return q.trigger(v, w, F); }); }); }); }, r.prototype.__remove = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this.em, l = (0, S.isString)(t) ? this.get(t) : t, f = function() { return l && n.all.remove(l, e), l; }; return !e.silent && (i == null || i.trigger(this.events.removeBefore, l, f, e)), !e.abort && f(); }, r.prototype.__catchAllEvent = function(t, e, n, i) { var l = this.em, f = this.events, d = i || n; l && f.all && l.trigger(f.all, { event: t, model: e, options: d }), this.__onAllEvent(); }, r.prototype.__appendTo = function(t) { var e = this.config.appendTo; if (e) { var n = (0, S.isElement)(e) ? e : document.querySelector(e); if (!n) return this.__logWarn('"appendTo" element not found'); n.appendChild(this.render(t)); } }, r.prototype.__onAllEvent = function() { }, r.prototype._createId = function(t) { t === void 0 && (t = 16); var e, n = this.getAll().length + t, i = this.getAllMap(); do e = (0, H.createId)(n); while (i[e]); return e; }, r.prototype.__listenAdd = function(t, e) { var n = this; t.on("add", function(i, l, f) { return n.em.trigger(e, i, f); }); }, r.prototype.__listenRemove = function(t, e) { var n = this; t.on("remove", function(i, l, f) { return n.em.trigger(e, i, f); }); }, r.prototype.__listenUpdate = function(t, e) { var n = this; t.on("change", function(i, l) { return n.em.trigger(e, i, i.changedAttributes(), l); }); }, r.prototype.__destroy = function() { var t; this.cls.forEach(function(e) { e.stopListening(), e.reset(); }), (t = this.view) === null || t === void 0 || t.remove(), this.view = void 0; }, r; }(Et); const ee = { stylePrefix: "cv-", scripts: [], styles: [], customBadgeLabel: void 0, autoscrollLimit: 50, extHl: !1, frameContent: "", frameStyle: ` body { background-color: #fff } * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) } * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) } * ::-webkit-scrollbar { width: 10px } `, notTextable: ["button", "a", "input[type=checkbox]", "input[type=radio]"] }; var xt = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const bt = function(a) { function r(t, e, n) { var i = a.call(this, e, n) || this; return i._module = t, i; } return xt(r, a), Object.defineProperty(r.prototype, "module", { get: function() { return this._module; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "config", { get: function() { return this._module.config; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "em", { get: function() { return this._module.em; }, enumerable: !1, configurable: !0 }), r; }(k.Hn); var Wt = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Ft = function(a) { function r(t, e, n) { return a.call(this, e, { module: t, modelConstructor: n }) || this; } return Wt(r, a), r.prototype.add = function(t, e) { var n, i = this, l = (0, S.isArray)(t) ? t : (0, S.isUndefined)(t) ? void 0 : [t]; return l = (n = l == null ? void 0 : l.map(function(f) { return f instanceof i.newModel ? f : new i.newModel(i.module, f); })) !== null && n !== void 0 ? n : [void 0], a.prototype.add.call(this, (0, S.isArray)(t) ? l : l[0], e); }, r.prototype.preinitialize = function(t, e) { this.newModel = e.modelConstructor, this.module = e.module; }, r; }(k.FE); var Ht = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Q = function() { return Q = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Q.apply(this, arguments); }, j = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, V = "__aw", Y = "__ah", nt = function(a) { function r(t, e) { var n = a.call(this, t, e) || this, i = n.em, l = n.attributes, f = l.styles, d = l.component, v = i.Components, h = v.getConfig(), w = i.Css.getAll(), C = {}, L = { em: i, config: h, frame: n, idMap: C }; if (!(0, H.isComponent)(d)) { var F = (0, H.isObject)(d) ? d : { components: d }; !F.type && (F.type = "wrapper"); var q = v.getType("wrapper").model; n.set("component", new q(F, L)); } return f ? (0, H.isObject)(f) || (Object.keys(C).length && Array.isArray(f) && f.forEach(function(et) { var X = et.selectors; if (X && X.length == 1) { var At = X[0], It = At.name && At.type === 2 && At; if (It && C[It.name]) It.name = C[It.name]; else if ((0, S.isString)(At) && At[0] === "#") { var ie = At.substring(1); ie && C[ie] && (X[0] = "#".concat(C[ie])); } } }), w.add(f), n.set("styles", w)) : n.set("styles", w), !e.width && n.set(V, 1), !e.height && n.set(Y, 1), n; } return Ht(r, a), r.prototype.defaults = function() { return { x: 0, y: 0, changesCount: 0, attributes: {}, width: null, height: null, head: [], component: "", styles: "", _undo: !0, _undoexc: ["changesCount"] }; }, Object.defineProperty(r.prototype, "head", { get: function() { return this.get("head"); }, enumerable: !1, configurable: !0 }), r.prototype.onRemove = function() { this.getComponent().remove({ root: 1 }); }, r.prototype.changesUp = function(t) { t === void 0 && (t = {}), t.temporary || t.noCount || t.avoidStore || this.set("changesCount", this.get("changesCount") + 1); }, r.prototype.getComponent = function() { return this.get("component"); }, r.prototype.getStyles = function() { return this.get("styles"); }, r.prototype.disable = function() { this.trigger("disable"); }, r.prototype.remove = function() { this.view = void 0; var t = this.collection; return t && t.remove(this); }, r.prototype.getHead = function() { return j([], this.head, !0); }, r.prototype.setHead = function(t) { return this.set("head", j([], t, !0)); }, r.prototype.addHeadItem = function(t) { this.head.push(t); }, r.prototype.getHeadByAttr = function(t, e, n) { return this.head.filter(function(i) { return i.attributes && i.attributes[t] == e && (!n || n === i.tag); })[0]; }, r.prototype.removeHeadByAttr = function(t, e, n) { var i = this.getHeadByAttr(t, e, n), l = this.head.indexOf(i); l >= 0 && this.head.splice(l, 1); }, r.prototype.addLink = function(t) { var e = "link"; !this.getHeadByAttr("href", t, e) && this.addHeadItem({ tag: e, attributes: { href: t, rel: "stylesheet" } }); }, r.prototype.removeLink = function(t) { this.removeHeadByAttr("href", t, "link"); }, r.prototype.addScript = function(t) { var e = "script"; !this.getHeadByAttr("src", t, e) && this.addHeadItem({ tag: e, attributes: { src: t } }); }, r.prototype.removeScript = function(t) { this.removeHeadByAttr("src", t, "script"); }, r.prototype.getPage = function() { var t; return (t = this.collection) === null || t === void 0 ? void 0 : t.page; }, r.prototype._emitUpdated = function(t) { t === void 0 && (t = {}), this.em.trigger("frame:updated", Q({ frame: this }, t)); }, r.prototype.toJSON = function(t) { t === void 0 && (t = {}); var e = bt.prototype.toJSON.call(this, t), n = (0, S.result)(this, "defaults"); return t.fromUndo && delete e.component, delete e.styles, delete e.changesCount, e[V] && delete e.width, e[Y] && delete e.height, (0, S.forEach)(e, function(i, l) { l.indexOf("_") === 0 && delete e[l]; }), (0, S.forEach)(n, function(i, l) { e[l] === i && delete e[l]; }), (0, S.forEach)(["attributes", "head"], function(i) { (0, S.isEmpty)(e[i]) && delete e[i]; }), e; }, r; }(bt); const wt = nt; var rt = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const gt = function(a) { function r(t, e) { e === void 0 && (e = []); var n = a.call(this, t, e, wt) || this; return n.loadedItems = 0, n.itemsToLoad = 0, (0, S.bindAll)(n, "itemLoaded"), n.on("reset", n.onReset), n.on("remove", n.onRemove), n; } return rt(r, a), r.prototype.onReset = function(t, e) { var n = this; ((e == null ? void 0 : e.previousModels) || []).map(function(i) { return n.onRemove(i); }); }, r.prototype.onRemove = function(t) { t == null || t.onRemove(); }, r.prototype.itemLoaded = function() { this.loadedItems++, this.loadedItems >= this.itemsToLoad && (this.trigger("loaded:all"), this.listenToLoadItems(!1)); }, r.prototype.listenToLoad = function() { this.loadedItems = 0, this.itemsToLoad = this.length, this.listenToLoadItems(!0); }, r.prototype.listenToLoadItems = function(t) { var e = this; this.forEach(function(n) { return n[t ? "on" : "off"]("loaded", e.itemLoaded); }); }, r; }(Ft); var N = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Lt = function(a) { function r(t, e) { e === void 0 && (e = {}); var n = a.call(this, t, e) || this, i = e.em, l = {}; n.em = i, t.frames || (l.component = t.component, l.styles = t.styles, ["component", "styles"].map(function(h) { return n.unset(h); })); var f = t.frames || [l], d = new gt(i.Canvas, f); d.page = n, n.set("frames", d), !n.getId() && n.set("id", i == null ? void 0 : i.get("PageManager")._createId()); var v = i == null ? void 0 : i.get("UndoManager"); return v == null || v.add(d), n; } return N(r, a), r.prototype.defaults = function() { return { frames: [], _undo: !0 }; }, r.prototype.onRemove = function() { this.getFrames().reset(); }, r.prototype.getFrames = function() { return this.get("frames"); }, r.prototype.getId = function() { return this.id; }, r.prototype.getName = function() { return this.get("name"); }, r.prototype.setName = function(t) { return this.set({ name: t }); }, r.prototype.getAllFrames = function() { return this.getFrames().models || []; }, r.prototype.getMainFrame = function() { return this.getFrames().at(0); }, r.prototype.getMainComponent = function() { var t = this.getMainFrame(); return t == null ? void 0 : t.getComponent(); }, r.prototype.toJSON = function(t) { t === void 0 && (t = {}); var e = k.Hn.prototype.toJSON.call(this, t), n = (0, S.result)(this, "defaults"); return (0, S.forEach)(e, function(i, l) { l.indexOf("_") === 0 && delete e[l]; }), (0, S.forEach)(n, function(i, l) { e[l] === i && delete e[l]; }), e; }, r; }(k.Hn); var Tt = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Qt = function() { return Qt = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Qt.apply(this, arguments); }; const Oe = function(a) { function r(t, e) { var n = a.call(this, t) || this; return n.on("reset", n.onReset), n.on("remove", n.onRemove), n.model = function(i, l) { return l === void 0 && (l = {}), new Lt(i, Qt(Qt({}, l), { em: e })); }, n; } return Tt(r, a), r.prototype.onReset = function(t, e) { var n, i = this; (n = e == null ? void 0 : e.previousModels) === null || n === void 0 || n.map(function(l) { return i.onRemove(l); }); }, r.prototype.onRemove = function(t) { t == null || t.onRemove(); }, r; }(k.FE); var Se = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), _e = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, De = "page", xe = "".concat(De, ":"), Te = "".concat(xe, "select"), be = "".concat(Te, ":before"), ge = "".concat(xe, "update"), pe = "".concat(xe, "add"), ce = "".concat(pe, ":before"), st = "".concat(xe, "remove"), Xt = "".concat(st, ":before"), qt = "change:selected", ne = "main", ae = { all: De, select: Te, selectBefore: be, update: ge, add: pe, addBefore: ce, remove: st, removeBefore: Xt }, Zt = function(a) { function r(t) { var e = a.call(this, t, "PageManager", new Oe([], t), ae) || this; e.storageKey = "pages", (0, S.bindAll)(e, "_onPageChange"); var n = new bt({ _undo: !0 }); return e.model = n, e.pages.on("reset", function(i) { return i.at(0) && e.select(i.at(0)); }), e.pages.on("all", e.__onChange, e), n.on(qt, e._onPageChange), e; } return Se(r, a), Object.defineProperty(r.prototype, "pages", { get: function() { return this.all; }, enumerable: !1, configurable: !0 }), r.prototype.getAll = function() { return _e([], this.all.models, !0); }, r.prototype.__onChange = function(t, e, n, i) { var l = i || n; this.em.trigger(De, { event: t, page: e, options: l }); }, r.prototype.onLoad = function() { var t, e = this, n = this.pages, i = { silent: !0 }; n.add(((t = this.config.pages) === null || t === void 0 ? void 0 : t.map(function(f) { return new Lt(f, { em: e.em, config: e.config }); })) || [], i); var l = n.length ? this.getMain() : this.add({ type: ne }, i); l && this.select(l, i); }, r.prototype._onPageChange = function(t, e, n) { var i = this.em, l = i.Layers, f = e.getMainComponent(); l && f && l.setRoot(f), i.trigger(Te, e, t.previous("selected")), this.__onChange(qt, e, n); }, r.prototype.postLoad = function() { var t = this, e = t.em, n = t.model, i = t.pages, l = e.UndoManager; l.add(n), l.add(i), i.on("add remove reset change", function(f, d, v) { return e.changesUp(v || d); }); }, r.prototype.add = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this.em; t.id = t.id || this._createId(); var l = function() { var f = n.pages.add(new Lt(t, { em: n.em, config: n.config }), e); return e.select && n.select(f), f; }; return !e.silent && i.trigger(ce, t, l, e), !e.abort && l(); }, r.prototype.remove = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this.em, l = (0, S.isString)(t) ? this.get(t) : t, f = function() { return l && n.pages.remove(l, e), l; }; return !e.silent && i.trigger(Xt, l, f, e), !e.abort && f(); }, r.prototype.get = function(t) { return this.pages.filter(function(e) { return e.get(e.idAttribute) === t; })[0]; }, r.prototype.getMain = function() { var t = this.pages; return t.filter(function(e) { return e.get("type") === ne; })[0] || t.at(0); }, r.prototype.getAllWrappers = function() { var t = this.getAll(); return (0, S.unique)((0, S.flatten)(t.map(function(e) { return e.getAllFrames().map(function(n) { return n.getComponent(); }); }))); }, r.prototype.select = function(t, e) { e === void 0 && (e = {}); var n = (0, S.isString)(t) ? this.get(t) : t; return n && (this.em.trigger(be, n, e), this.model.set("selected", n, e)), this; }, r.prototype.getSelected = function() { return this.model.get("selected"); }, r.prototype.destroy = function() { var t = this; this.pages.off().reset(), this.model.stopListening(), this.model.clear({ silent: !0 }), ["selected", "model"].map(function(e) { return t[e] = 0; }); }, r.prototype.store = function() { return this.getProjectData(); }, r.prototype.load = function(t) { return this.loadProjectData(t, { all: this.pages, reset: !0 }); }, r.prototype._createId = function() { var t, e = this.getAll().length + 16, n = this.getAllMap(); do t = (0, H.createId)(e); while (n[t]); return t; }, r; }(Dt); const Ae = Zt, Ke = { default: "", devices: [{ id: "desktop", name: "Desktop", width: "" }, { id: "tablet", name: "Tablet", width: "770px", widthMedia: "992px" }, { id: "mobileLandscape", name: "Mobile landscape", width: "568px", widthMedia: "768px" }, { id: "mobilePortrait", name: "Mobile portrait", width: "320px", widthMedia: "480px" }] }; var Xe = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const vn = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Xe(r, a), r.prototype.defaults = function() { return { name: "", width: null, height: "", widthMedia: null, priority: null }; }, r.prototype.initialize = function() { var t = this; this.get("widthMedia") === null && this.set("widthMedia", this.get("width")), this.get("width") === null && this.set("width", this.get("widthMedia")), !this.get("priority") && this.set("priority", parseFloat(this.get("widthMedia")) || 0), ["width", "height", "widthMedia"].forEach(function(e) { return t.checkUnit(e); }); }, r.prototype.checkUnit = function(t) { var e = this.get(t) || ""; (parseFloat(e) || 0).toString() === e.toString() && this.set(t, "".concat(e, "px")); }, r.prototype.getName = function() { return this.get("name") || this.get("id"); }, r.prototype.getWidthMedia = function() { return this.get("widthMedia") || ""; }, r; }(k.Hn); var Rn = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), mt = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Rn(r, a), r; }(k.FE); const zt = mt; mt.prototype.model = vn; var b = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), I = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }; const U = function(a) { function r(t) { var e = a.call(this, t) || this; return e.config = t.config || {}, e.em = e.config.em, e.ppfx = e.config.pStylePrefix || "", e.listenTo(e.em, "change:device", e.updateSelect), e; } return b(r, a), r.prototype.template = function(t) { var e = t.ppfx, n = t.label; return pt(ht || (ht = I([`
', `
`], [`
', `
`])), e, n, e, e, e, e, e, e, e); }, r.prototype.events = function() { return { change: "updateDevice", "click [data-add-trasp]": "startAdd" }; }, r.prototype.startAdd = function() { }, r.prototype.updateDevice = function() { var t = this.em; if (t) { var e = this.devicesEl; t.set("device", e ? e.val() : ""); } }, r.prototype.updateSelect = function() { var t = this.em, e = this.devicesEl; if (t && t.getDeviceModel && e) { var n = t.getDeviceModel(); e.val(n ? n.get("id") : ""); } }, r.prototype.getOptions = function() { var t = this.collection, e = this.em, n = ""; return t.forEach(function(i) { var l = i.attributes, f = l.name, d = l.id, v = e && e.t && e.t("deviceManager.devices.".concat(d)) || f; n += '"); }), n; }, r.prototype.render = function() { var t = this, e = t.em, n = t.ppfx, i = t.$el, l = t.el, f = e && e.t && e.t("deviceManager.device"); return i.html(this.template({ ppfx: n, label: f })), this.devicesEl = i.find(".".concat(n, "devices")), this.devicesEl.append(this.getOptions()), this.devicesEl.val(e.get("device")), l.className = "".concat(n, "devices-c"), this; }, r; }(k.G7); var ht, kt = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ot = function() { return Ot = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Ot.apply(this, arguments); }, fe = "device", ke = "".concat(fe, ":"), Ve = "".concat(ke, "select"), ze = "".concat(ke, "update"), Qe = "".concat(ke, "add"), Kt = "".concat(ke, "remove"), R = "".concat(Kt, ":before"), tt = "change:device", ut = { all: fe, select: Ve, update: ze, add: Qe, remove: Kt, removeBefore: R }, yt = function(a) { function r(t) { var e, n = this; return (n = a.call(this, t, "DeviceManager", new zt(), ut, Ke) || this).Device = vn, n.Devices = zt, n.storageKey = "", n.devices = n.all, (e = n.config.devices) === null || e === void 0 || e.forEach(function(i) { return n.add(i, { silent: !0 }); }), n.select(n.config.default || n.devices.at(0)), t.on(tt, n._onSelect, n), n; } return kt(r, a), r.prototype._onSelect = function(t, e, n) { var i = this.em, l = this.events, f = t.previous("device"), d = this.get(e), v = l.select; i.trigger(v, d, this.get(f)), this.__catchAllEvent(v, d, n); }, r.prototype.add = function(t, e) { var n; e === void 0 && (e = {}); var i = e; if ((0, S.isString)(t)) { var l = e; n = Ot(Ot({}, i = arguments[2] || {}), { id: t, name: i.name || t, width: l }); } else n = t; return n.id || (n.id = n.name || this._createId()), this.devices.add(n, i); }, r.prototype.get = function(t) { return this.getAll().filter(function(e) { return e.get("name") === t; })[0] || this.devices.get(t) || null; }, r.prototype.remove = function(t, e) { return e === void 0 && (e = {}), this.__remove(t, e); }, r.prototype.getDevices = function() { return this.devices.models; }, r.prototype.select = function(t, e) { e === void 0 && (e = {}); var n = (0, S.isString)(t) ? this.get(t) : t; return n && this.em.set("device", n.get("id"), e), this; }, r.prototype.getSelected = function() { return this.get(this.em.get("device")); }, r.prototype.getAll = function() { return this.devices; }, r.prototype.render = function() { var t, e = this.em; return (t = this.view) === null || t === void 0 || t.remove(), this.view = new U({ collection: this.devices, config: Ot({ em: e }, this.config) }), this.view.render().el; }, r.prototype.destroy = function() { this.__destroy(); }, r; }(Dt); const Yt = yt; var he = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Re = function(a) { function r(t) { var e = this, n = t.em, i = t.config, l = i.scripts, f = i.styles; return (e = a.call(this, t, { scripts: l, styles: f }) || this).set("frames", new gt(t)), e.listenTo(e, "change:zoom", e.onZoomChange), e.listenTo(n, "change:device ".concat(ze), e.updateDevice), e.listenTo(n, Te, e._pageUpdated), e; } return he(r, a), r.prototype.defaults = function() { return { frame: "", frames: [], rulers: !1, zoom: 100, x: 0, y: 0, scripts: [], styles: [] }; }, Object.defineProperty(r.prototype, "frames", { get: function() { return this.get("frames"); }, enumerable: !1, configurable: !0 }), r.prototype.init = function() { var t = this.em.Pages.getMain(); this.set("frames", t.getFrames()), this.updateDevice({ frame: t.getMainFrame() }); }, r.prototype._pageUpdated = function(t, e) { var n = this.em; n.setSelected(), n.get("readyCanvas") && n.stopDefault(), e == null || e.getFrames().map(function(i) { return i.disable(); }), this.set("frames", t.getFrames()), this.updateDevice({ frame: t.getMainFrame() }); }, r.prototype.updateDevice = function(t) { t === void 0 && (t = {}); var e = this.em, n = e.getDeviceModel(), i = t.frame || e.getCurrentFrameModel(); if (i && n) { var l = n.attributes, f = l.width, d = l.height; i.set({ width: f, height: d }, { noUndo: 1 }); } }, r.prototype.onZoomChange = function() { this.get("zoom") < 1 && this.set("zoom", 1); }, r; }(bt); const We = Re; var Ln = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const pn = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ln(r, a), Object.defineProperty(r.prototype, "pfx", { get: function() { return this.ppfx + this.config.stylePrefix || ""; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "ppfx", { get: function() { return this.em.config.stylePrefix || ""; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "module", { get: function() { var t, e; return (e = (t = this.model) === null || t === void 0 ? void 0 : t.module) !== null && e !== void 0 ? e : this.collection.module; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "em", { get: function() { return this.module.em; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "config", { get: function() { return this.module.config; }, enumerable: !1, configurable: !0 }), r.prototype.preinitialize = function(t) { this.className = ""; }, r; }(k.G7); var Ne = gn(491), Ar = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Yn = function(a) { function r(t, e) { t === void 0 && (t = {}), e === void 0 && (e = !1); var n = a.call(this, t) || this; return n.itemsView = "", n.itemType = "type", n.reuseView = !1, n.viewCollection = [], e && n.listenTo(n.collection, "add", n.addTo), n; } return Ar(r, a), r.prototype.addTo = function(t) { this.add(t); }, r.prototype.itemViewNotFound = function(t) { }, r.prototype.add = function(t, e) { var n, i = this, l = i.reuseView, f = i.viewCollection, d = (i.itemsView, e || null), v = t.get(this.itemType); n = t.view && l ? t.view : this.renderView(t, v), f.push(n); var h = n.render().el; d ? d.appendChild(h) : this.$el.append(h); }, r.prototype.render = function() { var t = this, e = document.createDocumentFragment(); return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each(function(n) { return t.add(n, e); }), this.$el.append(e), this.onRender(), this; }, r.prototype.onRender = function() { }, r.prototype.onRemoveBefore = function(t, e) { }, r.prototype.onRemove = function(t, e) { }, r.prototype.remove = function(t) { t === void 0 && (t = {}); var e = this.viewCollection; return this.onRemoveBefore(e, t), this.clearItems(), k.G7.prototype.remove.apply(this, t), this.onRemove(e, t), this; }, r.prototype.clearItems = function() { this.viewCollection; }, r; }(pn); var jr = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const fn = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; e.config = t.config || {}; var n = e.model; return e.listenTo(n, "change", e.render), e.listenTo(n, "destroy remove", e.remove), e.listenTo(n.get("selectors"), "change", e.render), e; } return jr(r, a), r.prototype.tagName = function() { return "style"; }, r.prototype.render = function() { var t = this.model, e = this.el, n = t.get("important"); return e.innerHTML = t.toCSS({ important: n }), this; }, r; }(k.G7); var _n = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Bn = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return _n(r, a), r.prototype._createElement = function() { return document.createTextNode(""); }, r.prototype.render = function() { var t = this.model, e = t.get("important"); return this.el.textContent = t.getDeclaration({ important: e }), this; }, r; }(fn); var Mr = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Dn = function(a, r) { return "".concat(a).concat(r ? "-".concat(parseFloat(r)) : ""); }, _o = function(a) { function r(t) { var e = a.call(this, t) || this; (0, S.bindAll)(e, "sortRules"); var n = t.config || {}; e.atRules = {}, e.config = n, e.em = n.em, e.pfx = n.stylePrefix || "", e.className = e.pfx + "rules"; var i = e.collection; return e.listenTo(i, "add", e.addTo), e.listenTo(i, "reset", e.render), e; } return Mr(r, a), r.prototype.addTo = function(t) { this.addToCollection(t); }, r.prototype.addToCollection = function(t, e) { if (this.renderStarted) { var n, i, l = e || null, f = { model: t, config: this.config }; if (t.get("atRuleType") === "keyframes") { var d = t.getAtRule(), v = this.atRules[d]; if (!v) { var h = document.createElement("style"); v = document.createTextNode(""), h.appendChild(document.createTextNode("".concat(d, "{"))), h.appendChild(v), h.appendChild(document.createTextNode("}")), this.atRules[d] = v, n = h; } i = new Bn(f), v.appendData(i.render().el.textContent); } else n = (i = new fn(f)).render().el; var w = this.className, C = t.get("mediaText"), L = Dn(w), F = L; if (C && (F = Dn(w, this.getMediaWidth(C))), n) { var q = l || this.el, et = void 0; try { et = q.querySelector("#".concat(F)); } catch { } et || (et = q.querySelector("#".concat(L))), et == null || et.appendChild(n); } return n; } }, r.prototype.getMediaWidth = function(t) { return t && t.replace("(".concat(this.em.getConfig().mediaCondition, ": "), "").replace(")", ""); }, r.prototype.sortRules = function(t, e) { var n = (this.em.getConfig().mediaCondition || "").indexOf("min-width") !== -1; return n ? (n ? t : e) - (n ? e : t) : 0; }, r.prototype.render = function() { var t = this; this.renderStarted = !0, this.atRules = {}; var e = this, n = e.em, i = e.$el, l = e.collection, f = this.className, d = document.createDocumentFragment(); i.empty(); var v = n.Devices.getAll().pluck("priority").sort(this.sortRules); return v.every(function(h) { return h; }) && v.unshift(0), v.forEach(function(h) { return d.appendChild((0, Ne.ut)("div", { id: Dn(f, h) })); }), l.each(function(h) { return t.addToCollection(h, d); }), i.append(d), i.attr("class", f), this; }, r; }(k.G7); const Vo = _o; var xo = function() { return xo = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, xo.apply(this, arguments); }, Ro = function() { function a(r, t) { var e = this; this.em = r, this.canvas = r.Canvas; var n = t || this.canvas.getFrames().map(function(l) { return l.getComponent().getEl(); }), i = Array.isArray(n) ? n : [n]; this.el = i[0], this.counter = 0, (0, S.bindAll)(this, "handleDragEnter", "handleDragOver", "handleDrop", "handleDragLeave"), i.forEach(function(l) { return e.toggleEffects(l, !0); }); } return a.prototype.toggleEffects = function(r, t) { var e = { on: H.on, off: H.off }, n = t ? "on" : "off"; e[n](r, "dragenter", this.handleDragEnter), e[n](r, "dragover", this.handleDragOver), e[n](r, "drop", this.handleDrop), e[n](r, "dragleave", this.handleDragLeave); }, a.prototype.__customTglEff = function(r) { var t, e = r ? H.on : H.off, n = this.el.ownerDocument, i = (t = n.defaultView) === null || t === void 0 ? void 0 : t.frameElement; this.sortOpts = r ? { onStart: function(l) { var f = l.sorter; (0, H.on)(i, "pointermove", f.onMove); }, onEnd: function(l) { var f = l.sorter; (0, H.off)(i, "pointermove", f.onMove); }, customTarget: function(l) { var f = l.event; return n.elementFromPoint(f.clientX, f.clientY); } } : null, e(i, "pointerenter", this.handleDragEnter), e(i, "pointermove", this.handleDragOver), e(document, "pointerup", this.handleDrop), e(i, "pointerout", this.handleDragLeave); }, a.prototype.startCustom = function() { this.__customTglEff(!0); }, a.prototype.endCustom = function(r) { this.over ? this.endDrop(r) : this.__customTglEff(!1); }, a.prototype.endDrop = function(r, t) { var e = this.em, n = this.dragStop; this.counter = 0, n && n(r), this.__customTglEff(!1), e.trigger("canvas:dragend", t); }, a.prototype.handleDragLeave = function(r) { this.updateCounter(-1, r); }, a.prototype.updateCounter = function(r, t) { this.counter += r, this.counter === 0 && this.endDrop(!0, t); }, a.prototype.handleDragEnter = function(r) { var t = this, e = this.em, n = this.canvas, i = r.dataTransfer; if (this.updateCounter(1, r), !this.over) { this.over = !0; var l, f, d = e.Utils, v = e.get("dragContent") || "
"; if (e.stopDefault(), e.inAbsoluteMode()) { var h = e.Components.getWrapper(), w = h.append({})[0], C = e.Commands.run("core:component-drag", { event: r, guidesInfo: 1, center: 1, target: w, onEnd: function(F, q, et) { var X; if (!et.cancelled) { X = h.append(v)[0]; var At = n.getOffset(), It = w.getStyle(), ie = It.top, se = It.left, Me = It.position, Ie = (0, Ne.GX)(F.target), Je = parseInt("".concat(parseFloat(se) + Ie.x - At.left), 10), dn = parseInt("".concat(parseFloat(ie) + Ie.y - At.top), 10); X.addStyle({ left: Je + "px", top: dn + "px", position: Me }); } t.handleDragEnd(X, i), w.remove(); } }); l = function(F) { return C.stop(r, { cancel: F }); }, f = function(F) { return v = F; }; } else { var L = new d.Sorter(xo({ em: e, wmargin: 1, nested: 1, canvasRelative: 1, direction: "a", container: this.el, placer: n.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: "gjs-", onEndMove: function(F) { return t.handleDragEnd(F, i); }, document: this.el.ownerDocument }, this.sortOpts || {})); L.setDropContent(v), L.startSort(), this.sorter = L, l = function(F) { F && (L.moved = !1), L.endMove(); }, f = function(F) { return L.setDropContent(F); }; } this.dragStop = l, this.dragContent = f, e.trigger("canvas:dragenter", i, v); } }, a.prototype.handleDragEnd = function(r, t) { var e = this.em; this.over = !1, r && (e.set("dragResult", r), e.trigger("canvas:drop", t, r)), e.runDefault({ preserveSelected: 1 }); }, a.prototype.handleDragOver = function(r) { r.preventDefault(), this.em.trigger("canvas:dragover", r); }, a.prototype.handleDrop = function(r) { r.preventDefault(); var t = this.dragContent, e = r.dataTransfer, n = this.getContentByData(e).content; r.target.style.border = "", n && t && t(n), this.endDrop(!n, r); }, a.prototype.getContentByData = function(r) { var t = this.em, e = r && r.types, n = r && r.files || [], i = t.get("dragContent"), l = r && r.getData("text"); if (n.length) { l = []; for (var f = 0; f < n.length; f++) { var d = n[f], v = d.type.split("/")[0]; v == "image" && l.push({ type: v, file: d, attributes: { alt: d.name } }); } } else if (i) l = i; else if ((0, S.indexOf)(e, "text/html") >= 0) l = r && r.getData("text/html").replace(/<\/?meta[^>]*>/g, ""); else if ((0, S.indexOf)(e, "text/uri-list") >= 0) l = { type: "link", attributes: { href: l }, content: l }; else if ((0, S.indexOf)(e, "text/json") >= 0) { var h = r && r.getData("text/json"); h && (l = JSON.parse(h)); } else e.length === 1 && e[0] === "text/plain" && (l = "
".concat(l, "
")); var w = { content: l }; return t.trigger("canvas:dragdata", r, w), w; }, a; }(); const ro = Ro; var ur = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ln = function() { return ln = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ln.apply(this, arguments); }, Ho = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, Lr = function(a) { function r(t, e) { var n = a.call(this, { model: t }) || this; n.dragging = !1, n.lastMaxHeight = 0, n.tools = {}, (0, S.bindAll)(n, "updateClientY", "stopAutoscroll", "autoscroll", "_emitUpdate"); var i = n, l = i.el; i.em, n.module._config = ln(ln({}, n.config || {}), { frameView: n }), n.frameWrapView = e, n.showGlobalTools = (0, S.debounce)(n.showGlobalTools.bind(n), 50); var f = n.getCanvasModel(); return n.listenTo(t, "change:head", n.updateHead), n.listenTo(f, "change:styles", n.renderStyles), t.view = n, (0, H.setViewEl)(l, n), n; } return ur(r, a), Object.defineProperty(r.prototype, "tagName", { get: function() { return "iframe"; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "attributes", { get: function() { return { allowfullscreen: "allowfullscreen" }; }, enumerable: !1, configurable: !0 }), r.prototype.updateHead = function() { var t = this.model, e = this.getHead(), n = [], i = [], l = t.head, f = t.previous("head"), d = function(h) { return h === void 0 && (h = {}), Object.keys(h).sort().map(function(w) { return "[".concat(w, '="').concat(h[w], '"]'); }).join(""); }, v = function(h, w, C) { h.forEach(function(L) { var F = L.tag, q = L.attributes; !w.some(function(et) { return et.tag === F && d(et.attributes) === d(q); }) && C.push(L); }); }; v(l, f, i), v(f, l, n), n.forEach(function(h) { var w, C = e.querySelector("".concat(h.tag).concat(d(h.attributes))); (w = C == null ? void 0 : C.parentNode) === null || w === void 0 || w.removeChild(C); }), (0, Ne.SJ)(e, i); }, r.prototype.getEl = function() { return this.el; }, r.prototype.getCanvasModel = function() { return this.em.Canvas.getModel(); }, r.prototype.getWindow = function() { return this.getEl().contentWindow; }, r.prototype.getDoc = function() { return this.getEl().contentDocument; }, r.prototype.getHead = function() { return this.getDoc().querySelector("head"); }, r.prototype.getBody = function() { return this.getDoc().querySelector("body"); }, r.prototype.getWrapper = function() { return this.getBody().querySelector("[data-gjs-type=wrapper]"); }, r.prototype.getJsContainer = function() { return this.jsContainer || (this.jsContainer = (0, Ne.ut)("div", { class: "".concat(this.ppfx, "js-cont") })), this.jsContainer; }, r.prototype.getToolsEl = function() { var t; return (t = this.frameWrapView) === null || t === void 0 ? void 0 : t.elTools; }, r.prototype.getGlobalToolsEl = function() { return this.em.Canvas.getGlobalToolsEl(); }, r.prototype.getHighlighter = function() { return this._getTool("[data-hl]"); }, r.prototype.getBadgeEl = function() { return this._getTool("[data-badge]"); }, r.prototype.getOffsetViewerEl = function() { return this._getTool("[data-offset]"); }, r.prototype.getRect = function() { return this.rect || (this.rect = this.el.getBoundingClientRect()), this.rect; }, r.prototype.getOffsetRect = function() { var t = this.el, e = this.getBody(), n = e.scrollTop, i = e.scrollLeft, l = t.offsetHeight, f = t.offsetWidth; return { top: t.offsetTop, left: t.offsetLeft, height: l, width: f, scrollTop: n, scrollLeft: i, scrollBottom: n + l, scrollRight: i + f }; }, r.prototype._getTool = function(t) { var e = this.tools, n = this.getToolsEl(); return e[t] || (e[t] = n.querySelector(t)), e[t]; }, r.prototype.remove = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n = this.wrapper; return this._toggleEffects(!1), this.tools = {}, n && n.remove(), pn.prototype.remove.apply(this, t), this; }, r.prototype.startAutoscroll = function() { var t = this; this.lastMaxHeight = this.getWrapper().offsetHeight - this.el.offsetHeight, setTimeout(function() { t._toggleAutoscrollFx(!0), requestAnimationFrame(t.autoscroll); }, 0); }, r.prototype.autoscroll = function() { if (this.dragging) { var t = this.lastClientY, e = this.em.Canvas, n = this.getWindow(), i = n.pageYOffset, l = t || 0, f = e.getConfig().autoscrollLimit, d = this.getRect().height - f, v = i; l < f && (v -= f - l), l > d && (v += l - d), !(0, S.isUndefined)(t) && v !== i && v > 0 && v < this.lastMaxHeight && (this.getGlobalToolsEl().style.opacity = "0", this.showGlobalTools(), n.scrollTo(0, v)), requestAnimationFrame(this.autoscroll); } }, r.prototype.updateClientY = function(t) { t.preventDefault(), this.lastClientY = (0, H.getPointerEvent)(t).clientY * this.em.getZoomDecimal(); }, r.prototype.showGlobalTools = function() { this.getGlobalToolsEl().style.opacity = ""; }, r.prototype.stopAutoscroll = function() { this.dragging && this._toggleAutoscrollFx(!1); }, r.prototype._toggleAutoscrollFx = function(t) { this.dragging = t; var e = this.getWindow(), n = t ? "on" : "off", i = { on: H.on, off: H.off }; i[n](e, "mousemove dragover", this.updateClientY), i[n](e, "mouseup", this.stopAutoscroll); }, r.prototype.render = function() { var t = this.$el, e = this.ppfx; return t.attr({ class: "".concat(e, "frame") }), this.renderScripts(), this; }, r.prototype.renderScripts = function() { var t = this, e = this, n = e.el, i = e.model, l = e.em, f = "frame:load", d = { el: n, model: i, view: this }, v = this.getCanvasModel(), h = function(w) { var C; if (w.length > 0) { var L = w.shift(), F = (0, Ne.ut)("script", ln({ type: "text/javascript" }, (0, S.isString)(L) ? { src: L } : L)); F.onerror = F.onload = h.bind(null, w), (C = n.contentDocument) === null || C === void 0 || C.head.appendChild(F); } else t.renderBody(), l && l.trigger(f, d); }; n.onload = function() { var w = t.config.frameContent; if (w) { var C = t.getDoc(); C.open(), C.write(w), C.close(); } l && l.trigger("".concat(f, ":before"), d), h(Ho([], v.get("scripts"), !0)); }; }, r.prototype.renderStyles = function(t) { t === void 0 && (t = {}); var e = this.getHead(), n = this.getCanvasModel(), i = function(w) { return w.map(function(C) { return { tag: "link", attributes: ln({ rel: "stylesheet" }, (0, S.isString)(C) ? { href: C } : C) }; }); }, l = i(t.prev || n.previous("styles")), f = i(n.get("styles")), d = [], v = [], h = function(w, C, L) { w.forEach(function(F) { var q = F.attributes.href; !C.some(function(et) { return et.attributes.href === q; }) && L.push(F); }); }; h(f, l, v), h(l, f, d), d.forEach(function(w) { var C, L = e.querySelector('link[href="'.concat(w.attributes.href, '"]')); (C = L == null ? void 0 : L.parentNode) === null || C === void 0 || C.removeChild(L); }), (0, Ne.SJ)(e, v); }, r.prototype.renderBody = function() { var t, e, n = this, i = this, l = i.config, f = i.em, d = i.model, v = i.ppfx, h = this.getDoc(), w = this.getBody(), C = this.getWindow(), L = f.config; C._isEditor = !0, this.renderStyles({ prev: [] }), (0, Ne.R3)(w, ``)); var F = d.getComponent(), q = f.Components.getType("wrapper").view; this.wrapper = new q({ model: F, config: ln(ln({}, F.config), { em: f, frameView: this }) }).render(), (0, Ne.R3)(w, (t = this.wrapper) === null || t === void 0 ? void 0 : t.el), (0, Ne.R3)(w, new Vo({ collection: d.getStyles(), config: ln(ln({}, f.Css.getConfig()), { frameView: this }) }).render().el), (0, Ne.R3)(w, this.getJsContainer()), (0, H.on)(w, "click", function(et) { var X; return et && ((X = et.target) === null || X === void 0 ? void 0 : X.tagName) == "A" && et.preventDefault(); }), (0, H.on)(w, "submit", function(et) { return et && et.preventDefault(); }), [{ event: "keydown keyup keypress", class: "KeyboardEvent" }, { event: "mousedown mousemove mouseup", class: "MouseEvent" }, { event: "pointerdown pointermove pointerup", class: "PointerEvent" }, { event: "wheel", class: "WheelEvent" }].forEach(function(et) { return et.event.split(" ").forEach(function(X) { h.addEventListener(X, function(At) { return n.el.dispatchEvent((0, Ne.t3)(At, et.class)); }); }); }), this._toggleEffects(!0), (0, H.hasDnd)(f) && (this.droppable = new ro(f, (e = this.wrapper) === null || e === void 0 ? void 0 : e.el)), d.trigger("loaded"); }, r.prototype._toggleEffects = function(t) { var e = t ? H.on : H.off, n = this.getWindow(); n && e(n, "".concat(Ne.G1, " resize"), this._emitUpdate); }, r.prototype._emitUpdate = function() { this.model._emitUpdated(); }, r; }(pn); const Co = Lr; var Jr = gn(668), Wn = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Nn = function() { return Nn = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Nn.apply(this, arguments); }; const $n = function(a) { function r(t, e) { var n = a.call(this, { model: t }) || this; return (0, S.bindAll)(n, "onScroll", "frameLoaded", "updateOffset", "remove", "startDrag"), Nn(Nn({}, t.config), { frameWrapView: n }), n.cv = e, n.frame = new Co(t, n), n.classAnim = "".concat(n.ppfx, "frame-wrapper--anim"), n.updateOffset = (0, S.debounce)(n.updateOffset.bind(n), 0), n.updateSize = (0, S.debounce)(n.updateSize.bind(n), 0), n.listenTo(t, "loaded", n.frameLoaded), n.listenTo(t, "change:x change:y", n.updatePos), n.listenTo(t, "change:width change:height", n.updateSize), n.listenTo(t, "destroy remove", n.remove), n.updatePos(), n.setupDragger(), n; } return Wn(r, a), r.prototype.events = function() { return { "click [data-action-remove]": "remove", "mousedown [data-action-move]": "startDrag" }; }, r.prototype.setupDragger = function() { var t, e, n, i = this, l = this.module, f = this.model, d = function(v) { l.toggleFramesEvents(v); }; this.dragger = new Jr.Z({ onStart: function() { var v = f.attributes, h = v.x, w = v.y; n = i.em.getZoomMultiplier(), t = h, e = w, d(!1); }, onEnd: function() { return d(!0); }, setPosition: function(v) { f.set({ x: t + v.x * n, y: e + v.y * n }); } }); }, r.prototype.startDrag = function(t) { var e; t && ((e = this.dragger) === null || e === void 0 || e.start(t)); }, r.prototype.__clear = function(t) { var e = this.frame; e && e.remove(t), (0, Ne.L_)(this.elTools); }, r.prototype.remove = function(t) { var e = this; return this.__clear(t), pn.prototype.remove.apply(this, t), ["frame", "dragger", "cv", "elTools"].forEach(function(n) { return e[n] = 0; }), this; }, r.prototype.updateOffset = function() { var t, e = this, n = e.em, i = e.$el, l = e.frame; n && !n.destroyed && (n.runDefault({ preserveSelected: 1 }), i.removeClass(this.classAnim), (t = l == null ? void 0 : l.model) === null || t === void 0 || t._emitUpdated()); }, r.prototype.updatePos = function(t) { var e = this.model, n = this.el, i = e.attributes, l = i.x, f = i.y, d = n.style; this.frame.rect = void 0, d.left = isNaN(l) ? l : "".concat(l, "px"), d.top = isNaN(f) ? f : "".concat(f, "px"), t && this.updateOffset(); }, r.prototype.updateSize = function() { this.updateDim(); }, r.prototype.updateDim = function() { var t = this, e = t.em, n = t.el, i = t.$el, l = t.model, f = t.classAnim, d = t.frame; if (d) { d.rect = void 0, i.addClass(f); var v = this.__handleSize(), h = v.noChanges, w = v.width, C = v.height; ((0, S.isNull)(w) || (0, S.isNull)(C)) && l.set(Nn(Nn({}, w ? {} : { width: n.offsetWidth }), C ? {} : { height: n.offsetHeight }), { silent: 1 }), e.stopDefault({ preserveSelected: 1 }), h ? this.updateOffset() : setTimeout(this.updateOffset, 350); } }, r.prototype.onScroll = function() { var t = this.frame; this.em.trigger("frame:scroll", { frame: t, body: t.getBody(), target: t.getWindow() }); }, r.prototype.frameLoaded = function() { this.frame.getWindow().onscroll = this.onScroll, this.updateDim(); }, r.prototype.__handleSize = function() { var t = "px", e = this.model, n = this.el.style, i = e.attributes, l = i.width, f = i.height, d = n.width || "", v = n.height || "", h = l || "", w = f || "", C = d == h && v == w; return n.width = (0, S.isNumber)(h) ? "".concat(h).concat(t) : h, n.height = (0, S.isNumber)(w) ? "".concat(w).concat(t) : w, { noChanges: C, width: l, height: f, newW: h, newH: w }; }, r.prototype.render = function() { var t = this, e = t.frame, n = t.$el, i = t.ppfx, l = t.cv, f = t.model, d = t.el, v = f.attributes.onRender; this.__clear(), this.__handleSize(), e.render(), n.empty().attr({ class: "".concat(i, "frame-wrapper") }).append(`
`).concat(f.get("name") || "", `
`)).append(e.el); var h = (0, Ne.ut)("div", { class: "".concat(i, "tools"), style: "pointer-events:none; display: none" }, `
`)); this.elTools = h; var w = l == null ? void 0 : l.toolsWrapper; return w && w.appendChild(h), v && v({ el: d, elTop: d.querySelector("[data-frame-top]"), elRight: d.querySelector("[data-frame-right]"), elBottom: d.querySelector("[data-frame-bottom]"), elLeft: d.querySelector("[data-frame-left]"), frame: f, frameWrapperView: this, remove: this.remove, startDrag: this.startDrag }), this; }, r; }(pn); var zo = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), mo = function(a) { function r(t, e) { t === void 0 && (t = {}); var n = a.call(this, t, !0) || this; return n.listenTo(n.collection, "reset", n.render), n.canvasView = e.canvasView, n._module = e.module, n; } return zo(r, a), r.prototype.onRemoveBefore = function(t, e) { e === void 0 && (e = {}), t.forEach(function(n) { return n.remove(e); }); }, r.prototype.onRender = function() { var t = this.$el, e = this.ppfx; t.attr({ class: "".concat(e, "frames") }); }, r.prototype.renderView = function(t, e) { return new $n(t, this.canvasView); }, r; }(Yn); const qe = mo; var ve = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), rr = function() { return rr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, rr.apply(this, arguments); }, Uo = function(a) { function r(t) { var e = a.call(this, { model: t }) || this; e.ready = !1, (0, S.bindAll)(e, "clearOff", "onKeyPress", "onCanvasMove"), e.className = e.pfx + "canvas"; var n = e.em; return e._initFrames(), e.listenTo(n, "change:canvasOffset", e.clearOff), e.listenTo(n, "component:selected", e.checkSelected), e.listenTo(t, "change:zoom change:x change:y", e.updateFrames), e.listenTo(t, "change:frames", e._onFramesUpdate), e.toggleListeners(!0), e; } return ve(r, a), r.prototype.events = function() { return { wheel: "onWheel" }; }, r.prototype.template = function() { var t = this.pfx; return `
`); }, r.prototype._onFramesUpdate = function() { this._initFrames(), this._renderFrames(); }, r.prototype._initFrames = function() { var t = this, e = t.frames, n = t.model, i = t.config, l = t.em, f = n.frames; l.set("readyCanvas", 0), f.once("loaded:all", function() { return l.set("readyCanvas", 1); }), e == null || e.remove(), this.frames = new qe({ collection: f }, rr(rr({}, i), { canvasView: this })); }, r.prototype.checkSelected = function(t, e) { var n; e === void 0 && (e = {}); var i = e.scroll, l = this.em.get("currentFrame"); i && ((n = t.views) === null || n === void 0 || n.forEach(function(f) { f._getFrame() === l && f.scrollIntoView(i); })); }, r.prototype.remove = function() { for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; return (t = this.frames) === null || t === void 0 || t.remove(), this.frames = void 0, pn.prototype.remove.apply(this, e), this.toggleListeners(!1), this; }, r.prototype.preventDefault = function(t) { var e; t && (t.preventDefault(), (e = t._parentEvent) === null || e === void 0 || e.preventDefault()); }, r.prototype.onCanvasMove = function(t) { }, r.prototype.toggleListeners = function(t) { this.el; var e = t ? H.on : H.off; e(document, "keypress", this.onKeyPress), e(window, "scroll resize", this.clearOff); }, r.prototype.onKeyPress = function(t) { var e = this.em; (0, H.getKeyChar)(t) !== " " || e.getZoomDecimal() === 1 || e.Canvas.isInputFocused() || (this.preventDefault(t), e.Editor.runCommand("core:canvas-move")); }, r.prototype.onWheel = function(t) { if ((t.ctrlKey || t.metaKey) && this.em.getConfig().multiFrames) { this.preventDefault(t); var e = this.model, n = Math.max(-1, Math.min(1, t.wheelDelta || -t.detail)), i = e.get("zoom"); e.set("zoom", i + 2 * n); } }, r.prototype.updateFrames = function(t) { var e = this.em, n = this.model.attributes, i = n.x, l = n.y, f = this.getZoom(), d = { preserveSelected: 1 }, v = f ? 1 / f : 1; this.framesArea.style.transform = "scale(".concat(f, ") translate(").concat(i * v, "px, ").concat(l * v, "px)"), this.clearOff(), e.stopDefault(d), e.trigger("canvas:update", t), this.timerZoom && clearTimeout(this.timerZoom), this.timerZoom = setTimeout(function() { return e.runDefault(d); }, 300); }, r.prototype.getZoom = function() { return this.em.getZoomDecimal(); }, r.prototype.isElInViewport = function(t) { var e = (0, H.getElement)(t), n = (0, H.getElRect)(e), i = this.getFrameOffset(e), l = n.top, f = n.left; return l >= 0 && f >= 0 && l <= i.height && f <= i.width; }, r.prototype.offset = function(t, e) { e === void 0 && (e = {}); var n = e.noScroll, i = (0, H.getElRect)(t), l = n ? { x: 0, y: 0 } : (0, Ne.GX)(t); return { top: i.top + l.y, left: i.left + l.x, width: i.width, height: i.height }; }, r.prototype.clearOff = function() { this.frmOff = void 0, this.cvsOff = void 0; }, r.prototype.getFrameOffset = function(t) { var e; if (!this.frmOff || t) { var n = (e = this.frame) === null || e === void 0 ? void 0 : e.el, i = t == null ? void 0 : t.ownerDocument.defaultView, l = i ? i.frameElement : n; this.frmOff = this.offset(l || n); } return this.frmOff; }, r.prototype.getCanvasOffset = function() { return this.cvsOff || (this.cvsOff = this.offset(this.el)), this.cvsOff; }, r.prototype.getElementPos = function(t, e) { e === void 0 && (e = {}); var n = this.getZoom(), i = this.getFrameOffset(t), l = this.el, f = this.getCanvasOffset(), d = this.offset(t, e), v = e.avoidFrameOffset ? 0 : i.top, h = e.avoidFrameOffset ? 0 : i.left, w = e.avoidFrameZoom ? d.top : d.top * n, C = e.avoidFrameZoom ? d.left : d.left * n; return { top: e.avoidFrameOffset ? w : w + v - f.top + l.scrollTop, left: e.avoidFrameOffset ? C : C + h - f.left + l.scrollLeft, height: e.avoidFrameZoom ? d.height : d.height * n, width: e.avoidFrameZoom ? d.width : d.width * n, zoom: n, rect: d }; }, r.prototype.getElementOffsets = function(t) { var e = this; if (!t || (0, H.isTextNode)(t)) return {}; var n = {}, i = window.getComputedStyle(t); return ["marginTop", "marginRight", "marginBottom", "marginLeft", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"].forEach(function(l) { n[l] = parseFloat(i[l]) * e.getZoom(); }), n; }, r.prototype.getPosition = function(t) { var e; t === void 0 && (t = {}); var n = (e = this.frame) === null || e === void 0 ? void 0 : e.el.contentDocument; if (!n) return { top: 0, left: 0, width: 0, height: 0 }; var i = n.body, l = this.getZoom(), f = this.getFrameOffset(), d = this.getCanvasOffset(), v = t.noScroll; return { top: f.top + (v ? 0 : i.scrollTop) * l - d.top, left: f.left + (v ? 0 : i.scrollLeft) * l - d.left, width: d.width, height: d.height }; }, r.prototype.updateScript = function(t) { var e = t.model, n = e.getId(); t.scriptContainer || (t.scriptContainer = (0, Ne.ut)("div", { "data-id": n }), this.getJsContainer().appendChild(t.scriptContainer)), t.el.id = n, t.scriptContainer.innerHTML = ""; var i = document.createElement("script"), l = e.getScriptString(), f = e.get("script-props") ? l : `function(){ `.concat(l, ` ;}`), d = JSON.stringify(e.__getScriptProps()); i.innerHTML = ` setTimeout(function() { var item = document.getElementById('`.concat(n, `'); if (!item) return; (`).concat(f, ".bind(item))(").concat(d, `) }, 1);`), setTimeout(function() { var v = t.scriptContainer; v == null || v.appendChild(i); }, 0); }, r.prototype.getJsContainer = function(t) { var e = this.getFrameView(t); return e && e.getJsContainer(); }, r.prototype.getFrameView = function(t) { return (t == null ? void 0 : t._getFrame()) || this.em.get("currentFrame"); }, r.prototype._renderFrames = function() { if (this.ready) { var t = this, e = t.model, n = t.frames, i = t.em, l = t.framesArea, f = e.frames; f.listenToLoad(), n.render(); var d = f.at(0), v = d == null ? void 0 : d.view; i.setCurrentFrame(v), l == null || l.appendChild(n.el), this.frame = v; } }, r.prototype.render = function() { var t = this, e = t.el, n = t.$el, i = t.ppfx, l = t.config, f = t.em; n.html(this.template()); var d = n.find("[data-frames]"); this.framesArea = d.get(0); var v = n.find("[data-tools]"); return this.toolsWrapper = v.get(0), v.append(`
`).concat(l.extHl ? '
') : "", `
`)), this.toolsEl = e.querySelector("#".concat(i, "tools")), this.hlEl = e.querySelector(".".concat(i, "highlighter")), this.badgeEl = e.querySelector(".".concat(i, "badge")), this.placerEl = e.querySelector(".".concat(i, "placeholder")), this.ghostEl = e.querySelector(".".concat(i, "ghost")), this.toolbarEl = e.querySelector(".".concat(i, "toolbar")), this.resizerEl = e.querySelector(".".concat(i, "resizer")), this.offsetEl = e.querySelector(".".concat(i, "offset-v")), this.fixedOffsetEl = e.querySelector(".".concat(i, "offset-fixed-v")), this.toolsGlobEl = e.querySelector(".".concat(i, "tools-gl")), this.el.className = (0, H.getUiClass)(f, this.className), this.ready = !0, this._renderFrames(), this; }, r; }(pn); const or = Uo; var Ye = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), In = function() { return In = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, In.apply(this, arguments); }, yo = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, Bo = function(a) { function r(t) { var e = a.call(this, t, "Canvas", ee) || this; return e.canvas = new We(e), e.model = e.canvas, e.startAutoscroll = e.startAutoscroll.bind(e), e.stopAutoscroll = e.stopAutoscroll.bind(e), e; } return Ye(r, a), r.prototype.getCanvasView = function() { return this.canvasView; }, r.prototype.onLoad = function() { this.model.init(); }, r.prototype.getModel = function() { return this.canvas; }, r.prototype.getElement = function() { return this.getCanvasView().el; }, r.prototype.getFrame = function(t) { return this.getFrames()[t || 0]; }, r.prototype.getFrameEl = function() { var t = (this.canvasView || {}).frame; return t == null ? void 0 : t.el; }, r.prototype.getFramesEl = function() { var t; return (t = this.canvasView) === null || t === void 0 ? void 0 : t.framesArea; }, r.prototype.getWindow = function() { var t = (this.canvasView || {}).frame; return t == null ? void 0 : t.getWindow(); }, r.prototype.getDocument = function() { var t = this.getFrameEl(); return t == null ? void 0 : t.contentDocument; }, r.prototype.getBody = function() { var t = this.getDocument(); return t == null ? void 0 : t.body; }, r.prototype._getLocalEl = function(t, e, n) { var i = t, l = e == null ? void 0 : e._getFrame(); return i = l ? l[n]() : i; }, r.prototype.getGlobalToolsEl = function() { var t; return (t = this.canvasView) === null || t === void 0 ? void 0 : t.toolsGlobEl; }, r.prototype.getToolsEl = function(t) { return this._getLocalEl(this.getCanvasView().toolsEl, t, "getToolsEl"); }, r.prototype.getHighlighter = function(t) { return this._getLocalEl(this.getCanvasView().hlEl, t, "getHighlighter"); }, r.prototype.getBadgeEl = function(t) { return this._getLocalEl(this.getCanvasView().badgeEl, t, "getBadgeEl"); }, r.prototype.getPlacerEl = function() { return this.getCanvasView().placerEl; }, r.prototype.getGhostEl = function() { return this.getCanvasView().ghostEl; }, r.prototype.getToolbarEl = function() { return this.getCanvasView().toolbarEl; }, r.prototype.getResizerEl = function() { return this.getCanvasView().resizerEl; }, r.prototype.getOffsetViewerEl = function(t) { return this._getLocalEl(this.getCanvasView().offsetEl, t, "getOffsetViewerEl"); }, r.prototype.getFixedOffsetViewerEl = function() { return this.getCanvasView().fixedOffsetEl; }, r.prototype.render = function() { var t; return (t = this.canvasView) === null || t === void 0 || t.remove(), this.canvasView = new or(this.canvas), this.canvasView.render().el; }, r.prototype.getOffset = function() { var t = this.offset(this.getFrameEl()), e = this.offset(this.getElement()); return { top: t.top - e.top, left: t.left - e.left }; }, r.prototype.offset = function(t) { return this.getCanvasView().offset(t); }, r.prototype.setCustomBadgeLabel = function(t) { this.config.customBadgeLabel = t; }, r.prototype.getElementPos = function(t, e) { return this.getCanvasView().getElementPos(t, e); }, r.prototype.getElementOffsets = function(t) { return this.getCanvasView().getElementOffsets(t); }, r.prototype.getRect = function() { var t, e = (t = this.getCanvasView().getPosition()) !== null && t !== void 0 ? t : {}, n = e.top, i = n === void 0 ? 0 : n, l = e.left, f = l === void 0 ? 0 : l; return In(In({}, this.getCanvasView().getCanvasOffset()), { topScroll: i, leftScroll: f }); }, r.prototype.getTargetToElementDim = function(t, e, n) { n === void 0 && (n = {}); var i = n || {}, l = this.getCanvasView().getPosition(); if (l) { var f = i.elPos || this.getCanvasView().getElementPos(e), d = n.toRight || 0, v = i.targetHeight || t.offsetHeight, h = i.targetWidth || t.offsetWidth, w = i.event || null, C = f.top - v, L = f.left; L += d ? f.width : 0; var F = (L = d ? L - h : L) < l.left ? l.left : L, q = C < l.top ? l.top : C, et = { top: q = q > f.top + f.height ? f.top + f.height : q, left: F, elementTop: f.top, elementLeft: f.left, elementWidth: f.width, elementHeight: f.height, targetWidth: t.offsetWidth, targetHeight: t.offsetHeight, canvasTop: l.top, canvasLeft: l.left, canvasWidth: l.width, canvasHeight: l.height }; return w && this.em && this.em.trigger(w, et), et; } }, r.prototype.canvasRectOffset = function(t, e, n) { var i = this; n === void 0 && (n = {}); var l = function(f, d, v) { d === void 0 && (d = 1); var h = i.em.getZoomDecimal(), w = d ? "top" : "left", C = f.ownerDocument, L = n.offset ? function(Je) { var dn = Je.defaultView; return dn == null ? void 0 : dn.frameElement; }(C) : {}, F = L.offsetTop, q = F === void 0 ? 0 : F, et = L.offsetLeft, X = et === void 0 ? 0 : et, At = C.body || {}, It = At.scrollTop, ie = It === void 0 ? 0 : It, se = At.scrollLeft, Me = d ? ie : se === void 0 ? 0 : se, Ie = d ? q : X; return v[w] - (Me - Ie) * h; }; return { top: l(t, 1, e), left: l(t, 0, e) }; }, r.prototype.getTargetToElementFixed = function(t, e, n) { n === void 0 && (n = {}); var i = n.pos || this.getElementPos(t, { noScroll: !0 }), l = n.canvasOff || this.canvasRectOffset(t, i), f = e.offsetHeight || 0, d = e.offsetWidth || 0, v = i.left + i.width, h = this.getCanvasView(), w = h.getPosition(), C = h.getFrameOffset(t), L = n.event, F = -f, q = (0, S.isUndefined)(n.left) ? i.width - d : n.left; if (q = i.left < -q ? -i.left : q, q = v > w.width ? q - (v - w.width) : q, l.top < f) { var et = i.height + f; et < C.height ? F += et : F = -l.top < i.height ? -l.top : i.height; } var X = { top: F, left: q, canvasOffsetTop: l.top, canvasOffsetLeft: l.left, elRect: i, canvasOffset: l, canvasRect: w, targetWidth: d, targetHeight: f }; return L && this.em.trigger(L, X), X; }, r.prototype.getMouseRelativePos = function(t, e) { e === void 0 && (e = {}); var n = 0, i = 0, l = e.subWinOffset, f = t.target.ownerDocument, d = f.defaultView || f.parentWindow, v = d.frameElement, h = l ? d.pageYOffset : 0, w = l ? d.pageXOffset : 0; if (v) { var C = v.getBoundingClientRect(); n = C.top || 0, i = C.left || 0; } return { y: t.clientY + n - h, x: t.clientX + i - w }; }, r.prototype.getMouseRelativeCanvas = function(t, e) { var n, i = this.getZoomDecimal(), l = (n = this.getCanvasView().getPosition(e)) !== null && n !== void 0 ? n : {}, f = l.top, d = f === void 0 ? 0 : f, v = l.left, h = v === void 0 ? 0 : v; return { y: t.clientY * i + d, x: t.clientX * i + h }; }, r.prototype.hasFocus = function() { return this.getDocument().hasFocus(); }, r.prototype.isInputFocused = function() { var t = this.getDocument(), e = this.getFrameEl(), n = yo(["body"], this.config.notTextable, !0), i = e && document.activeElement === e ? t && t.activeElement : document.activeElement; return i && !n.some(function(l) { return i.matches(l); }); }, r.prototype.scrollTo = function(t, e) { e === void 0 && (e = {}); var n = (0, H.getElement)(t), i = n && (0, H.getViewEl)(n); i && i.scrollIntoView(e); }, r.prototype.startAutoscroll = function(t) { var e = t && t.view || this.em.getCurrentFrame(); e && e.startAutoscroll(); }, r.prototype.stopAutoscroll = function(t) { var e = t && t.view || this.em.getCurrentFrame(); e && e.stopAutoscroll(); }, r.prototype.setZoom = function(t) { return this.canvas.set("zoom", typeof t == "string" ? parseFloat(t) : t), this; }, r.prototype.getZoom = function() { return parseFloat(this.canvas.get("zoom")); }, r.prototype.setCoords = function(t, e) { return this.canvas.set({ x: parseFloat(t), y: parseFloat(e) }), this; }, r.prototype.getCoords = function() { var t = this.canvas.attributes; return { x: t.x, y: t.y }; }, r.prototype.getZoomDecimal = function() { return this.getZoom() / 100; }, r.prototype.getZoomMultiplier = function() { var t = this.getZoomDecimal(); return t ? 1 / t : 1; }, r.prototype.toggleFramesEvents = function(t) { this.getFramesEl().style.pointerEvents = t ? "" : "none"; }, r.prototype.getFrames = function() { return this.canvas.frames.map(function(t) { return t; }); }, r.prototype.addFrame = function(t, e) { return t === void 0 && (t = {}), e === void 0 && (e = {}), this.canvas.frames.add(new wt(this, In({}, t)), e); }, r.prototype.destroy = function() { var t, e = this; this.canvas.stopListening(), (t = this.canvasView) === null || t === void 0 || t.remove(), ["model", "droppable"].forEach(function(n) { return e[n] = {}; }); }, r; }(jt); const Bt = Bo, T = { stylePrefix: "comp-", components: [], draggableComponents: !0, disableTextInnerChilds: !1, processor: void 0, voidElements: ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"] }; var G = "text/html", Mt = G, te = function() { return te = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, te.apply(this, arguments); }, de = "data-gjs-", $e = "parse:html"; const oe = function(a, r) { return r === void 0 && (r = {}), { compTypes: "", modelAttrStart: de, getPropAttribute: function(t, e) { var n = t.replace(this.modelAttrStart, ""), i = (e == null ? void 0 : e.length) || 0, l = e == null ? void 0 : e.substring(0, 1), f = e == null ? void 0 : e.substring(i - 1), d = e === "true" || e !== "false" && e; try { d = l == "{" && f == "}" || l == "[" && f == "]" ? JSON.parse(d) : d; } catch { } return { name: n, value: d }; }, splitPropsFromAttr: function(t) { var e = this; t === void 0 && (t = {}); var n = {}, i = {}; return (0, S.each)(t, function(l, f) { if (f.indexOf(e.modelAttrStart) === 0) { var d = e.getPropAttribute(f, l); n[d.name] = d.value; } else i[f] = l; }), { props: n, attrs: i }; }, parseStyle: function(t) { for (var e = {}, n = t.split(";"), i = 0, l = n.length; i < l; i++) { var f = n[i].trim(); if (f) { var d = f.split(":"); e[d[0].trim()] = d.slice(1).join(":").trim(); } } return e; }, parseClass: function(t) { for (var e = [], n = t.split(" "), i = 0, l = n.length; i < l; i++) { var f = n[i].trim(); f && e.push(f); } return e; }, parseNode: function(t, e) { e === void 0 && (e = {}); for (var n = [], i = t.childNodes, l = 0, f = i.length; l < f; l++) { var d = i[l], v = d.attributes || [], h = v.length, w = n[n.length - 1], C = d.childNodes.length, L = this.compTypes, F = {}; if (L) { var q = "", et = d.getAttribute && d.getAttribute("".concat(this.modelAttrStart, "type")); if (et) F = { type: et }; else { for (var X = 0; X < L.length; X++) { var At = L[X]; if (q = At.model.isComponent(d, e)) { typeof q != "object" && (q = { type: At.id }); break; } } F = q; } } if (!F.tagName) { var It = d.tagName || "", ie = d.namespaceURI || ""; F.tagName = It && ie === "http://www.w3.org/1999/xhtml" ? It.toLowerCase() : It; } h && (F.attributes = {}); for (var se = 0; se < h; se++) { var Me = v[se].nodeName, Ie = v[se].nodeValue; if (Me == "style") F.style = this.parseStyle(Ie); else if (Me == "class") F.classes = this.parseClass(Ie); else { if (Me == "contenteditable") continue; if (Me.indexOf(this.modelAttrStart) === 0) { var Je = this.getPropAttribute(Me, Ie); F[Je.name] = Je.value; } else Ie === "" && d[Me] === !0 && (Ie = !0), F.attributes[Me] = Ie; } } if (C && !F.components) { var dn = d.childNodes[0]; C === 1 && dn.nodeType === 3 ? (!F.type && (F.type = "text"), F.components = { type: "textnode", content: dn.nodeValue }) : F.components = this.parseNode(d, te(te({}, e), { inSvg: e.inSvg || F.type === "svg" })); } if (F.type == "textnode") { if (w && w.type == "textnode") { w.content += F.content; continue; } if (!e.keepEmptyTextNodes) { var Er = d.nodeValue; if (Er != " " && !Er.trim()) continue; } } C || "".concat(d.outerHTML).slice(-2) !== "/>" || (F.void = !0); var qr = F.components; if (!F.type && qr) { for (var Gr = 1, no = 0, Kr = 0; Kr < qr.length; Kr++) { var ii = qr[Kr], Vi = ii.type; if (["text", "textnode"].indexOf(Vi) < 0 && r.textTags.indexOf(ii.tagName) < 0) { Gr = 0; break; } Vi == "textnode" && (no = 1); } Gr && no && (F.type = "text"); } (F.tagName || F.type == "textnode") && n.push(F); } return n; }, parse: function(t, e, n) { var i; n === void 0 && (n = {}); var l = (a == null ? void 0 : a.get("Config")) || {}, f = {}, d = te(te({}, r), n), v = te(te(te({}, r.optionsHtml), { htmlType: ((i = r.optionsHtml) === null || i === void 0 ? void 0 : i.htmlType) || r.htmlType }), n), h = (0, S.isFunction)(d.parserHtml) ? d.parserHtml(t, v) : function(At, It) { It === void 0 && (It = {}); var ie, se = new DOMParser(), Me = It.htmlType || Mt, Ie = Me === G, Je = Ie ? At : "
".concat(At, "
"), dn = se.parseFromString(Je, Me); if (Ie) { var Er = dn.head, qr = dn.body, Gr = Er.querySelectorAll("script"); (0, S.each)(Gr, function(Kr) { return qr.appendChild(Kr); }); var no = []; (0, S.each)(Er.children, function(Kr) { return no.push(Kr); }), (0, S.each)(no, function(Kr, ii) { return qr.insertBefore(Kr, qr.children[ii]); }), ie = qr; } else ie = dn.firstChild; return ie; }(t, v), w = h.querySelectorAll("script"), C = w.length; if (!((0, S.isUndefined)(l.allowScripts) ? v.allowScripts : l.allowScripts)) for (; C--; ) w[C].parentNode.removeChild(w[C]); if (v.allowUnsafeAttr || this.__clearUnsafeAttr(h), e) { for (var L = h.querySelectorAll("style"), F = L.length, q = ""; F--; ) q = L[F].innerHTML + q, L[F].parentNode.removeChild(L[F]); q && (f.css = e.parse(q)); } a && a.trigger("".concat($e, ":root"), { input: t, root: h }); var et = this.parseNode(h, d), X = et.length !== 1 || d.returnArray ? et : et[0]; return f.html = X, a && a.trigger($e, { input: t, output: f }), f; }, __clearUnsafeAttr: function(t) { var e = this, n = t.attributes || [], i = t.childNodes || [], l = []; (0, S.each)(n, function(f) { var d = f.nodeName || ""; d.indexOf("on") === 0 && l.push(d); }), l.map(function(f) { return t.removeAttribute(f); }), (0, S.each)(i, function(f) { return e.__clearUnsafeAttr(f); }); } }; }; var Hn = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Tn = function() { return Tn = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Tn.apply(this, arguments); }, Hi = oe(); const _r = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Hn(r, a), r.prototype.parseStyle = function(t) { return Hi.parseStyle(t); }, r.prototype.extendStyle = function(t) { return Tn(Tn({}, this.getStyle()), t); }, r.prototype.getStyle = function(t) { var e = this.get("style") || {}, n = Tn({}, e); return t && (0, S.isString)(t) ? n[t] : n; }, r.prototype.setStyle = function(t, e) { var n = this; t === void 0 && (t = {}), e === void 0 && (e = {}), (0, S.isString)(t) && (t = this.parseStyle(t)); var i = this.getStyle(e), l = Tn({}, t), f = Tn({}, l); (0, S.keys)(f).forEach(function(v) { f[v] === "" && delete f[v]; }), this.set("style", f, e); var d = (0, H.shallowDiff)(i, l); return delete d.__p, (0, S.keys)(d).forEach(function(v) { var h = n.em; e.noEvent || (n.trigger("change:style:".concat(v)), h && (h.trigger("styleable:change", n, v, e), h.trigger("styleable:change:".concat(v), n, v, e))); }), l; }, r.prototype.addStyle = function(t, e, n) { var i; e === void 0 && (e = ""), n === void 0 && (n = {}), typeof t == "string" ? ((i = {})[t] = e, t = i) : n = e || {}, t = this.extendStyle(t), this.setStyle(t, n); }, r.prototype.removeStyle = function(t) { var e = this.getStyle(); delete e[t], this.setStyle(e); }, r.prototype.styleToString = function(t) { t === void 0 && (t = {}); var e = [], n = this.getStyle(t); for (var i in n) { var l = t.important, f = (0, S.isArray)(l) ? l.indexOf(i) >= 0 : l, d = "".concat(n[i]).concat(f ? " !important" : ""), v = i.substr(0, 2) == "__"; d && !v && e.push("".concat(i, ":").concat(d, ";")); } return e.join(""); }, r.prototype.getSelectors = function() { return this.get("selectors") || this.get("classes"); }, r.prototype.getSelectorsString = function(t) { return this.selectorsToString ? this.selectorsToString(t) : this.getSelectors().getFullString(); }, r; }(k.Hn); var Ds = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), xr = function() { return xr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, xr.apply(this, arguments); }, bo = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, oo = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, io = function(a, r) { return r === void 0 && (r = []), a ? (((0, S.isArray)(a) || (0, S.isFunction)(a.map) ? a : [a]).map(function(t) { r.push(t.getId()), io(t.components().models, r); }), r) : []; }, Xn = function(a, r, t) { r === void 0 && (r = {}), t === void 0 && (t = {}), t.visitedCmps = t.visitedCmps || {}; var e = t.visitedCmps; return ((0, S.isArray)(a) ? a : [a]).map(function(n) { var i = n.attributes, l = i === void 0 ? {} : i, f = n.components, d = n.tagName, v = l.id, h = (l.draggable, bo(l, ["id", "draggable"])), w = n; if (v && (e[v] ? (e[v].push(w), v = yn.getNewId(r), w.attributes.id = v) : (e[v] = [], r[v] && (w = r[v], d && w.set({ tagName: d }, xr(xr({}, t), { silent: !0 })), (0, S.keys)(h).length && w.addAttributes(h, xr({}, t))))), f) { var C = Xn(f, r); if ((0, S.isFunction)(w.components)) { var L = w.components(); L.length > 0 && L.reset(C, t); } else w.components = C; } return w; }); }, wo = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ds(r, a), r.prototype.initialize = function(t, e) { e === void 0 && (e = {}), this.opt = e, this.listenTo(this, "add", this.onAdd), this.listenTo(this, "remove", this.removeChildren), this.listenTo(this, "reset", this.resetChildren); var n = e.em, i = e.config; this.config = i, this.em = n, this.domc = e.domc || (n == null ? void 0 : n.Components); }, r.prototype.resetChildren = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this, l = e.previousModels || [], f = l.filter(function(h) { return !t.get(h.cid); }), d = io(t), v = io(l).filter(function(h) { return d.indexOf(h) >= 0; }); e.keepIds = (e.keepIds || []).concat(v), f.forEach(function(h) { return n.removeChildren(h, i, e); }), t.each(function(h) { return n.onAdd(h); }); }, r.prototype.resetFromString = function(t, e) { var n, i; t === void 0 && (t = ""), e === void 0 && (e = {}), e.keepIds = io(this); var l = this, f = l.domc, d = l.em, v = l.parent, h = d == null ? void 0 : d.Css, w = (f == null ? void 0 : f.allById()) || {}, C = this.parseString(t, e), L = Xn(C, w, e), F = e.visitedCmps, q = F === void 0 ? {} : F; Object.keys(q).forEach(function(et) { var X = q[et]; if (X.length) { var At = (h == null ? void 0 : h.getRules("#".concat(et))) || []; At.length && X.forEach(function(It) { At.forEach(function(ie) { var se = ie.clone(); se.set("selectors", ["#".concat(It.attributes.id)]), h.getAll().add(se); }); }); } }), this.reset(L, e), d == null || d.trigger("component:content", v, e, t), (i = (n = v).__checkInnerChilds) === null || i === void 0 || i.call(n); }, r.prototype.removeChildren = function(t, e, n) { var i = this; if (n === void 0 && (n = {}), t) { var l = this.domc, f = this.em, d = n.temporary || n.fromUndo; if (t.prevColl = this, !d) { var v = t.getId(), h = f.Selectors.getAll(), w = f.Css.getAll(), C = (n.keepIds || []).indexOf(v) < 0; delete (l ? l.allById() : {})[v]; var L = C ? w.remove(w.filter(function(q) { return q.getSelectors().getFullString() === "#".concat(v); }), n) : []; h.remove(L.map(function(q) { return q.getSelectors().at(0); })), t.opt.temporary || (f.Commands.run("core:component-style-clear", { target: t }), t.removed(), t.trigger("removed"), f.trigger("component:remove", t)), t.components().forEach(function(q) { return i.removeChildren(q, e, n); }); } var F = t.components(); f.stopListening(F), f.stopListening(t), f.stopListening(t.get("classes")), t.__postRemove(); } }, r.prototype.model = function(t, e) { var n, i = e.collection.opt, l = i.em, f = l.Components.componentTypes; e.em = l, e.config = i.config, e.componentTypes = f, e.domc = i.domc; for (var d = 0; d < f.length; d++) if (f[d].id == t.type) { n = f[d].model; break; } return n || (n = f[f.length - 1].model, l && t.type && l.logWarning("Component type '".concat(t.type, "' not found"), { attrs: t, options: e })), new n(t, e); }, r.prototype.parseString = function(t, e) { e === void 0 && (e = {}); var n = this.em, i = this.domc, l = n.Css, f = n.Parser.parseHtml(t); if (yn.checkId(f.html, f.css, i.componentsById, e), f.css && l && !e.temporary) { e.at; var d = bo(e, ["at"]); l.addCollection(f.css, xr(xr({}, d), { extend: 1 })); } return f.html; }, r.prototype.add = function(t, e) { var n = this; e === void 0 && (e = {}), e.keepIds = oo(oo([], e.keepIds || [], !0), io(e.previousModels), !0), (0, S.isString)(t) ? t = this.parseString(t, e) : (0, S.isArray)(t) && (t = oo([], t, !0)).forEach(function(f, d) { if ((0, S.isString)(f)) { var v = n.parseString(f, e); t[d] = (0, S.isArray)(v) && !v.length ? null : v; } }); var i = (0, S.isArray)(t); t = (i ? t : [t]).filter(Boolean).map(function(f) { return n.processDef(f); }), t = i ? (0, S.flatten)(t, 1) : t[0]; var l = k.FE.prototype.add.apply(this, [t, e]); return this.__firstAdd = l, l; }, r.prototype.processDef = function(t) { if (t.cid && t.ccid) return t; var e = this.em, n = this.config, i = (n === void 0 ? {} : n).processor, l = t; if (i) { var f = i(l = xr({}, l)); f && ((0, S.each)(l, function(L, F) { return delete l[F]; }), (0, S.extend)(l, f)); } if (l.$$typeof && typeof l.props == "object") { (l = xr({}, l)).props = xr({}, l.props); var d = e.Components, v = e.Parser.parserHtml; (0, S.each)(l, function(L, F) { (0, S.includes)(["props", "type"], F) || delete l[F]; }); var h = l.props, w = h.children; delete h.children, delete l.props; var C = v.splitPropsFromAttr(h); l.attributes = C.attrs, w && (l.components = w), l.type ? d.getType(l.type) || (l.tagName = l.type, delete l.type) : l.type = "textnode", (0, S.extend)(l, C.props); } return l; }, r.prototype.onAdd = function(t, e, n) { n === void 0 && (n = {}); var i = this.domc, l = this.em, f = t.getStyle(), d = l && l.getConfig().avoidInlineStyle; if (i && i.Component.ensureInList(t), !(0, S.isEmpty)(f) && !d && l && l.get && l.getConfig().forceClass && !n.temporary) { var v = t.cid; l.Css.setClassRule(v, f), t.setStyle({}), t.addClass(v); } t.__postAdd({ recursive: !0 }); }, r; }(k.FE); const Wo = wo; var Ns = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), So = 1, zi = 2, Is = function(a) { function r(t, e) { e === void 0 && (e = {}); var n = a.call(this, t, e) || this, i = e.config, l = i === void 0 ? {} : i, f = n.get("name"), d = n.get("label"); f ? d || n.set("label", f) : n.set("name", d); var v = n.get("name"), h = l.escapeName, w = h ? h(v) : r.escapeName(v); return n.set("name", w), n.em = e.em, n; } return Ns(r, a), r.prototype.defaults = function() { return { name: "", label: "", type: So, active: !0, private: !1, protected: !1, _undo: !0 }; }, r.prototype.isId = function() { return this.get("type") === zi; }, r.prototype.isClass = function() { return this.get("type") === So; }, r.prototype.getFullName = function(t) { t === void 0 && (t = {}); var e = t.escape, n = this.get("name"), i = ""; switch (this.get("type")) { case So: i = "."; break; case zi: i = "#"; } return i + (e ? e(n) : n); }, r.prototype.toString = function() { return this.getFullName(); }, r.prototype.getLabel = function() { return this.get("label"); }, r.prototype.setLabel = function(t) { return this.set("label", t); }, r.prototype.getActive = function() { return this.get("active"); }, r.prototype.setActive = function(t) { return this.set("active", t); }, r.prototype.toJSON = function(t) { t === void 0 && (t = {}); var e = this.em, n = k.Hn.prototype.toJSON.call(this, [t]), i = (0, S.result)(this, "defaults"); if (e && e.getConfig().avoidDefaults) { (0, S.forEach)(i, function(f, d) { n[d] === f && delete n[d]; }), n.label === n.name && delete n.label; var l = (0, S.keys)(n).length; l === 1 && n.name && (n = n.name), l === 2 && n.name && n.type && (n = this.getFullName()); } return n; }, r.escapeName = function(t) { return "".concat(t).trim().replace(/([^a-z0-9\w-\:@]+)/gi, "-"); }, r.TYPE_CLASS = So, r.TYPE_ID = zi, r; }(k.Hn); const Jn = Is; Is.prototype.idAttribute = "name"; var Zr = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), fi = function(a, r) { return a.reduce(function(t, e, n) { return t.concat(fi(a.slice(n + 1), "".concat(r).concat(e))); }, [r]); }, Fs = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Zr(r, a), r.prototype.modelId = function(t) { return "".concat(t.name, "_").concat(t.type || Jn.TYPE_CLASS); }, r.prototype.getStyleable = function() { return (0, S.filter)(this.models, function(t) { return t.get("active") && !t.get("private"); }); }, r.prototype.getValid = function(t) { var e = (t === void 0 ? {} : t).noDisabled; return (0, S.filter)(this.models, function(n) { return !n.get("private"); }).filter(function(n) { return e ? n.get("active") : 1; }); }, r.prototype.getFullString = function(t, e) { e === void 0 && (e = {}); var n = []; return (t || this).forEach(function(i) { return n.push(i.getFullName(e)); }), e.sort && n.sort(), n.join("").trim(); }, r.prototype.getFullName = function(t) { t === void 0 && (t = {}); var e = t.combination, n = t.array, i = [], l = this.map(function(f) { return f.getFullName(t); }).sort(); return e ? l.forEach(function(f, d) { i = i.concat(fi(l.slice(d + 1), f)); }) : i = l, n ? i : e ? i.join(",") : i.join(""); }, r; }(k.FE); const Cr = Fs; Fs.prototype.model = Jn; var Oo = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), di = function() { return di = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, di.apply(this, arguments); }; const Vs = function(a) { function r(t) { var e = a.call(this, t) || this, n = e.attributes, i = n.target, l = n.name, f = n.changeProp, d = n.value; if (!e.get("id") && e.set("id", l), i) { e.target = i, e.unset("target"); var v = f ? "change:".concat(l) : "change:attributes:".concat(l); e.listenTo(i, v, e.targetUpdated); var h = d || e.getValue(); !(0, S.isUndefined)(h) && e.set({ value: h }, { silent: !0 }); } return e; } return Oo(r, a), r.prototype.defaults = function() { return { type: "text", label: "", name: "", unit: "", step: 1, value: "", default: "", placeholder: "", changeProp: !1, options: [] }; }, r.prototype.getId = function() { return this.get("id"); }, r.prototype.getType = function() { return this.get("type"); }, r.prototype.getName = function() { return this.get("name"); }, r.prototype.getLabel = function(t) { var e; t === void 0 && (t = {}); var n = t.locale, i = n === void 0 || n, l = this.getId(), f = this.get("label") || this.getName(); return i && ((e = this.em) === null || e === void 0 ? void 0 : e.t("traitManager.traits.labels.".concat(l))) || f; }, r.prototype.getValue = function() { return this.getTargetValue(); }, r.prototype.setValue = function(t, e) { var n; e === void 0 && (e = {}); var i = {}, l = this.get("setValue"); l ? l({ value: t, editor: (n = this.em) === null || n === void 0 ? void 0 : n.getEditor(), trait: this, component: this.target, partial: !!e.partial }) : (e.partial && (i.avoidStore = !0), this.setTargetValue(t, i), e.partial === !1 && (this.setTargetValue(""), this.setTargetValue(t))); }, r.prototype.props = function() { return this.attributes; }, r.prototype.targetUpdated = function() { var t, e = this.getTargetValue(); this.set({ value: e }, { fromTarget: 1 }), (t = this.em) === null || t === void 0 || t.trigger("trait:update", { trait: this, component: this.target }); }, r.prototype.getTargetValue = function() { var t, e, n = this.getName(), i = this.target, l = this.get("getValue"); return e = l ? l({ editor: (t = this.em) === null || t === void 0 ? void 0 : t.getEditor(), trait: this, component: i }) : this.get("changeProp") ? i.get(n) : i.getAttributes()[n], (0, S.isUndefined)(e) ? "" : e; }, r.prototype.setTargetValue = function(t, e) { var n; e === void 0 && (e = {}); var i = this.target, l = this.attributes, f = this.getName(); if (!(0, S.isUndefined)(t)) { var d = t; if (t === "false" ? d = !1 : t === "true" && (d = !0), this.getType() === "checkbox") { var v = l.valueTrue, h = l.valueFalse; d && !(0, S.isUndefined)(v) && (d = v), d || (0, S.isUndefined)(h) || (d = h); } this.get("changeProp") ? i.set(f, d, e) : i.addAttributes(((n = {})[f] = d, n), e); } }, r.prototype.setValueFromInput = function(t, e, n) { e === void 0 && (e = !0), n === void 0 && (n = {}); var i = { value: t }; this.set(i, di(di({}, n), { avoidStore: 1 })), e && (this.set("value", "", n), this.set(i, n)); }, r.prototype.getInitValue = function() { var t, e = this.target, n = this.getName(); if (e) { var i = e.get("attributes"); t = this.get("changeProp") ? e.get(n) : i[n]; } return t || this.get("value") || this.get("default"); }, r; }(k.Hn); var Aa = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), hi = function(a) { function r(t, e) { var n = a.call(this, t) || this; return n.em = e.em, n.listenTo(n, "add", n.handleAdd), n.listenTo(n, "reset", n.handleReset), n; } return Aa(r, a), r.prototype.handleReset = function(t, e) { var n = (e === void 0 ? {} : e).previousModels; (n === void 0 ? [] : n).forEach(function(i) { return i.trigger("remove"); }); }, r.prototype.handleAdd = function(t) { t.em = this.em; var e = this.target; e && (t.target = e); }, r.prototype.setTarget = function(t) { this.target = t; }, r.prototype.add = function(t, e) { var n = this.em; if ((0, S.isString)(t) || (0, S.isArray)(t)) { var i = n && n.get && n.Traits, l = function(w) { return w === void 0 && (w = {}), { build: function(C) { var L = []; typeof C == "string" && (C = [C]); for (var F = 0; F < C.length; F++) { var q = C[F], et = { name: q, type: "text" }; q === "target" && (et.type = "select", et.default = !1, et.options = w.optionsTarget), L.push(et); } return L; } }; }(i && i.getConfig()); (0, S.isString)(t) && (t = [t]); for (var f = 0, d = t.length; f < d; f++) { var v = t[f], h = (0, S.isString)(v) ? l.build(v)[0] : v; h.target = this.target, t[f] = h; } } return k.FE.prototype.add.apply(this, [t, e]); }, r; }(k.FE); const $o = hi; hi.prototype.model = Vs; var Ui = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Be = function() { return Be = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Be.apply(this, arguments); }, Zn = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, Bi = function(a) { return a.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); }, hr = "component:drag", qn = "__symbols", mn = "__symbol", Sr = "__symbol_ovrd", qo = "component:update", Dr = "".concat(qo, "-inside"), Wi = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ui(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { var t; return (t = { tagName: "div", type: "", name: "", removable: !0, draggable: !0, droppable: !0, badgable: !0, stylable: !0, "stylable-require": "", "style-signature": "", unstylable: "", highlightable: !0, copyable: !0, resizable: !1, editable: !1, layerable: !0, selectable: !0, hoverable: !0, locked: !1, void: !1, state: "", status: "", content: "", icon: "", style: "", styles: "", classes: "", script: "", "script-props": "", "script-export": "", attributes: {}, traits: ["id", "title"], propagate: "", dmode: "", toolbar: null })[mn] = 0, t[qn] = 0, t[Sr] = 0, t._undo = !0, t._undoexc = ["status", "open"], t; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "classes", { get: function() { return this.get("classes"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "traits", { get: function() { return this.get("traits"); }, enumerable: !1, configurable: !0 }), r.prototype.init = function() { }, r.prototype.updated = function(t, e, n) { }, r.prototype.removed = function() { }, r.prototype.initialize = function(t, e) { var n = this; t === void 0 && (t = {}), e === void 0 && (e = {}), (0, S.bindAll)(this, "__upSymbProps", "__upSymbCls", "__upSymbComps"); var i = e.em, l = this.parent(), f = l == null ? void 0 : l.attributes, d = this.get("propagate"); if (d && this.set("propagate", (0, S.isArray)(d) ? d : [d]), f && f.propagate && !d) { var v = {}, h = f.propagate; h.forEach(function(q) { return v[q] = l.get(q); }), v.propagate = h, this.set(Be(Be({}, v), t)); } if (e && e.config && e.config.voidElements.indexOf(this.get("tagName")) >= 0 && this.set("void", !0), e.em = i, this.opt = e, this.em = i, this.frame = e.frame, this.config = e.config || {}, this.set("attributes", Be(Be({}, (0, S.result)(this, "defaults").attributes || {}), this.get("attributes") || {})), this.ccid = r.createId(this, e), this.initClasses(), this.initComponents(), this.initTraits(), this.initToolbar(), this.initScriptProps(), this.listenTo(this, "change:script", this.scriptUpdated), this.listenTo(this, "change:tagName", this.tagUpdated), this.listenTo(this, "change:attributes", this.attrUpdated), this.listenTo(this, "change:attributes:id", this._idUpdated), this.on("change:toolbar", this.__emitUpdateTlb), this.on("change", this.__onChange), this.on(Dr, this.__propToParent), this.set("status", ""), this.views = [], ["classes", "traits", "components"].forEach(function(q) { var et = "add remove ".concat(q !== "components" ? "change" : ""); n.listenTo(n.get(q), et.trim(), function() { for (var X = [], At = 0; At < arguments.length; At++) X[At] = arguments[At]; return n.emitUpdate.apply(n, Zn([q], X, !1)); }); }), !e.temporary) { var w = i && i.Css, C = this.attributes, L = C.styles, F = C.type; L && w && w.addCollection(L, { avoidUpdateStyle: !0 }, { group: "cmp:".concat(F) }), this.__postAdd(), this.init(), this.__isSymbolOrInst() && this.__initSymb(), i && i.trigger("component:create", this); } }, r.prototype.__postAdd = function(t) { t === void 0 && (t = {}); var e = this.em, n = e == null ? void 0 : e.UndoManager, i = this.components(); n && !this.__hasUm && (n.add(i), n.add(this.getSelectors()), this.__hasUm = !0), t.recursive && i.map(function(l) { return l.__postAdd(t); }); }, r.prototype.__postRemove = function() { var t = this.em, e = t == null ? void 0 : t.get("UndoManager"); e && (e.remove(this.components()), e.remove(this.getSelectors()), delete this.__hasUm); }, r.prototype.__onChange = function(t, e) { var n = this, i = this.changedAttributes() || {}; (0, S.keys)(i).forEach(function(l) { return n.emitUpdate(l); }), ["status", "open", "toolbar", "traits"].forEach(function(l) { return delete i[l]; }), (0, H.isEmptyObj)(i) || (this.__changesUp(e), this.__propSelfToParent({ component: this, changed: i, options: e })); }, r.prototype.__changesUp = function(t) { var e = this.em; [this.frame, e].forEach(function(n) { return n && n.changesUp(t); }); }, r.prototype.__propSelfToParent = function(t) { this.trigger(qo, t), this.__propToParent(t); }, r.prototype.__propToParent = function(t) { var e = this.parent(); e && e.trigger(Dr, t); }, r.prototype.__emitUpdateTlb = function() { this.emitUpdate("toolbar"); }, r.prototype.is = function(t) { return this.get("type") == t; }, r.prototype.props = function() { return this.attributes; }, r.prototype.index = function() { var t = this.collection; return t ? t.indexOf(this) : 0; }, r.prototype.setDragMode = function(t) { return this.set("dmode", t); }, r.prototype.getDragMode = function() { return this.get("dmode") || ""; }, r.prototype.find = function(t) { var e, n = [], i = (e = this.view) === null || e === void 0 ? void 0 : e.$el.find(t); return i == null || i.each(function(l) { var f = i.eq(l).data("model"); f && n.push(f); }), n; }, r.prototype.findType = function(t) { var e = [], n = function(i) { return i.forEach(function(l) { l.is(t) && e.push(l), n(l.components()); }); }; return n(this.components()), e; }, r.prototype.closest = function(t) { var e, n = (e = this.view) === null || e === void 0 ? void 0 : e.$el.closest(t); return n != null && n.length ? n.data("model") : void 0; }, r.prototype.closestType = function(t) { for (var e = this.parent(); e && !e.is(t); ) e = e.parent(); return e; }, r.prototype.contains = function(t) { var e = !1; if (!t) return e; var n = function(i) { !e && i.forEach(function(l) { l === t && (e = !0), !e && n(l.components()); }); }; return n(this.components()), e; }, r.prototype.tagUpdated = function() { this.trigger("rerender"); }, r.prototype.replaceWith = function(t) { var e = this.collection, n = e.indexOf(this); return e.remove(this), e.add(t, { at: n }); }, r.prototype.attrUpdated = function(t, e, n) { var i = this; n === void 0 && (n = {}); var l = this.get("attributes"), f = l.class; f && this.setClass(f), delete l.class; var d = l.style; d && this.setStyle(d), delete l.style; var v = Be({}, this.previous("attributes")), h = (0, H.shallowDiff)(v, this.get("attributes")); (0, S.keys)(h).forEach(function(w) { return i.trigger("change:attributes:".concat(w), i, h[w], n); }); }, r.prototype.setAttributes = function(t, e) { return e === void 0 && (e = {}), this.set("attributes", Be({}, t), e), this; }, r.prototype.addAttributes = function(t, e) { return e === void 0 && (e = {}), this.setAttributes(Be(Be({}, this.getAttributes({ noClass: !0 })), t), e); }, r.prototype.removeAttributes = function(t, e) { t === void 0 && (t = []), e === void 0 && (e = {}); var n = Array.isArray(t) ? t : [t], i = this.getAttributes(); return n.map(function(l) { return delete i[l]; }), this.setAttributes(i, e); }, r.prototype.getStyle = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}); var n = this.em, i = (0, S.isString)(t) ? t : "", l = i ? e : t; if (n && n.getConfig().avoidInlineStyle && !l.inline) { var f = n.get("state"), d = n.Css.getIdRule(this.getId(), Be({ state: f }, l)); if (this.rule = d, d) return d.getStyle(i); } return a.prototype.getStyle.call(this, i); }, r.prototype.setStyle = function(t, e) { var n = this; t === void 0 && (t = {}), e === void 0 && (e = {}); var i = this, l = i.opt, f = i.em; if (f && f.getConfig().avoidInlineStyle && !l.temporary && !e.inline) { var d = this.get("style") || {}; t = (0, S.isString)(t) ? this.parseStyle(t) : t, t = Be(Be({}, t), d); var v = f.get("state"), h = f.Css, w = this.getStyle(e); this.rule = h.setIdRule(this.getId(), t, Be(Be({}, e), { state: v })); var C = (0, H.shallowDiff)(w, t); this.set("style", "", { silent: !0 }), (0, S.keys)(C).forEach(function(L) { return n.trigger("change:style:".concat(L)); }); } else t = a.prototype.setStyle.apply(this, arguments); return t; }, r.prototype.getAttributes = function(t) { t === void 0 && (t = {}); var e = this.em, n = [], i = Be({}, this.get("attributes")), l = e == null ? void 0 : e.Selectors, f = this.getId(); if (t.noClass ? delete i.class : (this.classes.forEach(function(h) { return n.push((0, S.isString)(h) ? h : h.get("name")); }), n.length && (i.class = n.join(" "))), !t.noStyle) { var d = this.get("style"); (0, H.isObject)(d) && !(0, H.isEmptyObj)(d) && (i.style = this.styleToString({ inline: 1 })); } if (!(0, S.has)(i, "id")) { var v = void 0; (function(h) { return h && h.getConfig().avoidInlineStyle; })(e) ? v = l && l.get(f, l.Selector.TYPE_ID) : (0, S.isEmpty)(this.getStyle()) || (v = 1), (this.__getSymbol() || this.__getSymbols()) && (v = 1), v && (i.id = f); } return i; }, r.prototype.addClass = function(t) { var e = this.em.Selectors.addClass(t); return this.classes.add(e); }, r.prototype.setClass = function(t) { return this.classes.reset(), this.addClass(t); }, r.prototype.removeClass = function(t) { var e = []; t = (0, S.isArray)(t) ? t : [t]; var n = this.classes, i = Jn.TYPE_CLASS; return t.forEach(function(l) { l.split(" ").forEach(function(f) { var d = n.where({ name: f, type: i })[0]; d && e.push(n.remove(d)); }); }), e; }, r.prototype.getClasses = function() { var t = this.getAttributes().class; return t ? t.split(" ") : []; }, r.prototype.__logSymbol = function(t, e, n) { n === void 0 && (n = {}); var i = this.__getSymbol(), l = this.__getSymbols(); (i || l) && this.em.log(t, { model: this, toUp: e, context: "symbols", opts: n }); }, r.prototype.__initSymb = function() { this.__symbReady || (this.on("change", this.__upSymbProps), this.__symbReady = !0); }, r.prototype.__isSymbol = function() { return (0, S.isArray)(this.get(qn)); }, r.prototype.__isSymbolOrInst = function() { return !(!this.__isSymbol() && !this.get(mn)); }, r.prototype.__isSymbolTop = function() { var t = this.parent(); return this.__isSymbolOrInst() && (!t || t && !t.__isSymbol() && !t.__getSymbol()); }, r.prototype.__isSymbolNested = function() { if (!this.__isSymbolOrInst() || this.__isSymbolTop()) return !1; var t = (this.__isSymbol() ? this : this.__getSymbol()).__getSymbTop(), e = this.__getSymbTop(); return (e.__isSymbol() ? e : e.__getSymbol()) !== t; }, r.prototype.__getAllById = function() { var t = this.em; return t ? t.Components.allById() : {}; }, r.prototype.__getSymbol = function() { var t = this.get(mn); if (t && (0, S.isString)(t)) { var e = this.__getAllById()[t]; e ? (t = e, this.set(mn, e)) : t = 0; } return t; }, r.prototype.__getSymbols = function() { var t = this, e = this.get(qn); return e && (0, S.isArray)(e) && (e.forEach(function(n, i) { n && (0, S.isString)(n) && (e[i] = t.__getAllById()[n]); }), e = e.filter(function(n) { return n && !(0, S.isString)(n); })), e; }, r.prototype.__isSymbOvrd = function(t) { t === void 0 && (t = ""); var e = this.get(Sr), n = t.split(":")[0], i = t !== n ? [t, n] : [t]; return e === !0 || (0, S.isArray)(e) && i.some(function(l) { return e.indexOf(l) >= 0; }); }, r.prototype.__getSymbToUp = function(t) { var e = this; t === void 0 && (t = {}); var n = [], i = t.changed; if (t.fromInstance || t.noPropagate || t.fromUndo || i && this.__isSymbOvrd(i)) return n; var l = this.__getSymbols() || [], f = this.__getSymbol(); return n = (f ? Zn([f], f.__getSymbols() || [], !0) : l).filter(function(d) { return d !== e; }).filter(function(d) { return !(i && d.__isSymbOvrd(i)); }); }, r.prototype.__getSymbTop = function(t) { for (var e = this, n = this.parent(t); n && (n.__isSymbol() || n.__getSymbol()); ) e = n, n = n.parent(t); return e; }, r.prototype.__upSymbProps = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this.changedAttributes() || {}, l = i.attributes || {}; if (delete i.status, delete i.open, delete i[qn], delete i[mn], delete i[Sr], delete i.attributes, delete l.id, (0, H.isEmptyObj)(l) || (i.attributes = l), !(0, H.isEmptyObj)(i)) { var f = this.__getSymbToUp(e); (0, S.keys)(i).map(function(d) { n.__isSymbOvrd(d) && delete i[d]; }), this.__logSymbol("props", f, { opts: e, changed: i }), f.forEach(function(d) { var v = Be({}, i); (0, S.keys)(v).map(function(h) { d.__isSymbOvrd(h) && delete v[h]; }), d.set(v, Be({ fromInstance: n }, e)); }); } }, r.prototype.__upSymbCls = function(t, e, n) { var i = this; n === void 0 && (n = {}); var l = this.__getSymbToUp(n); this.__logSymbol("classes", l, { opts: n }), l.forEach(function(f) { f.set("classes", i.get("classes"), { fromInstance: i }); }), this.__changesUp(n); }, r.prototype.__upSymbComps = function(t, e, n) { var i = this, l = n || e || {}, f = { fromInstance: l.fromInstance, fromUndo: l.fromUndo }, d = t.opt.temporary; if (n) if (n.add) { var v = [], h = !!this.__getSymbols(); if ((It = this.__getSymbToUp(Be(Be({}, f), { changed: "components:add" }))).length) { var w = t.__getSymbol(); v = (w ? w.__getSymbols() : t.__getSymbols()) || [], (v = Zn([], v, !0)).push(w || t); } !d && this.__logSymbol("add", It, { opts: n, addedInstances: v.map(function(se) { return se.cid; }), added: t.cid }), It.forEach(function(se) { var Me = se.__getSymbTop(), Ie = v.filter(function(Je) { var dn = Je.__getSymbTop({ prev: 1 }); return Me && dn && dn === Me; })[0] || t.clone({ symbol: !0, symbolInv: h }); se.append(Ie, Be({ fromInstance: i }, n)); }); } else { var C = t.__getSymbol(); if (C && !n.temporary && C.set(qn, C.__getSymbols().filter(function(se) { return se !== t; })), !t.__isSymbolTop()) { var L = "components:remove", F = n.index, q = t.parent(), et = Be({ fromInstance: t }, n), X = t.__isSymbolNested(), At = function(se) { var Me = se.parent(); Me && !Me.__isSymbOvrd(L) && se.remove(et); }; It = q != null && q.__isSymbOvrd(L) ? [] : t.__getSymbToUp(f), X && (It = q == null ? void 0 : q.__getSymbToUp(Be(Be({}, f), { changed: L })), At = function(se) { var Me = se.components().at(F); Me && Me.remove(Be({ fromInstance: q }, et)); }), !d && this.__logSymbol("remove", It, { opts: n, removed: t.cid, isSymbNested: X }), It.forEach(At); } } else { var It = this.__getSymbToUp(Be(Be({}, f), { changed: "components:reset" })), ie = t.models; this.__logSymbol("reset", It, { components: ie }), It.forEach(function(se) { var Me = ie.map(function(Ie) { return Ie.clone({ symbol: !0 }); }); se.components().reset(Me, Be({ fromInstance: i }, e)); }); } this.__changesUp(l); }, r.prototype.initClasses = function(t, e, n) { n === void 0 && (n = {}); var i = this.get("attributes").class || [], l = [this, "change:classes", this.initClasses], f = this.get("classes") || i, d = (0, S.isString)(f) ? f.split(" ") : f; this.stopListening.apply(this, l); var v = this.normalizeClasses(d), h = new Cr([]); return this.set("classes", h, n), h.add(v), h.on("add remove reset", this.__upSymbCls), this.listenTo.apply(this, l), this; }, r.prototype.initComponents = function() { var t = [this, "change:components", this.initComponents]; this.stopListening.apply(this, t); var e = new Wo([], this.opt); e.parent = this; var n = this.get("components"), i = !this.opt.avoidChildren; return this.set("components", e), i && n && e.add((0, S.isFunction)(n) ? n(this) : n, this.opt), e.on("add remove reset", this.__upSymbComps), this.listenTo.apply(this, t), this; }, r.prototype.initTraits = function(t) { var e = this.em, n = "change:traits"; this.off(n, this.initTraits), this.__loadTraits(); var i = Be({}, this.get("attributes")), l = this.traits; return l.each(function(f) { if (!f.get("changeProp")) { var d = f.get("name"), v = f.getInitValue(); d && v && (i[d] = v); } }), l.length && this.set("attributes", i), this.on(n, this.initTraits), t && e && e.trigger("component:toggled"), this; }, r.prototype.initScriptProps = function() { if (!this.opt.temporary) { var t = "script-props", e = ["change:".concat(t), this.initScriptProps]; this.off.apply(this, e); var n = this.previous(t) || [], i = this.get(t) || [], l = n.map(function(d) { return "change:".concat(d); }).join(" "), f = i.map(function(d) { return "change:".concat(d); }).join(" "); l && this.off(l, this.__scriptPropsChange), f && this.on(f, this.__scriptPropsChange), this.on.apply(this, e); } }, r.prototype.__scriptPropsChange = function(t, e, n) { n === void 0 && (n = {}), n.avoidStore || this.trigger("rerender"); }, r.prototype.append = function(t, e) { e === void 0 && (e = {}); var n = ((0, S.isArray)(t) ? Zn([], t, !0) : [t]).map(function(l) { return (0, S.isString)(l) || l.collection && l.collection.remove(l, { temporary: !0 }), l; }), i = this.components().add(n, e); return (0, S.isArray)(i) ? i : [i]; }, r.prototype.components = function(t, e) { e === void 0 && (e = {}); var n = this.get("components"); return (0, S.isUndefined)(t) ? n : (n.reset(void 0, e), t ? this.append(t, e) : []); }, r.prototype.getChildAt = function(t) { return this.components().at(t || 0) || void 0; }, r.prototype.getLastChild = function() { var t = this.components(); return t.at(t.length - 1) || null; }, r.prototype.empty = function(t) { return t === void 0 && (t = {}), this.components().reset(void 0, t), this; }, r.prototype.parent = function(t) { t === void 0 && (t = {}); var e = this.collection || t.prev && this.prevColl; return e ? e.parent : void 0; }, r.prototype.parents = function() { var t = this.parent(); return t ? [t].concat(t.parents()) : []; }, r.prototype.scriptUpdated = function() { this.set("scriptUpdated", 1); }, r.prototype.initToolbar = function() { var t = this.em, e = this, n = t && t.getConfig().stylePrefix || ""; if (!e.get("toolbar") && t) { var i = []; e.collection && i.push({ label: t.getIcon("arrowUp"), command: function(l) { return l.runCommand("core:component-exit", { force: 1 }); } }), e.get("draggable") && i.push({ attributes: { class: "".concat(n, "no-touch-actions"), draggable: !0 }, label: t.getIcon("move"), command: "tlb-move" }), e.get("copyable") && i.push({ label: t.getIcon("copy"), command: "tlb-clone" }), e.get("removable") && i.push({ label: t.getIcon("delete"), command: "tlb-delete" }), e.set("toolbar", i); } }, r.prototype.__loadTraits = function(t, e) { e === void 0 && (e = {}); var n = t || this.traits; if (!(n instanceof $o)) { n = (0, S.isFunction)(n) ? n(this) : n; var i = new $o([], this.opt); i.setTarget(this), n.length && (n.forEach(function(l) { return l.attributes && delete l.attributes.value; }), i.add(n)), this.set({ traits: i }, e); } return this; }, r.prototype.getTraits = function() { return this.__loadTraits(), Zn([], this.traits.models, !0); }, r.prototype.setTraits = function(t) { var e = (0, S.isArray)(t) ? t : [t]; return this.set({ traits: e }), this.getTraits(); }, r.prototype.getTrait = function(t) { return this.getTraits().filter(function(e) { return e.get("id") === t || e.get("name") === t; })[0] || null; }, r.prototype.updateTrait = function(t, e) { var n, i = this.getTrait(t); return i && i.set(e), (n = this.em) === null || n === void 0 || n.trigger("component:toggled"), this; }, r.prototype.getTraitIndex = function(t) { var e = this.getTrait(t); return e ? this.traits.indexOf(e) : -1; }, r.prototype.removeTrait = function(t) { var e, n = this, i = ((0, S.isArray)(t) ? t : [t]).map(function(d) { return n.getTrait(d); }), l = this.traits, f = i.length ? l.remove(i) : []; return (e = this.em) === null || e === void 0 || e.trigger("component:toggled"), (0, S.isArray)(f) ? f : [f]; }, r.prototype.addTrait = function(t, e) { var n; e === void 0 && (e = {}), this.__loadTraits(); var i = this.traits.add(t, e); return (n = this.em) === null || n === void 0 || n.trigger("component:toggled"), (0, S.isArray)(i) ? i : [i]; }, r.prototype.normalizeClasses = function(t) { var e = [], n = this.em, i = n == null ? void 0 : n.Selectors; return i ? t.models ? Zn([], t.models, !0) : (t.forEach(function(l) { return e.push(i.add(l)); }), e) : []; }, r.prototype.clone = function(t) { t === void 0 && (t = {}); var e = this.em, n = Be({}, this.attributes), i = Be({}, this.opt), l = this.getId(), f = e == null ? void 0 : e.Css; n.attributes = Be({}, n.attributes), delete n.attributes.id, n.components = [], n.classes = [], n.traits = [], this.__isSymbolTop() && (t.symbol = !0), this.get("components").each(function(L, F) { n.components[F] = L.clone(Be(Be({}, t), { _inner: 1 })); }), this.get("traits").each(function(L, F) { n.traits[F] = L.clone(); }), this.get("classes").each(function(L, F) { n.classes[F] = L.get("name"); }), n.status = "", i.collection = null; var d = new this.constructor(n, i), v = "#".concat(d.getId()); (f ? f.getRules("#".concat(l)) : []).forEach(function(L) { var F = L.clone(); F.set("selectors", [v]), f.getAll().add(F); }), d.set(qn, 0); var h = this.__getSymbol(), w = this.__getSymbols(); t.symbol || !h && !w ? h ? (h.set(qn, Zn(Zn([], h.__getSymbols(), !0), [d], !1)), d.__initSymb()) : t.symbol && (this.__isSymbol() ? (this.set(qn, Zn(Zn([], w, !0), [d], !1)), d.set(mn, this), d.__initSymb()) : t.symbolInv ? (this.set(qn, [d]), d.set(mn, this), [this, d].map(function(L) { return L.__initSymb(); })) : (d.set(qn, [this]), [this, d].map(function(L) { return L.__initSymb(); }), this.set(mn, d))) : (d.set(mn, 0), d.set(qn, 0)); var C = "component:clone"; return e && e.trigger(C, d), this.trigger(C, d), d; }, r.prototype.getName = function(t) { t === void 0 && (t = {}); var e = this.em, n = this.attributes, i = n.type, l = n.tagName, f = n.name, d = i || l, v = i ? "" : l, h = "domComponents.names.", w = f && (e == null ? void 0 : e.t("".concat(h).concat(f))), C = v && (e == null ? void 0 : e.t("".concat(h).concat(v))), L = e && (e.t("".concat(h).concat(i)) || e.t("".concat(h).concat(l))), F = this.get("custom-name"); return (t.noCustom ? "" : F) || w || f || C || (0, H.capitalize)(v) || L || (0, H.capitalize)(d); }, r.prototype.getIcon = function() { var t = this.get("icon"); return t ? t + " " : ""; }, r.prototype.toHTML = function(t) { t === void 0 && (t = {}); var e = this, n = [], i = t.tag || e.get("tagName"), l = e.get("void"), f = t.attributes, d = this.getAttrToHTML(); if (delete t.tag, f && ((0, S.isFunction)(f) ? d = f(e, d) || {} : (0, H.isObject)(f) && (d = f)), t.withProps) { var v = this.toJSON(); (0, S.forEach)(v, function(X, At) { At[0] !== "_" && ["classes", "attributes", "components"].indexOf(At) < 0 && (d["data-gjs-".concat(At)] = (0, S.isArray)(X) || (0, H.isObject)(X) ? JSON.stringify(X) : X); }); } for (var h in d) { var w = d[h]; if (!(0, S.isUndefined)(w) && w !== null) if ((0, S.isBoolean)(w)) w && n.push(h); else { var C = ""; if (t.altQuoteAttr && (0, S.isString)(w) && w.indexOf('"') >= 0) C = "'".concat(w.replace(/'/g, "'"), "'"); else { var L = (0, S.isString)(w) ? w.replace(/"/g, """) : w; C = '"'.concat(L, '"'); } n.push("".concat(h, "=").concat(C)); } } var F = n.length ? " ".concat(n.join(" ")) : "", q = e.getInnerHTML(t), et = "<".concat(i).concat(F).concat(l ? "/" : "", ">").concat(q); return !l && (et += "")), et; }, r.prototype.getInnerHTML = function(t) { return this.__innerHTML(t); }, r.prototype.__innerHTML = function(t) { t === void 0 && (t = {}); var e = this.components(); return e.length ? e.map(function(n) { return n.toHTML(t); }).join("") : this.get("content"); }, r.prototype.getAttrToHTML = function() { var t = this.getAttributes(); return delete t.style, t; }, r.prototype.toJSON = function(t) { t === void 0 && (t = {}); var e = _t.Model.prototype.toJSON.call(this, t); if (e.attributes = this.getAttributes(), delete e.attributes.class, delete e.toolbar, delete e.traits, delete e.status, delete e.open, delete e._undoexc, !t.fromUndo) { var n = e[mn], i = e[qn]; i && (0, S.isArray)(i) && (e[qn] = i.filter(function(l) { return l; }).map(function(l) { return l.getId ? l.getId() : l; })), n && !(0, S.isString)(n) && (e[mn] = n.getId()); } return this.em.getConfig().avoidDefaults && this.getChangedProps(e), e; }, r.prototype.getChangedProps = function(t) { var e = t || _t.Model.prototype.toJSON.apply(this), n = (0, S.result)(this, "defaults"); return (0, S.forEach)(n, function(i, l) { ["type"].indexOf(l) === -1 && e[l] === i && delete e[l]; }), (0, S.isEmpty)(e.type) && delete e.type, (0, S.forEach)(["attributes", "style"], function(i) { (0, S.isEmpty)(n[i]) && (0, S.isEmpty)(e[i]) && delete e[i]; }), (0, S.forEach)(["classes", "components"], function(i) { (!e[i] || (0, S.isEmpty)(n[i]) && !e[i].length) && delete e[i]; }), e; }, r.prototype.getId = function() { return (this.get("attributes") || {}).id || this.ccid || this.cid; }, r.prototype.setId = function(t, e) { var n = Be({}, this.get("attributes")); return n.id = t, this.set("attributes", n, e), this; }, r.prototype.getEl = function(t) { t === void 0 && (t = void 0); var e = this.getView(t); return e && e.el; }, r.prototype.getView = function(t) { var e = this.view, n = this.views; return t && (e = n.filter(function(i) { return i._getFrame() === t.view; })[0]), e; }, r.prototype.getCurrentView = function() { var t = (this.em.get("currentFrame") || {}).model; return this.getView(t); }, r.prototype.__getScriptProps = function() { var t = this.props(); return (this.get("script-props") || []).reduce(function(e, n) { return e[n] = t[n], e; }, {}); }, r.prototype.getScriptString = function(t) { var e = this, n = t || this.get("script") || ""; if (!n) return n; if (this.get("script-props")) n = n.toString().trim(); else { if (typeof n == "function") { var i = n.toString().trim(); n = (i = i.replace(/^function[\s\w]*\(\)\s?\{/, "").replace(/\}$/, "")).trim(); } var l = this.em.getConfig(), f = Bi(l.tagVarStart || "{[ "), d = Bi(l.tagVarEnd || " ]}"), v = new RegExp("".concat(f, "([\\w\\d-]*)").concat(d), "g"); n = n.replace(v, function(h, w) { e.scriptUpdated(); var C = e.attributes[w] || ""; return (0, S.isArray)(C) || typeof C == "object" ? JSON.stringify(C) : C; }); } return n; }, r.prototype.emitUpdate = function(t) { for (var e, n = [], i = 1; i < arguments.length; i++) n[i - 1] = arguments[i]; var l = this.em, f = qo + (t ? ":".concat(t) : ""), d = t && this.get(t); t && this.updated.apply(this, Zn([t, d, t && this.previous(t)], n, !1)), this.trigger.apply(this, Zn([f], n, !1)), l && l.trigger.apply(l, Zn([f, this], n, !1)), ["components", "classes"].indexOf(t) >= 0 && this.__propSelfToParent({ component: this, changed: (e = {}, e[t] = d, e), options: n[2] || n[1] || {} }); }, r.prototype.onAll = function(t) { return (0, S.isFunction)(t) && (t(this), this.components().forEach(function(e) { return e.onAll(t); })), this; }, r.prototype.forEachChild = function(t) { (0, S.isFunction)(t) && this.components().forEach(function(e) { t(e), e.forEachChild(t); }); }, r.prototype.remove = function(t) { var e = this; t === void 0 && (t = {}); var n = this.em, i = this.collection, l = function() { i && i.remove(e, Be(Be({}, t), { action: "remove-component" })), i || (e.components("", t), e.components().removeChildren(e, void 0, t)); }, f = Be({}, t); return [this, n].map(function(d) { return d.trigger("component:remove:before", e, l, f); }), !f.abort && l(), this; }, r.prototype.move = function(t, e) { if (e === void 0 && (e = {}), t) { var n = e.at, i = this.index(), l = t === this.parent(); l && (i === n || i === n - 1) || (l && n && n > i && (e.at = n - 1), this.remove({ temporary: 1 }), t.append(this, e), this.emitUpdate()); } return this; }, r.prototype.isInstanceOf = function(t) { var e, n, i = (n = (e = this.em) === null || e === void 0 ? void 0 : e.Components.getType(t)) === null || n === void 0 ? void 0 : n.model; return !!i && this instanceof i; }, r.prototype.isChildOf = function(t) { for (var e = (0, S.isString)(t), n = this.parent(); n; ) { if (e) { if (n.isInstanceOf(t)) return !0; } else if (n === t) return !0; n = n.parent(); } return !1; }, r.prototype.resetId = function(t) { var e = this.em, n = this.getId(); if (!n) return this; var i = r.createId(this); this.setId(i); var l = e == null ? void 0 : e.Css.getIdRule(n), f = l == null ? void 0 : l.get("selectors").at(0); return f == null || f.set("name", i), this; }, r.prototype._getStyleRule = function(t) { var e = (t === void 0 ? {} : t).id, n = this.em, i = e || this.getId(); return n == null ? void 0 : n.Css.getIdRule(i); }, r.prototype._getStyleSelector = function(t) { var e = this._getStyleRule(t); return e == null ? void 0 : e.get("selectors").at(0); }, r.prototype._idUpdated = function(t, e, n) { if (n === void 0 && (n = {}), !n.idUpdate) { var i = this.ccid, l = (this.get("attributes") || {}).id, f = (this.previous("attributes") || {}).id || i, d = r.getList(this); if (d[l] || !l && f) return this.setId(f, { idUpdate: !0 }); delete d[f], d[l] = this, this.ccid = l; var v = this._getStyleSelector({ id: f }); v && v.set({ name: l, label: l }); } }, r.getDefaults = function() { return (0, S.result)(this.prototype, "defaults"); }, r.isComponent = function(t) { return { tagName: (0, H.toLowerCase)(t.tagName) }; }, r.ensureInList = function(t) { var e = r.getList(t), n = t.getId(), i = e[n]; if (i) { if (i !== t) { var l = r.getIncrementId(n, e); t.setId(l), e[l] = t; } } else e[n] = t; t.components().forEach(function(f) { return r.ensureInList(f); }); }, r.createId = function(t, e) { e === void 0 && (e = {}); var n, i = r.getList(t), l = e.idMap, f = l === void 0 ? {} : l, d = t.get("attributes").id; return d ? (n = r.getIncrementId(d, i, e), t.setId(n), d !== n && (f[d] = n)) : n = r.getNewId(i), i[n] = t, n; }, r.getNewId = function(t) { for (var e = Object.keys(t).length.toString().length + 2, n = (Math.random() + 1.1).toString(36).slice(-e), i = "i".concat(n); t[i]; ) i = r.getNewId(t); return i; }, r.getIncrementId = function(t, e, n) { n === void 0 && (n = {}); var i = n.keepIds, l = 1, f = t; if ((i === void 0 ? [] : i).indexOf(t) < 0) for (; e[f]; ) l++, f = "".concat(t, "-").concat(l); return f; }, r.getList = function(t) { var e = t.opt, n = e === void 0 ? {} : e, i = n.domc, l = n.em, f = i || (l == null ? void 0 : l.Components); return f ? f.componentsById : {}; }, r.checkId = function(t, e, n, i) { e === void 0 && (e = []), n === void 0 && (n = {}), i === void 0 && (i = {}); var l = (0, S.isArray)(t) ? t : [t], f = i.keepIds, d = f === void 0 ? [] : f; l.forEach(function(v) { v.attributes; var h = v.attributes, w = h === void 0 ? {} : h, C = v.components, L = w.id; if (L && n[L] && d.indexOf(L) < 0) { var F = r.getIncrementId(L, n); w.id = F, (0, S.isArray)(e) && e.forEach(function(q) { var et = q.selectors; et.forEach(function(X, At) { X === "#".concat(L) && (et[At] = "#".concat(F)); }); }); } C && r.checkId(C, e, n, i); }); }, r; }(_r); const yn = Wi; var Or = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), $i = function(a) { function r() { var t = a !== null && a.apply(this, arguments) || this; return t.compView = kn, t; } return Or(r, a), r.prototype.initialize = function(t) { this.opts = t || {}, this.config = t.config || {}, this.em = this.config.em; var e = this.collection; this.listenTo(e, "add", this.addTo), this.listenTo(e, "reset", this.resetChildren), this.listenTo(e, "remove", this.removeChildren); }, r.prototype.removeChildren = function(t, e, n) { var i = this; n === void 0 && (n = {}), t.views.forEach(function(l) { if (l) { var f = l.childrenView, d = l.scriptContainer; f && f.stopListening(), (0, Ne.L_)(d), l.remove.apply(l); } }), t.components().forEach(function(l) { return i.removeChildren(l, e, n); }); }, r.prototype.addTo = function(t, e, n) { n === void 0 && (n = {}); var i = this.em, l = this.collection.indexOf(t); if (this.addToCollection(t, null, l), i && !n.temporary) { var f = function(d) { i.trigger("component:add", d), d.components().forEach(function(v) { return f(v); }); }; f(t); } }, r.prototype.addToCollection = function(t, e, n) { for (var i = this, l = i.config, f = i.opts, d = i.em, v = e || null, h = l.frameView, w = (h == null ? void 0 : h.model) && t.getView(h.model), C = f.componentTypes || (d == null ? void 0 : d.Components.getTypes()), L = t.get("type") || "default", F = this.compView, q = 0; q < C.length; q++) if (C[q].id == L) { F = C[q].view; break; } var et, X = w || new F({ model: t, config: l, componentTypes: C }); try { et = X.render().el; } catch (se) { et = document.createTextNode(""), d.logError(se); } if (v) v.appendChild(et); else { var At = this.parentEl, It = At.childNodes; if ((0, S.isUndefined)(n)) At.appendChild(et); else { var ie = It.length == n; ie && n--, ie || !It.length ? At.appendChild(et) : At.insertBefore(et, It[n]); } } return t.opt.temporary || d == null || d.trigger("component:mount", t), et; }, r.prototype.resetChildren = function(t, e) { var n = this, i = (e === void 0 ? {} : e).previousModels, l = i === void 0 ? [] : i; this.parentEl.innerHTML = "", l.forEach(function(f) { return n.removeChildren(f, n.collection); }), t.each(function(f) { return n.addToCollection(f); }); }, r.prototype.render = function(t) { var e = this, n = this.el, i = document.createDocumentFragment(); return this.parentEl = t || this.el, this.collection.each(function(l) { return e.addToCollection(l, i); }), n.innerHTML = "", n.appendChild(i), this; }, r; }(k.G7); const gi = $i; var pr = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Nr = function() { return Nr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Nr.apply(this, arguments); }, Ir = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return pr(r, a), r.prototype.className = function() { return this.getClasses(); }, r.prototype.tagName = function() { return this.model.get("tagName"); }, r.prototype.initialize = function(t) { t === void 0 && (t = {}); var e = this.model, n = t.config || {}, i = n.em, l = e.opt || {}, f = this.$el, d = this.el; this.opts = t, this.modelOpt = l, this.config = n, this.em = i, this.pfx = n.stylePrefix || "", this.ppfx = n.pStylePrefix || "", this.attr = e.get("attributes"), this.classe = this.attr.class || [], this.listenTo(e, "change:style", this.updateStyle), this.listenTo(e, "change:attributes", this.renderAttributes), this.listenTo(e, "change:highlightable", this.updateHighlight), this.listenTo(e, "change:status change:locked", this.updateStatus), this.listenTo(e, "change:script rerender", this.reset), this.listenTo(e, "change:content", this.updateContent), this.listenTo(e, "change", this.handleChange), this.listenTo(e, "active", this.onActive), this.listenTo(e, "disable", this.onDisable), f.data("model", e), (0, H.setViewEl)(d, this), e.view = this, this._getFrame() && e.views.push(this), this.initClasses(), this.initComponents({ avoidRender: !0 }), this.events = Nr(Nr({}, this.constructor.getEvents()), { dragstart: "handleDragStart" }), this.delegateEvents(), !l.temporary && this.init(this._clbObj()); }, r.prototype.__isDraggable = function() { var t = this.model, e = this.config, n = t.attributes.draggable; return e.draggableComponents && n; }, r.prototype._clbObj = function() { var t = this, e = t.em, n = t.model, i = t.el; return { editor: e == null ? void 0 : e.getEditor(), model: n, el: i }; }, r.prototype.init = function(t) { }, r.prototype.removed = function(t) { }, r.prototype.onRender = function(t) { }, r.prototype.onActive = function(t) { }, r.prototype.onDisable = function() { }, r.prototype.remove = function() { var t; a.prototype.remove.call(this); var e = this.model, n = this.$el, i = e.views, l = this._getFrame() || {}; return e.components().forEach(function(f) { var d = f.getView(l.model); d == null || d.remove(); }), (t = this.childrenView) === null || t === void 0 || t.remove(), i.splice(i.indexOf(this), 1), this.removed(this._clbObj()), n.data({ model: "", collection: "", view: "" }), this; }, r.prototype.handleDragStart = function(t) { if (!this.__isDraggable()) return !1; t.stopPropagation(), t.preventDefault(), this.em.Commands.run("tlb-move", { target: this.model, event: t }); }, r.prototype.initClasses = function() { var t = this.model, e = "change:classes", n = t.get("classes"); n instanceof Cr && (this.stopListening(t, e, this.initClasses), this.listenTo(t, e, this.initClasses), this.listenTo(n, "add remove change", this.updateClasses), n.length && this.importClasses()); }, r.prototype.initComponents = function(t) { t === void 0 && (t = {}); var e = this, n = e.model, i = e.$el, l = e.childrenView, f = n.get("components"), d = [n, "change:components", this.initComponents]; f instanceof Wo && (i.data("collection", f), l && l.remove(), this.stopListening.apply(this, d), !t.avoidRender && this.renderChildren(), this.listenTo.apply(this, d)); }, r.prototype.handleChange = function() { var t = this.model, e = (0, S.keys)(t.changed); if (e.length !== 1 || e[0] !== "status") for (var n in t.emitUpdate(), t.changed) t.emitUpdate(n); }, r.prototype.importClasses = function() { var t = this.em.Selectors; t && this.model.classes.each(function(e) { t.add(e.get("name")); }); }, r.prototype.updateStatus = function(t) { t === void 0 && (t = {}); var e = this, n = e.em, i = e.el, l = e.ppfx, f = e.model, d = n == null ? void 0 : n.Canvas.getConfig().extHl, v = f.get("status"), h = "".concat(l, "selected"), w = "".concat(h, "-parent"), C = "".concat(l, "freezed"), L = "".concat(l, "hovered"), F = "".concat(l, "no-pointer"), q = [h, w, C, L, F], et = d && !t.noExtHl ? "" : h; this.$el.removeClass(q.join(" ")); var X = [i.getAttribute("class") || ""]; switch (v) { case "selected": X.push(et); break; case "selected-parent": X.push(w); break; case "freezed": X.push(C); break; case "freezed-selected": X.push(C, et); break; case "hovered": !t.avoidHover && X.push(L); } f.get("locked") && X.push(F); var At = X.filter(Boolean).join(" "); At && i.setAttribute("class", At); }, r.prototype.updateHighlight = function() { var t = this.model, e = t.get("textable"), n = t.get("highlightable") && (e || !t.isChildOf("text")); this.setAttribute("data-gjs-highlightable", !!n || ""); }, r.prototype.updateStyle = function(t, e, n) { n === void 0 && (n = {}); var i = this.model, l = this.em; if (l && l.getConfig().avoidInlineStyle && !n.inline) { var f = i.getStyle(); !(0, S.isEmpty)(f) && i.setStyle(f); } else this.setAttribute("style", i.styleToString(n)); }, r.prototype.updateClasses = function() { var t = this.model.classes.pluck("name").join(" "); this.setAttribute("class", t), this.updateStatus(), this.onAttrUpdate(); }, r.prototype.setAttribute = function(t, e) { var n = this.$el; e ? n.attr(t, e) : n.removeAttr(t); }, r.prototype.getClasses = function() { return this.model.getClasses().join(" "); }, r.prototype.updateAttributes = function() { var t = [], e = this, n = e.model, i = e.$el, l = e.el, f = n.attributes, d = f.textable, v = f.type, h = Nr(Nr({ id: n.getId(), "data-gjs-type": v || "default" }, this.__isDraggable() && { draggable: !0 }), d && { contenteditable: "false" }); (0, S.each)(l.attributes, function(C) { return t.push(C.nodeName); }), t.forEach(function(C) { return i.removeAttr(C); }), this.updateStyle(), this.updateHighlight(); var w = Nr(Nr({}, h), n.getAttributes()); (0, S.keys)(w).forEach(function(C) { return w[C] === !1 && delete w[C]; }), i.attr(w); }, r.prototype.updateContent = function() { var t = this.model.get("content"), e = this.model.components().length; this.getChildrenContainer().innerHTML = e ? "" : t; }, r.prototype.prevDef = function(t) { t.preventDefault(); }, r.prototype.updateScript = function() { var t = this.model, e = this.em; t.get("script") && (e == null || e.Canvas.getCanvasView().updateScript(this)); }, r.prototype.getChildrenContainer = function() { var t = this.el; return typeof this.getChildrenSelector == "function" ? t = this.el.querySelector(this.getChildrenSelector()) : this.getTemplate, t; }, r.prototype.getOffsetRect = function() { var t = {}, e = this.el, n = 0, i = 0, l = function(f) { var d = f.offsetParent; d ? (n += d.offsetTop, i += d.offsetLeft, l(d)) : (t.top = e.offsetTop + n, t.left = e.offsetLeft + i, t.bottom = t.top + e.offsetHeight, t.right = t.left + e.offsetWidth); }; return l(e), t; }, r.prototype.isInViewport = function(t) { var e, n = (t === void 0 ? {} : t).rect, i = this.el.ownerDocument, l = i.body, f = (e = i.defaultView) === null || e === void 0 ? void 0 : e.frameElement, d = n || this.getOffsetRect(), v = d.top, h = d.left, w = this._getFrame().getOffsetRect(); return v >= w.scrollTop && h >= w.scrollLeft && v <= w.scrollBottom && h <= (f == null ? void 0 : f.offsetWidth) + l.scrollLeft; }, r.prototype.scrollIntoView = function(t) { var e; t === void 0 && (t = {}); var n = this.getOffsetRect(); if (!this.isInViewport({ rect: n }) || t.force) { var i = this.el; t.behavior !== "smooth" ? (e = i.ownerDocument.defaultView) === null || e === void 0 || e.scrollTo(0, n.top) : i.scrollIntoView(Nr({ behavior: "smooth", block: "nearest" }, t)); } }, r.prototype.reset = function() { var t = this.el; this.el = "", this._ensureElement(), this._setData(), (0, Ne.dL)(t, this.el), this.render(); }, r.prototype._setData = function() { var t = this.model, e = t.components(); this.$el.data({ model: t, collection: e, view: this }); }, r.prototype._getFrame = function() { var t; return (t = this.em) === null || t === void 0 ? void 0 : t.get("Canvas").config.frameView; }, r.prototype.renderChildren = function() { this.updateContent(); var t = this.getChildrenContainer(), e = this.childrenView || new gi({ collection: this.model.get("components"), config: this.config, componentTypes: this.opts.componentTypes }); e.render(t), this.childrenView = e; for (var n = Array.prototype.slice.call(e.el.childNodes), i = 0, l = n.length; i < l; i++) t.appendChild(n.shift()); }, r.prototype.renderAttributes = function() { this.updateAttributes(), this.updateClasses(); }, r.prototype.onAttrUpdate = function() { }, r.prototype.render = function() { return this.renderAttributes(), this.modelOpt.temporary || (this.renderChildren(), this.updateScript(), (0, H.setViewEl)(this.el, this), this.postRender()), this; }, r.prototype.postRender = function() { this.modelOpt.temporary || this.onRender(this._clbObj()); }, r.getEvents = function() { return (0, S.result)(this.prototype, "events"); }, r; }(k.G7); const kn = Ir; var Fr = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const vi = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Fr(r, a), r.prototype.tagName = function() { return "div"; }, r; }(kn); var Rs = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Vr = function() { return Vr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Vr.apply(this, arguments); }; const Hs = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Rs(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Vr(Vr({}, a.prototype.defaults), { type: "cell", tagName: "td", draggable: ["tr"] }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t) { return ["td", "th"].indexOf((0, H.toLowerCase)(t.tagName)) >= 0; }, r; }(yn); var ja = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Ma = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return ja(r, a), r; }(kn); var qi = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Go = function() { return Go = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Go.apply(this, arguments); }, Gi = "tr"; const La = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return qi(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Go(Go({}, a.prototype.defaults), { tagName: Gi, draggable: ["thead", "tbody", "tfoot"], droppable: ["th", "td"] }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === Gi; }, r; }(yn); var Da = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Na = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Da(r, a), r; }(kn); var El = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), To = function() { return To = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, To.apply(this, arguments); }, Ki = "table"; const Yi = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return El(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return To(To({}, a.prototype.defaults), { type: Ki, tagName: Ki, droppable: ["tbody", "thead", "tfoot"] }); }, enumerable: !1, configurable: !0 }), r.prototype.initialize = function(t, e) { a.prototype.initialize.call(this, t, e); var n = this.get("components"); !n.length && n.add({ type: "tbody" }); }, r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === Ki; }, r; }(yn), so = kn.extend({ events: {} }); var Tr = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), mi = function() { return mi = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, mi.apply(this, arguments); }, Xi = "tbody"; const Ji = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Tr(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return mi(mi({}, a.prototype.defaults), { type: Xi, tagName: Xi, draggable: ["table"], droppable: ["tr"], columns: 1, rows: 1 }); }, enumerable: !1, configurable: !0 }), r.prototype.initialize = function(t, e) { a.prototype.initialize.call(this, t, e); var n = this.get("components"), i = this.get("columns"), l = this.get("rows"); if (!n.length) { for (var f = []; l--; ) { for (var d = [], v = i; v--; ) d.push({ type: "cell", classes: ["cell"] }); f.push({ type: "row", classes: ["row"], components: d }); } n.add(f); } }, r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === Xi; }, r; }(yn); var ko = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), bn = function() { return bn = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, bn.apply(this, arguments); }, Po = "thead"; const zs = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return ko(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return bn(bn({}, a.prototype.defaults), { type: Po, tagName: Po }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === Po; }, r; }(Ji); var Ko = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const yi = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ko(r, a), r; }(kn); var Us = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Ia = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Us(r, a), r; }(kn); var Zi = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Yo = function() { return Yo = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Yo.apply(this, arguments); }, bi = "tfoot"; const Bs = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Zi(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Yo(Yo({}, a.prototype.defaults), { type: bi, tagName: bi }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === bi; }, r; }(Ji); var Fa = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Qi = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Fa(r, a), r; }(kn); var Al = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), _ = function() { return _ = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, _.apply(this, arguments); }, A = 'xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 24 24" style="fill: rgba(0,0,0,0.15); transform: scale(0.75)"', K = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Al(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return _(_({}, a.prototype.defaults), { type: "image", tagName: "img", void: !0, droppable: 0, editable: 1, highlightable: 0, resizable: { ratioDefault: 1 }, traits: ["alt"], src: " `), fallback: " `), file: "" }); }, enumerable: !1, configurable: !0 }), r.prototype.initialize = function(t, e) { a.prototype.initialize.call(this, t, e); var n = this.get("attributes").src; n && (0, H.buildBase64UrlFromSvg)((0, S.result)(this, "defaults").src) !== n && this.set("src", n, { silent: !0 }); }, r.prototype.initToolbar = function() { a.prototype.initToolbar.call(this); var t = this.em; if (t) { var e = "image-editor"; if (t.Commands.has(e)) { for (var n = !1, i = this.get("toolbar"), l = 0; l < i.length; l++) if (i[l].command === "image-editor") { n = !0; break; } n || (i.push({ attributes: { class: "fa fa-pencil" }, command: e }), this.set("toolbar", i)); } } }, r.prototype.getAttrToHTML = function() { var t = a.prototype.getAttrToHTML.call(this), e = this.getSrcResult(); return e && (t.src = e), t; }, r.prototype.getSrcResult = function(t) { t === void 0 && (t = {}); var e = this.get(t.fallback ? "fallback" : "src") || "", n = e; return e && e.substr(0, 4) === "= 0) && delete n.editable; }); } return n; }, r; }(Ao); const bp = yp; var Hc = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), es = function() { return es = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, es.apply(this, arguments); }, Xo = function(a, r, t, e) { return new (t || (t = Promise))(function(n, i) { function l(v) { try { d(e.next(v)); } catch (h) { i(h); } } function f(v) { try { d(e.throw(v)); } catch (h) { i(h); } } function d(v) { var h; v.done ? n(v.value) : (h = v.value, h instanceof t ? h : new t(function(w) { w(h); })).then(l, f); } d((e = e.apply(a, r || [])).next()); }); }, $s = function(a, r) { var t, e, n, i, l = { label: 0, sent: function() { if (1 & n[0]) throw n[1]; return n[1]; }, trys: [], ops: [] }; return i = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() { return this; }), i; function f(d) { return function(v) { return function(h) { if (t) throw new TypeError("Generator is already executing."); for (; i && (i = 0, h[0] && (l = 0)), l; ) try { if (t = 1, e && (n = 2 & h[0] ? e.return : h[0] ? e.throw || ((n = e.return) && n.call(e), 0) : e.next) && !(n = n.call(e, h[1])).done) return n; switch (e = 0, n && (h = [2 & h[0], n.value]), h[0]) { case 0: case 1: n = h; break; case 4: return l.label++, { value: h[1], done: !1 }; case 5: l.label++, e = h[1], h = [0]; continue; case 7: h = l.ops.pop(), l.trys.pop(); continue; default: if (n = l.trys, !((n = n.length > 0 && n[n.length - 1]) || h[0] !== 6 && h[0] !== 2)) { l = 0; continue; } if (h[0] === 3 && (!n || h[1] > n[0] && h[1] < n[3])) { l.label = h[1]; break; } if (h[0] === 6 && l.label < n[1]) { l.label = n[1], n = h; break; } if (n && l.label < n[2]) { l.label = n[2], l.ops.push(h); break; } n[2] && l.ops.pop(), l.trys.pop(); continue; } h = r.call(a, l); } catch (w) { h = [6, w], e = 0; } finally { t = n = 0; } if (5 & h[0]) throw h[1]; return { value: h[0] ? h[1] : void 0, done: !0 }; }([d, v]); }; } }, zc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Hc(r, a), r.prototype.events = function() { return { dblclick: "onActive", input: "onInput" }; }, r.prototype.initialize = function(t) { a.prototype.initialize.call(this, t), (0, S.bindAll)(this, "disableEditing", "onDisable"); var e = this.model, n = this.em; this.listenTo(e, "focus", this.onActive), this.listenTo(e, "change:content", this.updateContentText), this.listenTo(e, "sync:content", this.syncContent), this.rte = n == null ? void 0 : n.RichTextEditor; }, r.prototype.updateContentText = function(t, e, n) { n === void 0 && (n = {}), !n.fromDisable && this.disableEditing(); }, r.prototype.canActivate = function() { var t, e = this, n = e.model, i = e.rteEnabled, l = e.em, f = (l == null ? void 0 : l.getEditing()) === n, d = !0, v = !1; if ((i || !n.get("editable") || f || (v = n.isChildOf("text"))) && (d = !1, v && !n.get("textable"))) { for (var h = n.parent(); h && !h.isInstanceOf("text"); ) h = h.parent(); h && h.get("editable") ? t = h : d = !0; } return { result: d, delegate: t }; }, r.prototype.onActive = function(t) { var e, n; return Xo(this, void 0, void 0, function() { var i, l, f, d, v, h, w, C, L; return $s(this, function(F) { switch (F.label) { case 0: return l = (i = this).rte, f = i.em, d = this.canActivate(), v = d.result, h = d.delegate, v ? ((n = t == null ? void 0 : t.stopPropagation) === null || n === void 0 || n.call(t), w = this, [4, this.getContent()]) : (h && ((e = t == null ? void 0 : t.stopPropagation) === null || e === void 0 || e.call(t), f.setSelected(h), h.trigger("active", t)), [2]); case 1: if (w.lastContent = F.sent(), !l) return [3, 5]; F.label = 2; case 2: return F.trys.push([2, 4, , 5]), C = this, [4, l.enable(this, this.activeRte, { event: t })]; case 3: return C.activeRte = F.sent(), [3, 5]; case 4: return L = F.sent(), f.logError(L), [3, 5]; case 5: return this.toggleEvents(!0), [2]; } }); }); }, r.prototype.onDisable = function() { this.disableEditing(); }, r.prototype.disableEditing = function(t) { return t === void 0 && (t = {}), Xo(this, void 0, void 0, function() { var e, n, i, l, f, d, v, h; return $s(this, function(w) { switch (w.label) { case 0: if (n = (e = this).model, i = e.rte, l = e.activeRte, f = e.em, d = n && n.get("editable"), !i) return [3, 8]; w.label = 1; case 1: return w.trys.push([1, 3, , 4]), [4, i.disable(this, l)]; case 2: return w.sent(), [3, 4]; case 3: return v = w.sent(), f.logError(v), [3, 4]; case 4: return (h = d) ? [4, this.getContent()] : [3, 6]; case 5: h = w.sent() !== this.lastContent, w.label = 6; case 6: return h ? [4, this.syncContent(t)] : [3, 8]; case 7: w.sent(), this.lastContent = "", w.label = 8; case 8: return this.toggleEvents(), [2]; } }); }); }, r.prototype.getContent = function() { return Xo(this, void 0, void 0, function() { var t, e, n, i; return $s(this, function(l) { switch (l.label) { case 0: return e = (t = this).rte, n = t.activeRte, i = "", e ? [4, e.getContent(this, n)] : [3, 2]; case 1: i = l.sent(), l.label = 2; case 2: return [2, i]; } }); }); }, r.prototype.syncContent = function(t) { return t === void 0 && (t = {}), Xo(this, void 0, void 0, function() { var e, n, i, l, f, d; return $s(this, function(v) { switch (v.label) { case 0: return n = (e = this).model, i = e.rte, e.rteEnabled || t.force ? [4, this.getContent()] : [2]; case 1: return l = v.sent(), f = n.components(), d = es({ fromDisable: 1 }, t), n.set("content", "", d), i != null && i.customRte && !i.customRte.parseContent ? (f.length && f.reset(void 0, es(es({}, t), { keepIds: io(f) })), n.set("content", l, d)) : f.resetFromString(l, t), [2]; } }); }); }, r.prototype.insertComponent = function(t, e) { var n; e === void 0 && (e = {}); var i = this.model, l = this.el.ownerDocument.getSelection(); if (l != null && l.rangeCount) { var f = l.getRangeAt(0), d = f.startContainer, v = f.startOffset, h = (0, H.getModel)(d), w = []; if (h && (!((n = h.is) === null || n === void 0) && n.call(h, "textnode"))) { var C = h.collection; C.forEach(function(q) { if (q === h) { var et = "textnode", X = q.get("content") || ""; w.push({ type: et, content: X.slice(0, v) }), w.push(t), w.push({ type: et, content: X.slice(v) }); } else w.push(q); }); var L = w.filter(Boolean), F = L.indexOf(t); return C.reset(L, e), C.at(F); } } return i.append(t, e); }, r.prototype.onInput = function() { var t = this.em, e = "component", n = ["".concat(e, ":update"), "".concat(e, ":input")].join(" "); t && t.trigger(n, this.model); }, r.prototype.disablePropagation = function(t) { t.stopPropagation(); }, r.prototype.toggleEvents = function(t) { var e = this, n = e.em, i = e.model, l = e.$el, f = { on: H.on, off: H.off }, d = t ? "on" : "off"; n.setEditing(!!t && this), this.rteEnabled = !!t; var v = [this.el.ownerDocument, document]; if (f.off(v, "mousedown", this.onDisable), f[d](v, "mousedown", this.onDisable), n[d]("toolbar:run:before", this.onDisable), i && (i[d]("removed", this.onDisable), i.trigger("rte:".concat(t ? "enable" : "disable"))), l == null || l.off("mousedown", this.disablePropagation), l && l[d]("mousedown", this.disablePropagation), this.config.draggableComponents) for (var h = this.el; h; ) h.draggable = !t, (h = h.parentNode) && h.tagName == "BODY" && (h = 0); }, r; }(kn); const Va = zc; var Ra = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const jl = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ra(r, a), r.prototype.render = function() { return a.prototype.render.call(this), this.el.addEventListener("click", this.prevDef, !0), this; }, r; }(Va); var Ha = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), kr = function() { return kr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, kr.apply(this, arguments); }, za = "label"; const Ml = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ha(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return kr(kr({}, a.prototype.defaults), { type: za, tagName: za, traits: ["id", "title", "for"] }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === za; }, r; }(Ao); var Ll = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Uc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ll(r, a), r; }(jl); var Bc = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ns = function() { return ns = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ns.apply(this, arguments); }, Dl = "video", rs = "yt", os = "vi", ao = "ytnc", Jo = function(a) { return a && a !== "0"; }, Nl = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Bc(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return ns(ns({}, a.prototype.defaults), { type: Dl, tagName: Dl, videoId: "", void: !1, provider: "so", ytUrl: "https://www.youtube.com/embed/", ytncUrl: "https://www.youtube-nocookie.com/embed/", viUrl: "https://player.vimeo.com/video/", loop: 0, poster: "", muted: 0, autoplay: 0, controls: 1, color: "", list: "", rel: 1, modestbranding: 0, sources: [], attributes: { allowfullscreen: "allowfullscreen" } }); }, enumerable: !1, configurable: !0 }), r.prototype.initialize = function(t, e) { this.em = e.em, this.get("src") && this.parseFromSrc(), this.updateTraits(), this.listenTo(this, "change:provider", this.updateTraits), this.listenTo(this, "change:videoId change:provider", this.updateSrc), a.prototype.initialize.call(this, t, e); }, r.prototype.updateTraits = function() { var t, e = this.em, n = "iframe"; switch (this.get("provider")) { case rs: case ao: t = this.getYoutubeTraits(); break; case os: t = this.getVimeoTraits(); break; default: n = "video", t = this.getSourceTraits(); } this.set({ tagName: n }, { silent: !0 }), this.set({ traits: t }), e.get("ready") && e.trigger("component:toggled"); }, r.prototype.parseFromSrc = function() { var t = this.get("provider"), e = this.parseUri(this.get("src")), n = e.query; switch (t) { case rs: case ao: case os: this.set("videoId", e.pathname.split("/").pop()), n.list && this.set("list", n.list), Jo(n.autoplay) && this.set("autoplay", 1), Jo(n.loop) && this.set("loop", 1), parseInt(n.controls) === 0 && this.set("controls", 0), Jo(n.color) && this.set("color", n.color), n.rel === "0" && this.set("rel", 0), n.modestbranding === "1" && this.set("modestbranding", 1); } }, r.prototype.updateSrc = function() { var t = ""; switch (this.get("provider")) { case rs: t = this.getYoutubeSrc(); break; case ao: t = this.getYoutubeNoCookieSrc(); break; case os: t = this.getVimeoSrc(); } this.set({ src: t }); }, r.prototype.getAttrToHTML = function() { var t = a.prototype.getAttrToHTML.call(this); switch (this.get("provider")) { case rs: case ao: case os: break; default: this.get("loop") && (t.loop = "loop"), this.get("autoplay") && (t.autoplay = "autoplay"), this.get("controls") && (t.controls = "controls"); } return t; }, r.prototype.getProviderTrait = function() { return { type: "select", label: "Provider", name: "provider", changeProp: !0, options: [{ value: "so", name: "HTML5 Source" }, { value: rs, name: "Youtube" }, { value: ao, name: "Youtube (no cookie)" }, { value: os, name: "Vimeo" }] }; }, r.prototype.getSourceTraits = function() { return [this.getProviderTrait(), { label: "Source", name: "src", placeholder: "eg. ./media/video.mp4", changeProp: !0 }, { label: "Poster", name: "poster", placeholder: "eg. ./media/image.jpg" }, this.getAutoplayTrait(), this.getLoopTrait(), this.getControlsTrait()]; }, r.prototype.getYoutubeTraits = function() { return [this.getProviderTrait(), { label: "Video ID", name: "videoId", placeholder: "eg. jNQXAC9IVRw", changeProp: !0 }, this.getAutoplayTrait(), this.getLoopTrait(), this.getControlsTrait(), { type: "checkbox", label: "Related", name: "rel", changeProp: !0 }, { type: "checkbox", label: "Modest", name: "modestbranding", changeProp: !0 }]; }, r.prototype.getVimeoTraits = function() { return [this.getProviderTrait(), { label: "Video ID", name: "videoId", placeholder: "eg. 123456789", changeProp: !0 }, { label: "Color", name: "color", placeholder: "eg. FF0000", changeProp: !0 }, this.getAutoplayTrait(), this.getLoopTrait()]; }, r.prototype.getAutoplayTrait = function() { return { type: "checkbox", label: "Autoplay", name: "autoplay", changeProp: !0 }; }, r.prototype.getLoopTrait = function() { return { type: "checkbox", label: "Loop", name: "loop", changeProp: !0 }; }, r.prototype.getControlsTrait = function() { return { type: "checkbox", label: "Controls", name: "controls", changeProp: !0 }; }, r.prototype.getYoutubeSrc = function() { var t = this.get("videoId"), e = this.get("ytUrl"), n = this.get("list"); return e += t + (t.indexOf("?") < 0 ? "?" : ""), e += n ? "&list=".concat(n) : "", e += this.get("autoplay") ? "&autoplay=1" : "", e += this.get("controls") ? "" : "&controls=0&showinfo=0", e += this.get("loop") ? "&loop=1&playlist=".concat(t) : "", e += this.get("rel") ? "" : "&rel=0", e += this.get("modestbranding") ? "&modestbranding=1" : ""; }, r.prototype.getYoutubeNoCookieSrc = function() { var t = this.getYoutubeSrc(); return t = t.replace(this.get("ytUrl"), this.get("ytncUrl")); }, r.prototype.getVimeoSrc = function() { var t = this.get("viUrl"); return t += this.get("videoId") + "?", t += this.get("autoplay") ? "&autoplay=1" : "", t += this.get("loop") ? "&loop=1" : "", t += this.get("controls") ? "" : "&title=0&portrait=0&badge=0", t += this.get("color") ? "&color=" + this.get("color") : ""; }, r.isComponent = function(t) { var e = t.tagName, n = t.src, i = /youtube\.com\/embed/.test(n), l = /youtube-nocookie\.com\/embed/.test(n), f = /player\.vimeo\.com\/video/.test(n), d = i || l || f; if ((0, H.toLowerCase)(e) == Dl || (0, H.toLowerCase)(e) == "iframe" && d) { var v = { type: "video" }; return n && (v.src = n), d && (i ? v.provider = rs : l ? v.provider = ao : f && (v.provider = os)), v; } }, r; }(Z); const Il = Nl; var Wc = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Fl = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Wc(r, a), r.prototype.tagName = function() { return "div"; }, r.prototype.events = function() { return {}; }, r.prototype.initialize = function() { kn.prototype.initialize.apply(this, arguments); var t = this.model, e = ["loop", "autoplay", "controls", "color", "rel", "modestbranding", "poster"], n = e.map(function(i) { return "change:".concat(i); }).join(" "); this.listenTo(t, "change:provider", this.updateProvider), this.listenTo(t, "change:src", this.updateSrc), this.listenTo(t, n, this.updateVideo); }, r.prototype.updateProvider = function() { var t = this.model.get("provider"); this.el.innerHTML = "", this.el.appendChild(this.renderByProvider(t)); }, r.prototype.updateSrc = function() { var t = this.model, e = this.videoEl; if (e) { var n = t.get("provider"), i = t.get("src"); switch (n) { case "yt": i = t.getYoutubeSrc(); break; case "ytnc": i = t.getYoutubeNoCookieSrc(); break; case "vi": i = t.getVimeoSrc(); } e.src = i; } }, r.prototype.updateVideo = function() { var t = this.model, e = this.videoEl; switch (t.get("provider")) { case "yt": case "ytnc": case "vi": t.trigger("change:videoId"); break; default: if (e) { var n = e; n.loop = t.get("loop"), n.autoplay = t.get("autoplay"), n.controls = t.get("controls"), n.poster = t.get("poster"); } } }, r.prototype.renderByProvider = function(t) { var e; switch (t) { case "yt": e = this.renderYoutube(); break; case "ytnc": e = this.renderYoutubeNoCookie(); break; case "vi": e = this.renderVimeo(); break; default: e = this.renderSource(); } return this.videoEl = e, e; }, r.prototype.renderSource = function() { var t = document.createElement("video"); return t.src = this.model.get("src"), this.initVideoEl(t), t; }, r.prototype.renderYoutube = function() { var t = document.createElement("iframe"); return t.src = this.model.getYoutubeSrc(), t.frameBorder = "0", t.setAttribute("allowfullscreen", "true"), this.initVideoEl(t), t; }, r.prototype.renderYoutubeNoCookie = function() { var t = document.createElement("iframe"); return t.src = this.model.getYoutubeNoCookieSrc(), t.frameBorder = "0", t.setAttribute("allowfullscreen", "true"), this.initVideoEl(t), t; }, r.prototype.renderVimeo = function() { var t = document.createElement("iframe"); return t.src = this.model.getVimeoSrc(), t.frameBorder = "0", t.setAttribute("allowfullscreen", "true"), this.initVideoEl(t), t; }, r.prototype.initVideoEl = function(t) { t.className = this.ppfx + "no-pointer", t.style.height = "100%", t.style.width = "100%"; }, r.prototype.render = function() { kn.prototype.render.apply(this), this.updateClasses(); var t = this.model.get("provider"); return this.el.appendChild(this.renderByProvider(t)), this.updateVideo(), this; }, r; }(cn); const wi = Fl; var _i = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Qn = function() { return Qn = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Qn.apply(this, arguments); }, lo = "script"; const Zo = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return _i(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Qn(Qn({}, a.prototype.defaults), { type: lo, tagName: lo, droppable: !1, draggable: !1, layerable: !1 }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t) { if ((0, H.toLowerCase)(t.tagName) == lo) { var e = { type: lo }; return t.src && (e.src = t.src, e.onload = t.onload), e; } }, r; }(yn); var Ua = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), wp = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ua(r, a), r.prototype.tagName = function() { return "script"; }, r.prototype.events = function() { return {}; }, r.prototype.render = function() { var t = this.model, e = this.em, n = t.get("src"), i = e && e.get("scriptCount"), l = i || 0, f = ""; if (n) { var d = t.get("onload"), v = "script".concat(l), h = "script".concat(l + 1), w = "".concat(v, "Start"), C = "".concat(h, "Start"); f = ` var `.concat(v, ` = document.createElement('script'); `).concat(v, `.onload = function() { `).concat(d ? "".concat(d, `(); `) : "", ` typeof `).concat(C, " == 'function' && ").concat(C, `(); }; `).concat(v, ".src = '").concat(n, `'; function `).concat(w, "() { document.body.appendChild(").concat(v, `); }; `).concat(l ? "" : "".concat(w, "();"), ` `), e && e.set("scriptCount", l + 1); } else f = t.__innerHTML(); return this.el.innerHTML = f, this.postRender(), this; }, r; }(cn); const $c = wp; var qs = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Gs = function() { return Gs = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Gs.apply(this, arguments); }, Ks = "svg"; const Ys = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return qs(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Gs(Gs({}, a.prototype.defaults), { type: Ks, tagName: Ks, highlightable: !1, resizable: { ratioDefault: !0 } }); }, enumerable: !1, configurable: !0 }), r.prototype.getName = function() { var t = this.get("tagName"), e = this.get("custom-name"); return t = t.charAt(0).toUpperCase() + t.slice(1), e || t; }, r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === Ks; }, r; }(yn); var _p = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), is = function() { return is = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, is.apply(this, arguments); }; const qc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return _p(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return is(is({}, a.prototype.defaults), { selectable: !1, hoverable: !1, layerable: !1 }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t, e) { return e === void 0 && (e = {}), !!e.inSvg; }, r; }(Ys); var Vl = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Rl = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Vl(r, a), r.prototype._createElement = function(t) { return document.createElementNS("http://www.w3.org/2000/svg", t); }, r; }(kn); const xi = Rl; var Ba = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Xs = function() { return Xs = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Xs.apply(this, arguments); }; const Js = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ba(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Xs(Xs({}, a.prototype.defaults), { tagName: "", droppable: !1, layerable: !1, selectable: !1, editable: !0 }); }, enumerable: !1, configurable: !0 }), r.prototype.toHTML = function() { var t = this.parent(), e = this.get("content"); return t != null && t.is("script") ? e : this.__escapeContent(e); }, r.prototype.__escapeContent = function(t) { return (0, H.escapeNodeContent)(t); }, r.isComponent = function(t) { if (t.nodeType === 3) return { type: "textnode", content: t.textContent }; }, r; }(yn); var xp = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Hl = function() { return Hl = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Hl.apply(this, arguments); }; const Cp = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return xp(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Hl({}, a.prototype.defaults); }, enumerable: !1, configurable: !0 }), r.prototype.toHTML = function() { return ""); }, r.isComponent = function(t) { if (t.nodeType == 8) return { tagName: "NULL", type: "comment", content: t.textContent }; }, r; }(Js); var zl = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Wa = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return zl(r, a), r.prototype._setAttributes = function() { }, r.prototype.renderAttributes = function() { }, r.prototype.updateStatus = function() { }, r.prototype.updateClasses = function() { }, r.prototype.setAttribute = function() { }, r.prototype.updateAttributes = function() { }, r.prototype.initClasses = function() { }, r.prototype.initComponents = function() { }, r.prototype.delegateEvents = function() { return this; }, r.prototype._createElement = function() { return document.createTextNode(""); }, r.prototype.render = function() { var t = this.model, e = this.el; return t.opt.temporary || (e.textContent = t.get("content")), this; }, r; }(kn); var ss = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Zs = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return ss(r, a), r.prototype._createElement = function() { return document.createComment(this.model.get("content")); }, r; }(Wa); var Sp = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ci = function() { return Ci = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Ci.apply(this, arguments); }; const Gc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Sp(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return Ci(Ci({}, a.prototype.defaults), { tagName: "body", removable: !1, copyable: !1, draggable: !1, components: [], traits: [], stylable: ["background", "background-color", "background-image", "background-repeat", "background-attachment", "background-position", "background-size"] }); }, enumerable: !1, configurable: !0 }), r.prototype.__postAdd = function() { var t, e = (t = this.em) === null || t === void 0 ? void 0 : t.UndoManager; return !this.__hasUm && (e == null || e.add(this)), a.prototype.__postAdd.call(this); }, r.prototype.__postRemove = function() { var t, e = (t = this.em) === null || t === void 0 ? void 0 : t.UndoManager; return e == null || e.remove(this), a.prototype.__postRemove.call(this); }, r.isComponent = function() { return !1; }, r; }(yn); var Qs = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ta = function() { return ta = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ta.apply(this, arguments); }, jo = "iframe"; const ea = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Qs(r, a), Object.defineProperty(r.prototype, "defaults", { get: function() { return ta(ta({}, a.prototype.defaults), { type: jo, tagName: jo, droppable: !1, resizable: !0, traits: ["id", "title", "src"], attributes: { frameborder: "0" } }); }, enumerable: !1, configurable: !0 }), r.isComponent = function(t) { return (0, H.toLowerCase)(t.tagName) === jo; }, r; }(yn); var Si = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const na = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Si(r, a), r.prototype.tagName = function() { return "div"; }, r.prototype.initialize = function(t) { a.prototype.initialize.call(this, t), this.listenTo(this.model, "change:attributes:src", this.updateSrc); }, r.prototype.updateSrc = function() { var t = (0, Ne.sE)(this.el, "iframe")[0]; t && (0, Ne.FW)(t, { src: this.__getSrc() }); }, r.prototype.render = function() { a.prototype.render.call(this); var t = (0, Ne.ut)("iframe", { class: "".concat(this.ppfx, "no-pointer"), style: "width: 100%; height: 100%; border: none", src: this.__getSrc() }); return this.el.appendChild(t), this; }, r.prototype.__getSrc = function() { return this.model.getAttributes().src || ""; }, r; }(kn); var as = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), zr = function() { return zr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, zr.apply(this, arguments); }, Kc = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, Yc = function(a) { function r(t) { var e = a.call(this, t, "DomComponents", new Wo(void 0, { em: t })) || this; for (var n in e.componentTypes = [{ id: "cell", model: Hs, view: Ma }, { id: "row", model: La, view: Na }, { id: "table", model: Yi, view: so }, { id: "thead", model: zs, view: yi }, { id: "tbody", model: Ji, view: Ia }, { id: "tfoot", model: Bs, view: Qi }, { id: "map", model: Gt, view: ts }, { id: "link", model: bp, view: jl }, { id: "label", model: Ml, view: Uc }, { id: "video", model: Il, view: wi }, { id: "image", model: Z, view: cn }, { id: "script", model: Zo, view: $c }, { id: "svg-in", model: qc, view: xi }, { id: "svg", model: Ys, view: xi }, { id: "iframe", model: ea, view: na }, { id: "comment", model: Cp, view: Zs }, { id: "textnode", model: Js, view: Wa }, { id: "text", model: Ao, view: Va }, { id: "wrapper", model: Gc, view: vi }, { id: "default", model: yn, view: kn }], e.componentsById = {}, e.Component = yn, e.Components = Wo, e.ComponentsView = gi, e.storageKey = "components", t && (e.config.components = t.config.components || e.config.components), T) n in e.config || (e.config[n] = T[n]); var i = e.config.pStylePrefix; if (i && (e.config.stylePrefix = i + e.config.stylePrefix), t) { t.get("Parser").compTypes = e.componentTypes, t.on("change:componentHovered", e.componentHovered, e); var l = t.get("selected"); t.listenTo(l, "add", function(f, d, v) { return e.selectAdd(l.getComponent(f), v); }), t.listenTo(l, "remove", function(f, d, v) { return e.selectRemove(l.getComponent(f), v); }); } return e; } return as(r, a), r.prototype.load = function(t) { var e = this; return this.loadProjectData(t, { onResult: function(n) { var i = e.getWrapper(); if (i || (e.em.Pages.add({}, { select: !0 }), i = e.getWrapper()), (0, S.isArray)(n)) n.length && i.components(n); else { var l = n.components, f = l === void 0 ? [] : l, d = Kc(n, ["components"]); i.set(d), i.components(f); } } }); }, r.prototype.store = function() { return {}; }, r.prototype.getComponent = function() { var t = this.em.Pages.getSelected(), e = t == null ? void 0 : t.getMainFrame(); return e == null ? void 0 : e.getComponent(); }, r.prototype.getWrapper = function() { return this.getComponent(); }, r.prototype.getComponents = function() { var t = this.getWrapper(); return t == null ? void 0 : t.get("components"); }, r.prototype.addComponent = function(t, e) { return e === void 0 && (e = {}), this.getComponents().add(t, e); }, r.prototype.render = function() { var t; return (t = this.componentView) === null || t === void 0 ? void 0 : t.render().el; }, r.prototype.clear = function(t) { t === void 0 && (t = {}); var e = this.getComponents(); return e == null || e.filter(Boolean).forEach(function(n) { return n.remove(t); }), this; }, r.prototype.setComponents = function(t, e) { e === void 0 && (e = {}), this.clear(e).addComponent(t, e); }, r.prototype.addType = function(t, e) { var n = this.em, i = e.model, l = i === void 0 ? {} : i, f = e.view, d = f === void 0 ? {} : f, v = e.isComponent, h = e.extend, w = e.extendView, C = e.extendFn, L = C === void 0 ? [] : C, F = e.extendFnView, q = F === void 0 ? [] : F, et = this.getType(t), X = this.getType(h), At = this.getType(w), It = X || et || this.getType("default"), ie = It.model, se = At ? At.view : It.view, Me = function(dn, Er, qr) { return dn.reduce(function(Gr, no) { var Kr = Er[no], ii = qr.prototype[no]; return Kr && ii && (Gr[no] = function() { for (var Vi = [], Ca = 0; Ca < arguments.length; Ca++) Vi[Ca] = arguments[Ca]; ii.bind(this).apply(void 0, Vi), Kr.bind(this).apply(void 0, Vi); }), Gr; }, {}); }; if (typeof l == "object") { var Ie = (0, S.result)(l, "defaults"); delete l.defaults, e.model = ie.extend(zr(zr({}, l), Me(L, l, ie)), { isComponent: !et || X || v ? v || function() { return 0; } : ie.isComponent }), Object.defineProperty(e.model.prototype, "defaults", { value: zr(zr({}, (0, S.result)(ie.prototype, "defaults") || {}), Ie || {}) }); } typeof d == "object" && (e.view = se.extend(zr(zr({}, d), Me(q, d, se)))), et ? (et.model = e.model, et.view = e.view) : (e.id = t, this.componentTypes.unshift(e)); var Je = "component:type:".concat(et ? "update" : "add"); return n == null || n.trigger(Je, et || e), this; }, r.prototype.getType = function(t) { for (var e = this.componentTypes, n = 0; n < e.length; n++) if (e[n].id == t) return e[n]; }, r.prototype.removeType = function(t) { var e = this.componentTypes, n = this.getType(t); if (n) { var i = e.indexOf(n); return e.splice(i, 1), n; } }, r.prototype.getTypes = function() { return this.componentTypes; }, r.prototype.selectAdd = function(t, e) { var n = this; e === void 0 && (e = {}), t && (t.set({ status: "selected" }), ["component:selected", "component:toggled"].forEach(function(i) { return n.em.trigger(i, t, e); })); }, r.prototype.selectRemove = function(t, e) { var n = this; e === void 0 && (e = {}), t && (this.em, t.set({ status: "", state: "" }), ["component:deselected", "component:toggled"].forEach(function(i) { return n.em.trigger(i, t, e); })); }, r.prototype.componentHovered = function() { var t = this.em, e = t.get("componentHovered"), n = t.previous("componentHovered"), i = "hovered"; n && n.get("status") == i && n.set({ status: "", state: "" }), e && (0, S.isEmpty)(e.get("status")) && e.set("status", i); }, r.prototype.getShallowWrapper = function() { var t = this.shallow, e = this.em; if (!t && e) { var n = e.shallow; if (!n) return; var i = n.Components; if (i.componentTypes = this.componentTypes, t = i.getWrapper()) { var l = [qo, Dr].join(" "); t.on(l, (0, S.debounce)(function() { return t == null ? void 0 : t.components(""); }, 100)); } this.shallow = t; } return t; }, r.prototype.canMove = function(t, e, n) { var i = n || n === 0 ? n : null, l = { result: !1, reason: 0, target: t, source: null }; if (!e || !t) return l; var f = e.toHTML ? e : null; if (!f) { var d = this.getShallowWrapper(); f = (d == null ? void 0 : d.append(e)[0]) || null; } if (l.source = f, !f) return l; var v = f.get("draggable"); if ((0, S.isFunction)(v)) v = !!v(f, t, i); else { var h = t.getEl(); v = (0, S.isArray)(v) ? v.join(",") : v, v = (0, S.isString)(v) ? h == null ? void 0 : h.matches(v) : v; } if (!v) return zr(zr({}, l), { reason: 1 }); var w = t.get("droppable"); (0, S.isFunction)(w) ? w = !!w(f, t, i) : w === !1 && t.isInstanceOf("text") && f.get("textable") ? w = !0 : (h = f.getEl(), w = (0, S.isArray)(w) ? w.join(",") : w, w = (0, S.isString)(w) ? h == null ? void 0 : h.matches(w) : w); var C = [t].concat(t.parents()).indexOf(f) > -1; return zr(zr({}, l), !w || C ? { reason: 2 } : { result: !0 }); }, r.prototype.allById = function() { return this.componentsById; }, r.prototype.getById = function(t) { return this.componentsById[t] || null; }, r.prototype.destroy = function() { var t, e = this.allById(); Object.keys(e).forEach(function(n) { return e[n] && e[n].remove(); }), (t = this.componentView) === null || t === void 0 || t.remove(), [this.em, this.componentsById, this.componentView].forEach(function(n) { return {}; }); }, r; }(Dt); const Op = Yc, Oi = { stylePrefix: "css-", rules: [] }; var Ti = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Tp = Number.MAX_VALUE, kp = function(a) { function r() { var t = a.call(this) || this; return (0, S.bindAll)(t, "sortRules"), t.compCls = [], t.ids = [], t; } return Ti(r, a), r.prototype.buildFromModel = function(t, e) { var n = this; e === void 0 && (e = {}); var i = "", l = this.em, f = l && l.getConfig().avoidInlineStyle, d = t.styleToString(), v = t.classes; return this.ids.push("#".concat(t.getId())), v.forEach(function(h) { return n.compCls.push(h.getFullName()); }), !f && d && (i = "#".concat(t.getId(), "{").concat(d, "}")), t.components().forEach(function(h) { return i += n.buildFromModel(h, e); }), i; }, r.prototype.build = function(t, e) { var n = this; e === void 0 && (e = {}); var i = e.json, l = e.em, f = e.cssc || (l == null ? void 0 : l.Css); this.em = l, this.compCls = [], this.ids = [], this.model = t; var d = [], v = t ? this.buildFromModel(t, e) : "", h = (0, S.isUndefined)(e.clearStyles) && l ? l.getConfig().clearStyles : e.clearStyles; if (f) { var w = e.rules || f.getAll(), C = {}, L = []; e.onlyMatched && t && (0, H.hasWin)() && (w = this.matchedRules(t, w)), w.forEach(function(F) { var q = F.getAtRule(); if (q) { var et = C[q]; et ? et.push(F) : C[q] = [F]; } else { var X = n.buildFromRule(F, L, e); i ? d.push(X) : v += X; } }), this.sortMediaObject(C).forEach(function(F) { var q = "", et = F.key; F.value.forEach(function(X) { var At = n.buildFromRule(X, L, e); X.get("singleAtRule") ? v += "".concat(et, "{").concat(At, "}") : q += At, i && d.push(At); }), q && (v += "".concat(et, "{").concat(q, "}")); }), l && h && w.remove && w.remove(L); } return i ? d.filter(function(F) { return F; }) : v; }, r.prototype.buildFromRule = function(t, e, n) { var i, l = this; n === void 0 && (n = {}); var f, d = "", v = this.model, h = t.selectorsToString({ skipAdd: 1 }), w = t.get("selectorsAdd"), C = t.get("singleAtRule"); if ((i = t.get("selectors")) === null || i === void 0 || i.forEach(function(F) { var q = F.getFullName(); (l.compCls.indexOf(q) >= 0 || l.ids.indexOf(q) >= 0 || n.keepUnusedStyles) && (f = 1); }), h && f || w || C || !v) { var L = t.getDeclaration({ body: 1 }); L && (n.json ? d = t : d += L); } else e.push(t); return d; }, r.prototype.matchedRules = function(t, e) { var n = this, i = t.getEl(), l = []; return e.forEach(function(f) { try { f.selectorsToString().split(",").some(function(d) { return i == null ? void 0 : i.matches(n.__cleanSelector(d)); }) && l.push(f); } catch { } }), t.components().forEach(function(f) { l = l.concat(n.matchedRules(f, e)); }), l = l.filter(function(f, d) { return l.indexOf(f) === d; }); }, r.prototype.getQueryLength = function(t) { var e = /(-?\d*\.?\d+)\w{0,}/.exec(t); return e ? parseFloat(e[1]) : Tp; }, r.prototype.sortMediaObject = function(t) { var e = this; t === void 0 && (t = {}); var n = []; return (0, S.each)(t, function(i, l) { return n.push({ key: l, value: i }); }), n.sort(function(i, l) { var f = [i.key, l.key].every(function(h) { return h.indexOf("min-width") !== -1; }), d = f ? i.key : l.key, v = f ? l.key : i.key; return e.getQueryLength(d) - e.getQueryLength(v); }); }, r.prototype.sortRules = function(t, e) { var n = function(d) { return d.get("mediaText") || ""; }, i = [n(t), n(e)].every(function(d) { return d.indexOf("min-width") !== -1; }), l = n(i ? t : e), f = n(i ? e : t); return this.getQueryLength(l) - this.getQueryLength(f); }, r.prototype.__cleanSelector = function(t) { return t.split(" ").map(function(e) { return e.split(":")[0]; }).join(" "); }, r; }(k.Hn); const Pp = kp; var Ep = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ra = function() { return ra = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ra.apply(this, arguments); }, Ap = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, fr = ((0, H.hasWin)() ? window : {}).CSS, Gn = function(a) { function r(t, e) { e === void 0 && (e = {}); var n = a.call(this, t) || this; return n.config = t || {}, n.opt = e, n.em = e.em, n.ensureSelectors(null, null, {}), n.on("change", n.__onChange), n; } return Ep(r, a), r.prototype.defaults = function() { return { selectors: [], selectorsAdd: "", style: {}, mediaText: "", state: "", stylable: !0, atRuleType: "", singleAtRule: !1, important: !1, group: "", shallow: !1, _undo: !0 }; }, r.prototype.__onChange = function(t, e) { var n = this.em, i = this.changedAttributes(); i && !(0, H.isEmptyObj)(i) && (n == null || n.changesUp(e)); }, r.prototype.clone = function() { var t = ra({}, this.opt), e = ra({}, this.attributes); return e.selectors = this.get("selectors").map(function(n) { return n.clone(); }), new this.constructor(e, t); }, r.prototype.ensureSelectors = function(t, e, n) { var i = this.em, l = i == null ? void 0 : i.get("SelectorManager"), f = [this, "change:selectors", this.ensureSelectors], d = this.getSelectors(); if (this.stopListening.apply(this, f), d.models && (d = Ap([], d.models, !0)), d = (0, S.isString)(d) ? [d] : d, Array.isArray(d)) { var v = d.filter(function(h) { return h; }).map(function(h) { return l ? l.add(h) : h; }); d = new Cr(v); } this.set("selectors", d, n), this.listenTo.apply(this, f); }, r.prototype.getAtRule = function() { var t = this.get("atRuleType"), e = this.get("mediaText"), n = t ? "@".concat(t) : e ? "@media" : ""; return n + (e && n ? " ".concat(e) : ""); }, r.prototype.selectorsToString = function(t) { t === void 0 && (t = {}); var e = [], n = this.get("state"), i = this.get("selectorsAdd"), l = { escape: function(v) { return fr && fr.escape ? fr.escape(v) : v; } }, f = this.get("selectors").getFullString(0, l), d = n && !t.skipState ? ":".concat(n) : ""; return f && e.push("".concat(f).concat(d)), i && !t.skipAdd && e.push(i), e.join(", "); }, r.prototype.getDeclaration = function(t) { t === void 0 && (t = {}); var e = "", n = this.attributes.important, i = this.selectorsToString(t), l = this.styleToString(ra({ important: n }, t)), f = this.get("singleAtRule"); return (i || f) && (l || t.allowEmpty) && (e = f ? l : "".concat(i, "{").concat(l, "}")), e; }, r.prototype.getDevice = function() { var t = this.em, e = this.attributes, n = e.atRuleType, i = e.mediaText, l = (t == null ? void 0 : t.get("DeviceManager").getDevices()) || [], f = l.filter(function(d) { return d.getWidthMedia() === ""; })[0]; return n === "media" && i ? l.filter(function(d) { return d.getWidthMedia() === ((v = /(-?\d*\.?\d+)\w{0,}/.exec(i)) ? v[0] : ""); var v; })[0] || null : f || null; }, r.prototype.getState = function() { var t = this.em, e = this.get("state"); return ((t == null ? void 0 : t.get("SelectorManager").getStates()) || []).filter(function(n) { return n.getName() === e; })[0] || null; }, r.prototype.getComponent = function() { var t, e = this.getSelectors(), n = e.length == 1 && e.at(0), i = n && n.isId() && n.get("name"); return i && ((t = this.em) === null || t === void 0 ? void 0 : t.get("DomComponents").getById(i)) || null; }, r.prototype.toCSS = function(t) { t === void 0 && (t = {}); var e = "", n = this.getAtRule(), i = this.getDeclaration(t); return (i || t.allowEmpty) && (e = i), n && e && (e = "".concat(n, "{").concat(e, "}")), e; }, r.prototype.toJSON = function() { for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; var i = k.Hn.prototype.toJSON.apply(this, e); if (!((t = this.em) === null || t === void 0) && t.getConfig().avoidDefaults) { var l = this.defaults(); (0, S.forEach)(l, function(f, d) { i[d] === f && delete i[d]; }), delete i.style.__p, (0, S.isEmpty)(i.selectors) && delete i.selectors, (0, S.isEmpty)(i.style) && delete i.style; } return i; }, r.prototype.compare = function(t, e, n, i) { var l; i === void 0 && (i = {}); var f = e || "", d = n || "", v = i.selectorsAdd || "", h = i.atRuleType || ""; d && !h && (h = "media"); var w = ((0, S.isArray)(t) || t.models ? t.models || t : [t]).map(function(q) { return q.getFullName(); }), C = (l = this.get("selectors")) === null || l === void 0 ? void 0 : l.map(function(q) { return q.getFullName(); }), L = w.slice().sort(), F = C.slice().sort(); return !(w.length !== C.length || !L.every(function(q, et) { return q === F[et]; })) && this.get("state") === f && this.get("mediaText") === d && this.get("selectorsAdd") === v && this.get("atRuleType") === h; }, r; }(_r); const ir = Gn; var Kn = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ls = function(a) { function r(t, e) { var n = a.call(this, t) || this; return n.editor = e == null ? void 0 : e.em, setTimeout(function() { n.on("remove", n.onRemove), n.on("add", n.onAdd); }), n; } return Kn(r, a), r.prototype.toJSON = function(t) { return k.FE.prototype.toJSON.call(this, t).filter(function(e) { return e.style && !e.shallow; }); }, r.prototype.onAdd = function(t, e, n) { t.ensureSelectors(t, e, n); }, r.prototype.onRemove = function(t) { var e = this.editor; e.stopListening(t), e.UndoManager.remove(t); }, r.prototype.add = function(t, e) { return e === void 0 && (e = {}), typeof t == "string" && (t = this.editor.get("Parser").parseCss(t)), e.em = this.editor, k.FE.prototype.add.apply(this, [t, e]); }, r; }(k.FE); const jp = ls; ls.prototype.model = ir; var $a = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ki = function() { return ki = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ki.apply(this, arguments); }, Mp = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, Lp = function(a) { function r(t) { var e = a.call(this, t, "CssComposer", null, {}, Oi) || this; e.Selectors = Cr, e.storageKey = "styles"; var n = e.config, i = n.pStylePrefix; return i && (n.stylePrefix = i + n.stylePrefix), n.rules = e.em.config.style || n.rules || "", e.rules = new jp([], n), e; } return $a(r, a), r.prototype.onLoad = function() { this.rules.add(this.config.rules, { silent: !0 }); }, r.prototype.postLoad = function() { var t, e = (t = this.em) === null || t === void 0 ? void 0 : t.get("UndoManager"); e && e.add(this.getAll()); }, r.prototype.store = function() { return this.getProjectData(); }, r.prototype.load = function(t) { return this.loadProjectData(t, { all: this.rules }); }, r.prototype.add = function(t, e, n, i, l) { i === void 0 && (i = {}), l === void 0 && (l = {}); var f = e || "", d = n || "", v = ki({}, i), h = this.get(t, f, d, v); return h && h.config && !h.config.singleAtRule || (v.state = f, v.mediaText = d, v.selectors = [], d && !v.atRuleType && (v.atRuleType = "media"), (h = new ir(v, this.config)).get("selectors").add(t, l), this.rules.add(h, l)), h; }, r.prototype.get = function(t, e, n, i) { var l = t; if ((0, S.isString)(t)) { var f = this.em.Selectors, d = t.split(",")[0].trim(), v = this.em.Parser.parserCss.checkNode({ selectors: d })[0]; l = f.get(v.selectors); } return this.rules.find(function(h) { return h.compare(l, e, n, i); }) || null; }, r.prototype.getAll = function() { return this.rules; }, r.prototype.addCollection = function(t, e, n) { e === void 0 && (e = {}), n === void 0 && (n = {}); var i = this.em, l = []; (0, S.isString)(t) && (t = i.Parser.parseCss(t)); for (var f = t instanceof Array ? t : [t], d = 0, v = f.length; d < v; d++) { var h = f[d] || {}; if (h.selectors) { var w = i == null ? void 0 : i.Selectors; w || console.warn("Selector Manager not found"); for (var C = h.selectors, L = C instanceof Array ? C : [C], F = [], q = 0, et = L.length; q < et; q++) { var X = w.add(L[q]); F.push(X); } var At = this.get(F, h.state, h.mediaText, h), It = this.add(F, h.state, h.mediaText, h, e), ie = !At || !e.avoidUpdateStyle, se = h.style || {}; if ((0, H.isObject)(n) && It.set(n, e), ie) { var Me = e.extend ? ki(ki({}, It.get("style")), se) : se; It.set("style", Me, e); } l.push(It); } } return l; }, r.prototype.addRules = function(t) { return this.addCollection(t); }, r.prototype.setRule = function(t, e, n) { e === void 0 && (e = {}), n === void 0 && (n = {}); var i = n.atRuleType, l = n.atRuleParams, f = this.em.Parser.parserCss.checkNode({ selectors: t, style: e })[0], d = f.state, v = f.selectorsAdd, h = this.em.Selectors.add(f.selectors), w = this.add(h, d, l, { selectorsAdd: v, atRule: i }); return w.setStyle(e, n), w; }, r.prototype.getRule = function(t, e) { e === void 0 && (e = {}); var n = this.em, i = n.Selectors, l = n.Parser.parserCss.checkNode({ selectors: t })[0], f = i.get(l.selectors), d = l.state, v = l.selectorsAdd, h = e.atRuleType, w = e.atRuleParams; return f ? this.get(f, d, w, { selectorsAdd: v, atRuleType: h }) : void 0; }, r.prototype.getRules = function(t) { var e = this.getAll(); if (!t) return Mp([], e.models, !0); var n = { sort: !0 }, i = (0, S.isString)(t) ? t.split(",").map(function(l) { return l.trim(); }) : t; return e.filter(function(l) { return i.indexOf(l.getSelectors().getFullString(null, n)) >= 0; }); }, r.prototype.setIdRule = function(t, e, n) { e === void 0 && (e = {}), n === void 0 && (n = {}); var i = n.addOpts, l = i === void 0 ? {} : i, f = n.mediaText, d = n.state || "", v = (0, S.isUndefined)(f) ? this.em.getCurrentMedia() : f, h = this.em.Selectors.add({ name: t, type: Jn.TYPE_ID }, l), w = this.add(h, d, v, {}, l); return w.setStyle(e, ki(ki({}, n), l)), w; }, r.prototype.getIdRule = function(t, e) { e === void 0 && (e = {}); var n = e.mediaText, i = e.state || "", l = (0, S.isUndefined)(n) ? this.em.getCurrentMedia() : n, f = this.em.Selectors.get(t, Jn.TYPE_ID); return f && this.get(f, i, l); }, r.prototype.setClassRule = function(t, e, n) { e === void 0 && (e = {}), n === void 0 && (n = {}); var i = n.state || "", l = n.mediaText || this.em.getCurrentMedia(), f = this.em.Selectors.add({ name: t, type: Jn.TYPE_CLASS }), d = this.add(f, i, l); return d.setStyle(e, n), d; }, r.prototype.getClassRule = function(t, e) { e === void 0 && (e = {}); var n = e.state || "", i = e.mediaText || this.em.getCurrentMedia(), l = this.em.Selectors.get(t, Jn.TYPE_CLASS); return l && this.get(l, n, i); }, r.prototype.remove = function(t, e) { var n = (0, S.isString)(t) ? this.getRules(t) : t, i = this.getAll().remove(n, e); return (0, S.isArray)(i) ? i : [i]; }, r.prototype.clear = function(t) { return t === void 0 && (t = {}), this.getAll().reset([], t), this; }, r.prototype.getComponentRules = function(t, e) { e === void 0 && (e = {}); var n = e.state, i = e.mediaText; e.current && (n = this.em.get("state") || "", i = this.em.getCurrentMedia()); var l = t.getId(); return this.getAll().filter(function(f) { return !(!(0, S.isUndefined)(n) && f.get("state") !== n) && !(!(0, S.isUndefined)(i) && f.get("mediaText") !== i) && f.getSelectorsString() === "#".concat(l); }); }, r.prototype.render = function() { var t; return (t = this.rulesView) === null || t === void 0 || t.remove(), this.rulesView = new Vo({ collection: this.rules, config: this.config }), this.rulesView.render().el; }, r.prototype.destroy = function() { var t; this.rules.reset(), this.rules.stopListening(), (t = this.rulesView) === null || t === void 0 || t.remove(); }, r; }(Dt); const Ul = Lp, Xc = { appendTo: "", blocks: [], appendOnClick: !1, custom: !1 }; var Bl = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Jc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Bl(r, a), r.prototype.defaults = function() { return { label: "", content: "", media: "", category: "", activate: !1, select: void 0, resetId: !1, disable: !1, onClick: void 0, attributes: {} }; }, r.prototype.getId = function() { return this.id; }, r.prototype.getLabel = function() { return this.get("label"); }, r.prototype.getMedia = function() { return this.get("media"); }, r.prototype.getContent = function() { return this.get("content"); }, r.prototype.getCategoryLabel = function() { var t = this.get("category"); return (0, S.isFunction)(t == null ? void 0 : t.get) ? t.get("label") : t != null && t.label ? t == null ? void 0 : t.label : t; }, r; }(k.Hn); var Wl = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), qa = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Wl(r, a), r; }(k.FE); const oa = qa; qa.prototype.model = Jc; var Zc = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Ga = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Zc(r, a), r.prototype.defaults = function() { return { id: "", label: "", open: !0, attributes: {} }; }, r; }(k.Hn); var Qc = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), cs = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Qc(r, a), r; }(k.FE); const tu = cs; cs.prototype.model = Ga; var Ka = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Mo = function(a) { function r(t, e) { e === void 0 && (e = {}); var n = a.call(this, t) || this, i = n.model; return n.em = e.em, n.config = e, n.endDrag = n.endDrag.bind(n), n.ppfx = e.pStylePrefix || "", n.listenTo(i, "destroy remove", n.remove), n.listenTo(i, "change", n.render), n; } return Ka(r, a), r.prototype.events = function() { return { click: "handleClick", mousedown: "startDrag", dragstart: "handleDragStart", drag: "handleDrag", dragend: "handleDragEnd" }; }, r.prototype.__getModule = function() { return this.em.Blocks; }, r.prototype.handleClick = function(t) { var e = this, n = e.config, i = e.model, l = e.em, f = i.get("onClick") || n.appendOnClick; if (l.trigger("block:click", i, t), f) { if ((0, S.isFunction)(f)) return f(i, l == null ? void 0 : l.getEditor(), { event: t }); var d, v, h = n.getSorter(), w = i.get("content"), C = l.getSelected(); if (h.setDropContent(w), C) if (h.validTarget(C.getEl(), w).valid) d = C; else { var L = C.parent(); L && h.validTarget(L.getEl(), w).valid && (d = L, v = L.components().indexOf(C) + 1); } if (!d) { var F = l.getWrapper(); h.validTarget(F.getEl(), w).valid && (d = F); } var q = d && d.append(w, { at: v })[0]; q && l.setSelected(q, { scroll: 1 }); } }, r.prototype.startDrag = function(t) { var e = this, n = e.config, i = e.em, l = e.model, f = l.get("disable"); if (t.button === 0 && n.getSorter && !this.el.draggable && !f) { i.refreshCanvas(); var d = n.getSorter(); d.__currentBlock = l, d.setDragHelper(this.el, t), d.setDropContent(this.model.get("content")), d.startSort(this.el), (0, H.on)(document, "mouseup", this.endDrag); } }, r.prototype.handleDragStart = function(t) { this.__getModule().__startDrag(this.model, t); }, r.prototype.handleDrag = function(t) { this.__getModule().__drag(t); }, r.prototype.handleDragEnd = function() { this.__getModule().__endDrag(); }, r.prototype.endDrag = function() { (0, H.off)(document, "mouseup", this.endDrag); var t = this.config.getSorter(); t.moved = 0, t.endMove(); }, r.prototype.render = function() { var t, e = this, n = e.em, i = e.el, l = e.$el, f = e.ppfx, d = e.model, v = d.get("disable"), h = d.get("attributes") || {}, w = h.class || "", C = "".concat(f, "block"), L = n && n.t("blockManager.labels.".concat(d.id)) || d.get("label"), F = d.get("render"), q = d.get("media"), et = v ? "".concat(C, "--disable") : "".concat(f, "four-color-h"); l.attr(h), i.className = "".concat(w, " ").concat(C, " ").concat(f, "one-bg ").concat(et).trim(), i.innerHTML = ` `.concat(q ? '
').concat(q, "
") : "", `
').concat(L, `
`), i.title = h.title || ((t = i.textContent) === null || t === void 0 ? void 0 : t.trim()), i.setAttribute("draggable", "".concat(!(!(0, H.hasDnd)(n) || v))); var X = F && F({ el: i, model: d, className: C, prefix: f }); return X && (i.innerHTML = X), this; }, r; }(k.G7); const eu = Mo; var Dp = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), nu = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }, Ur = function(a) { function r(t, e) { var n = a.call(this, t) || this; n.config = e; var i = e.pStylePrefix || ""; return n.em = e.em, n.pfx = i, n.caretR = "fa fa-caret-right", n.caretD = "fa fa-caret-down", n.iconClass = "".concat(i, "caret-icon"), n.activeClass = "".concat(i, "open"), n.className = "".concat(i, "block-category"), n.listenTo(n.model, "change:open", n.updateVisibility), n.model.view = n, n; } return Dp(r, a), r.prototype.events = function() { return { "click [data-title]": "toggle" }; }, r.prototype.template = function(t) { var e = t.pfx, n = t.label; return pt(Qr || (Qr = nu([`
`, `
`], [`
`, `
`])), e, e, n, e); }, r.prototype.attributes = function() { return this.model.get("attributes") || {}; }, r.prototype.updateVisibility = function() { this.model.get("open") ? this.open() : this.close(); }, r.prototype.open = function() { this.$el.addClass(this.activeClass), this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretD), this.getBlocksEl().style.display = ""; }, r.prototype.close = function() { this.$el.removeClass(this.activeClass), this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretR), this.getBlocksEl().style.display = "none"; }, r.prototype.toggle = function() { var t = this.model; t.set("open", !t.get("open")); }, r.prototype.getIconEl = function() { return this.iconEl || (this.iconEl = this.el.querySelector(".".concat(this.iconClass))), this.iconEl; }, r.prototype.getBlocksEl = function() { return this.blocksEl || (this.blocksEl = this.el.querySelector(".".concat(this.pfx, "blocks-c"))), this.blocksEl; }, r.prototype.append = function(t) { this.getBlocksEl().appendChild(t); }, r.prototype.render = function() { var t = this, e = t.em, n = t.el, i = t.$el, l = t.model, f = t.pfx, d = e.t("blockManager.categories.".concat(l.id)) || l.get("label"); return n.innerHTML = this.template({ pfx: f, label: d }), i.addClass(this.className), i.css({ order: l.get("order") }), this.updateVisibility(), this; }, r; }(k.G7); const tn = Ur; var Qr, Qo = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), co = function() { return co = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, co.apply(this, arguments); }, ru = function(a) { function r(t, e) { var n = a.call(this, t) || this; (0, S.bindAll)(n, "getSorter", "onDrag", "onDrop", "onMove"), n.config = e || {}, n.categories = t.categories || "", n.renderedCategories = {}; var i = n.config.pStylePrefix || ""; n.ppfx = i, n.noCatClass = "".concat(i, "blocks-no-cat"), n.blockContClass = "".concat(i, "blocks-c"), n.catsClass = "".concat(i, "block-categories"); var l = n.collection; return n.listenTo(l, "add", n.addTo), n.listenTo(l, "reset", n.render), n.em = n.config.em, n.em && (n.config.getSorter = n.getSorter), n; } return Qo(r, a), r.prototype.__getModule = function() { return this.em.Blocks; }, r.prototype.updateConfig = function(t) { t === void 0 && (t = {}), this.config = co(co({}, this.config), t); }, r.prototype.getSorter = function() { var t = this.em; if (t) { if (!this.sorter) { var e = t.Utils, n = t.Canvas; this.sorter = new e.Sorter({ container: n.getBody(), placer: n.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: this.ppfx, onStart: this.onDrag, onEndMove: this.onDrop, onMove: this.onMove, document: n.getFrameEl().contentDocument, direction: "a", wmargin: 1, nested: 1, em: t, canvasRelative: 1 }); } return this.sorter; } }, r.prototype.onDrag = function(t) { this.em.stopDefault(), this.__getModule().__startDrag(this.sorter.__currentBlock, t); }, r.prototype.onMove = function(t) { this.__getModule().__drag(t), this.em.trigger("block:drag:move", t); }, r.prototype.onDrop = function(t) { this.em.runDefault(), this.__getModule().__endDrag({ component: t }), delete this.sorter.__currentBlock; }, r.prototype.addTo = function(t) { this.add(t); }, r.prototype.add = function(t, e) { var n = this.config, i = new eu({ model: t, attributes: t.get("attributes") }, n).render().el, l = t.get("category"); if (l && this.categories && !n.ignoreCategories) { (0, S.isString)(l) ? l = { id: l, label: l } : (0, S.isObject)(l) && !l.id && (l.id = l.label); var f = this.categories.add(l), d = f.get("id"), v = this.getCategoriesEl(), h = this.renderedCategories[d]; return t.set("category", f, { silent: !0 }), !h && v && (h = new tn({ model: f }, n).render(), this.renderedCategories[d] = h, v.appendChild(h.el)), void (h && h.append(i)); } e ? e.appendChild(i) : this.append(i); }, r.prototype.getCategoriesEl = function() { return this.catsEl || (this.catsEl = this.el.querySelector(".".concat(this.catsClass))), this.catsEl; }, r.prototype.getBlocksEl = function() { return this.blocksEl || (this.blocksEl = this.el.querySelector(".".concat(this.noCatClass, " .").concat(this.blockContClass))), this.blocksEl; }, r.prototype.append = function(t) { var e = this.getBlocksEl(); e && e.appendChild(t); }, r.prototype.render = function() { var t = this, e = this.ppfx, n = document.createDocumentFragment(); delete this.catsEl, delete this.blocksEl, this.renderedCategories = {}, this.el.innerHTML = `
`), this.collection.each(function(l) { return t.add(l, n); }), this.append(n); var i = "".concat(this.blockContClass, "s ").concat(e, "one-bg ").concat(e, "two-color"); return this.$el.addClass(i), this.rendered = !0, this; }, r; }(k.G7); const Ya = ru; var ou = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ti = function() { return ti = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ti.apply(this, arguments); }, Xa = "block", Lo = "".concat(Xa, ":"), iu = "".concat(Lo, "add"), $l = "".concat(Lo, "update"), Do = "".concat(Lo, "remove"), su = "".concat(Do, ":before"), Ja = "".concat(Lo, "drag"), Np = { all: Xa, update: $l, add: iu, remove: Do, removeBefore: su, drag: Ja, dragStart: "".concat(Ja, ":start"), dragEnd: "".concat(Ja, ":stop"), custom: "".concat(Lo, "custom") }, Za = function(a) { function r(t) { var e, n = this; return (n = a.call(this, t, "BlockManager", new oa(((e = t.config.blockManager) === null || e === void 0 ? void 0 : e.blocks) || []), Np, Xc) || this).Block = Jc, n.Blocks = oa, n.Category = Ga, n.Categories = tu, n.storageKey = "", n.blocks = n.all, n.blocksVisible = new oa(n.blocks.models), n.categories = new tu(), n.blocks.on("add", function(i) { return n.blocksVisible.add(i); }), n.blocks.on("remove", function(i) { return n.blocksVisible.remove(i); }), n.blocks.on("reset", function(i) { return n.blocksVisible.reset(i.models); }), n; } return ou(r, a), r.prototype.__trgCustom = function() { this.em.trigger(this.events.custom, this.__customData()); }, r.prototype.__customData = function() { var t = this, e = this.__getBehaviour(); return { bm: this, blocks: this.getAll().models, container: e.container, dragStart: function(n, i) { return t.startDrag(n, i); }, drag: function(n) { return t.__drag(n); }, dragStop: function(n) { return t.endDrag(n); } }; }, r.prototype.__startDrag = function(t, e) { var n = this, i = n.em, l = n.events, f = n.blocks, d = t.getContent ? t.getContent() : t; this._dragBlock = t, i.set({ dragResult: null, dragContent: d }), [i, f].map(function(v) { return v.trigger(l.dragStart, t, e); }); }, r.prototype.__drag = function(t) { var e = this, n = e.em, i = e.events, l = e.blocks, f = this._dragBlock; [n, l].map(function(d) { return d.trigger(i.drag, f, t); }); }, r.prototype.__endDrag = function(t) { t === void 0 && (t = {}); var e = this, n = e.em, i = e.events, l = e.blocks, f = this._dragBlock, d = t.component || n.get("dragResult"); if (delete this._dragBlock, d && f) { var v = "activeOnRender", h = d.get && d.get(v), w = f.get("activate") || h, C = f.get("select"), L = (0, S.isArray)(d) ? d[0] : d; (C || w && C !== !1) && n.setSelected(L), w && (L.trigger("active"), h && L.unset(v)), f.get("resetId") && L.onAll(function(F) { return F.resetId(); }); } n.set({ dragResult: null, dragContent: null }), f && [n, l].map(function(F) { return F.trigger(i.dragEnd, d, f); }); }, r.prototype.__getFrameViews = function() { return this.em.get("Canvas").getFrames().map(function(t) { return t.view; }); }, r.prototype.__behaviour = function(t) { return t === void 0 && (t = {}), this._bhv = ti(ti({}, this._bhv || {}), t); }, r.prototype.__getBehaviour = function() { return this._bhv || {}; }, r.prototype.startDrag = function(t, e) { this.__startDrag(t, e), this.__getFrameViews().forEach(function(n) { return n.droppable.startCustom(); }); }, r.prototype.endDrag = function(t) { this.__getFrameViews().forEach(function(e) { return e.droppable.endCustom(t); }), this.__endDrag(); }, r.prototype.postRender = function() { var t = this, e = t.categories, n = t.config, i = t.em, l = this.blocksVisible; this.blocksView = new Ya({ collection: l, categories: e }, ti(ti({}, n), { em: i })), this.__appendTo(l.models), this.__trgCustom(); }, r.prototype.add = function(t, e, n) { n === void 0 && (n = {}); var i = e || {}; return i.id = t, this.blocks.add(i, n); }, r.prototype.get = function(t) { return this.blocks.get(t); }, r.prototype.getAll = function() { return this.blocks; }, r.prototype.getAllVisible = function() { return this.blocksVisible; }, r.prototype.remove = function(t, e) { return e === void 0 && (e = {}), this.__remove(t, e); }, r.prototype.getCategories = function() { return this.categories; }, r.prototype.getContainer = function() { var t; return (t = this.blocksView) === null || t === void 0 ? void 0 : t.el; }, r.prototype.render = function(t, e) { e === void 0 && (e = {}); var n = this, i = n.categories, l = n.config, f = n.em, d = t || this.getAll().models; if (e.external) { var v = new oa(d); return new Ya({ collection: v, categories: i }, ti(ti({ em: f }, l), e)).render().el; } return this.blocksView && (this.blocksView.updateConfig(e), this.blocksView.collection.reset(d), this.blocksView.rendered || (this.blocksView.render(), this.blocksView.rendered = !0)), this.getContainer(); }, r.prototype.destroy = function() { var t, e = [this.blocks, this.blocksVisible, this.categories]; e.map(function(n) { return n.stopListening(); }), e.map(function(n) { return n.reset(); }), (t = this.blocksView) === null || t === void 0 || t.remove(); }, r; }(Dt); const ql = Za, au = { stylePrefix: "clm-", appendTo: "", selectors: [], states: [{ name: "hover" }, { name: "active" }, { name: "nth-of-type(2n)" }], iconAdd: '', iconSync: '', iconTagOn: '', iconTagOff: '', iconTagRemove: '', componentFirst: !1, custom: !1 }; var Ip = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Gl = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ip(r, a), r.prototype.defaults = function() { return { name: "", label: "" }; }, r.prototype.getName = function() { return this.get("name"); }, r.prototype.getLabel = function() { return this.get("label") || this.getName(); }, r; }(k.Hn); const Kl = Gl; Gl.prototype.idAttribute = "name"; var Fp = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Qa = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }, Yl = "contentEditable", Vp = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this, n = t.config || {}; return e.config = n, e.module = t.module, e.coll = t.coll || null, e.pfx = n.stylePrefix || "", e.ppfx = n.pStylePrefix || "", e.em = n.em, e.listenTo(e.model, "change:active", e.updateStatus), e; } return Fp(r, a), r.prototype.template = function() { var t = this, e = t.pfx, n = t.model, i = t.config, l = n.get("label") || ""; return pt(Xl || (Xl = Qa([` ', ` $', ` `], [` ', ` $', ` `])), e, e, e, l, e, e, i.iconTagRemove); }, r.prototype.events = function() { return { "click [data-tag-remove]": "removeTag", "click [data-tag-status]": "changeStatus", "dblclick [data-tag-name]": "startEditTag", "focusout [data-tag-name]": "endEditTag" }; }, r.prototype.getInputEl = function() { return this.inputEl || (this.inputEl = this.el.querySelector("[data-tag-name]")), this.inputEl; }, r.prototype.startEditTag = function() { var t = this.em, e = this.getInputEl(); e[Yl] = "true", e.focus(), t == null || t.setEditing(!0); }, r.prototype.endEditTag = function() { var t = this.model, e = this.em, n = this.getInputEl(), i = n.textContent || "", l = e == null ? void 0 : e.Selectors; n[Yl] = "false", e == null || e.setEditing(!1), l && l.rename(t, i) !== t && (n.innerText = t.get("label")); }, r.prototype.changeStatus = function() { var t = this.model; t.set("active", !t.get("active")); }, r.prototype.removeTag = function() { this.module.removeSelected(this.model); }, r.prototype.updateStatus = function() { var t = this, e = t.model, n = t.$el, i = t.config, l = i.iconTagOn, f = i.iconTagOff, d = n.find("[data-tag-status]"); e.get("active") ? (d.html(l), n.removeClass("opac50")) : (d.html(f), n.addClass("opac50")); }, r.prototype.render = function() { var t = this.pfx, e = this.ppfx; return this.$el.html(this.template()), this.$el.attr("class", "".concat(t, "tag ").concat(e, "three-bg")), this.updateStatus(), this; }, r; }(k.G7); const Rp = Vp; var Xl, us = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Pi = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }, tl = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; e.config = t.config || {}, e.pfx = e.config.stylePrefix || "", e.ppfx = e.config.pStylePrefix || "", e.className = e.pfx + "tags", e.stateInputId = e.pfx + "states", e.stateInputC = e.pfx + "input-c", e.states = e.config.states || []; var n = e.config.em, i = e.collection; e.target = n; var l = n.Selectors; return e.module = l, e.em = n, e.componentChanged = (0, S.debounce)(e.componentChanged.bind(e), 0), e.checkSync = (0, S.debounce)(e.checkSync.bind(e), 0), e.listenTo(n, "component:toggled component:update:classes", e.componentChanged), e.listenTo(n, "styleManager:update", e.componentChanged), e.listenTo(n, "component:update:classes change:state", e.__handleStateChange), e.listenTo(n, "styleable:change change:device", e.checkSync), e.listenTo(i, "add", e.addNew), e.listenTo(i, "reset", e.renderClasses), e.listenTo(i, "remove", e.tagRemoved), e.listenTo(l.getAll(), l.events.state, (0, S.debounce)(function() { return e.renderStates(); }, 0)), e.delegateEvents(), e; } return us(r, a), r.prototype.template = function(t) { var e = t.labelInfo, n = t.labelHead, i = t.iconSync, l = t.iconAdd, f = t.pfx, d = t.ppfx; return pt(el || (el = Pi(['
', `
$', `
', `:
`], ['
', `
$', `
', `:
`])), f, f, f, f, n, f, f, f, d, d, d, f, d, d, f, d, f, f, f, f, f, l, f, f, i, f, f, e, f); }, r.prototype.events = function() { return { "change [data-states]": "stateChanged", "click [data-add]": "startNewTag", "focusout [data-input]": "endNewTag", "keyup [data-input]": "onInputKeyUp", "click [data-sync-style]": "syncStyle" }; }, r.prototype.syncStyle = function() { var t, e = this.em, n = this.getTarget(), i = e.Css, l = this.getCommonSelectors({ opts: { noDisabled: 1 } }), f = e.get("state"), d = e.getCurrentMedia(), v = [], h = i.get(l, f, d) || i.add(l, f, d); this.getTargets().forEach(function(w) { var C = i.getIdRule(w.getId(), { state: f, mediaText: d }); t = C.getStyle(), C.setStyle({}), v.push(C); }), t && h.addStyle(t), e.trigger("component:toggled"), e.trigger("component:sync-style", { component: n, selectors: l, mediaText: d, rule: h, ruleComponents: v, state: f }); }, r.prototype.tagRemoved = function(t) { this.updateStateVis(); }, r.prototype.addNew = function(t) { this.addToClasses(t); }, r.prototype.startNewTag = function() { var t, e; (t = this.$addBtn) === null || t === void 0 || t.css({ display: "none" }), (e = this.$input) === null || e === void 0 || e.show().focus(); }, r.prototype.endNewTag = function() { var t, e; (t = this.$addBtn) === null || t === void 0 || t.css({ display: "" }), (e = this.$input) === null || e === void 0 || e.hide().val(""); }, r.prototype.onInputKeyUp = function(t) { var e; t.keyCode === 13 ? (t.preventDefault(), this.addNewTag((e = this.$input) === null || e === void 0 ? void 0 : e.val())) : t.keyCode === 27 && this.endNewTag(); }, r.prototype.checkStates = function() { var t = this.em.getState(), e = this.getStates(); e && e.val(t); }, r.prototype.componentChanged = function(t) { var e = (t === void 0 ? {} : t).targets; this.updateSelection(e); }, r.prototype.updateSelection = function(t) { var e = t || this.getTargets(), n = []; return (e = (0, S.isArray)(e) ? e : [e]) && e.length && (n = this.getCommonSelectors({ targets: e }), this.checkSync({ validSelectors: n })), this.collection.reset(n), this.updateStateVis(e), this.module.__trgCustom(), n; }, r.prototype.getCommonSelectors = function(t) { var e = t === void 0 ? {} : t, n = e.targets, i = e.opts, l = i === void 0 ? {} : i, f = n || this.getTargets(); return this.module.__getCommonSelectors(f, l); }, r.prototype._commonSelectors = function() { for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; return (t = this.module).__common.apply(t, e); }, r.prototype.checkSync = function() { var t, e = this, n = e.$btnSyncEl, i = e.config, l = e.collection, f = this.getTarget(); if (f && i.componentFirst && l.length) { var d = f.getStyle(); t = !(0, S.isEmpty)(d); } n && n[t ? "show" : "hide"](); }, r.prototype.getTarget = function() { return this.target.getSelected(); }, r.prototype.getTargets = function() { return this.target.getSelectedAll(); }, r.prototype.updateStateVis = function(t) { var e = this.em, n = e && e.getConfig().avoidInlineStyle, i = this.collection.length || n ? "" : "none"; this.getStatesC().css("display", i), this.updateSelector(t); }, r.prototype.__handleStateChange = function() { this.updateSelector(this.getTargets()); }, r.prototype.updateSelector = function(t) { var e = this, n = this.el.querySelector("[data-selected]"), i = [], l = t || this.getTargets(); (l = (0, S.isArray)(l) ? l : [l]).forEach(function(f) { return i.push(e.__getName(f)); }), n && (n.innerHTML = i.join(", ")), this.checkStates(); }, r.prototype.__getName = function(t) { var e, n = this, i = n.pfx, l = n.config, f = n.em, d = l.selectedName, v = l.componentFirst; if ((0, S.isString)(t)) e = pt(Jl || (Jl = Pi(['', ""], ['', ""])), i, t); else { var h = t == null ? void 0 : t.getSelectors(); if (!h) return ""; var w = h.getStyleable(), C = f.get("state"), L = t.getId ? pt(cu || (cu = Pi(['', ` #', ""], ['', ` #', ""])), i, t.getName(), i, t.getId()) : ""; e = (e = this.collection.getFullString(w)) ? pt(Zl || (Zl = Pi(['', ""], ['', ""])), i, e) : t.get("selectorsAdd") || L, e = v && L ? L : e, e += C ? pt(tr || (tr = Pi([':', ""], [':', ""])), i, C) : "", e = d ? d({ result: e, state: C, target: t }) : e; } return e && '').concat(e, ""); }, r.prototype.stateChanged = function(t) { var e = this.em, n = t.target.value; e.set("state", n); }, r.prototype.addNewTag = function(t) { var e = t.trim(); e && (this.module.addSelected({ label: e }), this.endNewTag()); }, r.prototype.addToClasses = function(t, e) { var n = e, i = this.getClasses(), l = new Rp({ model: t, config: this.config, coll: this.collection, module: this.module }).render().el; return n ? n.appendChild(l) : i.append(l), l; }, r.prototype.renderClasses = function() { var t = this, e = document.createDocumentFragment(), n = this.getClasses(); n.empty(), this.collection.each(function(i) { return t.addToClasses(i, e); }), n.append(e); }, r.prototype.getClasses = function() { return this.$el.find("[data-selectors]"); }, r.prototype.getStates = function() { if (!this.$states) { var t = this.$el.find("[data-states]"); this.$states = t[0] && t; } return this.$states; }, r.prototype.getStatesC = function() { return this.$statesC || (this.$statesC = this.$el.find("#" + this.stateInputC)), this.$statesC; }, r.prototype.renderStates = function() { var t = this.module, e = this.em, n = e.t("selectorManager.emptyState"), i = t.getStates().map(function(f) { var d = e.t("selectorManager.states.".concat(f.id)) || f.getLabel() || f.id; return '"); }).join(""), l = this.getStates(); l && l.html('").concat(i)), this.checkStates(); }, r.prototype.render = function() { var t = this, e = t.em, n = t.pfx, i = t.ppfx, l = t.config, f = t.$el, d = t.el, v = l.render, h = { iconSync: l.iconSync, iconAdd: l.iconAdd, labelHead: e.t("selectorManager.label"), labelInfo: e.t("selectorManager.selected"), ppfx: i, pfx: n, el: d }; f.html(this.template(h)); var w = v && v(h); return w && w !== d && f.empty().append(w), this.$input = f.find("[data-input]"), this.$addBtn = f.find("[data-add]"), this.$classes = f.find("#" + n + "tags-c"), this.$btnSyncEl = f.find("[data-sync-style]"), this.$input.hide(), this.renderStates(), this.renderClasses(), f.attr("class", "".concat(this.className, " ").concat(i, "one-bg ").concat(i, "two-color")), this; }, r; }(k.G7); const lu = tl; var el, Jl, cu, Zl, tr, nl = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ps = function() { return ps = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ps.apply(this, arguments); }, rl = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, Ql = function(a) { return (0, S.isString)(a) && a[0] == "#"; }, Ei = function(a) { return (0, S.isString)(a) && a[0] == "."; }, ia = "selector", fs = "".concat(ia, ":"), uu = "".concat(fs, "add"), pu = "".concat(fs, "update"), Ai = "".concat(fs, "remove"), fu = "".concat(Ai, ":before"), ol = "".concat(fs, "custom"), tc = "".concat(fs, "state"), sa = { all: ia, update: pu, add: uu, remove: Ai, removeBefore: fu, state: tc, custom: ol }, Hp = function(a) { function r(t) { var e = a.call(this, t, "SelectorManager", new Cr([]), sa, au, { skipListen: !0 }) || this; e.Selector = Jn, e.Selectors = Cr, e.storageKey = "", (0, S.bindAll)(e, "__updateSelectedByComponents"); var n = e.config, i = n.pStylePrefix; return i && (n.stylePrefix = i + n.stylePrefix), e.all = new Cr(n.selectors), e.selected = new Cr([], { em: t, config: n }), e.states = new k.FE(n.states.map(function(l) { return new Kl(l); }), { model: Kl }), e.model = new k.Hn({ cFirst: n.componentFirst, _undo: !0 }), e.__update = (0, S.debounce)(function() { return e.__trgCustom(); }, 0), e.__initListen({ collections: [e.states, e.selected], propagate: [{ entity: e.states, event: e.events.state }] }), t.on("change:state", function(l, f) { return t.trigger(tc, f); }), e.model.on("change:cFirst", function(l, f) { return t.trigger("selector:type", f); }), t.on("component:toggled component:update:classes", e.__updateSelectedByComponents), e.model.listenTo(t, "component:toggled component:update:classes change:device styleManager:update selector:state selector:type style:target", function() { return e.__update(); }), e; } return nl(r, a), r.prototype.__trgCustom = function(t) { this.em.trigger(this.events.custom, this.__customData(t)); }, r.prototype.getAll = function(t) { return t === void 0 && (t = {}), this.all ? t.array ? rl([], this.all.models, !0) : this.all : []; }, r.prototype.__customData = function(t) { t === void 0 && (t = {}); var e = t.container; return { states: this.getStates(), selected: this.getSelected(), container: e }; }, r.prototype.postRender = function() { this.__appendTo(), this.__trgCustom(); }, r.prototype.select = function(t, e) { e === void 0 && (e = {}); var n = Array.isArray(t) ? t : [t], i = this.em.Styles.select(n, e); this.selected.reset(this.__getCommonSelectors(i)); var l = this.selectorTags, f = i.filter(function(d) { return d; }).map(function(d) { return (0, H.isComponent)(d) || (0, H.isRule)(d) && !d.get("selectorsAdd") ? d : d.getSelectorsString(); }); return l && l.componentChanged({ targets: f }), this; }, r.prototype.addSelector = function(t, e, n) { e === void 0 && (e = {}), n === void 0 && (n = {}); var i = ps({}, e); (0, S.isObject)(t) ? i = t : i.name = t, Ql(i.name) ? (i.name = i.name.substr(1), i.type = Jn.TYPE_ID) : Ei(i.name) && (i.name = i.name.substr(1)), i.label && !i.name && (i.name = this.escapeName(i.label)); var l = i.name, f = this.getConfig(), d = this.all, v = this.em, h = l ? this.get(l, i.type) : d.where(i)[0]; if (!h) { var w = i instanceof Jn ? i : new Jn(i, ps(ps({}, n), { config: f, em: v })); return d.add(w, n); } return h; }, r.prototype.getSelector = function(t, e) { return e === void 0 && (e = Jn.TYPE_CLASS), Ql(t) ? (t = t.substr(1), e = Jn.TYPE_ID) : Ei(t) && (t = t.substr(1)), this.all.where({ name: t, type: e })[0]; }, r.prototype.add = function(t, e) { var n = this; e === void 0 && (e = {}); var i = (0, S.isString)(t) ? {} : e; return (0, S.isArray)(t) ? t.map(function(l) { return n.addSelector(l, e, i); }) : this.addSelector(t, e, i); }, r.prototype.addClass = function(t) { var e = this, n = []; return (0, S.isString)(t) && (t = t.trim().split(" ")), t.forEach(function(i) { return n.push(e.addSelector(i)); }), n; }, r.prototype.get = function(t, e) { var n = this; if ((0, S.isArray)(t)) { var i = []; return t.map(function(l) { return n.getSelector(l); }).filter(Boolean).forEach(function(l) { return i.indexOf(l) < 0 && i.push(l); }), i; } return this.getSelector(t, e); }, r.prototype.remove = function(t, e) { return this.__remove(t, e); }, r.prototype.rename = function(t, e, n) { var i = this.escapeName(e); return this.get(i) || t.set({ name: i, label: e }, n); }, r.prototype.setState = function(t) { return this.em.setState(t), this; }, r.prototype.getState = function() { return this.em.getState(); }, r.prototype.getStates = function() { return rl([], this.states.models, !0); }, r.prototype.setStates = function(t, e) { return this.states.reset(t.map(function(n) { return new Kl(n); }), e); }, r.prototype.getSelected = function() { return this.__getCommon(); }, r.prototype.getSelectedAll = function() { return rl([], this.selected.models, !0); }, r.prototype.addSelected = function(t) { var e = this.add(t); this.em.getSelectedAll().forEach(function(n) { n.getSelectors().add(e); }); }, r.prototype.removeSelected = function(t) { this.em.getSelectedAll().forEach(function(e) { !t.get("protected") && e && e.getSelectors().remove(t); }); }, r.prototype.duplicateSelected = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this.em, l = this.getSelected(); if (!(l.indexOf(t) < 0)) { var f = this.getState(), d = i.getCurrentMedia(), v = i.Css.get(l, f, d), h = v == null ? void 0 : v.getStyle(); i.getSelectedAll().forEach(function(w) { var C = w.getSelectors(); if (C.includes(t)) { var L = e.suffix || " copy", F = t.getLabel(), q = n.addSelector("".concat(F).concat(L)), et = C.indexOf(t); C.remove(t), C.add(q, { at: et }); } }), h && i.Css.add(this.getSelected(), f, d).setStyle(h); } }, r.prototype.getSelectedTargets = function() { return this.em.Styles.getSelectedAll(); }, r.prototype.setComponentFirst = function(t) { this.getConfig().componentFirst = t, this.model.set({ cFirst: t }); }, r.prototype.getComponentFirst = function() { return this.getConfig().componentFirst; }, r.prototype.escapeName = function(t) { var e = this.getConfig().escapeName; return e ? e(t) : Jn.escapeName(t); }, r.prototype.render = function(t) { var e = this.selectorTags, n = this.getConfig(), i = e == null ? void 0 : e.el; return this.selected.reset(t), this.selectorTags = new lu({ el: i, collection: this.selected, module: this, config: n }), this.selectorTags.render().el; }, r.prototype.destroy = function() { var t = this.selectorTags; this.model.stopListening(), this.__update.cancel(), this.__destroy(), t == null || t.remove(), this.selectorTags = void 0; }, r.prototype.__getCommon = function() { return this.__getCommonSelectors(this.em.getSelectedAll()); }, r.prototype.__getCommonSelectors = function(t, e) { e === void 0 && (e = {}); var n = t.map(function(i) { return i.getSelectors && i.getSelectors().getValid(e); }).filter(Boolean); return this.__common.apply(this, n); }, r.prototype.__common = function() { for (var t = this, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; return e.length ? e.length === 1 ? e[0] : e.length === 2 ? e[0].filter(function(i) { return e[1].indexOf(i) >= 0; }) : e.slice(1).reduce(function(i, l) { return t.__common(i, l); }, e[0]) : []; }, r.prototype.__updateSelectedByComponents = function() { this.selected.reset(this.__getCommon()); }, r; }(Dt); const ds = Hp, du = { textTags: ["br", "b", "i", "u", "a", "ul", "ol"], parserCss: void 0, parserHtml: void 0, optionsHtml: { htmlType: "text/html", allowScripts: !1, allowUnsafeAttr: !1, keepEmptyTextNodes: !1 } }; var aa = { 4: "media", 5: "font-face", 6: "page", 7: "keyframes", 11: "counter-style", 12: "supports", 13: "document", 14: "font-feature-values", 15: "viewport" }, hu = (0, S.keys)(aa), la = ["5", "6", "11", "15"], ca = ["font-face", "page", "counter-style", "viewport"], hs = function(a) { a === void 0 && (a = ""); for (var r = [], t = [], e = a.split(","), n = 0, i = e.length; n < i; n++) { var l = e[n].trim(); if (/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(l) || /^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(l)) { var f = l.split(".").filter(Boolean); t.push(f); } else r.push(l); } return { result: t, add: r }; }, ua = function(a) { for (var r = a.style, t = {}, e = 0, n = r.length; e < n; e++) { var i = r[e], l = r.getPropertyValue(i), f = r.getPropertyPriority(i); t[i] = "".concat(l).concat(f ? " !".concat(f) : ""); } return t; }, ec = function(a) { return (a.conditionText || a.media && a.media.mediaText || a.name || a.selectorText || "").trim(); }, nc = function(a, r, t) { r === void 0 && (r = {}), t === void 0 && (t = {}); var e = {}, n = a.length, i = a[n - 1], l = i ? i.split(/:(.+)/) : [], f = l[1], d = t.atRule, v = t.selectorsAdd, h = t.mediaText; return ca.indexOf(d) >= 0 && (e.singleAtRule = !0), d && (e.atRuleType = d), v && (e.selectorsAdd = v), h && (e.mediaText = h), f && (a[n - 1] = l[0], e.state = f, l.splice(l.length - 1, 1)), e.selectors = a, e.style = r, e; }, rc = function(a) { for (var r = [], t = a.cssRules || [], e = 0, n = t.length; e < n; e++) { var i = t[e], l = i.type.toString(), f = !1, d = "", v = "", h = i.selectorText || i.keyText, w = la.indexOf(l) >= 0; if (w) f = !0, d = aa[l], v = ec(i); else if (hu.indexOf(l) >= 0) { var C = rc(i); v = ec(i); for (var L = 0, F = C.length; L < F; L++) { var q = C[L]; v && (q.mediaText = v), q.atRuleType = aa[l]; } r = r.concat(C); } if (h || w) { for (var et = ua(i), X = hs(h), At = X.add, It = X.result, ie = void 0, se = 0, Me = It.length; se < Me; se++) { var Ie = nc(It[se], et, { atRule: aa[l] }); r.push(Ie), ie = Ie; } if (At.length) { var Je = At.join(", "); ie ? ie.selectorsAdd = Je : (Ie = { selectors: [], selectorsAdd: Je, style: et }, f && (Ie.singleAtRule = f), d && (Ie.atRuleType = d), v && (Ie.mediaText = v), r.push(Ie)); } } } return r; }; const ei = function(a, r) { return r === void 0 && (r = {}), { parse: function(t) { var e = this, n = [], i = r.parserCss, l = a == null ? void 0 : a.Editor, f = i ? i(t, l) : function(d) { var v = document.createElement("style"); v.innerHTML = d, document.head.appendChild(v); var h = v.sheet; return document.head.removeChild(v), rc(h); }(t); return f.forEach(function(d) { return n = n.concat(e.checkNode(d)); }), a == null || a.trigger("parse:css", { input: t, output: n }), n; }, checkNode: function(t) { var e = t.selectors, n = t.style, i = [t]; if ((0, S.isString)(e)) { var l = [], f = t, d = hs(e), v = d.result, h = d.add.join(", "), w = { atRule: f.atRule, mediaText: f.params }; v.length ? v.forEach(function(C) { l.push(nc(C, n, w)); }) : l.push(nc([], n, w)), h && (l[l.length - 1].selectorsAdd = h), i = l; } return i; } }; }; var gs = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), pa = function(a) { function r(t) { var e = a.call(this, t, "Parser", du) || this, n = e.config; return e.parserCss = ei(t, n), e.parserHtml = oe(t, n), e; } return gs(r, a), r.prototype.parseHtml = function(t, e) { e === void 0 && (e = {}); var n = this.em, i = this.parserHtml; return i.compTypes = n.Components.getTypes() || {}, i.parse(t, this.parserCss, e); }, r.prototype.parseCss = function(t) { return this.parserCss.parse(t); }, r.prototype.destroy = function() { }, r; }(jt); const zp = pa, gu = { id: "gjs-", type: "local", autosave: !0, autoload: !0, stepsBeforeSave: 1, recovery: !1, onStore: function(a) { return a; }, onLoad: function(a) { return a; }, options: { local: { key: "gjsProject", checkLocal: !0 }, remote: { headers: {}, urlStore: "", urlLoad: "", contentTypeJson: !0, fetchOptions: "", credentials: "include", onStore: function(a) { return a; }, onLoad: function(a) { return a; } } } }; var vu = function(a, r, t, e) { return new (t || (t = Promise))(function(n, i) { function l(v) { try { d(e.next(v)); } catch (h) { i(h); } } function f(v) { try { d(e.throw(v)); } catch (h) { i(h); } } function d(v) { var h; v.done ? n(v.value) : (h = v.value, h instanceof t ? h : new t(function(w) { w(h); })).then(l, f); } d((e = e.apply(a, r || [])).next()); }); }, mu = function(a, r) { var t, e, n, i, l = { label: 0, sent: function() { if (1 & n[0]) throw n[1]; return n[1]; }, trys: [], ops: [] }; return i = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() { return this; }), i; function f(d) { return function(v) { return function(h) { if (t) throw new TypeError("Generator is already executing."); for (; i && (i = 0, h[0] && (l = 0)), l; ) try { if (t = 1, e && (n = 2 & h[0] ? e.return : h[0] ? e.throw || ((n = e.return) && n.call(e), 0) : e.next) && !(n = n.call(e, h[1])).done) return n; switch (e = 0, n && (h = [2 & h[0], n.value]), h[0]) { case 0: case 1: n = h; break; case 4: return l.label++, { value: h[1], done: !1 }; case 5: l.label++, e = h[1], h = [0]; continue; case 7: h = l.ops.pop(), l.trys.pop(); continue; default: if (n = l.trys, !((n = n.length > 0 && n[n.length - 1]) || h[0] !== 6 && h[0] !== 2)) { l = 0; continue; } if (h[0] === 3 && (!n || h[1] > n[0] && h[1] < n[3])) { l.label = h[1]; break; } if (h[0] === 6 && l.label < n[1]) { l.label = n[1], n = h; break; } if (n && l.label < n[2]) { l.label = n[2], l.ops.push(h); break; } n[2] && l.ops.pop(), l.trys.pop(); continue; } h = r.call(a, l); } catch (w) { h = [6, w], e = 0; } finally { t = n = 0; } if (5 & h[0]) throw h[1]; return { value: h[0] ? h[1] : void 0, done: !0 }; }([d, v]); }; } }; const Up = function() { function a() { } return a.prototype.store = function(r, t) { return t === void 0 && (t = {}), vu(this, void 0, void 0, function() { return mu(this, function(e) { return this.hasLocal(t, !0) && localStorage.setItem(t.key, JSON.stringify(r)), [2, r]; }); }); }, a.prototype.load = function(r) { return r === void 0 && (r = {}), vu(this, void 0, void 0, function() { var t; return mu(this, function(e) { return t = {}, this.hasLocal(r, !0) && (t = JSON.parse(localStorage.getItem(r.key) || "{}")), [2, t]; }); }); }, a.prototype.hasLocal = function(r, t) { if (r === void 0 && (r = {}), r.checkLocal && (!(0, H.hasWin)() || !localStorage)) { if (t) throw new Error("localStorage not available"); return !1; } return !0; }, a; }(); function Fn(a) { return Fn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) { return typeof r; } : function(r) { return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r; }, Fn(a); } const yu = function(a) { var r = this.constructor; return this.then(function(t) { return r.resolve(a()).then(function() { return t; }); }, function(t) { return r.resolve(a()).then(function() { return r.reject(t); }); }); }, Bp = function(a) { return new this(function(r, t) { if (!a || a.length === void 0) return t(new TypeError(Fn(a) + " " + a + " is not iterable(cannot read property Symbol(Symbol.iterator))")); var e = Array.prototype.slice.call(a); if (e.length === 0) return r([]); var n = e.length; function i(f, d) { if (d && (Fn(d) === "object" || typeof d == "function")) { var v = d.then; if (typeof v == "function") return void v.call(d, function(h) { i(f, h); }, function(h) { e[f] = { status: "rejected", reason: h }, --n == 0 && r(e); }); } e[f] = { status: "fulfilled", value: d }, --n == 0 && r(e); } for (var l = 0; l < e.length; l++) i(l, e[l]); }); }; function bu(a, r) { this.name = "AggregateError", this.errors = a, this.message = r || ""; } bu.prototype = Error.prototype; const Wp = function(a) { var r = this; return new r(function(t, e) { if (!a || a.length === void 0) return e(new TypeError("Promise.any accepts an array")); var n = Array.prototype.slice.call(a); if (n.length === 0) return e(); for (var i = [], l = 0; l < n.length; l++) try { r.resolve(n[l]).then(t).catch(function(f) { i.push(f), i.length === n.length && e(new bu(i, "All promises were rejected")); }); } catch (f) { e(f); } }); }; var wu = setTimeout; function oc(a) { return !!(a && a.length !== void 0); } function _u() { } function Sn(a) { if (!(this instanceof Sn)) throw new TypeError("Promises must be constructed via new"); if (typeof a != "function") throw new TypeError("not a function"); this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], vs(a, this); } function xu(a, r) { for (; a._state === 3; ) a = a._value; a._state !== 0 ? (a._handled = !0, Sn._immediateFn(function() { var t = a._state === 1 ? r.onFulfilled : r.onRejected; if (t !== null) { var e; try { e = t(a._value); } catch (n) { return void to(r.promise, n); } ic(r.promise, e); } else (a._state === 1 ? ic : to)(r.promise, a._value); })) : a._deferreds.push(r); } function ic(a, r) { try { if (r === a) throw new TypeError("A promise cannot be resolved with itself."); if (r && (Fn(r) === "object" || typeof r == "function")) { var t = r.then; if (r instanceof Sn) return a._state = 3, a._value = r, void ji(a); if (typeof t == "function") return void vs((e = t, n = r, function() { e.apply(n, arguments); }), a); } a._state = 1, a._value = r, ji(a); } catch (i) { to(a, i); } var e, n; } function to(a, r) { a._state = 2, a._value = r, ji(a); } function ji(a) { a._state === 2 && a._deferreds.length === 0 && Sn._immediateFn(function() { a._handled || Sn._unhandledRejectionFn(a._value); }); for (var r = 0, t = a._deferreds.length; r < t; r++) xu(a, a._deferreds[r]); a._deferreds = null; } function il(a, r, t) { this.onFulfilled = typeof a == "function" ? a : null, this.onRejected = typeof r == "function" ? r : null, this.promise = t; } function vs(a, r) { var t = !1; try { a(function(e) { t || (t = !0, ic(r, e)); }, function(e) { t || (t = !0, to(r, e)); }); } catch (e) { if (t) return; t = !0, to(r, e); } } Sn.prototype.catch = function(a) { return this.then(null, a); }, Sn.prototype.then = function(a, r) { var t = new this.constructor(_u); return xu(this, new il(a, r, t)), t; }, Sn.prototype.finally = yu, Sn.all = function(a) { return new Sn(function(r, t) { if (!oc(a)) return t(new TypeError("Promise.all accepts an array")); var e = Array.prototype.slice.call(a); if (e.length === 0) return r([]); var n = e.length; function i(f, d) { try { if (d && (Fn(d) === "object" || typeof d == "function")) { var v = d.then; if (typeof v == "function") return void v.call(d, function(h) { i(f, h); }, t); } e[f] = d, --n == 0 && r(e); } catch (h) { t(h); } } for (var l = 0; l < e.length; l++) i(l, e[l]); }); }, Sn.any = Wp, Sn.allSettled = Bp, Sn.resolve = function(a) { return a && Fn(a) === "object" && a.constructor === Sn ? a : new Sn(function(r) { r(a); }); }, Sn.reject = function(a) { return new Sn(function(r, t) { t(a); }); }, Sn.race = function(a) { return new Sn(function(r, t) { if (!oc(a)) return t(new TypeError("Promise.race accepts an array")); for (var e = 0, n = a.length; e < n; e++) Sn.resolve(a[e]).then(r, t); }); }, Sn._immediateFn = typeof setImmediate == "function" && function(a) { setImmediate(a); } || function(a) { wu(a, 0); }, Sn._unhandledRejectionFn = function(a) { typeof console < "u" && console && console.warn("Possible Unhandled Promise Rejection:", a); }; const uo = Sn; (0, H.hasWin)() && (window.Promise = window.Promise || uo); const Cu = typeof fetch == "function" ? fetch.bind() : function(a, r) { return new uo(function(t, e) { var n = new XMLHttpRequest(); for (var i in n.open(r.method || "get", a), n.withCredentials = r.credentials == "include", r.headers || {}) n.setRequestHeader(i, r.headers[i]); n.onload = function(l) { return t({ status: n.status, statusText: n.statusText, text: function() { return uo.resolve(n.responseText); } }); }, n.onerror = e, n.upload && r.onProgress && (n.upload.onprogress = r.onProgress), r.body ? n.send(r.body) : n.send(); }); }; var sl = function() { return sl = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, sl.apply(this, arguments); }, Mi = function(a, r, t, e) { return new (t || (t = Promise))(function(n, i) { function l(v) { try { d(e.next(v)); } catch (h) { i(h); } } function f(v) { try { d(e.throw(v)); } catch (h) { i(h); } } function d(v) { var h; v.done ? n(v.value) : (h = v.value, h instanceof t ? h : new t(function(w) { w(h); })).then(l, f); } d((e = e.apply(a, r || [])).next()); }); }, sc = function(a, r) { var t, e, n, i, l = { label: 0, sent: function() { if (1 & n[0]) throw n[1]; return n[1]; }, trys: [], ops: [] }; return i = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() { return this; }), i; function f(d) { return function(v) { return function(h) { if (t) throw new TypeError("Generator is already executing."); for (; i && (i = 0, h[0] && (l = 0)), l; ) try { if (t = 1, e && (n = 2 & h[0] ? e.return : h[0] ? e.throw || ((n = e.return) && n.call(e), 0) : e.next) && !(n = n.call(e, h[1])).done) return n; switch (e = 0, n && (h = [2 & h[0], n.value]), h[0]) { case 0: case 1: n = h; break; case 4: return l.label++, { value: h[1], done: !1 }; case 5: l.label++, e = h[1], h = [0]; continue; case 7: h = l.ops.pop(), l.trys.pop(); continue; default: if (n = l.trys, !((n = n.length > 0 && n[n.length - 1]) || h[0] !== 6 && h[0] !== 2)) { l = 0; continue; } if (h[0] === 3 && (!n || h[1] > n[0] && h[1] < n[3])) { l.label = h[1]; break; } if (h[0] === 6 && l.label < n[1]) { l.label = n[1], n = h; break; } if (n && l.label < n[2]) { l.label = n[2], l.ops.push(h); break; } n[2] && l.ops.pop(), l.trys.pop(); continue; } h = r.call(a, l); } catch (w) { h = [6, w], e = 0; } finally { t = n = 0; } if (5 & h[0]) throw h[1]; return { value: h[0] ? h[1] : void 0, done: !0 }; }([d, v]); }; } }; const Su = function() { function a() { } return a.prototype.store = function(r, t) { return t === void 0 && (t = {}), Mi(this, void 0, void 0, function() { return sc(this, function(e) { switch (e.label) { case 0: return [4, this.request(t.urlStore, this.__props(t, r), t)]; case 1: return [2, e.sent()]; } }); }); }, a.prototype.load = function(r) { return r === void 0 && (r = {}), Mi(this, void 0, void 0, function() { return sc(this, function(t) { switch (t.label) { case 0: return [4, this.request(r.urlLoad, this.__props(r), r)]; case 1: return [2, t.sent()]; } }); }); }, a.prototype.request = function(r, t, e) { return t === void 0 && (t = {}), e === void 0 && (e = {}), Cu(r, t).then(function(n) { var i = n.text(); return (n.status / 200 | 0) == 1 ? i : i.then(Promise.reject); }).then(function(n) { var i = n && (0, S.isString)(n); return e.contentTypeJson && i ? JSON.parse(n) : n; }); }, a.prototype.__props = function(r, t) { r === void 0 && (r = {}); var e, n = r.contentTypeJson, i = r.headers || {}, l = r.fetchOptions || {}, f = "X-Requested-With", d = "Content-Type"; if ((0, S.isUndefined)(i[f]) && (i[f] = "XMLHttpRequest"), (0, S.isUndefined)(i[d]) && n && (i[d] = "application/json; charset=utf-8"), t) if (n) e = JSON.stringify(t); else for (var v in e = new FormData(), t) e.append(v, t[v]); var h = { method: e ? "POST" : "GET", credentials: r.credentials, headers: i, body: e }; return sl(sl({}, h), (0, S.isFunction)(l) ? l(h) : l); }, a; }(); var Ou = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), No = function() { return No = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, No.apply(this, arguments); }, ni = function(a, r, t, e) { return new (t || (t = Promise))(function(n, i) { function l(v) { try { d(e.next(v)); } catch (h) { i(h); } } function f(v) { try { d(e.throw(v)); } catch (h) { i(h); } } function d(v) { var h; v.done ? n(v.value) : (h = v.value, h instanceof t ? h : new t(function(w) { w(h); })).then(l, f); } d((e = e.apply(a, r || [])).next()); }); }, fa = function(a, r) { var t, e, n, i, l = { label: 0, sent: function() { if (1 & n[0]) throw n[1]; return n[1]; }, trys: [], ops: [] }; return i = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() { return this; }), i; function f(d) { return function(v) { return function(h) { if (t) throw new TypeError("Generator is already executing."); for (; i && (i = 0, h[0] && (l = 0)), l; ) try { if (t = 1, e && (n = 2 & h[0] ? e.return : h[0] ? e.throw || ((n = e.return) && n.call(e), 0) : e.next) && !(n = n.call(e, h[1])).done) return n; switch (e = 0, n && (h = [2 & h[0], n.value]), h[0]) { case 0: case 1: n = h; break; case 4: return l.label++, { value: h[1], done: !1 }; case 5: l.label++, e = h[1], h = [0]; continue; case 7: h = l.ops.pop(), l.trys.pop(); continue; default: if (n = l.trys, !((n = n.length > 0 && n[n.length - 1]) || h[0] !== 6 && h[0] !== 2)) { l = 0; continue; } if (h[0] === 3 && (!n || h[1] > n[0] && h[1] < n[3])) { l.label = h[1]; break; } if (h[0] === 6 && l.label < n[1]) { l.label = n[1], n = h; break; } if (n && l.label < n[2]) { l.label = n[2], l.ops.push(h); break; } n[2] && l.ops.pop(), l.trys.pop(); continue; } h = r.call(a, l); } catch (w) { h = [6, w], e = 0; } finally { t = n = 0; } if (5 & h[0]) throw h[1]; return { value: h[0] ? h[1] : void 0, done: !0 }; }([d, v]); }; } }, al = "storage:start", ll = "storage:after", Tu = "storage:end", ms = "storage:error", da = "local", ku = "remote", Pu = function(a) { function r(t) { var e = a.call(this, t, "StorageManager", gu) || this; e.storages = {}; var n = e.config; return n._disable && (n.type = ""), e.storages = {}, e.add(da, new Up()), e.add(ku, new Su()), e.setCurrent(n.type), e; } return Ou(r, a), r.prototype.isAutosave = function() { return !!this.config.autosave; }, r.prototype.setAutosave = function(t) { return this.config.autosave = !!t, this; }, r.prototype.getStepsBeforeSave = function() { return this.config.stepsBeforeSave; }, r.prototype.setStepsBeforeSave = function(t) { return this.config.stepsBeforeSave = t, this; }, r.prototype.add = function(t, e) { return this.storages[t] = e, this; }, r.prototype.get = function(t) { return this.storages[t]; }, r.prototype.getStorages = function() { return this.storages; }, r.prototype.getCurrent = function() { return this.config.currentStorage; }, r.prototype.setCurrent = function(t) { return this.getConfig().currentStorage = t, this; }, r.prototype.getCurrentStorage = function() { return this.get(this.getCurrent()); }, r.prototype.getStorageOptions = function(t) { return this.getCurrentOptions(t); }, r.prototype.store = function(t, e) { return e === void 0 && (e = {}), ni(this, void 0, void 0, function() { var n, i, l, f, d; return fa(this, function(v) { switch (v.label) { case 0: n = this.getCurrentStorage(), i = No(No({}, this.getCurrentOptions()), e), l = this.getRecoveryStorage(), f = this.getCurrentOptions(da), v.label = 1; case 1: return v.trys.push([1, 5, , 9]), [4, this.__exec(n, i, t)]; case 2: return v.sent(), l ? [4, this.__exec(l, f, {})] : [3, 4]; case 3: v.sent(), v.label = 4; case 4: return [3, 9]; case 5: return d = v.sent(), l ? [4, this.__exec(l, f, t)] : [3, 7]; case 6: return v.sent(), [3, 8]; case 7: throw d; case 8: return [3, 9]; case 9: return [2, t]; } }); }); }, r.prototype.load = function(t) { return t === void 0 && (t = {}), ni(this, void 0, void 0, function() { var e, n, i, l, f; return fa(this, function(d) { switch (d.label) { case 0: return e = this.getCurrentStorage(), n = No(No({}, this.getCurrentOptions()), t), (i = this.getRecoveryStorage()) ? [4, this.__exec(i, this.getCurrentOptions(da))] : [3, 5]; case 1: if (f = d.sent(), (0, S.isEmpty)(f)) return [3, 5]; d.label = 2; case 2: return d.trys.push([2, 4, , 5]), [4, this.__askRecovery()]; case 3: return d.sent(), l = f, [3, 5]; case 4: return d.sent(), [3, 5]; case 5: return l ? [3, 7] : [4, this.__exec(e, n)]; case 6: l = d.sent(), d.label = 7; case 7: return [2, l || {}]; } }); }); }, r.prototype.__askRecovery = function() { var t = this.em, e = this.getRecovery(); return new Promise(function(n, i) { (0, S.isFunction)(e) ? e(n, i, t == null ? void 0 : t.getEditor()) : confirm(t == null ? void 0 : t.t("storageManager.recover")) ? n(null) : i(); }); }, r.prototype.getRecovery = function() { return this.config.recovery; }, r.prototype.getRecoveryStorage = function() { return this.getRecovery() && this.getCurrent() === ku && this.get(da); }, r.prototype.__exec = function(t, e, n) { var i; return ni(this, void 0, void 0, function() { var l, f, d, v, h, w, C, L, F, q, et, X, At; return fa(this, function(It) { switch (It.label) { case 0: if (l = n ? "store" : "load", f = this.getConfig(), d = f.onStore, v = f.onLoad, this.onStart(l, n), !t) return [2, n || {}]; It.label = 1; case 1: return It.trys.push([1, 14, , 15]), w = (i = this.em) === null || i === void 0 ? void 0 : i.getEditor(), C = void 0, n ? (F = d) ? [4, d(n, w)] : [3, 3] : [3, 7]; case 2: F = It.sent(), It.label = 3; case 3: return L = F || n, (q = e.onStore) ? [4, e.onStore(L, w)] : [3, 5]; case 4: q = It.sent(), It.label = 5; case 5: return L = q || L, [4, t.store(L, e)]; case 6: return C = It.sent(), h = n, [3, 13]; case 7: return [4, t.load(e)]; case 8: return C = It.sent(), h = this.__clearKeys(C), (et = e.onLoad) ? [4, e.onLoad(h, w)] : [3, 10]; case 9: et = It.sent(), It.label = 10; case 10: return h = et || h, (X = v) ? [4, v(h, w)] : [3, 12]; case 11: X = It.sent(), It.label = 12; case 12: h = X || h, It.label = 13; case 13: return this.onAfter(l, h, C), this.onEnd(l, h), [3, 15]; case 14: throw At = It.sent(), this.onError(l, At), At; case 15: return [2, h]; } }); }); }, r.prototype.__clearKeys = function(t) { t === void 0 && (t = {}); var e = this.getConfig(), n = new RegExp("^".concat(e.id)), i = {}; for (var l in t) i[l.replace(n, "")] = t[l]; return i; }, r.prototype.getCurrentOptions = function(t) { var e = this.getConfig(), n = t || this.getCurrent(); return e.options[n] || {}; }, r.prototype.onStart = function(t, e) { var n = this.em; n && (n.trigger(al), t && n.trigger("".concat(al, ":").concat(t), e)); }, r.prototype.onAfter = function(t, e, n) { var i = this.em; i && (i.trigger(ll), i.trigger("".concat(ll, ":").concat(t), e, n), i.trigger("storage:".concat(t), e, n)); }, r.prototype.onEnd = function(t, e) { var n = this.em; n && (n.trigger(Tu), t && n.trigger("".concat(Tu, ":").concat(t), e)); }, r.prototype.onError = function(t, e) { var n = this.em; n && (n.trigger(ms, e), t && n.trigger("".concat(ms, ":").concat(t), e), this.onEnd(t, e)); }, r.prototype.canAutoload = function() { return !!this.getCurrentStorage() && !!this.config.autoload; }, r.prototype.destroy = function() { this.storages = {}; }, r; }(jt); const cl = Pu, $p = { stylePrefix: "trt-", appendTo: "", optionsTarget: [{ value: !1 }, { value: "_blank" }] }; var qp = gn(330), ha = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ys = function() { return ys = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ys.apply(this, arguments); }, ac = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; e.events = {}, e.appendInput = !0; var n = t.config, i = n === void 0 ? {} : n, l = e, f = l.model, d = l.eventCapture, v = f.target, h = f.attributes.type; e.config = i, e.em = i.em, e.pfx = i.stylePrefix || "", e.ppfx = i.pStylePrefix || "", e.target = v; var w = e.ppfx; return e.clsField = "".concat(w, "field ").concat(w, "field-").concat(h), [["change:value", e.onValueChange], ["remove", e.removeView]].forEach(function(C) { var L = C[0], F = C[1]; f.off(L, F), e.listenTo(f, L, F); }), f.view = e, e.listenTo(f, "change:label", e.render), e.listenTo(f, "change:placeholder", e.rerender), e.events = {}, d.forEach(function(C) { return e.events[C] = "onChange"; }), e.delegateEvents(), e.init(), e; } return ha(r, a), r.prototype.attributes = function() { return this.model.get("attributes") || {}; }, r.prototype.templateLabel = function(t) { var e = this.ppfx, n = this.getLabel(); return '
').concat(n, "
"); }, r.prototype.templateInput = function(t) { var e = this.clsField; return '
'); }, r.prototype.getClbOpts = function() { return { component: this.target, trait: this.model, elInput: this.getInputElem() }; }, r.prototype.removeView = function() { this.remove(), this.removed(); }, r.prototype.init = function() { }, r.prototype.removed = function() { }, r.prototype.onRender = function(t) { }, r.prototype.onUpdate = function(t) { }, r.prototype.onEvent = function(t) { }, r.prototype.onChange = function(t) { var e = this.getInputElem(); e && !(0, S.isUndefined)(e.value) && this.model.set("value", e.value), this.onEvent(ys(ys({}, this.getClbOpts()), { event: t })); }, r.prototype.getValueForTarget = function() { return this.model.get("value"); }, r.prototype.setInputValue = function(t) { var e = this.getInputElem(); e && (e.value = t); }, r.prototype.onValueChange = function(t, e, n) { if (n === void 0 && (n = {}), n.fromTarget) this.setInputValue(t.get("value")), this.postUpdate(); else { var i = this.getValueForTarget(); t.setTargetValue(i, n); } }, r.prototype.renderLabel = function() { var t = this.$el, e = this.target, n = this.getLabel(), i = this.templateLabel(e); this.createLabel && (i = this.createLabel({ label: n, component: e, trait: this }) || ""), t.find("[data-label]").append(i); }, r.prototype.getLabel = function() { var t = this.em, e = this.model.attributes, n = e.label, i = e.name; return t.t("traitManager.traits.labels.".concat(i)) || (0, H.capitalize)(n || i).replace(/-/g, " "); }, r.prototype.getComponent = function() { return this.target; }, r.prototype.getInputEl = function() { if (!this.$input) { var t = this.em, e = this.model, n = e, i = e.attributes.name, l = n.get("placeholder") || n.get("default") || "", f = n.get("type") || "text", d = n.get("min"), v = n.get("max"), h = this.getModelValue(), w = (0, W.default)('')), C = t.t("traitManager.traits.attributes.".concat(i)) || {}; w.attr(ys({ placeholder: l }, C)), (0, S.isUndefined)(h) || (n.set({ value: h }, { silent: !0 }), w.prop("value", h)), d && w.prop("min", d), v && w.prop("max", v), this.$input = w; } return this.$input.get(0); }, r.prototype.getInputElem = function() { var t = this.input, e = this.$input; return t || e && e.get && e.get(0) || this.getElInput(); }, r.prototype.getModelValue = function() { var t, e = this.model, n = this.target, i = e.getName(); if (e.get("changeProp")) t = n.get(i); else { var l = n.get("attributes"); t = e.get("value") || l[i]; } return (0, S.isUndefined)(t) ? "" : t; }, r.prototype.getElInput = function() { return this.elInput; }, r.prototype.renderField = function() { var t = this, e = t.$el, n = t.appendInput, i = t.model, l = e.find("[data-input]"), f = l[l.length - 1], d = i.el; d || (d = this.createInput ? this.createInput(this.getClbOpts()) : this.getInputEl()), (0, S.isString)(d) ? (f.innerHTML = d, this.elInput = f.firstChild) : (n ? f.appendChild(d) : f.insertBefore(d, f.firstChild), this.elInput = d), i.el = this.elInput; }, r.prototype.hasLabel = function() { var t = this.model.attributes.label; return !this.noLabel && t !== !1; }, r.prototype.rerender = function() { delete this.model.el, this.render(); }, r.prototype.postUpdate = function() { this.onUpdate(this.getClbOpts()); }, r.prototype.render = function() { var t = this, e = t.$el, n = t.pfx, i = t.ppfx, l = t.model.attributes, f = l.type, d = l.id, v = this.hasLabel && this.hasLabel(), h = "".concat(n, "trait"); delete this.$input; var w = '
`).concat(v ? '
') : "", `
`).concat(this.templateInput ? (0, S.isFunction)(this.templateInput) ? this.templateInput(this.getClbOpts()) : this.templateInput : "", `
`); return e.empty().append(w), v && this.renderLabel(), this.renderField(), this.el.className = "".concat(h, "__wrp ").concat(h, "__wrp-").concat(d), this.postUpdate(), this.onRender(this.getClbOpts()), this; }, r; }(k.G7); const Io = ac; ac.prototype.eventCapture = ["change"]; var lc = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), cc = function(a) { function r(t, e) { t === void 0 && (t = {}); var n = a.call(this, t) || this; n.reuseView = !0, n.itemsView = e; var i = t.config || {}, l = i.stylePrefix || "", f = t.editor; return n.config = i, n.em = f, n.pfx = l, n.ppfx = i.pStylePrefix || "", n.className = "".concat(l, "traits"), n.listenTo(f, "component:toggled", n.updatedCollection), n.updatedCollection(), n; } return lc(r, a), r.prototype.updatedCollection = function() { var t = this, e = t.ppfx, n = t.className, i = t.em.getSelected(); this.el.className = "".concat(n, " ").concat(e, "one-bg ").concat(e, "two-color"), this.collection = i ? i.traits : [], this.render(); }, r; }(qp.Z); const Eu = cc; cc.prototype.itemView = Io; var Au = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const ju = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; return e.listenTo(e.model, "change:options", e.rerender), e; } return Au(r, a), r.prototype.templateInput = function() { var t = this.ppfx, e = this.clsField; return '
`); }, r.prototype.getInputEl = function() { if (!this.$input) { var t = this.model, e = this.em, n = t.get("name"), i = t.get("options") || [], l = [], f = "", this.$input = (0, W.default)(f); var d = t.getTargetValue(), v = l.indexOf(d) >= 0 ? d : t.get("default"); !(0, S.isUndefined)(v) && this.$input.val(v); } return this.$input.get(0); }, r; }(Io); var ga = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const va = function(a) { function r() { var t = a !== null && a.apply(this, arguments) || this; return t.appendInput = !1, t; } return ga(r, a), r.prototype.templateInput = function() { var t = this.ppfx, e = this.clsField; return '`); }, r.prototype.onChange = function() { this.model.set("value", this.getInputElem().checked); }, r.prototype.setInputValue = function(t) { var e = this.getInputElem(); e && (e.checked = !!t); }, r.prototype.getInputEl = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n = !this.$input, i = Io.prototype.getInputEl.apply(this, t); if (n) { var l = void 0, f = void 0, d = this, v = d.model, h = d.target, w = v.attributes.valueFalse, C = v.getName(); v.get("changeProp") ? f = l = h.get(C) : l = !(!(f = h.get("attributes")[C]) && f !== ""), (0, S.isUndefined)(w) || f !== w || (l = !1), i.checked = l; } return i; }, r; }(Io); var Gp = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ul = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this, n = t.ppfx || ""; return e.opts = t, e.ppfx = n, e.em = t.target || {}, !t.onChange && e.listenTo(e.model, "change:value", e.handleModelChange), e; } return Gp(r, a), r.prototype.template = function() { return ''); }, r.prototype.inputClass = function() { return "".concat(this.ppfx, "field"); }, r.prototype.holderClass = function() { return "".concat(this.ppfx, "input-holder"); }, r.prototype.elementUpdated = function() { this.model.trigger("el:change"); }, r.prototype.setValue = function(t, e) { var n = this.model, i = t || n.get("defaults"), l = this.getInputEl(); l && (l.value = i); }, r.prototype.handleModelChange = function(t, e, n) { this.setValue(e, n); }, r.prototype.handleChange = function(t) { t.stopPropagation(); var e = this.getInputEl().value; this.__onInputChange(e), this.elementUpdated(); }, r.prototype.__onInputChange = function(t) { this.model.set({ value: t }, { fromInput: 1 }); }, r.prototype.getInputEl = function() { if (!this.inputEl) { var t = this.model, e = this.opts.type || "text", n = t.get("placeholder") || t.get("defaults") || t.get("default") || ""; this.inputEl = (0, W.default)('')); } return this.inputEl.get(0); }, r.prototype.render = function() { this.inputEl = null; var t = this.$el; return t.addClass(this.inputClass()), t.html(this.template()), t.find(".".concat(this.holderClass())).append(this.getInputEl()), this; }, r; }(k.G7); const pl = ul; ul.prototype.events = { change: "handleChange" }; var Mu = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Lu = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; return (0, S.bindAll)(e, "moveIncrement", "upIncrement"), e.doc = document, e.listenTo(e.model, "change:unit", e.handleModelChange), e; } return Mu(r, a), r.prototype.template = function() { var t = this.ppfx; return `
`); }, r.prototype.inputClass = function() { var t = this.ppfx; return this.opts.contClass || "".concat(t, "field ").concat(t, "field-integer"); }, r.prototype.setValue = function(t, e) { var n = e || {}, i = this.validateInputValue(t, { deepCheck: 1 }), l = { value: i.value, unit: "" }; (i.unit || i.force) && (l.unit = i.unit), this.model.set(l, n), n.silent && this.handleModelChange(); }, r.prototype.handleChange = function(t) { t.stopPropagation(), this.setValue(this.getInputEl().value), this.elementUpdated(); }, r.prototype.handleUnitChange = function(t) { t.stopPropagation(); var e = this.getUnitEl().value; this.model.set("unit", e), this.elementUpdated(); }, r.prototype.handleKeyDown = function(t) { t.key === "ArrowUp" && (t.preventDefault(), this.upArrowClick()), t.key === "ArrowDown" && (t.preventDefault(), this.downArrowClick()); }, r.prototype.elementUpdated = function() { this.model.trigger("el:change"); }, r.prototype.handleModelChange = function() { var t = this.model; this.getInputEl().value = t.get("value"); var e = this.getUnitEl(); e && (e.value = t.get("unit") || ""); }, r.prototype.getUnitEl = function() { if (!this.unitEl) { var t = this.model, e = t.get("units") || []; if (e.length) { var n = ['']; e.forEach(function(l) { var f = l == t.get("unit") ? "selected" : ""; n.push("")); }); var i = document.createElement("div"); i.innerHTML = '"), this.unitEl = i.firstChild; } } return this.unitEl; }, r.prototype.upArrowClick = function() { var t = this.model, e = t.get("step"), n = parseFloat(t.get("value")); this.setValue(this.normalizeValue(n + e)), this.elementUpdated(); }, r.prototype.downArrowClick = function() { var t = this.model, e = t.get("step"), n = parseFloat(t.get("value")); this.setValue(this.normalizeValue(n - e)), this.elementUpdated(); }, r.prototype.downIncrement = function(t) { t.preventDefault(), this.moved = !1; var e = this.model.get("value") || 0; e = this.normalizeValue(e), this.current = { y: t.pageY, val: e }, (0, H.on)(this.doc, "mousemove", this.moveIncrement), (0, H.on)(this.doc, "mouseup", this.upIncrement); }, r.prototype.moveIncrement = function(t) { this.moved = !0; var e = this.model, n = e.get("step"), i = this.current, l = this.normalizeValue(i.val + (i.y - t.pageY) * n), f = this.validateInputValue(l), d = f.value, v = f.unit; return this.prValue = d, e.set({ value: d, unit: v }, { avoidStore: 1 }), !1; }, r.prototype.upIncrement = function() { var t = this.model, e = t.get("step"); if ((0, H.off)(this.doc, "mouseup", this.upIncrement), (0, H.off)(this.doc, "mousemove", this.moveIncrement), this.prValue && this.moved) { var n = this.prValue - e; t.set("value", n, { avoidStore: 1 }).set("value", n + e), this.elementUpdated(); } }, r.prototype.normalizeValue = function(t, e) { e === void 0 && (e = 0); var n = this.model.get("step"), i = 0; if (isNaN(t)) return e; if (t = parseFloat(t), Math.floor(t) !== t) { var l = n.toString().split(".")[1]; i = l ? l.length : 0; } return i ? parseFloat(t.toFixed(i)) : t; }, r.prototype.validateInputValue = function(t, e) { e === void 0 && (e = {}); var n = 0, i = e || {}, l = this.model, f = "", d = (0, S.isUndefined)(t) ? f : t, v = e.units || l.get("units") || [], h = l.get("unit") || v.length && v[0] || "", w = (0, S.isUndefined)(e.max) ? l.get("max") : e.max, C = (0, S.isUndefined)(e.min) ? l.get("min") : e.min, L = !!l.get("limitlessMax"), F = !!l.get("limitlessMin"); if (i.deepCheck) { var q = l.get("fixedValues") || []; if (d === "" && (h = ""), d) { var et = new RegExp("^" + q.join("|"), "g"); if (q.length && et.test(d)) d = d.match(et)[0], h = "", n = 1; else { var X = d + ""; d += "", d = parseFloat(d.replace(",", ".")), d = isNaN(d) ? f : d; var At = X.replace(d, ""); (0, S.indexOf)(v, At) >= 0 && (h = At); } } } return L || (0, S.isUndefined)(w) || w === "" || (d = d > w ? w : d), F || (0, S.isUndefined)(C) || C === "" || (d = d < C ? C : d), { force: n, value: d, unit: h }; }, r.prototype.render = function() { pl.prototype.render.call(this), this.unitEl = null; var t = this.getUnitEl(); return t && this.$el.find(".".concat(this.ppfx, "field-units")).get(0).appendChild(t), this; }, r; }(pl); const Du = Lu; Lu.prototype.events = { "change input": "handleChange", "change select": "handleUnitChange", "click [data-arrow-up]": "upArrowClick", "click [data-arrow-down]": "downArrowClick", "mousedown [data-arrows]": "downIncrement", keydown: "handleKeyDown" }; var Kp = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Yp = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Kp(r, a), r.prototype.getValueForTarget = function() { var t = this.model, e = t.attributes, n = e.value, i = e.unit; return (0, S.isUndefined)(n) || n === "" ? t.get("default") : n + i; }, r.prototype.getInputEl = function() { if (!this.input) { var t = this.ppfx, e = this.model, n = this.getModelValue(), i = new Du({ contClass: "".concat(t, "field-int"), type: "number", model: e, ppfx: t }); i.render(), this.$input = i.inputEl, this.$unit = i.unitEl, e.set("value", n, { fromTarget: !0 }), this.$input.val(n), this.input = i.el; } return this.input; }, r; }(Io); var Nu = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ma = function() { return ma = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ma.apply(this, arguments); }; W.default && function(a, r) { if ((0, H.hasWin)()) { var t = { beforeShow: Er, move: Er, change: Er, show: Er, hide: Er, color: !1, flat: !1, showInput: !1, allowEmpty: !1, showButtons: !0, clickoutFiresChange: !0, showInitial: !1, showPalette: !1, showPaletteOnly: !1, hideAfterPaletteSelect: !1, togglePaletteOnly: !1, showSelectionPalette: !0, localStorageKey: !1, appendTo: "body", maxSelectionSize: 7, cancelText: "cancel", chooseText: "choose", togglePaletteMoreText: "more", togglePaletteLessText: "less", clearText: "Clear Color Selection", noColorSelectedText: "No Color Selected", preferredFormat: !1, className: "", containerClassName: "", replacerClassName: "", showAlpha: !1, theme: "sp-light", palette: [["#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"]], selectionPalette: [], disabled: !1, offset: null }, e = [], n = !!/msie/i.exec(window.navigator.userAgent), i = function() { function ct(Pt, Ut) { return !!~("" + Pt).indexOf(Ut); } var St = document.createElement("div").style; return St.cssText = "background-color:rgba(0,0,0,.5)", ct(St.backgroundColor, "rgba") || ct(St.backgroundColor, "hsla"); }(), l = ["
", "
", "
▼
", "
"].join(""), f = function() { var ct = ""; if (n) for (var St = 1; St <= 6; St++) ct += "
"; return ["
", "
", "
", "
", "", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", ct, "
", "
", "
", "
", "
", "", "
", "
", "
", "", "", "
", "
", "
"].join(""); }(), d = "spectrum.id"; a.fn.spectrum = function(ct, St) { if (typeof ct == "string") { var Pt = this, Ut = Array.prototype.slice.call(arguments, 1); return this.each(function() { var ue = e[a(this).data(d)]; if (ue) { var Vt = ue[ct]; if (!Vt) throw new Error("Spectrum: no such method: '" + ct + "'"); ct == "get" ? Pt = ue.get() : ct == "container" ? Pt = ue.container : ct == "option" ? Pt = ue.option.apply(ue, Ut) : ct == "destroy" ? (ue.destroy(), a(this).removeData(d)) : Vt.apply(ue, Ut); } }), Pt; } return this.spectrum("destroy").each(function() { var ue = dn(this, a.extend({}, ct, a(this).data())); a(this).data(d, ue.id); }); }, a.fn.spectrum.load = !0, a.fn.spectrum.loadOpts = {}, a.fn.spectrum.draggable = no, a.fn.spectrum.defaults = t, a.fn.spectrum.inputTypeColorSupport = function ct() { if (ct._cachedResult === void 0) { var St = a("")[0]; ct._cachedResult = St.type === "color" && St.value !== ""; } return ct._cachedResult; }, a.spectrum = {}, a.spectrum.localization = {}, a.spectrum.palettes = {}, a.fn.spectrum.processNativeColorInputs = function() { var ct = a("input[type=color]"); ct.length && !Kr() && ct.spectrum({ preferredFormat: "hex6" }); }; var v = /^[\s,#]+/, h = /\s+$/, w = 0, C = Math, L = C.round, F = C.min, q = C.max, et = C.random, X = function(ct, St) { if (St = St || {}, (ct = ct || "") instanceof X) return ct; if (!(this instanceof X)) return new X(ct, St); var Pt = function(Ut) { var ue = { r: 0, g: 0, b: 0 }, Vt = 1, Ue = !1, en = !1; typeof Ut == "string" && (Ut = function(nn) { nn = nn.replace(v, "").replace(h, "").toLowerCase(); var we, on = !1; if (se[nn]) nn = se[nn], on = !0; else if (nn == "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; return (we = Ie.rgb.exec(nn)) ? { r: we[1], g: we[2], b: we[3] } : (we = Ie.rgba.exec(nn)) ? { r: we[1], g: we[2], b: we[3], a: we[4] } : (we = Ie.hsl.exec(nn)) ? { h: we[1], s: we[2], l: we[3] } : (we = Ie.hsla.exec(nn)) ? { h: we[1], s: we[2], l: we[3], a: we[4] } : (we = Ie.hsv.exec(nn)) ? { h: we[1], s: we[2], v: we[3] } : (we = Ie.hsva.exec(nn)) ? { h: we[1], s: we[2], v: we[3], a: we[4] } : (we = Ie.hex8.exec(nn)) ? { a: xm(we[1]), r: si(we[2]), g: si(we[3]), b: si(we[4]), format: on ? "name" : "hex8" } : (we = Ie.hex6.exec(nn)) ? { r: si(we[1]), g: si(we[2]), b: si(we[3]), format: on ? "name" : "hex" } : (we = Ie.hex3.exec(nn)) ? { r: si(we[1] + "" + we[1]), g: si(we[2] + "" + we[2]), b: si(we[3] + "" + we[3]), format: on ? "name" : "hex" } : !1; }(Ut)), typeof Ut == "object" && (Ut.hasOwnProperty("r") && Ut.hasOwnProperty("g") && Ut.hasOwnProperty("b") ? (Ze = Ut.r, go = Ut.g, cr = Ut.b, ue = { r: 255 * Mn(Ze, 255), g: 255 * Mn(go, 255), b: 255 * Mn(cr, 255) }, Ue = !0, en = String(Ut.r).substr(-1) === "%" ? "prgb" : "rgb") : Ut.hasOwnProperty("h") && Ut.hasOwnProperty("s") && Ut.hasOwnProperty("v") ? (Ut.s = Pc(Ut.s), Ut.v = Pc(Ut.v), ue = function(nn, we, on) { nn = 6 * Mn(nn, 360), we = Mn(we, 100), on = Mn(on, 100); var un = C.floor(nn), er = nn - un, Un = on * (1 - we), yr = on * (1 - er * we), Yr = on * (1 - (1 - er) * we), vo = un % 6, ai = [on, yr, Un, Un, Yr, on][vo], ks = [Yr, on, on, yr, Un, Un][vo], br = [Un, Un, Yr, on, on, yr][vo]; return { r: 255 * ai, g: 255 * ks, b: 255 * br }; }(Ut.h, Ut.s, Ut.v), Ue = !0, en = "hsv") : Ut.hasOwnProperty("h") && Ut.hasOwnProperty("s") && Ut.hasOwnProperty("l") && (Ut.s = Pc(Ut.s), Ut.l = Pc(Ut.l), ue = function(nn, we, on) { var un, er, Un; function yr(ai, ks, br) { return br < 0 && (br += 1), br > 1 && (br -= 1), br < 1 / 6 ? ai + 6 * (ks - ai) * br : br < 1 / 2 ? ks : br < 2 / 3 ? ai + (ks - ai) * (2 / 3 - br) * 6 : ai; } if (nn = Mn(nn, 360), we = Mn(we, 100), on = Mn(on, 100), we === 0) un = er = Un = on; else { var Yr = on < 0.5 ? on * (1 + we) : on + we - on * we, vo = 2 * on - Yr; un = yr(vo, Yr, nn + 1 / 3), er = yr(vo, Yr, nn), Un = yr(vo, Yr, nn - 1 / 3); } return { r: 255 * un, g: 255 * er, b: 255 * Un }; }(Ut.h, Ut.s, Ut.l), Ue = !0, en = "hsl"), Ut.hasOwnProperty("a") && (Vt = Ut.a)); var Ze, go, cr; return Vt = Md(Vt), { ok: Ue, format: Ut.format || en, r: F(255, q(ue.r, 0)), g: F(255, q(ue.g, 0)), b: F(255, q(ue.b, 0)), a: Vt }; }(ct); this._originalInput = ct, this._r = Pt.r, this._g = Pt.g, this._b = Pt.b, this._a = Pt.a, this._roundA = L(100 * this._a) / 100, this._format = St.format || Pt.format, this._gradientType = St.gradientType, this._r < 1 && (this._r = L(this._r)), this._g < 1 && (this._g = L(this._g)), this._b < 1 && (this._b = L(this._b)), this._ok = Pt.ok, this._tc_id = w++; }; X.prototype = { isDark: function() { return this.getBrightness() < 128; }, isLight: function() { return !this.isDark(); }, isValid: function() { return this._ok; }, getOriginalInput: function() { return this._originalInput; }, getFormat: function() { return this._format; }, getAlpha: function() { return this._a; }, getBrightness: function() { var ct = this.toRgb(); return (299 * ct.r + 587 * ct.g + 114 * ct.b) / 1e3; }, setAlpha: function(ct) { return this._a = Md(ct), this._roundA = L(100 * this._a) / 100, this; }, toHsv: function() { var ct = Vi(this._r, this._g, this._b); return { h: 360 * ct.h, s: ct.s, v: ct.v, a: this._a }; }, toHsvString: function() { var ct = Vi(this._r, this._g, this._b), St = L(360 * ct.h), Pt = L(100 * ct.s), Ut = L(100 * ct.v); return this._a == 1 ? "hsv(" + St + ", " + Pt + "%, " + Ut + "%)" : "hsva(" + St + ", " + Pt + "%, " + Ut + "%, " + this._roundA + ")"; }, toHsl: function() { var ct = ii(this._r, this._g, this._b); return { h: 360 * ct.h, s: ct.s, l: ct.l, a: this._a }; }, toHslString: function() { var ct = ii(this._r, this._g, this._b), St = L(360 * ct.h), Pt = L(100 * ct.s), Ut = L(100 * ct.l); return this._a == 1 ? "hsl(" + St + ", " + Pt + "%, " + Ut + "%)" : "hsla(" + St + ", " + Pt + "%, " + Ut + "%, " + this._roundA + ")"; }, toHex: function(ct) { return Ca(this._r, this._g, this._b, ct); }, toHexString: function(ct) { return "#" + this.toHex(ct); }, toHex8: function() { return jd(this._r, this._g, this._b, this._a); }, toHex8String: function() { return "#" + this.toHex8(); }, toRgb: function() { return { r: L(this._r), g: L(this._g), b: L(this._b), a: this._a }; }, toRgbString: function() { return this._a == 1 ? "rgb(" + L(this._r) + ", " + L(this._g) + ", " + L(this._b) + ")" : "rgba(" + L(this._r) + ", " + L(this._g) + ", " + L(this._b) + ", " + this._roundA + ")"; }, toPercentageRgb: function() { return { r: L(100 * Mn(this._r, 255)) + "%", g: L(100 * Mn(this._g, 255)) + "%", b: L(100 * Mn(this._b, 255)) + "%", a: this._a }; }, toPercentageRgbString: function() { return this._a == 1 ? "rgb(" + L(100 * Mn(this._r, 255)) + "%, " + L(100 * Mn(this._g, 255)) + "%, " + L(100 * Mn(this._b, 255)) + "%)" : "rgba(" + L(100 * Mn(this._r, 255)) + "%, " + L(100 * Mn(this._g, 255)) + "%, " + L(100 * Mn(this._b, 255)) + "%, " + this._roundA + ")"; }, toName: function() { return this._a === 0 ? "transparent" : !(this._a < 1) && (Me[Ca(this._r, this._g, this._b, !0)] || !1); }, toFilter: function(ct) { var St = "#" + jd(this._r, this._g, this._b, this._a), Pt = St, Ut = this._gradientType ? "GradientType = 1, " : ""; return ct && (Pt = X(ct).toHex8String()), "progid:DXImageTransform.Microsoft.gradient(" + Ut + "startColorstr=" + St + ",endColorstr=" + Pt + ")"; }, toString: function(ct) { var St = !!ct; ct = ct || this._format; var Pt = !1, Ut = this._a < 1 && this._a >= 0; return St || !Ut || ct !== "hex" && ct !== "hex6" && ct !== "hex3" && ct !== "name" ? (ct === "rgb" && (Pt = this.toRgbString()), ct === "prgb" && (Pt = this.toPercentageRgbString()), ct !== "hex" && ct !== "hex6" || (Pt = this.toHexString()), ct === "hex3" && (Pt = this.toHexString(!0)), ct === "hex8" && (Pt = this.toHex8String()), ct === "name" && (Pt = this.toName()), ct === "hsl" && (Pt = this.toHslString()), ct === "hsv" && (Pt = this.toHsvString()), Pt || this.toHexString()) : ct === "name" && this._a === 0 ? this.toName() : this.toRgbString(); }, _applyModification: function(ct, St) { var Pt = ct.apply(null, [this].concat([].slice.call(St))); return this._r = Pt._r, this._g = Pt._g, this._b = Pt._b, this.setAlpha(Pt._a), this; }, lighten: function() { return this._applyModification(fm, arguments); }, brighten: function() { return this._applyModification(dm, arguments); }, darken: function() { return this._applyModification(hm, arguments); }, desaturate: function() { return this._applyModification(cm, arguments); }, saturate: function() { return this._applyModification(um, arguments); }, greyscale: function() { return this._applyModification(pm, arguments); }, spin: function() { return this._applyModification(gm, arguments); }, _applyCombination: function(ct, St) { return ct.apply(null, [this].concat([].slice.call(St))); }, analogous: function() { return this._applyCombination(wm, arguments); }, complement: function() { return this._applyCombination(vm, arguments); }, monochromatic: function() { return this._applyCombination(_m, arguments); }, splitcomplement: function() { return this._applyCombination(bm, arguments); }, triad: function() { return this._applyCombination(mm, arguments); }, tetrad: function() { return this._applyCombination(ym, arguments); } }, X.fromRatio = function(ct, St) { if (typeof ct == "object") { var Pt = {}; for (var Ut in ct) ct.hasOwnProperty(Ut) && (Pt[Ut] = Ut === "a" ? ct[Ut] : Pc(ct[Ut])); ct = Pt; } return X(ct, St); }, X.equals = function(ct, St) { return !(!ct || !St) && X(ct).toRgbString() == X(St).toRgbString(); }, X.random = function() { return X.fromRatio({ r: et(), g: et(), b: et() }); }, X.mix = function(ct, St, Pt) { Pt = Pt === 0 ? 0 : Pt || 50; var Ut, ue = X(ct).toRgb(), Vt = X(St).toRgb(), Ue = Pt / 100, en = 2 * Ue - 1, Ze = Vt.a - ue.a, go = 1 - (Ut = ((Ut = en * Ze == -1 ? en : (en + Ze) / (1 + en * Ze)) + 1) / 2), cr = { r: Vt.r * Ut + ue.r * go, g: Vt.g * Ut + ue.g * go, b: Vt.b * Ut + ue.b * go, a: Vt.a * Ue + ue.a * (1 - Ue) }; return X(cr); }, X.readability = function(ct, St) { var Pt = X(ct), Ut = X(St), ue = Pt.toRgb(), Vt = Ut.toRgb(), Ue = Pt.getBrightness(), en = Ut.getBrightness(), Ze = Math.max(ue.r, Vt.r) - Math.min(ue.r, Vt.r) + Math.max(ue.g, Vt.g) - Math.min(ue.g, Vt.g) + Math.max(ue.b, Vt.b) - Math.min(ue.b, Vt.b); return { brightness: Math.abs(Ue - en), color: Ze }; }, X.isReadable = function(ct, St) { var Pt = X.readability(ct, St); return Pt.brightness > 125 && Pt.color > 500; }, X.mostReadable = function(ct, St) { for (var Pt = null, Ut = 0, ue = !1, Vt = 0; Vt < St.length; Vt++) { var Ue = X.readability(ct, St[Vt]), en = Ue.brightness > 125 && Ue.color > 500, Ze = 3 * (Ue.brightness / 125) + Ue.color / 500; (en && !ue || en && ue && Ze > Ut || !en && !ue && Ze > Ut) && (ue = en, Ut = Ze, Pt = X(St[Vt])); } return Pt; }; var At, It, ie, se = X.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, Me = X.hexNames = function(ct) { var St = {}; for (var Pt in ct) ct.hasOwnProperty(Pt) && (St[ct[Pt]] = Pt); return St; }(se), Ie = (It = "[\\s|\\(]+(" + (At = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)") + ")[,|\\s]+(" + At + ")[,|\\s]+(" + At + ")\\s*\\)?", ie = "[\\s|\\(]+(" + At + ")[,|\\s]+(" + At + ")[,|\\s]+(" + At + ")[,|\\s]+(" + At + ")\\s*\\)?", { rgb: new RegExp("rgb" + It), rgba: new RegExp("rgba" + ie), hsl: new RegExp("hsl" + It), hsla: new RegExp("hsla" + ie), hsv: new RegExp("hsv" + It), hsva: new RegExp("hsva" + ie), hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }); window.tinycolor = X, a(function() { a.fn.spectrum.load && a.fn.spectrum.processNativeColorInputs(); }); } function Je(ct, St, Pt, Ut) { for (var ue = [], Vt = 0; Vt < ct.length; Vt++) { var Ue = ct[Vt]; if (Ue) { var en = X(Ue), Ze = en.toHsl().l < 0.5 ? "sp-thumb-el sp-thumb-dark" : "sp-thumb-el sp-thumb-light"; Ze += X.equals(St, Ue) ? " sp-thumb-active" : ""; var go = en.toString(Ut.preferredFormat || "rgb"), cr = i ? "background-color:" + en.toRgbString() : "filter:" + en.toFilter(); ue.push(''); } else ue.push(a("
").append(a('').attr("title", Ut.noColorSelectedText)).html()); } return "
" + ue.join("") + "
"; } function dn(ct, St) { var Pt, Ut, ue, Vt = function(Pe, Ee) { var Fe = a.extend({}, t, Pe); return Fe.callbacks = { move: Gr(Fe.move, Ee), change: Gr(Fe.change, Ee), show: Gr(Fe.show, Ee), hide: Gr(Fe.hide, Ee), beforeShow: Gr(Fe.beforeShow, Ee) }, Fe; }(St, ct), Ue = Vt.flat, en = Vt.showSelectionPalette, Ze = Vt.localStorageKey, go = Vt.theme, cr = Vt.callbacks, nn = (Pt = Pa, Ut = 10, function() { var Pe = this, Ee = arguments, Fe = function() { ue = null, Pt.apply(Pe, Ee); }; ue || (ue = setTimeout(Fe, Ut)); }), we = !1, on = !1, un = !0, er = 0, Un = 0, yr = 0, Yr = 0, vo = 0, ai = 0, ks = 0, br = 0, Ec = 0, Ac = 0, li = 1, cp = [], jc = [], up = {}, ci = Vt.selectionPalette.slice(0), Cm = Vt.maxSelectionSize, Ld = "sp-dragging", Ps = null, Mc = ct.ownerDocument, nr = (Mc.body, a(ct)), Ef = !1, Ge = a(f, Mc).addClass(go), Sm = Ge.find(".sp-picker-container"), pp = Ge.find(".sp-color"), fp = Ge.find(".sp-dragger"), Af = Ge.find(".sp-hue"), dp = Ge.find(".sp-slider"), Lc = Ge.find(".sp-alpha-inner"), Dd = Ge.find(".sp-alpha"), hp = Ge.find(".sp-alpha-handle"), ui = Ge.find(".sp-input"), Nd = Ge.find(".sp-palette"), Id = Ge.find(".sp-initial"), Fd = Ge.find(".sp-cancel"), jf = Ge.find(".sp-clear"), Vd = Ge.find(".sp-choose"), Mf = Ge.find(".sp-palette-toggle"), gp = nr.is("input"), Om = gp && nr.attr("type") === "color" && Kr(), Lf = gp && !Ue, Cl = Lf ? a(l).addClass(go).addClass(Vt.className).addClass(Vt.replacerClassName) : a([]), Dc = Lf ? Cl : nr, Sl = Cl.find(".sp-preview-inner"), Nc = Vt.color || gp && nr.val(), Ol = !1, Tl = Vt.preferredFormat, Tm = !Vt.showButtons || Vt.clickoutFiresChange, Es = !Nc, Oa = Vt.allowEmpty && !Om; function Df() { if (Vt.showPaletteOnly && (Vt.showPalette = !0), Mf.text(Vt.showPaletteOnly ? Vt.togglePaletteMoreText : Vt.togglePaletteLessText), Vt.palette) { cp = Vt.palette.slice(0), jc = a.isArray(cp[0]) ? cp : [cp], up = {}; for (var Pe = 0; Pe < jc.length; Pe++) for (var Ee = 0; Ee < jc[Pe].length; Ee++) { var Fe = X(jc[Pe][Ee]).toRgbString(); up[Fe] = !0; } } Ge.toggleClass("sp-flat", Ue), Ge.toggleClass("sp-input-disabled", !Vt.showInput), Ge.toggleClass("sp-alpha-enabled", Vt.showAlpha), Ge.toggleClass("sp-clear-enabled", Oa), Ge.toggleClass("sp-buttons-disabled", !Vt.showButtons), Ge.toggleClass("sp-palette-buttons-disabled", !Vt.togglePaletteOnly), Ge.toggleClass("sp-palette-disabled", !Vt.showPalette), Ge.toggleClass("sp-palette-only", Vt.showPaletteOnly), Ge.toggleClass("sp-initial-disabled", !Vt.showInitial), Ge.addClass(Vt.className).addClass(Vt.containerClassName), Pa(); } function Rd() { if (Ze && window.localStorage) { try { var Pe = window.localStorage[Ze].split(",#"); Pe.length > 1 && (delete window.localStorage[Ze], a.each(Pe, function(Ee, Fe) { Nf(Fe); })); } catch { } try { ci = window.localStorage[Ze].split(";"); } catch { } } } function Nf(Pe) { if (en) { var Ee = X(Pe).toRgbString(); if (!up[Ee] && a.inArray(Ee, ci) === -1) for (ci.push(Ee); ci.length > Cm; ) ci.shift(); if (Ze && window.localStorage) try { window.localStorage[Ze] = ci.join(";"); } catch { } } } function Hd() { var Pe = Xr(), Ee = a.map(jc, function(Fe, Le) { return Je(Fe, Pe, "sp-palette-row sp-palette-row-" + Le, Vt); }); Rd(), ci && Ee.push(Je(function() { var Fe = []; if (Vt.showPalette) for (var Le = 0; Le < ci.length; Le++) { var wr = X(ci[Le]).toRgbString(); up[wr] || Fe.push(ci[Le]); } return Fe.reverse().slice(0, Vt.maxSelectionSize); }(), Pe, "sp-palette-row sp-palette-row-selection", Vt)), Nd.html(Ee.join("")); } function zd() { if (Vt.showInitial) { var Pe = Ol, Ee = Xr(); Id.html(Je([Pe, Ee], Ee, "sp-palette-row-initial", Vt)); } } function If() { (Un <= 0 || er <= 0 || Yr <= 0) && Pa(), on = !0, Ge.addClass(Ld), Ps = null, nr.trigger("dragstart.spectrum", [Xr()]); } function Ff() { on = !1, Ge.removeClass(Ld), nr.trigger("dragstop.spectrum", [Xr()]); } function Vf() { var Pe = ui.val(); if (Pe !== null && Pe !== "" || !Oa) { var Ee = X(Pe); Ee.isValid() ? (Ta(Ee), ka(!0)) : ui.addClass("sp-validation-error"); } else Ta(null), ka(!0); } function Ud() { we ? As() : Rf(); } function Rf() { var Pe = a.Event("beforeShow.spectrum"); if (we) Pa(); else if (nr.trigger("beforeShow.spectrum", [Xr()]), cr.beforeShow(Xr()) !== !1 && !Pe.isDefaultPrevented()) { (function() { for (var Fe = 0; Fe < e.length; Fe++) e[Fe] && e[Fe].hide(); })(), we = !0; var Ee = a(Mc); Ee.bind("keydown.spectrum", Bd), Ee.bind("click.spectrum", Wd), a(window).bind("resize.spectrum", nn), Cl.addClass("sp-active"), Ge.removeClass("sp-hidden"), Pa(), Pl(), Ol = Xr(), zd(), cr.show(Ol), nr.trigger("show.spectrum", [Ol]); } } function Bd(Pe) { Pe.keyCode === 27 && As(); } function Wd(Pe) { Pe.button != 2 && (on || (Tm ? ka(!0) : $d(), As())); } function As() { we && !Ue && (we = !1, a(Mc).unbind("keydown.spectrum", Bd), a(Mc).unbind("click.spectrum", Wd), a(window).unbind("resize.spectrum", nn), Cl.removeClass("sp-active"), Ge.addClass("sp-hidden"), cr.hide(Xr()), nr.trigger("hide.spectrum", [Xr()])); } function $d() { Ta(Ol, !0); } function Ta(Pe, Ee) { var Fe, Le; X.equals(Pe, Xr()) ? Pl() : (!Pe && Oa ? Es = !0 : (Es = !1, un = !Pe, Le = (Fe = X(Pe)).toHsv(), br = Le.h % 360 / 360, Ec = Le.s, Ac = Le.v, li = Le.a), Pl(), Fe && Fe.isValid() && !Ee && (Tl = Vt.preferredFormat || Fe.getFormat())); } function Xr(Pe) { return Pe = Pe || {}, Oa && Es ? null : X.fromRatio({ h: br, s: Ec, v: Ac, a: Math.round(100 * li) / 100 }, { format: Pe.format || Tl }); } function kl() { Pl(), cr.move(Xr()), nr.trigger("move.spectrum", [Xr()]); } function Pl() { ui.removeClass("sp-validation-error"), qd(); var Pe = X.fromRatio({ h: br, s: 1, v: 1 }); pp.css("background-color", Pe.toHexString()); var Ee = Tl; li < 1 && (li !== 0 || Ee !== "name") && (Ee !== "hex" && Ee !== "hex3" && Ee !== "hex6" && Ee !== "name" || (Ee = "rgb")); var Fe = Xr({ format: Ee }), Le = ""; if (Sl.removeClass("sp-clear-display"), Sl.css("background-color", "transparent"), !Fe && Oa) Sl.addClass("sp-clear-display"); else { var wr = Fe.toHexString(), pi = Fe.toRgbString(); if (i || Fe.alpha === 1 ? Sl.css("background-color", pi) : (Sl.css("background-color", "transparent"), Sl.css("filter", Fe.toFilter())), Vt.showAlpha) { var js = Fe.toRgb(); js.a = 0; var Ms = X(js).toRgbString(), Ea = "linear-gradient(left, " + Ms + ", " + wr + ")"; n ? Lc.css("filter", X(Ms).toFilter({ gradientType: 1 }, wr)) : (Lc.css("background", "-webkit-" + Ea), Lc.css("background", "-moz-" + Ea), Lc.css("background", "-ms-" + Ea), Lc.css("background", "linear-gradient(to right, " + Ms + ", " + wr + ")")); } Le = Fe.toString(Ee); } Vt.showInput && ui.val(Le), Vt.showPalette && Hd(), zd(); } function qd() { var Pe = Ec, Ee = Ac; if (Oa && Es) hp.hide(), dp.hide(), fp.hide(); else { hp.show(), dp.show(), fp.show(); var Fe = Pe * er, Le = Un - Ee * Un; Fe = Math.max(-yr, Math.min(er - yr, Fe - yr)), Le = Math.max(-yr, Math.min(Un - yr, Le - yr)), fp.css({ top: Le + "px", left: Fe + "px" }); var wr = li * vo; hp.css({ left: wr - ai / 2 + "px" }); var pi = br * Yr; dp.css({ top: pi - ks + "px" }); } } function ka(Pe) { var Ee = Xr(), Fe = "", Le = !!un || !X.equals(Ee, Ol); Ee && (Fe = Ee.toString(Tl), !we && Nf(Ee)), gp && nr.val(Fe), Pe && Le && (cr.change(Ee), nr.trigger("change", [Ee])); } function Pa() { we && (er = pp.width(), Un = pp.height(), yr = fp.height(), Af.width(), Yr = Af.height(), ks = dp.height(), vo = Dd.width(), ai = hp.width(), Ue || (Ge.css("position", "absolute"), Vt.offset ? Ge.offset(Vt.offset) : Ge.offset(function(Pe, Ee) { var Fe = 0, Le = Pe.outerWidth(), wr = Pe.outerHeight(), pi = Ee.outerHeight(), js = Pe[0].ownerDocument, Ms = js.documentElement, Ea = Ms.clientWidth, Hf = Ms.clientHeight, km = a(js).scrollLeft(), Pm = a(js).scrollTop(), zf = Ea + km, Kd = Hf + Pm, Ri = Ee.offset(); return Ri.top += pi, Ri.left -= Math.min(Ri.left, Ri.left + Le > zf && zf > Le ? Math.abs(Ri.left + Le - zf) : 0), Ri.top -= Math.min(Ri.top, Ri.top + wr > Kd && Kd > wr ? Math.abs(wr + pi - Fe) : Fe), Ri; }(Ge, Dc))), qd(), Vt.showPalette && Hd(), nr.trigger("reflow.spectrum")); } function Gd() { As(), Ef = !0, nr.attr("disabled", !0), Dc.addClass("sp-disabled"); } (function() { if (n && Ge.find("*:not(input)").attr("unselectable", "on"), Df(), Lf && nr.after(Cl).hide(), Oa || jf.hide(), Ue) nr.after(Ge).hide(); else { var Pe = Vt.appendTo === "parent" ? nr.parent() : a(Vt.appendTo); Pe.length !== 1 && (Pe = a("body")), Pe.append(Ge); } function Ee(Le) { return Le.data && Le.data.ignore ? (Ta(a(Le.target).closest(".sp-thumb-el").data("color")), kl()) : (Ta(a(Le.target).closest(".sp-thumb-el").data("color")), kl(), Vt.hideAfterPaletteSelect && (ka(!0), As())), !1; } Rd(), Dc.bind("click.spectrum touchstart.spectrum", function(Le) { Ef || Ud(), Le.stopPropagation(), a(Le.target).is("input") || Le.preventDefault(); }), (nr.is(":disabled") || Vt.disabled === !0) && Gd(), Ge.click(qr), ui.change(Vf), ui.bind("paste", function() { setTimeout(Vf, 1); }), ui.keydown(function(Le) { Le.keyCode == 13 && Vf(); }), Fd.text(Vt.cancelText), Fd.bind("click.spectrum", function(Le) { Le.stopPropagation(), Le.preventDefault(), $d(), As(); }), jf.attr("title", Vt.clearText), jf.bind("click.spectrum", function(Le) { Le.stopPropagation(), Le.preventDefault(), Es = !0, kl(), Ue && ka(!0); }), Vd.text(Vt.chooseText), Vd.bind("click.spectrum", function(Le) { Le.stopPropagation(), Le.preventDefault(), n && ui.is(":focus") && ui.trigger("change"), ui.hasClass("sp-validation-error") || (ka(!0), As()); }), Mf.text(Vt.showPaletteOnly ? Vt.togglePaletteMoreText : Vt.togglePaletteLessText), Mf.bind("click.spectrum", function(Le) { Le.stopPropagation(), Le.preventDefault(), Vt.showPaletteOnly = !Vt.showPaletteOnly, Vt.showPaletteOnly || Ue || Ge.css("left", "-=" + (Sm.outerWidth(!0) + 5)), Df(); }), no(Dd, function(Le, wr, pi) { li = Le / vo, Es = !1, pi.shiftKey && (li = Math.round(10 * li) / 10), kl(); }, If, Ff), no(Af, function(Le, wr) { br = parseFloat(wr / Yr), Es = !1, Vt.showAlpha || (li = 1), kl(); }, If, Ff), no(pp, function(Le, wr, pi) { if (pi.shiftKey) { if (!Ps) { var js = Ec * er, Ms = Un - Ac * Un, Ea = Math.abs(Le - js) > Math.abs(wr - Ms); Ps = Ea ? "x" : "y"; } } else Ps = null; var Hf = !Ps || Ps === "y"; (!Ps || Ps === "x") && (Ec = parseFloat(Le / er)), Hf && (Ac = parseFloat((Un - wr) / Un)), Es = !1, Vt.showAlpha || (li = 1), kl(); }, If, Ff), Nc ? (Ta(Nc), Pl(), Tl = Vt.preferredFormat || X(Nc).getFormat(), Nf(Nc)) : Pl(), Ue && Rf(); var Fe = n ? "mousedown.spectrum" : "click.spectrum touchstart.spectrum"; Nd.delegate(".sp-thumb-el", Fe, Ee), Id.delegate(".sp-thumb-el:nth-child(1)", Fe, { ignore: !0 }, Ee); })(); var vp = { show: Rf, hide: As, toggle: Ud, reflow: Pa, option: function(Pe, Ee) { return Pe === r ? a.extend({}, Vt) : Ee === r ? Vt[Pe] : (Vt[Pe] = Ee, Pe === "preferredFormat" && (Tl = Vt.preferredFormat), void Df()); }, enable: function() { Ef = !1, nr.attr("disabled", !1), Dc.removeClass("sp-disabled"); }, disable: Gd, offset: function(Pe) { Vt.offset = Pe, Pa(); }, set: function(Pe) { Ta(Pe), ka(); }, get: Xr, destroy: function() { nr.show(), Dc.unbind("click.spectrum touchstart.spectrum"), Ge.remove(), Cl.remove(), e[vp.id] = null; }, container: Ge }; return vp.id = e.push(vp) - 1, vp; } function Er() { } function qr(ct) { ct.stopPropagation(); } function Gr(ct, St) { var Pt = Array.prototype.slice, Ut = Pt.call(arguments, 2); return function() { return ct.apply(St, Ut.concat(Pt.call(arguments))); }; } function no(ct, St, Pt, Ut) { St = St || function() { }, Pt = Pt || function() { }, Ut = Ut || function() { }; var ue = document, Vt = !1, Ue = {}, en = 0, Ze = 0, go = "ontouchstart" in window, cr = {}; function nn(un) { un.stopPropagation && un.stopPropagation(), un.preventDefault && un.preventDefault(), un.returnValue = !1; } function we(un) { if (Vt) { if (n && ue.documentMode < 9 && !un.button) return on(); var er = un && un.touches && un.touches[0], Un = er && er.pageX || un.pageX, yr = er && er.pageY || un.pageY, Yr = Math.max(0, Math.min(Un - Ue.left, Ze)), vo = Math.max(0, Math.min(yr - Ue.top, en)); go && nn(un), St.apply(ct, [Yr, vo, un]); } } function on() { Vt && (a(ue).unbind(cr), a(ue.body).removeClass("sp-dragging"), setTimeout(function() { Ut.apply(ct, arguments); }, 0)), Vt = !1; } cr.selectstart = nn, cr.dragstart = nn, cr["touchmove mousemove"] = we, cr["touchend mouseup"] = on, a(ct).bind("touchstart mousedown", function(un) { var er = un.which ? un.which == 3 : un.button == 2; er || Vt || Pt.apply(ct, arguments) !== !1 && (Vt = !0, en = a(ct).height(), Ze = a(ct).width(), Ue = a(ct).offset(), a(ue).bind(cr), a(ue.body).addClass("sp-dragging"), we(un), nn(un)); }); } function Kr() { return a.fn.spectrum.inputTypeColorSupport(); } function ii(ct, St, Pt) { ct = Mn(ct, 255), St = Mn(St, 255), Pt = Mn(Pt, 255); var Ut, ue, Vt = q(ct, St, Pt), Ue = F(ct, St, Pt), en = (Vt + Ue) / 2; if (Vt == Ue) Ut = ue = 0; else { var Ze = Vt - Ue; switch (ue = en > 0.5 ? Ze / (2 - Vt - Ue) : Ze / (Vt + Ue), Vt) { case ct: Ut = (St - Pt) / Ze + (St < Pt ? 6 : 0); break; case St: Ut = (Pt - ct) / Ze + 2; break; case Pt: Ut = (ct - St) / Ze + 4; } Ut /= 6; } return { h: Ut, s: ue, l: en }; } function Vi(ct, St, Pt) { ct = Mn(ct, 255), St = Mn(St, 255), Pt = Mn(Pt, 255); var Ut, ue, Vt = q(ct, St, Pt), Ue = F(ct, St, Pt), en = Vt, Ze = Vt - Ue; if (ue = Vt === 0 ? 0 : Ze / Vt, Vt == Ue) Ut = 0; else { switch (Vt) { case ct: Ut = (St - Pt) / Ze + (St < Pt ? 6 : 0); break; case St: Ut = (Pt - ct) / Ze + 2; break; case Pt: Ut = (ct - St) / Ze + 4; } Ut /= 6; } return { h: Ut, s: ue, v: en }; } function Ca(ct, St, Pt, Ut) { var ue = [Sa(L(ct).toString(16)), Sa(L(St).toString(16)), Sa(L(Pt).toString(16))]; return Ut && ue[0].charAt(0) == ue[0].charAt(1) && ue[1].charAt(0) == ue[1].charAt(1) && ue[2].charAt(0) == ue[2].charAt(1) ? ue[0].charAt(0) + ue[1].charAt(0) + ue[2].charAt(0) : ue.join(""); } function jd(ct, St, Pt, Ut) { var ue; return [Sa((ue = Ut, Math.round(255 * parseFloat(ue)).toString(16))), Sa(L(ct).toString(16)), Sa(L(St).toString(16)), Sa(L(Pt).toString(16))].join(""); } function cm(ct, St) { St = St === 0 ? 0 : St || 10; var Pt = X(ct).toHsl(); return Pt.s -= St / 100, Pt.s = lp(Pt.s), X(Pt); } function um(ct, St) { St = St === 0 ? 0 : St || 10; var Pt = X(ct).toHsl(); return Pt.s += St / 100, Pt.s = lp(Pt.s), X(Pt); } function pm(ct) { return X(ct).desaturate(100); } function fm(ct, St) { St = St === 0 ? 0 : St || 10; var Pt = X(ct).toHsl(); return Pt.l += St / 100, Pt.l = lp(Pt.l), X(Pt); } function dm(ct, St) { St = St === 0 ? 0 : St || 10; var Pt = X(ct).toRgb(); return Pt.r = q(0, F(255, Pt.r - L(255 * (-St / 100)))), Pt.g = q(0, F(255, Pt.g - L(255 * (-St / 100)))), Pt.b = q(0, F(255, Pt.b - L(255 * (-St / 100)))), X(Pt); } function hm(ct, St) { St = St === 0 ? 0 : St || 10; var Pt = X(ct).toHsl(); return Pt.l -= St / 100, Pt.l = lp(Pt.l), X(Pt); } function gm(ct, St) { var Pt = X(ct).toHsl(), Ut = (L(Pt.h) + St) % 360; return Pt.h = Ut < 0 ? 360 + Ut : Ut, X(Pt); } function vm(ct) { var St = X(ct).toHsl(); return St.h = (St.h + 180) % 360, X(St); } function mm(ct) { var St = X(ct).toHsl(), Pt = St.h; return [X(ct), X({ h: (Pt + 120) % 360, s: St.s, l: St.l }), X({ h: (Pt + 240) % 360, s: St.s, l: St.l })]; } function ym(ct) { var St = X(ct).toHsl(), Pt = St.h; return [X(ct), X({ h: (Pt + 90) % 360, s: St.s, l: St.l }), X({ h: (Pt + 180) % 360, s: St.s, l: St.l }), X({ h: (Pt + 270) % 360, s: St.s, l: St.l })]; } function bm(ct) { var St = X(ct).toHsl(), Pt = St.h; return [X(ct), X({ h: (Pt + 72) % 360, s: St.s, l: St.l }), X({ h: (Pt + 216) % 360, s: St.s, l: St.l })]; } function wm(ct, St, Pt) { St = St || 6, Pt = Pt || 30; var Ut = X(ct).toHsl(), ue = 360 / Pt, Vt = [X(ct)]; for (Ut.h = (Ut.h - (ue * St >> 1) + 720) % 360; --St; ) Ut.h = (Ut.h + ue) % 360, Vt.push(X(Ut)); return Vt; } function _m(ct, St) { St = St || 6; for (var Pt = X(ct).toHsv(), Ut = Pt.h, ue = Pt.s, Vt = Pt.v, Ue = [], en = 1 / St; St--; ) Ue.push(X({ h: Ut, s: ue, v: Vt })), Vt = (Vt + en) % 1; return Ue; } function Md(ct) { return ct = parseFloat(ct), (isNaN(ct) || ct < 0 || ct > 1) && (ct = 1), ct; } function Mn(ct, St) { (function(Ut) { return typeof Ut == "string" && Ut.indexOf(".") != -1 && parseFloat(Ut) === 1; })(ct) && (ct = "100%"); var Pt = function(Ut) { return typeof Ut == "string" && Ut.indexOf("%") != -1; }(ct); return ct = F(St, q(0, parseFloat(ct))), Pt && (ct = parseInt(ct * St, 10) / 100), C.abs(ct - St) < 1e-6 ? 1 : ct % St / parseFloat(St); } function lp(ct) { return F(1, q(0, ct)); } function si(ct) { return parseInt(ct, 16); } function Sa(ct) { return ct.length == 1 ? "0" + ct : "" + ct; } function Pc(ct) { return ct <= 1 && (ct = 100 * ct + "%"), ct; } function xm(ct) { return si(ct) / 255; } }(W.default); var fl = function(a) { var r = a.getFormat() === "name" && a.toName(), t = a.getAlpha() == 1 ? a.toHexString() : a.toRgbString(); return r || t.replace(/ /g, ""); }; const uc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Nu(r, a), r.prototype.template = function() { var t = this.ppfx; return `
`); }, r.prototype.inputClass = function() { var t = this.ppfx; return "".concat(t, "field ").concat(t, "field-color"); }, r.prototype.holderClass = function() { return "".concat(this.ppfx, "input-holder"); }, r.prototype.remove = function() { return a.prototype.remove.call(this), this.colorEl.spectrum("destroy"), this; }, r.prototype.handleChange = function(t) { t.stopPropagation(); var e = t.target.value; (0, S.isUndefined)(e) || this.__onInputChange(e); }, r.prototype.__onInputChange = function(t) { var e = this.model, n = this.opts.onChange, i = t, l = this.getColorEl(); if (l) { l.spectrum("set", i); var f = l.spectrum("get"), d = i && fl(f); d && (i = d); } n ? n(i) : e.set({ value: i }, { fromInput: 1 }); }, r.prototype.setValue = function(t, e) { e === void 0 && (e = {}); var n = this.model, i = (0, S.isUndefined)(e.def) ? n.get("defaults") : e.def, l = (0, S.isUndefined)(t) ? (0, S.isUndefined)(i) ? "" : i : t, f = this.getInputEl(), d = this.getColorEl(), v = l != "none" ? l : ""; f.value = l, d.get(0).style.backgroundColor = v, (e.fromTarget || e.fromInput && !e.avoidStore) && (d.spectrum("set", v), this.noneColor = l == "none", this.movedColor = v); }, r.prototype.getColorEl = function() { var t = this; if (!this.colorEl) { var e = this, n = e.em, i = e.model, l = e.opts, f = this.ppfx, d = l.onChange, v = (0, W.default)('
')), h = v.get(0).style, w = n && n.config ? n.config.el : "", C = n && n.getConfig && n.getConfig().colorPicker || {}; this.movedColor = ""; var L, F = !1; this.$el.find("[data-colorp-c]").append(v); var q = function(et, X) { X === void 0 && (X = !0), d ? d(et, !X) : (X && i.setValueFromInput(0, !1), i.setValueFromInput(et, X)); }; v.spectrum(ma(ma(ma({ color: i.getValue() || !1, containerClassName: "".concat(f, "one-bg ").concat(f, "two-color"), appendTo: w || "body", maxSelectionSize: 8, showPalette: !0, showAlpha: !0, chooseText: "Ok", cancelText: "⨯", palette: [] }, C), i.get("colorPicker") || {}), { move: function(et) { var X = fl(et); t.movedColor = X, h.backgroundColor = X, q(X, !1); }, change: function(et) { F = !0; var X = fl(et); h.backgroundColor = X, q(X), t.noneColor = !1; }, show: function(et) { F = !1, t.movedColor = "", L = d ? i.getValue({ noDefault: !0 }) : fl(et); }, hide: function() { F || !L && !d || (t.noneColor && (L = ""), h.backgroundColor = L, v.spectrum("set", L), q(L, !1)); } })), n && n.on && this.listenTo(n, "component:selected", function() { t.movedColor && q(t.movedColor), F = !0, t.movedColor = "", v.spectrum("hide"); }), this.colorEl = v; } return this.colorEl; }, r.prototype.render = function() { return pl.prototype.render.call(this), this.getColorEl(), this; }, r; }(pl); var pc = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Iu = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return pc(r, a), r.prototype.templateInput = function() { return ""; }, r.prototype.getInputEl = function() { if (!this.input) { var t = this.model, e = this.getModelValue(), n = new uc({ model: t, target: this.config.em, contClass: this.ppfx + "field-color", ppfx: this.ppfx }).render(); n.setValue(e, { fromTarget: 1 }), this.input = n.el; } return this.input; }, r; }(Io); var Xp = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), fc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Xp(r, a), r.prototype.templateInput = function() { return ""; }, r.prototype.onChange = function() { this.handleClick(); }, r.prototype.handleClick = function() { var t = this.model, e = this.em, n = t.get("command"); n && ((0, S.isString)(n) ? e.Commands.run(n) : n(e.Editor, t)); }, r.prototype.renderLabel = function() { this.model.get("label") && Io.prototype.renderLabel.apply(this); }, r.prototype.getInputEl = function() { var t = this.model, e = this.ppfx, n = t.props(), i = n.labelButton, l = n.text, f = n.full, d = i || l, v = "".concat(e, "btn"); return '"); }, r; }(Io); const bs = fc; fc.prototype.eventCapture = ["click button"]; var Fu = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ws = function() { return ws = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ws.apply(this, arguments); }, Vu = "trait", Jp = "".concat(Vu, ":"), Zp = "".concat(Jp, "custom"), wn = { text: Io, number: Yp, select: ju, checkbox: va, color: Iu, button: bs }, Qp = function(a) { function r(t) { var e = a.call(this, t, "TraitManager", $p) || this; e.TraitsView = Eu, e.events = { all: Vu, custom: Zp }; var n = e.config, i = new k.Hn(); e.model = i; var l = n.pStylePrefix; e.types = ws({}, wn), l && (n.stylePrefix = "".concat(l).concat(n.stylePrefix)); var f = (0, S.debounce)(function() { return e.__upSel(); }, 0); i.listenTo(t, "component:toggled", f); var d = (0, S.debounce)(function() { return e.__onUp(); }, 0); return i.listenTo(t, "trait:update", d), e; } return Fu(r, a), r.prototype.__upSel = function() { this.select(this.em.getSelected()); }, r.prototype.__onUp = function() { this.select(this.getSelected()); }, r.prototype.select = function(t) { var e = t ? t.getTraits() : []; this.model.set({ component: t, traits: e }), this.__trgCustom(); }, r.prototype.getSelected = function() { return this.model.get("component") || null; }, r.prototype.getCurrent = function() { return this.model.get("traits") || []; }, r.prototype.__trgCustom = function(t) { t === void 0 && (t = {}), this.__ctn = this.__ctn || t.container, this.em.trigger(this.events.custom, { container: this.__ctn }); }, r.prototype.postRender = function() { this.__appendTo(); }, r.prototype.getTraitsViewer = function() { return this.view; }, r.prototype.addType = function(t, e) { var n = this.getType("text"); this.types[t] = n.extend(e); }, r.prototype.getType = function(t) { return this.getTypes()[t]; }, r.prototype.getTypes = function() { return this.types; }, r.prototype.render = function() { var t = this.view, e = this.em, n = this.getConfig(), i = t && t.el; return t = new Eu({ el: i, collection: [], editor: e, config: n }, this.getTypes()), this.view = t, t.el; }, r.prototype.destroy = function() { this.model.stopListening(), this.model.clear(); }, r; }(jt); const dc = Qp, ya = { stylePrefix: "", appendTo: "", sortable: !0, hidable: !0, hideTextnode: !0, root: "", showWrapper: !0, showHover: !0, scrollCanvas: { behavior: "smooth", block: "nearest" }, scrollLayers: { behavior: "auto", block: "nearest" }, highlightHover: !0, custom: !1, onInit: function() { }, onRender: function() { }, extend: {} }; var po = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), dl = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; e.items = [], e.opt = t; var n = t.config || {}; e.config = n, e.parentView = t.parentView; var i = n.stylePrefix || "", l = n.pStylePrefix || "", f = e.collection; e.listenTo(f, "add", e.addTo), e.listenTo(f, "reset resetNavigator", e.render), e.listenTo(f, "remove", e.removeChildren), e.className = "".concat(i, "layers"); var d = n.em; if (n.sortable && !e.opt.sorter) { var v = d.Utils; e.opt.sorter = new v.Sorter({ container: n.sortContainer || e.el, containerSel: ".".concat(e.className), itemSel: ".".concat(i, "layer"), ignoreViewChildren: 1, onEndMove: function(h, w, C) { var L = w.getSourceModel(); d.setSelected(L, { forceChange: 1 }), d.trigger("".concat(hr, ":end"), C); }, avoidSelectOnEnd: 1, nested: 1, ppfx: l, pfx: i }); } return e.$el.data("collection", f), t.parent && e.$el.data("model", t.parent), e; } return po(r, a), r.prototype.removeChildren = function(t) { var e = t.viewLayer; e && (e.remove(), delete t.viewLayer); }, r.prototype.addTo = function(t) { var e = this.collection.indexOf(t); this.addToCollection(t, null, e); }, r.prototype.addToCollection = function(t, e, n) { var i = this, l = i.parentView, f = i.opt, d = i.config, v = f.ItemView, h = f.opened, w = f.module, C = e || null, L = new v({ ItemView: v, level: f.level, model: t, parentView: l, config: d, sorter: f.sorter, opened: h, module: w }), F = L.render().el; if (C) C.appendChild(F); else if (n !== void 0) { var q = "before"; this.$el.children().length == n && (n--, q = "after"), n < 0 ? this.$el.append(F) : this.$el.children().eq(n)[q](F); } else this.$el.append(F); return this.items.push(L), F; }, r.prototype.remove = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return k.G7.prototype.remove.apply(this, t), this.items.map(function(n) { return n.remove(); }), this; }, r.prototype.render = function() { var t = this, e = document.createDocumentFragment(), n = this.el; return n.innerHTML = "", this.collection.each(function(i) { return t.addToCollection(i, e); }), n.appendChild(e), n.className = this.className, this; }, r; }(k.G7); const hc = dl; var Ru = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), gc = "contentEditable", Hu = function(a) { function r(t) { var e = a.call(this, t) || this; (0, S.bindAll)(e, "__render"), e.opt = t, e.module = t.module, e.config = t.config || {}, e.sorter = t.sorter || "", e.parentView = t.parentView; var n = e, i = n.model, l = n.pfx, f = n.ppfx, d = i.get("type") || "default"; return e.className = "".concat(l, "layer ").concat(l, "layer__t-").concat(d, " no-select ").concat(f, "two-color"), e.inputNameCls = "".concat(f, "layer-name"), e.clsTitleC = "".concat(l, "layer-title-c"), e.clsTitle = "".concat(l, "layer-title"), e.clsCaret = "".concat(l, "layer-caret"), e.clsCount = "".concat(l, "layer-count"), e.clsMove = "".concat(l, "layer-move"), e.clsChildren = "".concat(l, "layer-children"), e.clsNoChild = "".concat(l, "layer-no-chld"), e.clsEdit = "".concat(e.inputNameCls, "--edit"), e.clsNoEdit = "".concat(e.inputNameCls, "--no-edit"), e.initComponent(), e; } return Ru(r, a), r.prototype.events = function() { return { "mousedown [data-toggle-move]": "startSort", "touchstart [data-toggle-move]": "startSort", "click [data-toggle-visible]": "toggleVisibility", "click [data-toggle-open]": "toggleOpening", "click [data-toggle-select]": "handleSelect", "mouseover [data-toggle-select]": "handleHover", "mouseout [data-toggle-select]": "handleHoverOut", "dblclick [data-name]": "handleEdit", "keydown [data-name]": "handleEditKey", "focusout [data-name]": "handleEditEnd" }; }, r.prototype.template = function(t) { var e = this, n = e.pfx, i = e.ppfx, l = e.config, f = e.clsNoEdit, d = e.module, v = e.opt, h = e.em, w = l.hidable, C = d.getComponents(t).length, L = C ? "" : this.clsNoChild, F = "".concat(this.clsTitle, " ").concat(L), q = "".concat(this.clsTitleC, " ").concat(i, "one-bg"), et = "".concat(this.inputNameCls, " ").concat(f, " ").concat(i, "no-app"), X = v.level + 1, At = "".concat(30 + 10 * X, "px"), It = t.getName(), ie = t.getIcon(), se = "".concat(n, "layer"), Me = (h == null ? void 0 : h.getConfig()).icons, Ie = Me.move, Je = Me.eye, dn = Me.eyeOff, Er = Me.chevron; return ` `.concat(w ? ' ').concat(Je, ` ').concat(dn, ` `) : "", `
').concat(Er, ` `).concat(ie ? '').concat(ie, "") : "", ` ').concat(It, `
').concat(C || "", `
').concat(Ie || "", `
'); }, Object.defineProperty(r.prototype, "em", { get: function() { return this.module.em; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "ppfx", { get: function() { return this.em.getConfig().stylePrefix; }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "pfx", { get: function() { return this.config.stylePrefix; }, enumerable: !1, configurable: !0 }), r.prototype.initComponent = function() { var t = this, e = this.model, n = this.config.onInit, i = e.components(); this.listenTo(i, "remove add reset", this.checkChildren), [["change:status", this.updateStatus], ["change:open", this.updateOpening], ["change:layerable", this.updateLayerable], ["change:style:display", this.updateVisibility], ["rerender:layer", this.render], ["change:name change:custom-name", this.updateName]].forEach(function(l) { return t.listenTo(e, l[0], l[1]); }), this.$el.data("model", e), this.$el.data("collection", i), e.viewLayer = this, n.bind(this)({ component: e, render: this.__render, listenTo: this.listenTo }); }, r.prototype.updateName = function() { this.getInputName().innerText = this.model.getName(); }, r.prototype.getVisibilityEl = function() { return this.eyeEl || (this.eyeEl = this.$el.children(".".concat(this.pfx, "layer-vis"))), this.eyeEl; }, r.prototype.updateVisibility = function() { var t = this, e = t.pfx, n = t.model, i = t.module, l = "".concat(e, "layer-hidden"), f = i.isVisible(n) ? "removeClass" : "addClass"; this.$el[f](l), this.getVisibilityEl()[f]("".concat(e, "layer-off")); }, r.prototype.toggleVisibility = function(t) { t == null || t.stopPropagation(); var e = this.module, n = this.model; e.setVisible(n, !e.isVisible(n)); }, r.prototype.handleEdit = function(t) { t == null || t.stopPropagation(); var e = this, n = e.em, i = e.$el, l = e.clsNoEdit, f = e.clsEdit, d = this.getInputName(); d[gc] = "true", d.focus(), document.execCommand("selectAll", !1), n.setEditing(!0), i.find(".".concat(this.inputNameCls)).removeClass(l).addClass(f); }, r.prototype.handleEditKey = function(t) { t.stopPropagation(), ((0, H.isEscKey)(t) || (0, H.isEnterKey)(t)) && this.handleEditEnd(t); }, r.prototype.handleEditEnd = function(t) { t == null || t.stopPropagation(); var e = this, n = e.em, i = e.$el, l = e.clsNoEdit, f = e.clsEdit, d = this.getInputName(), v = d.textContent; d.scrollLeft = 0, d[gc] = "false", this.setName(v, { component: this.model, propName: "custom-name" }), n.setEditing(!1), i.find(".".concat(this.inputNameCls)).addClass(l).removeClass(f), this.updateName(); }, r.prototype.setName = function(t, e) { var n = e.propName; this.model.set(n, t); }, r.prototype.getInputName = function() { return this.inputName || (this.inputName = this.el.querySelector(".".concat(this.inputNameCls))), this.inputName; }, r.prototype.updateOpening = function() { var t = this, e = t.$el, n = t.model, i = t.pfx, l = "open", f = "".concat(i, "layer-open"), d = this.getCaret(); this.module.isOpen(n) ? (e.addClass(l), d.addClass(f)) : (e.removeClass(l), d.removeClass(f)); }, r.prototype.toggleOpening = function(t) { var e = this.model, n = this.module; t == null || t.stopImmediatePropagation(), e.get("components").length && n.setOpen(e, !n.isOpen(e)); }, r.prototype.handleSelect = function(t) { t == null || t.stopPropagation(); var e = this.module, n = this.model; e.setLayerData(n, { selected: !0 }, { event: t }); }, r.prototype.handleHover = function(t) { t == null || t.stopPropagation(); var e = this.module, n = this.model; e.setLayerData(n, { hovered: !0 }); }, r.prototype.handleHoverOut = function(t) { t == null || t.stopPropagation(); var e = this.module, n = this.model; e.setLayerData(n, { hovered: !1 }); }, r.prototype.startSort = function(t) { t.stopPropagation(); var e = this.em, n = this.sorter; t.button && t.button !== 0 || n && (n.onStart = function(i) { return e.trigger("".concat(hr, ":start"), i); }, n.onMoveClb = function(i) { return e.trigger(hr, i); }, n.startSort(t.target)); }, r.prototype.updateStatus = function() { kn.prototype.updateStatus.apply(this, [{ avoidHover: !this.config.highlightHover, noExtHl: !0 }]); }, r.prototype.checkChildren = function() { var t = this, e = t.model, n = t.clsNoChild, i = t.$el, l = t.module, f = l.getComponents(e).length, d = i.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)), v = this.cnt; v || (v = i.children("[data-count]").get(0), this.cnt = v), d[f ? "removeClass" : "addClass"](n), v && (v.innerHTML = f || ""), !f && l.setOpen(e, !1); }, r.prototype.getCaret = function() { return this.caret && this.caret.length || (this.caret = this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))), this.caret; }, r.prototype.setRoot = function(t) { t = (0, S.isString)(t) ? this.em.getWrapper().find(t)[0] : t; var e = (0, H.getModel)(t, 0); e && (this.stopListening(), this.model = e, this.initComponent(), this._rendered && this.render()); }, r.prototype.updateLayerable = function() { (this.parentView || this).render(); }, r.prototype.__clearItems = function() { var t; (t = this.items) === null || t === void 0 || t.remove(); }, r.prototype.remove = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return k.G7.prototype.remove.apply(this, t), this.__clearItems(), this; }, r.prototype.render = function() { var t = this, e = t.model, n = t.config, i = t.pfx, l = t.ppfx, f = t.opt, d = t.sorter; this.__clearItems(); var v = f.opened, h = f.module, w = f.ItemView, C = !h.__isLayerable(e), L = this.$el.empty(), F = f.level + 1; delete this.inputName, this.items = new hc({ ItemView: w, collection: e.get("components"), config: n, sorter: d, opened: v, parentView: this, parent: e, level: F, module: h }); var q = this.items.render().$el; return n.showWrapper || F !== 1 ? (L.html(this.template(e)), L.find(".".concat(this.clsChildren)).append(q)) : L.append(q), e.get("draggable") && n.sortable || L.children(".".concat(this.clsMove)).remove(), !h.isVisible(e) && (this.className += " ".concat(i, "hide")), C && (this.className += " ".concat(l, "hidden")), L.attr("class", this.className), this.updateStatus(), this.updateOpening(), this.updateVisibility(), this.__render(), this._rendered = !0, this; }, r.prototype.__render = function() { var t = this, e = t.model, n = t.config, i = { component: e, el: t.el }; n.onRender.bind(this)(i), this.em.trigger("layer:render", i); }, r; }(k.G7); const zu = Hu; var Uu = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), vc = function() { return vc = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, vc.apply(this, arguments); }, hl = "layer", gl = "".concat(hl, ":"), rn = "".concat(gl, "root"), mc = "".concat(gl, "component"), tf = "".concat(gl, "custom"), _s = { all: hl, root: rn, component: mc, custom: tf }, yc = { mediaText: "" }, vl = ["open", "status", "locked", "custom-name", "components", "classes"].map(function(a) { return "component:update:".concat(a); }).join(" "), ef = function(a) { function r(t) { var e = a.call(this, t, "LayerManager", ya) || this; return e.events = _s, (0, S.bindAll)(e, "componentChanged", "__onRootChange", "__onComponent"), e.model = new bt(e, { opened: {} }), e.config.stylePrefix = e.config.pStylePrefix, e; } return Uu(r, a), r.prototype.onLoad = function() { var t = this, e = this, n = e.em, i = e.config, l = e.model; l.listenTo(n, "component:selected", this.componentChanged), l.on("change:root", this.__onRootChange), l.listenTo(n, vl, this.__onComponent), this.componentChanged(), l.listenToOnce(n, "load", function() { t.setRoot(i.root), t.__appendTo(); }); }, r.prototype.setRoot = function(t) { var e = this.em.getWrapper(), n = (0, H.isComponent)(t) ? t : e; return t && (0, S.isString)(t) && (0, H.hasWin)() && (n = e.find(t)[0] || e), this.model.set("root", n), n; }, r.prototype.getRoot = function() { return this.model.get("root"); }, r.prototype.getComponents = function(t) { var e = this; return t.components().filter(function(n) { return e.__isLayerable(n); }); }, r.prototype.setOpen = function(t, e) { t.set("open", e); }, r.prototype.isOpen = function(t) { return !!t.get("open"); }, r.prototype.setVisible = function(t, e) { var n = "__prev-display", i = t.getStyle(yc), l = i.display; if (e) { var f = t.get(n); delete i.display, f && (i.display = f, t.unset(n)); } else l && t.set(n, l), i.display = "none"; t.setStyle(i, yc), this.updateLayer(t), this.em.trigger("component:toggled"); }, r.prototype.isVisible = function(t) { return (e = t.getStyle(yc)) === void 0 && (e = {}), (e.display || "").trim().indexOf("none") !== 0; var e; }, r.prototype.setLocked = function(t, e) { t.set("locked", e); }, r.prototype.isLocked = function(t) { return !!t.get("locked"); }, r.prototype.setName = function(t, e) { t.set("custom-name", e); }, r.prototype.getName = function(t) { return t.getName(); }, r.prototype.getLayerData = function(t) { var e = t.get("status"); return { name: t.getName(), open: this.isOpen(t), selected: e === "selected", hovered: e === "hovered", visible: this.isVisible(t), locked: this.isLocked(t), components: this.getComponents(t) }; }, r.prototype.setLayerData = function(t, e, n) { var i; n === void 0 && (n = {}); var l = this.em, f = this.config, d = e.open, v = e.selected, h = e.hovered, w = e.visible, C = e.locked, L = e.name, F = vc({ fromLayers: !0 }, n); if ((0, H.isDef)(d) && this.setOpen(t, d), (0, H.isDef)(v)) if (v) { l.setSelected(t, F); var q = f.scrollCanvas; q && ((i = t.views) === null || i === void 0 || i.forEach(function(et) { return et.scrollIntoView(q); })); } else l.removeSelected(t, F); (0, H.isDef)(h) && f.showHover && (h ? l.setHovered(t, F) : l.setHovered(null, F)), (0, H.isDef)(w) && w !== this.isVisible(t) && this.setVisible(t, w), (0, H.isDef)(C) && this.setLocked(t, C), (0, H.isDef)(L) && this.setName(t, L); }, r.prototype.componentChanged = function(t, e) { var n; if (e === void 0 && (e = {}), !e.fromLayers) { var i = this.em, l = this.config.scrollLayers, f = this.model.get("opened"), d = i.getSelected(), v = d == null ? void 0 : d.parent(); for (var h in f) f[h].set("open", !1), delete f[h]; for (; v; ) v.set("open", !0), f[v.cid] = v, v = v.parent(); if (d && l) { var w = (n = d.viewLayer) === null || n === void 0 ? void 0 : n.el; w == null || w.scrollIntoView(l); } } }, r.prototype.getAll = function() { return this.view; }, r.prototype.render = function() { var t, e, n = this.config, i = this.model, l = zu.extend(n.extend); return this.view = new l({ el: (t = this.view) === null || t === void 0 ? void 0 : t.el, ItemView: l, level: 0, config: n, opened: i.get("opened"), model: this.getRoot(), module: this }), (e = this.view) === null || e === void 0 ? void 0 : e.render().el; }, r.prototype.destroy = function() { var t; (t = this.view) === null || t === void 0 || t.remove(); }, r.prototype.__onRootChange = function() { var t, e = this.getRoot(); (t = this.view) === null || t === void 0 || t.setRoot(e), this.em.trigger(rn, e); }, r.prototype.__onComponent = function(t) { this.updateLayer(t); }, r.prototype.__isLayerable = function(t) { var e = t.get("tagName"); return (!this.config.hideTextnode || !t.is("textnode") && e !== "br") && t.get("layerable"); }, r.prototype.__trgCustom = function(t) { this.em.trigger(this.events.custom, { container: t.container, root: this.getRoot() }); }, r.prototype.updateLayer = function(t, e) { this.em.trigger(mc, t, e); }, r; }(jt); const Pn = ef, nf = { assets: [], noAssets: "", stylePrefix: "am-", upload: "", uploadName: "files", headers: {}, params: {}, credentials: "include", multiUpload: !0, autoAdd: !0, customFetch: void 0, uploadFile: void 0, embedAsBase64: !0, handleAdd: void 0, beforeUpload: void 0, showUrlInput: !0, custom: !1, dropzone: !1, openAssetsOnDrop: !0, dropzoneContent: "" }; var rf = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Bu = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return rf(r, a), r.getDefaults = function() { return (0, S.result)(this.prototype, "defaults"); }, r.prototype.defaults = function() { return { type: "", src: "" }; }, r.prototype.getType = function() { return this.get("type"); }, r.prototype.getSrc = function() { return this.get("src"); }, r.prototype.getFilename = function() { return this.get("src").split("/").pop().split("?").shift(); }, r.prototype.getExtension = function() { return this.getFilename().split(".").pop(); }, r; }(k.Hn); const xs = Bu; Bu.prototype.idAttribute = "src"; var o = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), s = function() { return s = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, s.apply(this, arguments); }; const u = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return o(r, a), r.prototype.defaults = function() { return s(s({}, xs.getDefaults()), { type: "image", unitDim: "px", height: 0, width: 0 }); }, r; }(xs); var c = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), p = function(a) { function r(t) { var e = a.call(this, t) || this; e.options = t, e.collection = t.collection; var n = t.config || {}; e.config = n, e.pfx = n.stylePrefix || "", e.ppfx = n.pStylePrefix || "", e.em = n.em, e.className = e.pfx + "asset", e.listenTo(e.model, "destroy remove", e.remove), e.model.view = e; var i = e.init && e.init.bind(e); return i && i(t), e; } return c(r, a), r.prototype.__getBhv = function() { var t = this.em, e = t == null ? void 0 : t.Assets; return (e == null ? void 0 : e.__getBehaviour()) || {}; }, r.prototype.template = function(t, e) { var n = this.pfx; return `
`).concat(this.getPreview(), `
`).concat(this.getInfo(), `
⨯
`); }, r.prototype.updateTarget = function(t) { t && t.set && (t.set("attributes", (0, S.clone)(t.get("attributes"))), t.set("src", this.model.get("src"))); }, r.prototype.getPreview = function() { return ""; }, r.prototype.getInfo = function() { return ""; }, r.prototype.render = function() { var t = this.el; return t.innerHTML = this.template(this, this.model), t.className = this.className, this; }, r; }(k.G7); const g = p; var m = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), y = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }, x = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return m(r, a), r.prototype.getPreview = function() { var t = this, e = t.pfx, n = t.ppfx, i = t.model.get("src"); return pt(B || (B = y([`
`], [`
`])), e, i, e, n); }, r.prototype.getInfo = function() { var t = this.pfx, e = this.model, n = e.get("name"), i = e.get("width"), l = e.get("height"), f = e.get("unitDim"), d = i && l ? "".concat(i, "x").concat(l).concat(f) : ""; return n = n || e.getFilename(), pt($ || ($ = y([`
', `
', `
`], [`
', `
', `
`])), t, n, t, d); }, r.prototype.init = function(t) { var e = this.pfx; this.className += " ".concat(e, "asset-image"); }, r.prototype.onClick = function() { var t = this.model, e = this.pfx, n = this.__getBhv().select, i = this.config.onClick, l = this.collection; l.trigger("deselectAll"), this.$el.addClass(e + "highlight"), (0, S.isFunction)(n) ? n(t, !1) : (0, S.isFunction)(i) ? i(t) : this.updateTarget(l.target); }, r.prototype.onDblClick = function() { var t = this.em, e = this.model, n = this.__getBhv().select, i = this.config.onDblClick, l = this.collection, f = l.target, d = l.onSelect; (0, S.isFunction)(n) ? n(e, !0) : (0, S.isFunction)(i) ? i(e) : (this.updateTarget(f), t == null || t.Modal.close()), (0, S.isFunction)(d) && d(e); }, r.prototype.onRemove = function(t) { t.stopImmediatePropagation(), this.model.collection.remove(this.model); }, r; }(g); const O = x; var B, $; x.prototype.events = { "click [data-toggle=asset-remove]": "onRemove", click: "onClick", dblclick: "onDblClick" }; var ft = function() { return ft = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ft.apply(this, arguments); }, dt = { types: [], initialize: function(a, r) { var t = this; r === void 0 && (r = {}); var e = r.em; this.em = e, this.opts = r, this.model = function(i, l) { var f, d, v; if (i === void 0 && (i = {}), l === void 0 && (l = {}), i && i.type) { var h = t.getBaseType(); f = (v = t.getType(i.type)) ? v.model : h.model, d = v ? v.view : h.view; } else { var w = t.recognizeType(i); f = (v = w.type).model, d = v.view, i = w.attributes; } var C = new f(i, ft(ft({}, l), { em: e })); return C.typeView = d, C; }; var n = this.init && this.init.bind(this); n && n(); }, recognizeType: function(a) { for (var r = this.getTypes(), t = 0; t < r.length; t++) { var e = r[t], n = e.isType(a); if (n = typeof n == "boolean" && n ? { type: e.id } : n) return { type: e, attributes: n }; } return { type: this.getBaseType(), attributes: a }; }, getBaseType: function() { var a = this.getTypes(); return a[a.length - 1]; }, getTypes: function() { return this.types; }, getType: function(a) { for (var r = this.getTypes(), t = 0; t < r.length; t++) { var e = r[t]; if (e.id === a) return e; } }, addType: function(a, r) { var t = this.getType(a), e = this.getBaseType(), n = t ? t.model : e.model, i = t ? t.view : e.view, l = r.model, f = r.view, d = r.isType; l = l instanceof k.Hn || (0, S.isFunction)(l) ? l : n.extend(l || {}), f = f instanceof k.G7 || (0, S.isFunction)(f) ? f : i.extend(f || {}), !this.extendViewApi || r.model || r.view || (f = f.extend(r)), t ? (t.model = l, t.view = f, t.isType = d || t.isType) : (r.id = a, r.model = l, r.view = f, r.isType = d || function(v) { if (v && v.type == a) return !0; }, this.getTypes().unshift(r)); } }; const Ct = dt; var Rt = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), $t = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Rt(r, a), r; }(k.FE.extend(Ct)); const re = $t; $t.prototype.types = [{ id: "image", model: u, view: O, isType: function(a) { return typeof a == "string" ? { type: "image", src: a } : a; } }]; var le = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Jt = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; e.options = t, e.config = t.config, e.pfx = e.config.stylePrefix || "", e.ppfx = e.config.pStylePrefix || "", e.em = e.config.em; var n = e.collection; return e.listenTo(n, "reset", e.renderAssets), e.listenTo(n, "add", e.addToAsset), e.listenTo(n, "remove", e.removedAsset), e.listenTo(n, "deselectAll", e.deselectAll), e; } return le(r, a), r.prototype.template = function(t) { var e = t.pfx, n = t.ppfx, i = t.em, l = ""; return this.config.showUrlInput && (l = `
`)), `
`).concat(l, `
`); }, r.prototype.handleSubmit = function(t) { t.preventDefault(); var e = this.getAddInput(), n = e && e.value.trim(), i = this.config.handleAdd; if (n) { e.value = ""; var l = this.getAssetsEl(); l && (l.scrollTop = 0), i ? i.bind(this)(n) : this.options.globalCollection.add(n, { at: 0 }); } }, r.prototype.getAssetsEl = function() { return this.el.querySelector(".".concat(this.pfx, "assets")); }, r.prototype.getAddInput = function() { return this.inputUrl && this.inputUrl.value || (this.inputUrl = this.el.querySelector(".".concat(this.pfx, "add-asset input"))), this.inputUrl; }, r.prototype.removedAsset = function(t) { this.collection.length || this.toggleNoAssets(); }, r.prototype.addToAsset = function(t) { this.collection.length == 1 && this.toggleNoAssets(!0), this.addAsset(t); }, r.prototype.addAsset = function(t, e) { e === void 0 && (e = null); var n = e, i = this.collection, l = this.config, f = new t.typeView({ model: t, collection: i, config: l }).render().el; if (n) n.appendChild(f); else { var d = this.getAssetsEl(); d && d.insertBefore(f, d.firstChild); } return f; }, r.prototype.toggleNoAssets = function(t) { t === void 0 && (t = !1); var e = this.$el.find(".".concat(this.pfx, "assets")); if (t) e.empty(); else { var n = this.config.noAssets; n && e.append(n); } }, r.prototype.deselectAll = function() { var t = this.pfx; this.$el.find(".".concat(t, "highlight")).removeClass("".concat(t, "highlight")); }, r.prototype.renderAssets = function() { var t = this, e = document.createDocumentFragment(), n = this.$el.find(".".concat(this.pfx, "assets")); n.empty(), this.toggleNoAssets(!!this.collection.length), this.collection.each(function(i) { return t.addAsset(i, e); }), n.append(e); }, r.prototype.render = function() { var t = this.options.fu.render().el; return this.$el.empty(), this.$el.append(t).append(this.template(this)), this.el.className = "".concat(this.ppfx, "asset-manager"), this.renderAssets(), this; }, r; }(k.G7); const ye = Jt; Jt.prototype.events = { submit: "handleSubmit" }; var me = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ce = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }, sn = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; e.options = t; var n = t.config || {}; e.module = t.module, e.config = n, e.em = e.config.em, e.pfx = n.stylePrefix || "", e.ppfx = n.pStylePrefix || "", e.target = e.options.globalCollection || {}, e.uploadId = e.pfx + "uploadFile", e.disabled = n.disableUpload !== void 0 ? n.disableUpload : !n.upload && !n.embedAsBase64, e.multiUpload = n.multiUpload === void 0 || n.multiUpload; var i = n.uploadFile; return i ? e.uploadFile = i.bind(e) : !n.upload && n.embedAsBase64 && (e.uploadFile = r.embedAsBase64), e.delegateEvents(), e; } return me(r, a), r.prototype.template = function(t) { var e = t.pfx, n = t.title, i = t.uploadId, l = t.disabled, f = t.multiUpload; return pt(gr || (gr = Ce([`
', `
`], [`
', `
`])), e, n, i, l ? "disabled" : "", f ? "multiple" : ""); }, r.prototype.events = function() { return { "change [data-input]": "uploadFile" }; }, r.prototype.onUploadStart = function() { var t = this.module; t && t.__propEv("asset:upload:start"); }, r.prototype.onUploadEnd = function(t) { var e = this.$el, n = this.module; n && n.__propEv("asset:upload:end", t); var i = e.find("input"); i && i.val(""); }, r.prototype.onUploadError = function(t) { var e = this.module; console.error(t), this.onUploadEnd(t), e && e.__propEv("asset:upload:error", t); }, r.prototype.onUploadResponse = function(t, e) { var n, i = this, l = i.module, f = i.config, d = i.target; try { n = typeof t == "string" ? JSON.parse(t) : t; } catch { n = t; } l && l.__propEv("asset:upload:response", n), f.autoAdd && d && d.add(n.data, { at: 0 }), this.onUploadEnd(t), e == null || e(n); }, r.prototype.uploadFile = function(t, e) { var n = this, i = t.dataTransfer ? t.dataTransfer.files : t.target.files, l = this.config, f = l.beforeUpload; if ((f && f(i)) !== !1) { var d = new FormData(), v = l.params, h = l.customFetch, w = l.fetchOptions; for (var C in v) d.append(C, v[C]); if (this.multiUpload) for (var L = 0; L < i.length; L++) d.append("".concat(l.uploadName, "[]"), i[L]); else i.length && d.append(l.uploadName, i[0]); var F = l.upload, q = l.headers, et = "X-Requested-With"; if (q[et] === void 0 && (q[et] = "XMLHttpRequest"), F) { this.onUploadStart(); var X = { method: "post", credentials: l.credentials || "include", headers: q, body: d }, At = (w == null ? void 0 : w(X)) || X; return (h ? h(F, At) : Cu(F, At).then(function(It) { return (It.status / 200 | 0) == 1 ? It.text() : It.text().then(function(ie) { return Promise.reject(ie); }); })).then(function(It) { return n.onUploadResponse(It, e); }).catch(function(It) { return n.onUploadError(It); }); } } }, r.prototype.initDrop = function() { var t = this; if (!this.uploadForm) { this.uploadForm = this.$el.find("form").get(0); var e = this.uploadForm; "draggable" in e && (this.uploadForm.ondragover = function() { return e.className = t.pfx + "hover", !1; }, this.uploadForm.ondragleave = function() { return e.className = "", !1; }, this.uploadForm.ondrop = function(n) { e.className = "", n.preventDefault(), t.uploadFile(n); }); } }, r.prototype.initDropzone = function(t) { var e = this, n = 0, i = this.config, l = t.model, f = t.el, d = l.Editor, v = l.Canvas.getBody(), h = this.ppfx, w = "".concat(h, "dropzone-active"), C = "".concat(h, "dropzone"), L = function() { f.className = f.className.replace(w, "").trim(), n = 0; }, F = function() { return n || (f.className += " ".concat(w), n = 1), !1; }, q = function() { return L(), !1; }, et = function(X) { if (L(), X.preventDefault(), X.stopPropagation(), e.uploadFile(X), i.openAssetsOnDrop && d) { var At = d.getSelected(); d.runCommand("open-assets", { target: At, onSelect: function() { d.Modal.close(), d.AssetManager.setTarget(null); } }); } return !1; }; t.$el.append('
').concat(i.dropzoneContent, "
")), L(), "draggable" in f && [f, v].forEach(function(X) { X.ondragover = F, X.ondragleave = q, X.ondrop = et; }); }, r.prototype.render = function() { var t = this, e = t.$el, n = t.pfx, i = t.em; return e.html(this.template({ title: i && i.t("assetManager.uploadTitle"), uploadId: this.uploadId, disabled: this.disabled, multiUpload: this.multiUpload, pfx: n })), this.initDrop(), e.attr("class", n + "file-uploader"), this; }, r.embedAsBase64 = function(t, e) { var n = this, i = t.dataTransfer ? t.dataTransfer.files : t.target.files, l = { data: [] }; if (FileReader) { for (var f = [], d = /^(.+)\/(.+)$/, v = function(C) { var L = new Promise(function(F, q) { var et = new FileReader(); et.addEventListener("load", function(X) { var At, It = C.name, ie = d.exec(C.type); if ((At = ie ? ie[1] : C.type) === "image") { var se = { src: et.result, name: It, type: At, height: 0, width: 0 }, Me = new Image(); Me.addEventListener("error", function(Ie) { q(Ie); }), Me.addEventListener("load", function() { se.height = Me.height, se.width = Me.width, F(se); }), Me.src = se.src; } else F(At ? { src: et.result, name: It, type: At } : et.result); }), et.addEventListener("error", function(X) { q(X); }), et.addEventListener("abort", function(X) { q("Aborted"); }), et.readAsDataURL(C); }); f.push(L); }, h = 0, w = i; h < w.length; h++) v(w[h]); return Promise.all(f).then(function(C) { l.data = C, n.onUploadResponse(l, e); }, function(C) { n.onUploadError(C); }); } this.onUploadError(new Error("Unsupported platform, FileReader is not defined")); }, r; }(k.G7); const an = sn; var gr, hn = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), sr = function() { return sr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, sr.apply(this, arguments); }, vr = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, xn = "asset", En = "".concat(xn, ":"), dr = "".concat(En, "select"), Vn = "".concat(En, "update"), An = "".concat(En, "add"), jn = "".concat(En, "remove"), mr = "".concat(jn, ":before"), ri = "".concat(En, "custom"), fo = "".concat(En, "open"), ar = "".concat(En, "close"), Cn = "".concat(En, "upload"), bc = "".concat(Cn, ":start"), Fo = "".concat(Cn, ":end"), Li = "".concat(Cn, ":error"), Di = "".concat(Cn, ":response"), zn = "open-assets", Cs = { all: xn, select: dr, update: Vn, add: An, remove: jn, removeBefore: mr, custom: ri, open: fo, close: ar, uploadStart: bc, uploadEnd: Fo, uploadError: Li, uploadResponse: Di }, wc = function(a) { function r(t) { var e = a.call(this, t, "AssetManager", new re([], t), Cs, nf) || this; e.storageKey = "assets", e.Asset = xs, e.Assets = re; var n = e, i = n.all, l = n.config; e.assetsVis = new re([]); var f = l.pStylePrefix; return f && (l.stylePrefix = "".concat(f).concat(l.stylePrefix)), i.on("add", function(d) { return e.getAllVisible().add(d); }), i.on("remove", function(d) { return e.getAllVisible().remove(d); }), e.__onAllEvent = (0, S.debounce)(function() { return e.__trgCustom(); }, 0), e; } return hn(r, a), r.prototype.__propEv = function(t) { for (var e, n, i = [], l = 1; l < arguments.length; l++) i[l - 1] = arguments[l]; (e = this.em).trigger.apply(e, vr([t], i, !1)), (n = this.getAll()).trigger.apply(n, vr([t], i, !1)); }, r.prototype.__trgCustom = function() { var t = this.__getBehaviour(), e = this.getConfig().custom; (t.container || e.open) && this.em.trigger(this.events.custom, this.__customData()); }, r.prototype.__customData = function() { var t = this, e = this.__getBehaviour(); return { am: this, open: this.isOpen(), assets: this.getAll().models, types: e.types || [], container: e.container, close: function() { return t.close(); }, remove: function(n, i) { return t.remove(n, i); }, select: function(n, i) { var l = t.add(n); (0, S.isFunction)(e.select) && e.select(l, i); }, options: e.options || {} }; }, r.prototype.open = function(t) { t === void 0 && (t = {}), this.em.Commands.run(zn, sr({ types: ["image"], select: function() { } }, t)); }, r.prototype.close = function() { this.em.Commands.stop(zn); }, r.prototype.isOpen = function() { var t = this.em.Commands; return !!(t != null && t.isActive(zn)); }, r.prototype.add = function(t, e) { return e === void 0 && (e = {}), e.at === void 0 && (e.at = 0), this.all.add(t, e); }, r.prototype.get = function(t) { return this.all.where({ src: t })[0] || null; }, r.prototype.getAll = function() { return this.all; }, r.prototype.getAllVisible = function() { return this.assetsVis; }, r.prototype.remove = function(t, e) { return this.__remove(t, e); }, r.prototype.store = function() { return this.getProjectData(); }, r.prototype.load = function(t) { return this.loadProjectData(t); }, r.prototype.getContainer = function() { var t; return this.__getBehaviour().container || ((t = this.am) === null || t === void 0 ? void 0 : t.el); }, r.prototype.getAssetsEl = function() { var t; return (t = this.am) === null || t === void 0 ? void 0 : t.el.querySelector("[data-el=assets]"); }, r.prototype.render = function(t) { if (!this.getConfig().custom) { var e = t || this.getAll().models; if (!this.am) { var n = this.__viewParams(); n.fu = this.FileUploader(), this.am = new ye(sr({}, n)), this.am.render(); } return this.assetsVis.reset(e), this.getContainer(); } }, r.prototype.__viewParams = function() { return { collection: this.assetsVis, globalCollection: this.all, config: this.config, module: this, fu: void 0 }; }, r.prototype.addType = function(t, e) { this.getAll().addType(t, e); }, r.prototype.getType = function(t) { return this.getAll().getType(t); }, r.prototype.getTypes = function() { return this.getAll().getTypes(); }, r.prototype.AssetsView = function() { return this.am; }, r.prototype.FileUploader = function() { return this.fu || (this.fu = new an(this.__viewParams())), this.fu; }, r.prototype.onLoad = function() { var t = this; this.getAll().reset(this.config.assets); var e = this.em, n = this.events; e.on("run:".concat(zn), function() { return t.__propEv(n.open); }), e.on("stop:".concat(zn), function() { return t.__propEv(n.close); }); }, r.prototype.postRender = function(t) { var e; this.config.dropzone && ((e = this.fu) === null || e === void 0 || e.initDropzone(t)); }, r.prototype.setTarget = function(t) { this.assetsVis.target = t; }, r.prototype.onSelect = function(t) { this.assetsVis.onSelect = t; }, r.prototype.onClick = function(t) { this.config.onClick = t; }, r.prototype.onDblClick = function(t) { this.config.onDblClick = t; }, r.prototype.__behaviour = function(t) { return t === void 0 && (t = {}), this._bhv = sr(sr({}, this._bhv || {}), t); }, r.prototype.__getBehaviour = function(t) { return this._bhv || {}; }, r.prototype.destroy = function() { var t, e; this.all.stopListening(), this.all.reset(), this.assetsVis.stopListening(), this.assetsVis.reset(), (t = this.fu) === null || t === void 0 || t.remove(), (e = this.am) === null || e === void 0 || e.remove(), this._bhv = {}; }, r; }(Dt); const Xd = wc; var of = { placeholder: "eg. Text here" }; const Jd = { locale: "en", localeFallback: "en", detectLocale: !0, debug: !1, messages: { en: { assetManager: { addButton: "Add image", inputPlh: "http://path/to/the/image.jpg", modalTitle: "Select Image", uploadTitle: "Drop files here or click to upload" }, blockManager: { labels: {}, categories: {} }, domComponents: { names: { "": "Box", wrapper: "Body", text: "Text", comment: "Comment", image: "Image", video: "Video", label: "Label", link: "Link", map: "Map", tfoot: "Table foot", tbody: "Table body", thead: "Table head", table: "Table", row: "Table row", cell: "Table cell" } }, deviceManager: { device: "Device", devices: { desktop: "Desktop", tablet: "Tablet", mobileLandscape: "Mobile Landscape", mobilePortrait: "Mobile Portrait" } }, panels: { buttons: { titles: { preview: "Preview", fullscreen: "Fullscreen", "sw-visibility": "View components", "export-template": "View code", "open-sm": "Open Style Manager", "open-tm": "Settings", "open-layers": "Open Layer Manager", "open-blocks": "Open Blocks" } } }, selectorManager: { label: "Classes", selected: "Selected", emptyState: "- State -", states: { hover: "Hover", active: "Click", "nth-of-type(2n)": "Even/Odd" } }, styleManager: { empty: "Select an element before using Style Manager", layer: "Layer", fileButton: "Images", sectors: { general: "General", layout: "Layout", typography: "Typography", decorations: "Decorations", extra: "Extra", flex: "Flex", dimension: "Dimension" }, properties: { "text-shadow-h": "X", "text-shadow-v": "Y", "text-shadow-blur": "Blur", "text-shadow-color": "Color", "box-shadow-h": "X", "box-shadow-v": "Y", "box-shadow-blur": "Blur", "box-shadow-spread": "Spread", "box-shadow-color": "Color", "box-shadow-type": "Type", "margin-top-sub": "Top", "margin-right-sub": "Right", "margin-bottom-sub": "Bottom", "margin-left-sub": "Left", "padding-top-sub": "Top", "padding-right-sub": "Right", "padding-bottom-sub": "Bottom", "padding-left-sub": "Left", "border-width-sub": "Width", "border-style-sub": "Style", "border-color-sub": "Color", "border-top-left-radius-sub": "Top Left", "border-top-right-radius-sub": "Top Right", "border-bottom-right-radius-sub": "Bottom Right", "border-bottom-left-radius-sub": "Bottom Left", "transform-rotate-x": "Rotate X", "transform-rotate-y": "Rotate Y", "transform-rotate-z": "Rotate Z", "transform-scale-x": "Scale X", "transform-scale-y": "Scale Y", "transform-scale-z": "Scale Z", "transition-property-sub": "Property", "transition-duration-sub": "Duration", "transition-timing-function-sub": "Timing", "background-image-sub": "Image", "background-repeat-sub": "Repeat", "background-position-sub": "Position", "background-attachment-sub": "Attachment", "background-size-sub": "Size" } }, traitManager: { empty: "Select an element before using Trait Manager", label: "Component settings", traits: { labels: {}, attributes: { id: of, alt: of, title: of, href: { placeholder: "eg. https://google.com" } }, options: { target: { false: "This window", _blank: "New window" } } } }, storageManager: { recover: "Do you want to recover unsaved changes?" } } }, messagesAdd: void 0 }; var Zd = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Qd = function(a) { function r(t) { var e = a.call(this, t, "I18n", Jd) || this, n = e.config.messagesAdd; return n && e.addMessages(n), e.config.detectLocale && (e.config.locale = e._localLang()), e; } return Zd(r, a), r.prototype.setLocale = function(t) { var e = this.em, n = this.config, i = { value: t, valuePrev: n.locale }; return e && e.trigger("i18n:locale", i), n.locale = t, this; }, r.prototype.getLocale = function() { return this.config.locale; }, r.prototype.getMessages = function(t, e) { e === void 0 && (e = {}); var n = this.config.messages; return t && !n[t] && this._debug("'".concat(t, "' i18n lang not found"), e), t ? n[t] : n; }, r.prototype.setMessages = function(t) { var e = this.em; return this.config.messages = t, e && e.trigger("i18n:update", t), this; }, r.prototype.addMessages = function(t) { var e = this.em, n = this.config.messages; return e && e.trigger("i18n:add", t), this.setMessages((0, H.deepMerge)(n, t)), this; }, r.prototype.t = function(t, e) { e === void 0 && (e = {}); var n = this.config, i = e.params || {}, l = e.l || this.getLocale(), f = e.lFlb || n.localeFallback, d = this._getMsg(t, l, e); return d || (d = this._getMsg(t, f, e)), !d && this._debug("'".concat(t, "' i18n key not found in '").concat(l, "' lang"), e), d = d && (0, S.isString)(d) ? this._addParams(d, i) : d; }, r.prototype._localLang = function() { var t = (0, H.hasWin)() && window.navigator || {}, e = t.language || t.userLanguage; return e ? e.split("-")[0] : "en"; }, r.prototype._addParams = function(t, e) { var n = new RegExp("{([\\w\\d-]*)}", "g"); return t.replace(n, function(i, l) { return e[l] || ""; }).trim(); }, r.prototype._getMsg = function(t, e, n) { n === void 0 && (n = {}); var i = this.getMessages(e, n); if (i) { var l = i[t]; return !l && t.indexOf(".") > 0 && (l = t.split(".").reduce(function(f, d) { if (!(0, S.isUndefined)(f)) return f[d]; }, i)), l; } }, r.prototype._debug = function(t, e) { e === void 0 && (e = {}); var n = this.em, i = this.config; (e.debug || i.debug) && n && n.logWarning(t); }, r.prototype.destroy = function() { }, r; }(jt); const th = Qd; var eh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ss = function() { return Ss = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Ss.apply(this, arguments); }, nh = function() { }, rh = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return eh(r, a), r.prototype.initialize = function(t) { t === void 0 && (t = {}), this.opt = t || {}, (0, S.bindAll)(this, "startSort", "onMove", "endMove", "rollback", "updateOffset", "moveDragHelper"); var e = t || {}; this.elT = 0, this.elL = 0, this.borderOffset = e.borderOffset || 10; var n = e.container; this.el = typeof n == "string" ? document.querySelector(n) : n, this.$el = (0, W.default)(this.el), this.containerSel = e.containerSel || "div", this.itemSel = e.itemSel || "div", this.draggable = e.draggable || !0, this.nested = !!e.nested, this.pfx = e.pfx || "", this.ppfx = e.ppfx || "", this.freezeClass = e.freezeClass || this.pfx + "freezed", this.onStart = e.onStart || nh, this.onEndMove = e.onEndMove, this.customTarget = e.customTarget, this.onEnd = e.onEnd, this.direction = e.direction || "v", this.onMoveClb = e.onMove, this.relative = e.relative || !1, this.ignoreViewChildren = !!e.ignoreViewChildren, this.plh = e.placer, this.wmargin = e.wmargin || 0, this.offTop = e.offsetTop || 0, this.offLeft = e.offsetLeft || 0, this.document = e.document || document, this.em = e.em, this.canvasRelative = !!e.canvasRelative, this.selectOnEnd = !e.avoidSelectOnEnd, this.scale = e.scale, this.em && this.em.on && (this.em.on("change:canvasOffset", this.updateOffset), this.updateOffset()); }, r.prototype.getScale = function() { return (0, S.result)(this, "scale") || 1; }, r.prototype.getContainerEl = function(t) { if (t && (this.el = t), !this.el) { var e = this.opt.container; this.el = typeof e == "string" ? document.querySelector(e) : e, this.$el = (0, W.default)(this.el); } return this.el; }, r.prototype.getDocuments = function(t) { var e = this.em, n = t ? t.ownerDocument : e == null ? void 0 : e.Canvas.getBody().ownerDocument, i = [document]; return n && i.push(n), i; }, r.prototype.updateOffset = function() { var t, e = ((t = this.em) === null || t === void 0 ? void 0 : t.get("canvasOffset")) || {}; this.offTop = e.top, this.offLeft = e.left; }, r.prototype.setDropContent = function(t) { delete this.dropModel, this.dropContent = t; }, r.prototype.updateTextViewCursorPosition = function(t) { var e = this.em; if (e) { var n = e.get("Canvas"), i = n.getDocument(), l = null; if (i.caretRangeFromPoint) { var f = (0, H.getPointerEvent)(t); l = i.caretRangeFromPoint(f.clientX, f.clientY); } else t.rangeParent && (l = i.createRange()).setStart(t.rangeParent, t.rangeOffset); var d = n.getWindow().getSelection(); n.getFrameEl().focus(), d.removeAllRanges(), l && d.addRange(l), this.setContentEditable(this.activeTextModel, !0); } }, r.prototype.setContentEditable = function(t, e) { if (t) { var n = t.getEl(); n.contentEditable != e && (n.contentEditable = e); } }, r.prototype.toggleSortCursor = function(t) { var e = this.em, n = e && e.get("Canvas"); n && (t ? n.startAutoscroll() : n.stopAutoscroll()); }, r.prototype.setDragHelper = function(t, e) { for (var n = e || "", i = t.cloneNode(!0), l = t.getBoundingClientRect(), f = getComputedStyle(t), d = "", v = 0; v < f.length; v++) { var h = f[v]; d += "".concat(h, ":").concat(f.getPropertyValue(h), ";"); } document.body.appendChild(i), i.className += " ".concat(this.pfx, "bdrag"), i.setAttribute("style", d), this.dragHelper = i, i.style.width = "".concat(l.width, "px"), i.style.height = "".concat(l.height, "px"), n && this.moveDragHelper(n), this.em && (0, W.default)(this.em.Canvas.getBody().ownerDocument).off("mousemove", this.moveDragHelper).on("mousemove", this.moveDragHelper), (0, W.default)(document).off("mousemove", this.moveDragHelper).on("mousemove", this.moveDragHelper); }, r.prototype.moveDragHelper = function(t) { var e = t.target.ownerDocument; if (this.dragHelper && e) { var n = t.pageY, i = t.pageX, l = 0, f = 0, d = (e.defaultView || e.parentWindow).frameElement, v = this.dragHelper.style; if (d) { var h = d.getBoundingClientRect(); l = h.top + document.documentElement.scrollTop, f = h.left + document.documentElement.scrollLeft, n = t.clientY, i = t.clientX; } v.top = n + l + "px", v.left = i + f + "px"; } }, r.prototype.matches = function(t, e) { return H.matches.call(t, e); }, r.prototype.closest = function(t, e) { if (t) for (var n = t.parentNode; n && n.nodeType === 1; ) { if (this.matches(n, e)) return n; n = n.parentNode; } }, r.prototype.offset = function(t) { var e = t.getBoundingClientRect(); return { top: e.top + document.body.scrollTop, left: e.left + document.body.scrollLeft }; }, r.prototype.createPlaceholder = function() { var t = this.pfx, e = document.createElement("div"), n = document.createElement("div"); return e.className = t + "placeholder", e.style.display = "none", e.style.pointerEvents = "none", n.className = t + "placeholder-int", e.appendChild(n), e; }, r.prototype.startSort = function(t, e) { var n, i; e === void 0 && (e = {}); var l, f = this, d = f.em, v = f.itemSel, h = f.containerSel, w = f.plh, C = this.getContainerEl(e.container), L = this.getDocuments(t); delete this.dropModel, delete this.target, delete this.prevTarget, this.moved = !1, t && !this.matches(t, "".concat(v, ", ").concat(h)) && (t = this.closest(t, v)), this.sourceEl = t, w || (this.plh = this.createPlaceholder(), C.appendChild(this.plh)), t && ((l = this.getSourceModel(t)) && l.set && l.set("status", "freezed"), this.srcModel = l), (0, H.on)(C, "mousemove dragover", this.onMove), (0, H.on)(L, "mouseup dragend touchend", this.endMove), (0, H.on)(L, "keydown", this.rollback), this.onStart({ sorter: this, target: l, parent: l && ((n = l.parent) === null || n === void 0 ? void 0 : n.call(l)), index: l && ((i = l.index) === null || i === void 0 ? void 0 : i.call(l)) }), d == null || d.clearSelection(), this.toggleSortCursor(!0), d == null || d.trigger("sorter:drag:start", t, l); }, r.prototype.getTargetModel = function(t) { var e = t || this.target; return (0, W.default)(e).data("model"); }, r.prototype.getSourceModel = function(t, e) { var n = this, i = e === void 0 ? {} : e, l = i.target, f = i.avoidChildren, d = f === void 0 ? 1 : f, v = this.em, h = this.sourceEl, w = t || h, C = this.dropModel, L = this.dropContent, F = function(At) { return At && l && At.opt && At.opt.avoidChildren && n.isTextableActive(At, l); }; if (L && v) { if (F(C) && (C = void 0), !C) { var q = v.Components.getComponents(), et = { avoidChildren: d, avoidStore: 1, avoidUpdateStyle: 1 }, X = q.add(L, Ss(Ss({}, et), { temporary: !0 })); if (C = (C = q.remove(X, et)) instanceof Array ? C[0] : C, this.dropModel = C, F(C)) return this.getSourceModel(w, { target: l, avoidChildren: 0 }); } return C; } return w && (0, W.default)(w).data("model"); }, r.prototype.selectTargetModel = function(t, e) { if (!(t instanceof k.FE || e && e === t)) { var n = this.targetModel; n && n !== this.srcModel && n.set("status", ""), t && t.set && (t.set("status", "selected-parent"), this.targetModel = t); } }, r.prototype.onMove = function(t) { var e = t, n = this, i = n.em, l = n.onMoveClb, f = n.plh, d = n.customTarget; this.moved = !0; var v = f.style.display; v && v !== "none" || (f.style.display = "block"); var h = this.offset(this.el); this.elT = this.wmargin ? Math.abs(h.top) : h.top, this.elL = this.wmargin ? Math.abs(h.left) : h.left; var w = t.pageY - this.elT + this.el.scrollTop, C = t.pageX - this.elL + this.el.scrollLeft; if (this.canvasRelative && i) { var L = i.get("Canvas").getMouseRelativeCanvas(t, { noScroll: 1 }); C = L.x, w = L.y; } this.rX = C, this.rY = w, this.eventMove = t; var F = this.getSourceModel(), q = d ? d({ sorter: this, event: t }) : t.target, et = this.dimsFromTarget(q, C, w), X = this.target, At = X && this.getTargetModel(X); if (this.selectTargetModel(At, F), At || (f.style.display = "none"), X) { this.lastDims = et; var It = this.findPosition(et, C, w); this.isTextableActive(F, At) ? (this.activeTextModel = At, f.style.display = "none", this.lastPos = It, this.updateTextViewCursorPosition(e)) : (this.disableTextable(), delete this.activeTextModel, this.lastPos && this.lastPos.index == It.index && this.lastPos.method == It.method || (this.movePlaceholder(this.plh, et, It, this.prevTargetDim), this.$plh || (this.$plh = (0, W.default)(this.plh)), this.canvasRelative || (this.offTop && this.$plh.css("top", "+=" + this.offTop + "px"), this.offLeft && this.$plh.css("left", "+=" + this.offLeft + "px")), this.lastPos = It)), (0, S.isFunction)(l) && l({ event: t, target: F, parent: At, index: It.index + (It.method == "after" ? 1 : 0) }), i && i.trigger("sorter:drag", { target: X, targetModel: At, sourceModel: F, dims: et, pos: It, x: C, y: w }); } }, r.prototype.isTextableActive = function(t, e) { var n; return ((n = t == null ? void 0 : t.get) === null || n === void 0 ? void 0 : n.call(t, "textable")) && (e == null ? void 0 : e.isInstanceOf("text")); }, r.prototype.disableTextable = function() { var t = this.activeTextModel; t == null || t.getView().disableEditing(), this.setContentEditable(t, !1); }, r.prototype.isInFlow = function(t, e) { if (!t) return !1; e = e || document.body; var n = t; return n.offsetHeight, !!this.styleInFlow(n, e); }, r.prototype.styleInFlow = function(t, e) { if (!(0, H.isTextNode)(t)) { var n = t.style || {}, i = (0, W.default)(t), l = e && (0, W.default)(e); if (!n.overflow || n.overflow === "visible") { var f = i.css("float"); if (!(f && f !== "none" || l && l.css("display") == "flex" && l.css("flex-direction") !== "column")) { switch (n.position) { case "static": case "relative": case "": break; default: return; } switch (t.tagName) { case "TR": case "TBODY": case "THEAD": case "TFOOT": return !0; } switch (i.css("display")) { case "block": case "list-item": case "table": case "flex": case "grid": return !0; } } } } }, r.prototype.validTarget = function(t, e) { var n = this.getTargetModel(t), i = this.getSourceModel(e, { target: n }), l = { valid: !0, src: e = i && i.view && i.view.el, srcModel: i, trg: t = n && n.view && n.view.el, trgModel: n, draggable: !1, droppable: !1, dragInfo: "", dropInfo: "" }; if (!e || !t) return l.valid = !1, l; var f = i.get("draggable"); if ((0, S.isFunction)(f)) { var d = f(i, n); l.dragInfo = d, l.draggable = d, f = d; } else f = f instanceof Array ? f.join(", ") : f, l.dragInfo = f, f = (0, S.isString)(f) ? this.matches(t, f) : f, l.draggable = f; var v = n.get("droppable"); return (0, S.isFunction)(v) ? (d = v(i, n), l.droppable = d, l.dropInfo = d, v = d) : (v = (v = v instanceof k.FE ? 1 : v) instanceof Array ? v.join(", ") : v, l.dropInfo = v, v = (0, S.isString)(v) ? this.matches(e, v) : v, v = f && this.isTextableActive(i, n) ? 1 : v, l.droppable = v), v && f || (l.valid = !1), l; }, r.prototype.dimsFromTarget = function(t, e, n) { var i = this.em, l = []; if (!t || (this.matches(t, "".concat(this.itemSel, ", ").concat(this.containerSel)) || (t = this.closest(t, this.itemSel)), this.draggable instanceof Array && (t = this.closest(t, this.draggable.join(","))), !t)) return l; if (this.prevTarget && this.prevTarget != t && delete this.prevTarget, !this.prevTarget) { this.targetP = this.closest(t, this.containerSel); var f = this.validTarget(t); if (i && i.trigger("sorter:drag:validation", f), !f.valid && this.targetP) return this.dimsFromTarget(this.targetP, e, n); this.prevTarget = t, this.prevTargetDim = this.getDim(t), this.cacheDimsP = this.getChildrenDim(this.targetP), this.cacheDims = this.getChildrenDim(t); } if (this.prevTarget == t && (l = this.cacheDims), this.target = this.prevTarget, this.nearBorders(this.prevTargetDim, e, n) || !this.nested && !this.cacheDims.length) { var d = this.targetP; d && this.validTarget(d).valid && (l = this.cacheDimsP, this.target = d); } return delete this.lastPos, l; }, r.prototype.getTargetFromEl = function(t) { var e, n = t, i = this.targetPrev, l = this.em, f = this.containerSel, d = this.itemSel; if (this.matches(n, "".concat(d, ", ").concat(f)) || (n = this.closest(n, d)), this.draggable instanceof Array && (n = this.closest(n, this.draggable.join(","))), i && i != n && delete this.targetPrev, !this.targetPrev) { e = this.closest(n, f); var v = this.validTarget(n); if (l && l.trigger("sorter:drag:validation", v), !v.valid && e) return this.getTargetFromEl(e); this.targetPrev = n; } return this.nearElBorders(n) && (e = this.closest(n, f)) && this.validTarget(e).valid && (n = e), n; }, r.prototype.nearElBorders = function(t) { var e = 10, n = t.getBoundingClientRect(), i = t.ownerDocument.body, l = this.getCurrentPos(), f = l.x, d = l.y, v = n.top + i.scrollTop, h = n.left + i.scrollLeft, w = n.width, C = n.height; if (d < v + e || d > v + C - e || f < h + e || f > h + w - e) return 1; }, r.prototype.getCurrentPos = function() { var t = this.eventMove; return { x: (t == null ? void 0 : t.pageX) || 0, y: (t == null ? void 0 : t.pageY) || 0 }; }, r.prototype.getDim = function(t) { var e, n, i, l, f = this.em, d = this.canvasRelative, v = f == null ? void 0 : f.Canvas, h = v ? v.getElementOffsets(t) : {}; if (d && f) { var w = v.getElementPos(t, { noScroll: 1 }); e = w.top, n = w.left, i = w.height, l = w.width; } else { var C = this.offset(t); e = this.relative ? t.offsetTop : C.top - (this.wmargin ? -1 : 1) * this.elT, n = this.relative ? t.offsetLeft : C.left - (this.wmargin ? -1 : 1) * this.elL, i = t.offsetHeight, l = t.offsetWidth; } return { top: e, left: n, height: i, width: l, offsets: h }; }, r.prototype.getChildrenDim = function(t) { var e = this, n = []; if (!t) return n; var i = this.getTargetModel(t); if (i && i.view && !this.ignoreViewChildren) { var l = i.getCurrentView ? i.getCurrentView() : i.view; t = l.getChildrenContainer(); } return (0, S.each)(t.children, function(f, d) { var v = f, h = (0, H.getModel)(v, W.default), w = h && h.index ? h.index() : d; if ((0, H.isTextNode)(v) || e.matches(v, e.itemSel)) { var C, L = e.getDim(v), F = e.direction; C = F == "v" || F != "h" && e.isInFlow(v, t), L.dir = C, L.el = v, L.indexEl = w, n.push(L); } }), n; }, r.prototype.nearBorders = function(t, e, n) { var i = !1, l = this.borderOffset, f = e || 0, d = n || 0, v = t.top, h = t.left, w = t.height, C = t.width; return (v + l > d || d > v + w - l || h + l > f || f > h + C - l) && (i = !0), i; }, r.prototype.findPosition = function(t, e, n) { for (var i, l = { index: 0, indexEl: 0, method: "before" }, f = 0, d = 0, v = 0, h = 0, w = 0, C = 0, L = 0, F = t.length; L < F; L++) { var q = (i = t[L]).top, et = i.left, X = i.height, At = i.width; if (C = q + X, h = et + At / 2, w = q + X / 2, !(d && et > d || v && w >= v || f && et + At < f)) if (l.index = L, l.indexEl = i.indexEl, i.dir) { if (n < w) { l.method = "before"; break; } l.method = "after"; } else n < C && (v = C), e < h ? (d = h, l.method = "before") : (f = h, l.method = "after"); } return l; }, r.prototype.movePlaceholder = function(t, e, n, i) { var l = 0, f = 0, d = 0, v = "", h = "", w = "px", C = 5, L = n.method, F = e[n.index]; if (t.classList.remove("vertical"), t.classList.add("horizontal"), F) { var q = F.top, et = F.left, X = F.height, At = F.width; F.dir ? (v = At + w, h = "auto", f = L == "before" ? q - l : q + X - l, d = et) : (v = "auto", h = X - 2 * l + w, f = q + l, d = L == "before" ? et - l : et + At - l, t.classList.remove("horizontal"), t.classList.add("vertical")); } else { if (!this.nested) return void (t.style.display = "none"); if (i) { var It = i.offsets || {}, ie = It.paddingTop || C, se = It.paddingLeft || C; f = i.top + ie, d = i.left + se, v = parseInt("".concat(i.width)) - 2 * se + w, h = "auto"; } } t.style.top = f + w, t.style.left = d + w, v && (t.style.width = v), h && (t.style.height = h); }, r.prototype.parents = function(t) { return t ? [t].concat(this.parents(t.parent())) : []; }, r.prototype.sort = function(t, e) { var n = t.parents.filter(function(l) { return e.parents.includes(l); })[0]; if (!n) return e.model.index() - t.model.index(); var i = t.parents[t.parents.indexOf(n) - 1]; return e.parents[e.parents.indexOf(n) - 1].index() - i.index(); }, r.prototype.endMove = function() { var t, e = this, n = this.sourceEl, i = [], l = this.getDocuments(), f = this.getContainerEl(), d = this.onEndMove, v = this.onEnd, h = this.target, w = this.lastPos; if ((0, H.off)(f, "mousemove dragover", this.onMove), (0, H.off)(l, "mouseup dragend touchend", this.endMove), (0, H.off)(l, "keydown", this.rollback), this.plh.style.display = "none", n && (t = this.getSourceModel(), this.selectOnEnd && t && t.set && (t.set("status", ""), t.set("status", "selected"))), this.moved && h) { var C = this.toMove, L = (0, S.isArray)(C) ? C : C ? [C] : [n], F = 0; L.length === 1 ? i.push(this.move(h, L[0], w)) : L.map(function(X) { return { model: X, parents: e.parents(X) }; }).sort(this.sort).forEach(function(X) { var At = X.model, It = At.index(), ie = At.parent().getEl(); i.push(e.move(h, At, Ss(Ss({}, w), { indexEl: w.indexEl - F, index: w.index - F }))), ie === h && It <= w.index && F++; }); } this.plh && (this.plh.style.display = "none"); var q = this.dragHelper; if (q && (q.parentNode.removeChild(q), delete this.dragHelper), this.disableTextable(), this.selectTargetModel(), this.toggleSortCursor(), delete this.toMove, delete this.eventMove, delete this.dropModel, (0, S.isFunction)(d)) { var et = { target: t, parent: t && t.parent(), index: t && t.index() }; i.length ? i.forEach(function(X) { return d(X, e, et); }) : d(null, this, Ss(Ss({}, et), { cancelled: 1 })); } (0, S.isFunction)(v) && v({ sorter: this }); }, r.prototype.move = function(t, e, n) { var i, l, f = this.em, d = this.dropContent, v = (0, H.getElement)(e), h = [], w = n.method === "after" ? n.indexEl + 1 : n.indexEl, C = this.validTarget(t, v), L = (0, W.default)(t).data("collection"), F = C.trgModel, q = C.srcModel, et = C.draggable, X = F instanceof k.FE ? 1 : C.droppable; if (L && X && et) { var At = { at: w, action: "move-component" }, It = this.isTextableActive(q, F); if (d) i = (0, S.isFunction)(d) ? d() : d, At.avoidUpdateStyle = !0, At.action = "add-component"; else { var ie = q.collection.indexOf(q), se = L === q.collection; (!se || !(ie === w || ie === w - 1) || It) && (i = q.collection.remove(q, { temporary: !0 }), se && w > ie && (At.at = w - 1)); } i && (It ? (delete At.at, l = F.getView().insertComponent(i, At)) : l = L.add(i, At)), delete this.dropContent, delete this.prevTarget; } else if (f) { var Me = C.dropInfo || (F == null ? void 0 : F.get("droppable")), Ie = C.dragInfo || (q == null ? void 0 : q.get("draggable")); !L && h.push("Target collection not found"), !X && Me && h.push("Target is not droppable, accepts [".concat(Me, "]")), !et && Ie && h.push("Component not draggable, acceptable by [".concat(Ie, "]")), f.logWarning("Invalid target position", { errors: h, model: q, context: "sorter", target: F }); } return f == null || f.trigger("sorter:drag:end", { targetCollection: L, modelToDrop: i, warns: h, validResult: C, dst: t, srcEl: v }), l; }, r.prototype.rollback = function(t) { (0, H.off)(this.getDocuments(), "keydown", this.rollback), (t.which || t.keyCode) == 27 && (this.moved = !1, this.endMove()); }, r; }(k.G7); const oh = rh; var ba = function() { return ba = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ba.apply(this, arguments); }, ih = function() { function a(r) { r === void 0 && (r = {}), this.defOpts = { ratioDefault: !1, onUpdateContainer: function() { }, step: 1, minDim: 10, maxDim: 1 / 0, unitHeight: "px", unitWidth: "px", keyHeight: "height", keyWidth: "width", currentUnit: !0, silentFrames: !1, avoidContainerUpdate: !1, keepAutoHeight: !1, keepAutoWidth: !1, autoHeight: !1, autoWidth: !1, tl: !0, tc: !0, tr: !0, cl: !0, cr: !0, bl: !0, bc: !0, br: !0 }, this.opts = ba({}, this.defOpts), this.setOptions(r), (0, S.bindAll)(this, "handleKeyDown", "handleMouseDown", "move", "stop"); } return a.prototype.getConfig = function() { return this.opts; }, a.prototype.setOptions = function(r, t) { r === void 0 && (r = {}), this.opts = ba(ba({}, t ? this.defOpts : this.opts), r), this.setup(); }, a.prototype.setup = function() { var r = this.opts, t = r.prefix || "", e = r.appendTo || document.body, n = this.container; for (n || ((n = document.createElement("div")).className = "".concat(t, "resizer-c"), e.appendChild(n), this.container = n); n.firstChild; ) n.removeChild(n.firstChild); var i = {}; for (var l in ["tl", "tc", "tr", "cl", "cr", "bl", "bc", "br"].forEach(function(d) { return i[d] = r[d] ? function(v, h) { h === void 0 && (h = {}); var w = h.prefix || "", C = document.createElement("i"); return C.className = w + "resizer-h " + w + "resizer-h-" + v, C.setAttribute("data-" + w + "handler", v), C; }(d, r) : null; }), i) { var f = i[l]; f && n.appendChild(f); } this.handlers = i, this.mousePosFetcher = r.mousePosFetcher, this.updateTarget = r.updateTarget, this.posFetcher = r.posFetcher, this.onStart = r.onStart, this.onMove = r.onMove, this.onEnd = r.onEnd, this.onUpdateContainer = r.onUpdateContainer; }, a.prototype.toggleFrames = function(r) { if (this.opts.silentFrames) { var t = document.querySelectorAll("iframe"); (0, S.each)(t, function(e) { return e.style.pointerEvents = r ? "none" : ""; }); } }, a.prototype.isHandler = function(r) { var t = this.handlers; for (var e in t) if (t[e] === r) return !0; return !1; }, a.prototype.getFocusedEl = function() { return this.el; }, a.prototype.getParentEl = function() { var r; return (r = this.el) === null || r === void 0 ? void 0 : r.parentElement; }, a.prototype.getDocumentEl = function() { return [this.el.ownerDocument, document]; }, a.prototype.getElementPos = function(r, t) { t === void 0 && (t = {}); var e = this.posFetcher; return e ? e(r, t) : function(n, i) { var l = i || window, f = n.getBoundingClientRect(); return { left: f.left + l.pageXOffset, top: f.top + l.pageYOffset, width: f.width, height: f.height }; }(r); }, a.prototype.focus = function(r) { r && r === this.el || (this.el = r, this.updateContainer({ forceShow: !0 }), (0, H.on)(this.getDocumentEl(), "pointerdown", this.handleMouseDown)); }, a.prototype.blur = function() { this.container.style.display = "none", this.el && ((0, H.off)(this.getDocumentEl(), "pointerdown", this.handleMouseDown), delete this.el); }, a.prototype.start = function(r) { var t = r; if (t.button === 0) { t.preventDefault(), t.stopPropagation(); var e = this.el, n = this.getParentEl(), i = this.opts || {}, l = this.mousePosFetcher, f = "data-" + i.prefix + "handler", d = this.getElementPos(e, { avoidFrameZoom: !0, avoidFrameOffset: !0 }), v = this.getElementPos(n), h = t.target; this.handlerAttr = h.getAttribute(f), this.clickedHandler = h, this.startDim = { t: d.top, l: d.left, w: d.width, h: d.height }, this.rectDim = { t: d.top, l: d.left, w: d.width, h: d.height }, this.startPos = l ? l(t) : { x: t.clientX, y: t.clientY }, this.parentDim = { t: v.top, l: v.left, w: v.width, h: v.height }; var w = this.getDocumentEl(); this.docs = w, (0, H.on)(w, "pointermove", this.move), (0, H.on)(w, "keydown", this.handleKeyDown), (0, H.on)(w, "pointerup", this.stop), (0, S.isFunction)(this.onStart) && this.onStart(t, { docs: w, config: i, el: e, resizer: this }), this.toggleFrames(!0), this.move(t); } }, a.prototype.move = function(r) { var t = r, e = this.onMove, n = this.mousePosFetcher, i = n ? n(t) : { x: t.clientX, y: t.clientY }; this.currentPos = i, this.delta = { x: i.x - this.startPos.x, y: i.y - this.startPos.y }, this.keys = { shift: t.shiftKey, ctrl: t.ctrlKey, alt: t.altKey }, this.rectDim = this.calc(this), this.updateRect(!1), e && e(t); }, a.prototype.stop = function(r) { var t = this.el, e = this.opts, n = this.docs || this.getDocumentEl(); (0, H.off)(n, "pointermove", this.move), (0, H.off)(n, "keydown", this.handleKeyDown), (0, H.off)(n, "pointerup", this.stop), this.updateRect(!0), this.toggleFrames(), (0, S.isFunction)(this.onEnd) && this.onEnd(r, { docs: n, config: e, el: t, resizer: this }), delete this.docs; }, a.prototype.updateRect = function(r) { var t = this.el, e = this.opts, n = this.rectDim, i = this.updateTarget, l = this.getSelectedHandler(), f = e.unitHeight, d = e.unitWidth, v = e.keyWidth, h = e.keyHeight; if ((0, S.isFunction)(i)) i(t, n, { store: r, selectedHandler: l, resizer: this, config: e }); else { var w = t.style; w[v] = n.w + d, w[h] = n.h + f, w.top = n.t + f, w.left = n.l + d; } this.updateContainer(); }, a.prototype.updateContainer = function(r) { var t; r === void 0 && (r = {}); var e = this, n = e.opts, i = e.container, l = e.el, f = i.style; !n.avoidContainerUpdate && l && r.forceShow && (f.display = "block"), (t = this.onUpdateContainer) === null || t === void 0 || t.call(this, { el: i, resizer: this, opts: ba(ba({}, n), r) }); }, a.prototype.getSelectedHandler = function() { var r = this.handlers; if (this.selectedHandler) { for (var t in r) if (r[t] === this.selectedHandler) return t; } }, a.prototype.handleKeyDown = function(r) { r.keyCode === 27 && (this.rectDim = this.startDim, this.stop(r)); }, a.prototype.handleMouseDown = function(r) { var t = r.target; this.isHandler(t) ? (this.selectedHandler = t, this.start(r)) : t !== this.el && (delete this.selectedHandler, this.blur()); }, a.prototype.calc = function(r) { var t, e = this.opts || {}, n = e.step, i = this.startDim, l = e.minDim, f = e.maxDim, d = r.delta.x, v = r.delta.y, h = this.parentDim.w, w = this.parentDim.h, C = this.opts.unitWidth, L = this.opts.unitHeight, F = C === "%" ? i.w / 100 * h : i.w, q = L === "%" ? i.h / 100 * w : i.h, et = { t: i.t, l: i.l, w: F, h: q }; if (r) { var X = r.handlerAttr; ~X.indexOf("r") && (t = C === "%" ? (0, H.normalizeFloat)((F + d * n) / h * 100, 0.01) : (0, H.normalizeFloat)(F + d * n, n), t = Math.max(l, t), f && (t = Math.min(f, t)), et.w = t), ~X.indexOf("b") && (t = L === "%" ? (0, H.normalizeFloat)((q + v * n) / w * 100, 0.01) : (0, H.normalizeFloat)(q + v * n, n), t = Math.max(l, t), f && (t = Math.min(f, t)), et.h = t), ~X.indexOf("l") && (t = C === "%" ? (0, H.normalizeFloat)((F - d * n) / h * 100, 0.01) : (0, H.normalizeFloat)(F - d * n, n), t = Math.max(l, t), f && (t = Math.min(f, t)), et.w = t), ~X.indexOf("t") && (t = L === "%" ? (0, H.normalizeFloat)((q - v * n) / w * 100, 0.01) : (0, H.normalizeFloat)(q - v * n, n), t = Math.max(l, t), f && (t = Math.min(f, t)), et.h = t); var At = e.ratioDefault ? !r.keys.shift : r.keys.shift; if (X.indexOf("c") < 0 && At) { var It = i.w / i.h; et.w / et.h > It ? et.h = Math.round(et.w / It) : et.w = Math.round(et.h * It); } for (var ie in ~X.indexOf("l") && (et.l += i.w - et.w), ~X.indexOf("t") && (et.t += i.h - et.h), et) { var se = ie; et[se] = parseInt("".concat(et[se]), 10); } return et; } }, a; }(); const sh = ih; var ah = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), sf = function() { return sf = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, sf.apply(this, arguments); }; const lh = function(a) { function r(t) { var e = a.call(this, t, "Utils") || this; return e.Sorter = oh, e.Resizer = sh, e.Dragger = Jr.Z, e.helpers = sf({}, H), e; } return ah(r, a), r.prototype.destroy = function() { }, r; }(jt); var eo, ho = {}, Br = { 16: !1, 18: !1, 17: !1, 91: !1 }, Bf = "all", wa = { "⇧": 16, shift: 16, "⌥": 18, alt: 18, option: 18, "⌃": 17, ctrl: 17, control: 17, "⌘": 91, command: 91 }, Wf = { backspace: 8, tab: 9, clear: 12, enter: 13, return: 13, esc: 27, escape: 27, space: 32, left: 37, up: 38, right: 39, down: 40, del: 46, delete: 46, home: 36, end: 35, pageup: 33, pagedown: 34, ",": 188, ".": 190, "/": 191, "`": 192, "-": 189, "=": 187, ";": 186, "'": 222, "[": 219, "]": 221, "\\": 220 }, af = function(a) { return Wf[a] || a.toUpperCase().charCodeAt(0); }, ml = []; for (eo = 1; eo < 20; eo++) Wf["f" + eo] = 111 + eo; function _c(a, r) { for (var t = a.length; t--; ) if (a[t] === r) return t; return -1; } function ch(a, r) { if (a.length != r.length) return !1; for (var t = 0; t < a.length; t++) if (a[t] !== r[t]) return !1; return !0; } var uh = { 16: "shiftKey", 18: "altKey", 17: "ctrlKey", 91: "metaKey" }; function ph(a) { for (eo in Br) Br[eo] = a[uh[eo]]; } function fh(a) { var r, t = a.keyCode, e = _c(ml, t); if (e >= 0 && ml.splice(e, 1), t != 93 && t != 224 || (t = 91), t in Br) for (r in Br[t] = !1, wa) wa[r] == t && (Wr[r] = !1); } function dh() { for (eo in Br) Br[eo] = !1; for (eo in wa) Wr[eo] = !1; } function Wr(a, r, t) { var e, n; e = $f(a), t === void 0 && (t = r, r = "all"); for (var i = 0; i < e.length; i++) n = [], (a = e[i].split("+")).length > 1 && (n = qf(a), a = [a[a.length - 1]]), a = a[0], (a = af(a)) in ho || (ho[a] = []), ho[a].push({ shortcut: e[i], scope: r, method: t, key: e[i], mods: n }); } for (eo in wa) Wr[eo] = !1; function lf() { return Bf || "all"; } function $f(a) { var r; return (r = (a = a.replace(/\s/g, "")).split(","))[r.length - 1] == "" && (r[r.length - 2] += ","), r; } function qf(a) { for (var r = a.slice(0, a.length - 1), t = 0; t < r.length; t++) r[t] = wa[r[t]]; return r; } function cf(a, r, t) { a.addEventListener ? a.addEventListener(r, t, !1) : a.attachEvent && a.attachEvent("on" + r, function() { t(window.event); }); } Wr.setScope = function(a) { Bf = a || "all"; }, Wr.getScope = lf, Wr.deleteScope = function(a) { var r, t, e; for (r in ho) for (t = ho[r], e = 0; e < t.length; ) t[e].scope === a ? t.splice(e, 1) : e++; }, Wr.filter = function(a) { var r = (a.target || a.srcElement).tagName; return !(r == "INPUT" || r == "SELECT" || r == "TEXTAREA"); }, Wr.isPressed = function(a) { return typeof a == "string" && (a = af(a)), _c(ml, a) != -1; }, Wr.getPressedKeyCodes = function() { return ml.slice(0); }, Wr.unbind = function(a, r) { var t, e, n, i, l, f = []; for (t = $f(a), i = 0; i < t.length; i++) { if ((e = t[i].split("+")).length > 1 && (f = qf(e)), a = e[e.length - 1], a = af(a), r === void 0 && (r = lf()), !ho[a]) return; for (n = 0; n < ho[a].length; n++) (l = ho[a][n]).scope === r && ch(l.mods, f) && (ho[a][n] = {}); } }, Wr.handlers = ho, Wr.init = function(a) { cf(a.document, "keydown", function(r) { (function(t) { var e, n, i, l, f, d; if (e = t.keyCode, _c(ml, e) == -1 && ml.push(e), e != 93 && e != 224 || (e = 91), e in Br) for (i in Br[e] = !0, wa) wa[i] == e && (Wr[i] = !0); else if (ph(t), Wr.filter.call(this, t) && e in ho) { for (d = lf(), l = 0; l < ho[e].length; l++) if ((n = ho[e][l]).scope == d || n.scope == "all") { for (i in f = n.mods.length > 0, Br) (!Br[i] && _c(n.mods, +i) > -1 || Br[i] && _c(n.mods, +i) == -1) && (f = !1); (n.mods.length != 0 || Br[16] || Br[18] || Br[17] || Br[91]) && !f || n.method(t, n) === !1 && (t.preventDefault ? t.preventDefault() : t.returnValue = !1, t.stopPropagation && t.stopPropagation(), t.cancelBubble && (t.cancelBubble = !0)); } } })(r); }), cf(a.document, "keyup", fh), cf(a, "focus", dh); }; const xc = Wr, hh = { defaults: { "core:undo": { keys: "⌘+z, ctrl+z", handler: "core:undo" }, "core:redo": { keys: "⌘+shift+z, ctrl+shift+z", handler: "core:redo" }, "core:copy": { keys: "⌘+c, ctrl+c", handler: "core:copy" }, "core:paste": { keys: "⌘+v, ctrl+v", handler: "core:paste" }, "core:component-next": { keys: "s", handler: "core:component-next" }, "core:component-prev": { keys: "w", handler: "core:component-prev" }, "core:component-enter": { keys: "d", handler: "core:component-enter" }, "core:component-exit": { keys: "a", handler: "core:component-exit" }, "core:component-delete": { keys: "backspace, delete", handler: "core:component-delete", opts: { prevent: !0 } } } }; var gh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Gf = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }; (0, H.hasWin)() && xc.init(window); var vh = function(a) { function r(t) { var e = a.call(this, t, "Keymaps", hh) || this; return e.keymaster = xc, e.keymaps = {}, e; } return gh(r, a), r.prototype.onLoad = function() { var t = this.config.defaults; for (var e in t) { var n = t[e]; this.add(e, n.keys, n.handler, n.opts || {}); } }, r.prototype.add = function(t, e, n, i) { i === void 0 && (i = {}); var l = this.em, f = l.Commands, d = l.getEditor(), v = l.Canvas, h = { id: t, keys: e, handler: n }; return this.keymaps[t] && this.remove(t), this.keymaps[t] = h, xc(e, function(w, C) { var L = { event: w, h: C }, F = (0, S.isString)(n) ? f.get(n) : n; if (!l.isEditing() && !d.Canvas.isInputFocused() || i.force) { i.prevent && v.getCanvasView().preventDefault(w), (0, S.isFunction)(F) ? F(d, 0, L) : f.runCommand(F, L); var q = [t, C.shortcut, w]; l.trigger.apply(l, Gf(["keymap:emit"], q, !1)), l.trigger.apply(l, Gf(["keymap:emit:".concat(t)], q, !1)); } }, void 0), l.trigger("keymap:add", h), h; }, r.prototype.get = function(t) { return this.keymaps[t]; }, r.prototype.getAll = function() { return this.keymaps; }, r.prototype.remove = function(t) { var e = this.em, n = this.get(t); if (n) return delete this.keymaps[t], n.keys.split(", ").forEach(function(i) { xc.unbind(i.trim()); }), e == null || e.trigger("keymap:remove", n), n; }, r.prototype.removeAll = function() { var t = this; return Object.keys(this.keymaps).forEach(function(e) { return t.remove(e); }), xc.handlers = {}, this; }, r.prototype.destroy = function() { this.removeAll(), this.keymaps = {}; }, r; }(jt); const mh = vh, yh = { stylePrefix: "mdl-", title: "", content: "", backdrop: !0, custom: !1, extend: {} }; var bh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const wh = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return bh(r, a), r.prototype.defaults = function() { return { title: "", content: "", attributes: {}, open: !1 }; }, r.prototype.open = function() { this.set("open", !0); }, r.prototype.close = function() { this.set("open", !1); }, r; }(bt); var _h = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Wu = function() { return Wu = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Wu.apply(this, arguments); }; const xh = function(a) { function r(t) { var e = a.call(this, t) || this, n = e.model; return e.listenTo(n, "change:open", e.updateOpen), e.listenTo(n, "change:title", e.updateTitle), e.listenTo(n, "change:content", e.updateContent), e; } return _h(r, a), r.prototype.template = function(t) { var e = t.pfx, n = t.ppfx, i = t.content, l = t.title; return '
').concat(l, `
⨯
').concat(i, `
'); }, r.prototype.events = function() { return { click: "onClick", "click [data-close-modal]": "hide" }; }, r.prototype.onClick = function(t) { this.config.backdrop && t.target === this.el && this.hide(); }, r.prototype.getCollector = function() { return this.$collector || (this.$collector = this.$el.find("." + this.pfx + "collector")), this.$collector; }, r.prototype.getContent = function() { var t = this.pfx; return this.$content || (this.$content = this.$el.find(".".concat(t, "content #").concat(t, "c"))), this.$content; }, r.prototype.getTitle = function(t) { return t === void 0 && (t = {}), this.$title || (this.$title = this.$el.find("." + this.pfx + "title")), t.$ ? this.$title : this.$title.get(0); }, r.prototype.updateContent = function() { var t = this.getContent(), e = t.children(), n = this.getCollector(), i = this.model.get("content"); e.length && n.append(e), t.empty().append(i); }, r.prototype.updateTitle = function() { var t = this.getTitle({ $: !0 }); t && t.empty().append(this.model.get("title")); }, r.prototype.updateOpen = function() { this.el.style.display = this.model.get("open") ? "" : "none"; }, r.prototype.hide = function() { this.model.close(); }, r.prototype.show = function() { this.model.open(); }, r.prototype.updateAttr = function(t) { var e = this, n = e.pfx, i = e.$el, l = e.el, f = [].slice.call(l.attributes).map(function(d) { return d.name; }); i.removeAttr(f.join(" ")), i.attr(Wu(Wu({}, t || {}), { class: "".concat(n, "container ").concat(t && t.class || "").trim() })); }, r.prototype.render = function() { var t = this.$el, e = this.model.toJSON(); return e.pfx = this.pfx, e.ppfx = this.ppfx, t.html(this.template(e)), this.updateAttr(), this.updateOpen(), this; }, r; }(pn); var Ch = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Sh = function(a) { function r(t) { var e = a.call(this, t, "Modal", yh) || this; return e.model = new wh(e), e.model.on("change:open", function(n, i) { t.trigger("modal:".concat(i ? "open" : "close")); }), e.model.on("change", (0, S.debounce)(function() { var n = e._evData(), i = e.config.custom; (0, S.isFunction)(i) && i(n), t.trigger("modal", n); }, 0)), e; } return Ch(r, a), r.prototype._evData = function() { var t = this, e = this.getTitle(), n = this.getContent(), i = this.model.attributes; return { open: i.open, attributes: i.attributes, title: (0, S.isString)(e) ? (0, Ne.rw)(e) : e, content: (0, S.isString)(n) ? (0, Ne.rw)(n) : n.get ? n.get(0) : n, close: function() { t.close(); } }; }, r.prototype.postRender = function(t) { var e = t.model.config.el || t.el, n = this.render(); n && (e == null || e.appendChild(n)); }, r.prototype.open = function(t) { t === void 0 && (t = {}); var e = t.attributes || {}; return t.title && this.setTitle(t.title), t.content && this.setContent(t.content), this.model.set("attributes", e), this.model.open(), this.modal && this.modal.updateAttr(e), this; }, r.prototype.close = function() { return this.model.close(), this; }, r.prototype.onceClose = function(t) { return this.em.once("modal:close", t), this; }, r.prototype.onceOpen = function(t) { return this.em.once("modal:open", t), this; }, r.prototype.isOpen = function() { return !!this.model.get("open"); }, r.prototype.setTitle = function(t) { return this.model.set("title", t), this; }, r.prototype.getTitle = function() { return this.model.get("title"); }, r.prototype.setContent = function(t) { return this.model.set("content", " "), this.model.set("content", t), this; }, r.prototype.getContent = function() { return this.model.get("content"); }, r.prototype.getContentEl = function() { var t; return (t = this.modal) === null || t === void 0 ? void 0 : t.getContent().get(0); }, r.prototype.getModel = function() { return this.model; }, r.prototype.render = function() { var t; if (!this.config.custom) { var e = xh.extend(this.config.extend), n = this.modal && this.modal.el; return this.modal = new e({ el: n, model: this.model, config: this.config }), (t = this.modal) === null || t === void 0 ? void 0 : t.render().el; } }, r.prototype.destroy = function() { var t; (t = this.modal) === null || t === void 0 || t.remove(); }, r; }(jt); var Kf = "sw-visibility", Yf = "export-template", Xf = "open-sm", Jf = "open-tm", Zf = "open-layers", Qf = "open-blocks", uf = "fullscreen", pf = "preview"; const ff = { stylePrefix: "pn-", defaults: [{ id: "commands", buttons: [{}] }, { id: "options", buttons: [{ active: !0, id: Kf, className: "fa fa-square-o", command: "core:component-outline", context: Kf, attributes: { title: "View components" } }, { id: pf, className: "fa fa-eye", command: pf, context: pf, attributes: { title: "Preview" } }, { id: uf, className: "fa fa-arrows-alt", command: uf, context: uf, attributes: { title: "Fullscreen" } }, { id: Yf, className: "fa fa-code", command: Yf, attributes: { title: "View code" } }] }, { id: "views", buttons: [{ id: Xf, className: "fa fa-paint-brush", command: Xf, active: !0, togglable: !1, attributes: { title: "Open Style Manager" } }, { id: Jf, className: "fa fa-cog", command: Jf, togglable: !1, attributes: { title: "Settings" } }, { id: Zf, className: "fa fa-bars", command: Zf, togglable: !1, attributes: { title: "Open Layer Manager" } }, { id: Qf, className: "fa fa-th-large", command: Qf, togglable: !1, attributes: { title: "Open Blocks" } }] }] }; var Oh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const td = function(a) { function r(t, e) { var n = a.call(this, t, e) || this; return n.get("buttons").length && n.set("buttons", new nd(n.module, n.get("buttons"))), n; } return Oh(r, a), r.prototype.defaults = function() { return { id: "", label: "", tagName: "span", className: "", command: "", context: "", buttons: [], attributes: {}, options: {}, active: !1, dragDrop: !1, togglable: !0, runDefaultCommand: !0, stopDefaultCommand: !1, disable: !1 }; }, Object.defineProperty(r.prototype, "className", { get: function() { return this.get("className"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "command", { get: function() { return this.get("command"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "active", { get: function() { return this.get("active"); }, set: function(t) { this.set("active", t); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "togglable", { get: function() { return this.get("togglable"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "runDefaultCommand", { get: function() { return this.get("runDefaultCommand"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "stopDefaultCommand", { get: function() { return this.get("stopDefaultCommand"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "disable", { get: function() { return this.get("disable"); }, enumerable: !1, configurable: !0 }), r; }(bt); var Th = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ed = function(a) { function r(t, e) { return a.call(this, t, e, td) || this; } return Th(r, a), r.prototype.deactivateAllExceptOne = function(t, e) { this.forEach(function(n, i) { n !== t && (n.set("active", !1), e && n.get("buttons").length && n.get("buttons").deactivateAllExceptOne(t, e)); }); }, r.prototype.deactivateAll = function(t, e) { var n = t || ""; this.forEach(function(i) { i.get("context") == n && i !== e && i.set("active", !1, { fromCollection: !0 }); }); }, r.prototype.disableAllButtons = function(t) { var e = t || ""; this.forEach(function(n, i) { n.get("context") == e && n.set("disable", !0); }); }, r.prototype.disableAllButtonsExceptOne = function(t, e) { this.forEach(function(n, i) { n !== t && (n.set("disable", !0), e && n.get("buttons").length && n.get("buttons").disableAllButtonsExceptOne(t, e)); }); }, r; }(Ft); const nd = ed; ed.prototype.model = td; var kh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const rd = function(a) { function r(t, e) { var n = a.call(this, t, e) || this, i = n.get("buttons") || []; return n.buttons = new nd(t, i), n; } return kh(r, a), r.prototype.defaults = function() { return { id: "", content: "", visible: !0, buttons: [], attributes: {} }; }, Object.defineProperty(r.prototype, "buttons", { get: function() { return this.get("buttons"); }, set: function(t) { this.set("buttons", t); }, enumerable: !1, configurable: !0 }), r; }(bt); var Ph = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), od = function(a) { function r(t, e) { return a.call(this, t, e, rd) || this; } return Ph(r, a), r; }(Ft); const Eh = od; od.prototype.model = rd; var Ah = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), yl = function() { return yl = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, yl.apply(this, arguments); }, jh = function(a) { function r(t) { var e = a.call(this, t) || this, n = e, i = n.model, l = n.em, f = n.pfx, d = n.ppfx, v = i.className, h = i.attributes, w = h.command, C = h.listen; if (e.id = f + i.get("id"), e.activeCls = "".concat(f, "active ").concat(d, "four-color"), e.disableCls = "".concat(d, "disabled"), e.btnsVisCls = "".concat(f, "visible"), e.className = f + "btn" + (v ? " " + v : ""), e.listenTo(i, "change", e.render), e.listenTo(i, "change:active updateActive", e.updateActive), e.listenTo(i, "checkActive", e.checkActive), e.listenTo(i, "change:bntsVis", e.updateBtnsVis), e.listenTo(i, "change:attributes", e.updateAttributes), e.listenTo(i, "change:className", e.updateClassName), e.listenTo(i, "change:disable", e.updateDisable), l && (0, S.isString)(w) && C) { var L = { fromListen: !0 }; e.listenTo(l, "run:".concat(w), function() { return i.set("active", !0, L); }), e.listenTo(l, "stop:".concat(w), function() { return i.set("active", !1, L); }); } return l && l.get && (e.commands = l.get("Commands")), e; } return Ah(r, a), r.prototype.tagName = function() { return this.model.get("tagName"); }, r.prototype.events = function() { return { click: "clicked" }; }, r.prototype.updateClassName = function() { var t = this.model, e = this.pfx, n = t.className, i = t.get("attributes").class, l = "".concat(i || "", " ").concat(e, "btn ").concat(n || ""); this.$el.attr("class", l.trim()); }, r.prototype.updateAttributes = function() { var t = this, e = t.em, n = t.model, i = t.$el, l = n.get("attributes") || {}, f = e && e.t && e.t("panels.buttons.titles.".concat(n.id)); i.attr(l), f && i.attr({ title: f }), this.updateClassName(); }, r.prototype.updateBtnsVis = function() { this.$buttons && (this.model.get("bntsVis") ? this.$buttons.addClass(this.btnsVisCls) : this.$buttons.removeClass(this.btnsVisCls)); }, r.prototype.updateActive = function(t, e, n) { var i; n === void 0 && (n = {}); var l = this, f = l.model, d = l.commands, v = l.$el, h = l.activeCls, w = n.fromCollection, C = n.fromListen, L = f.get("context"), F = f.get("options"), q = f.command, et = {}; q && (d && (0, S.isString)(q) ? et = d.get(q) || {} : (0, S.isFunction)(q) ? et = d.create({ run: q }) : q !== null && (0, S.isObject)(q) && (et = d.create(q)), f.active ? (!w && ((i = f.collection) === null || i === void 0 || i.deactivateAll(L, f)), f.set("active", !0, { silent: !0 }).trigger("checkActive"), !C && d.runCommand(et, yl(yl({}, F), { sender: f })), et.noStop && f.set("active", !1)) : (v.removeClass(h), !C && d.stopCommand(et, yl(yl({}, F), { sender: f, force: 1 })))); }, r.prototype.updateDisable = function() { var t = this.disableCls, e = this.model.disable; this.$el[e ? "addClass" : "removeClass"](t); }, r.prototype.checkActive = function() { var t = this, e = t.model, n = t.$el, i = t.activeCls; e.active ? n.addClass(i) : n.removeClass(i); }, r.prototype.clicked = function(t) { var e = this.model; e.get("bntsVis") || e.disable || !e.command || this.toggleActive(); }, r.prototype.toggleActive = function() { var t = this.model, e = this.em, n = t.active, i = t.togglable; n && !i || (t.active = !n, n ? t.runDefaultCommand && e.runDefault() : t.stopDefaultCommand && e.stopDefault()); }, r.prototype.render = function() { var t = this.model, e = t.get("label"), n = this.$el; return !t.get("el") && n.empty(), this.updateAttributes(), e && n.append(e), this.checkActive(), this.updateDisable(), this; }, r; }(pn); const Mh = jh; var Lh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Dh = function(a) { function r(t) { var e = a.call(this, { collection: t }) || this; return e.listenTo(e.collection, "add", e.addTo), e.listenTo(e.collection, "reset remove", e.render), e.className = e.pfx + "buttons", e; } return Lh(r, a), r.prototype.addTo = function(t) { this.addToCollection(t); }, r.prototype.addToCollection = function(t, e) { var n = e || null, i = t.get("el"), l = new Mh({ el: i, model: t }).render().el; return n ? n.appendChild(l) : this.$el.append(l), l; }, r.prototype.render = function() { var t = this, e = document.createDocumentFragment(); return this.$el.empty(), this.collection.each(function(n) { return t.addToCollection(n, e); }), this.$el.append(e), this.$el.attr("class", (0, S.result)(this, "className")), this; }, r; }(pn); var Nh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), df = function() { return df = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, df.apply(this, arguments); }, Ih = function(a) { function r(t) { var e = a.call(this, { model: t, el: t.get("el") }) || this; return e.className = e.pfx + "panel", e.id = e.pfx + t.get("id"), e.listenTo(t, "change:appendContent", e.appendContent), e.listenTo(t, "change:content", e.updateContent), e.listenTo(t, "change:visible", e.toggleVisible), t.view = e, e; } return Nh(r, a), r.prototype.appendContent = function() { this.$el.append(this.model.get("appendContent")); }, r.prototype.updateContent = function() { this.$el.html(this.model.get("content")); }, r.prototype.toggleVisible = function() { this.model.get("visible") ? this.$el.removeClass("".concat(this.ppfx, "hidden")) : this.$el.addClass("".concat(this.ppfx, "hidden")); }, r.prototype.attributes = function() { return this.model.get("attributes"); }, r.prototype.initResize = function() { var t = this.em, e = t == null ? void 0 : t.Editor, n = this.model.get("resizable"); if (e && n) { var i, l, f, d = n === !0 ? [1, 1, 1, 1] : n, v = d.length, h = 0; v == 2 ? (i = d[0], f = d[0], l = d[1], h = d[1]) : v == 4 && (i = d[0], l = d[1], f = d[2], h = d[3]); var w = new e.Utils.Resizer(df({ tc: i, cr: l, bc: f, cl: h, tl: 0, tr: 0, bl: 0, br: 0, appendTo: this.el, silentFrames: 1, avoidContainerUpdate: 1, prefix: e.getConfig().stylePrefix, onEnd: function() { t && t.trigger("change:canvasOffset"); }, posFetcher: function(C, L) { var F = L.target, q = C.style, et = w.getConfig(), X = et.keyWidth, At = et.keyHeight, It = C.getBoundingClientRect(), ie = F == "container", se = q[X], Me = q[At]; return { left: 0, top: 0, width: se && !ie ? parseFloat(se) : It.width, height: Me && !ie ? parseFloat(Me) : It.height }; } }, n)); w.blur = function() { }, w.focus(this.el); } }, r.prototype.render = function() { var t = this.model.buttons, e = this.$el, n = this.ppfx, i = "".concat(this.className, " ").concat(this.id, " ").concat(n, "one-bg ").concat(n, "two-color"); if (e.addClass(i), this.toggleVisible(), t.length) { var l = new Dh(t); e.append(l.render().el); } return e.append(this.model.get("content")), this; }, r; }(pn); const Fh = Ih; var Vh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Rh = function(a) { function r(t) { var e = a.call(this, { collection: t }) || this; return e.listenTo(t, "add", e.addTo), e.listenTo(t, "reset", e.render), e.listenTo(t, "remove", e.onRemove), e.className = e.pfx + "panels", e; } return Vh(r, a), r.prototype.onRemove = function(t) { var e = t.view; e && e.remove(); }, r.prototype.addTo = function(t) { this.addToCollection(t); }, r.prototype.addToCollection = function(t, e) { var n = e || null, i = (this.config, t.get("el")), l = new Fh(t), f = l.render().el, d = t.get("appendTo"); return i || (d ? document.querySelector(d).appendChild(f) : n ? n.appendChild(f) : this.$el.append(f)), l.initResize(), f; }, r.prototype.render = function() { var t = this, e = this.$el, n = document.createDocumentFragment(); return e.empty(), this.collection.each(function(i) { return t.addToCollection(i, n); }), e.append(n), e.attr("class", this.className), this; }, r; }(pn); var Hh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const zh = function(a) { function r(t) { var e = a.call(this, t, "Panels", ff) || this; for (var n in e.panels = new Eh(e, e.config.defaults), ff) n in e.config || (e.config[n] = ff[n]); return e; } return Hh(r, a), r.prototype.getPanels = function() { return this.panels; }, r.prototype.getPanelsEl = function() { return this.PanelsViewObj && this.PanelsViewObj.el; }, r.prototype.addPanel = function(t) { return this.panels.add(t); }, r.prototype.removePanel = function(t) { return this.panels.remove(t); }, r.prototype.getPanel = function(t) { var e = this.panels.where({ id: t }); return e.length ? e[0] : null; }, r.prototype.addButton = function(t, e) { var n = this.getPanel(t); return n ? n.get("buttons").add(e) : null; }, r.prototype.removeButton = function(t, e) { var n = this.getPanel(t); return n && n.get("buttons").remove(e); }, r.prototype.getButton = function(t, e) { var n = this.getPanel(t); if (n) { var i = n.get("buttons").where({ id: e }); return i.length ? i[0] : null; } return null; }, r.prototype.render = function() { return this.PanelsViewObj && this.PanelsViewObj.remove(), this.PanelsViewObj = new Rh(this.panels), this.PanelsViewObj.render().el; }, r.prototype.active = function() { this.getPanels().each(function(t) { t.get("buttons").each(function(e) { e.get("active") && e.trigger("updateActive"); }); }); }, r.prototype.disableButtons = function() { this.getPanels().each(function(t) { t.get("buttons").each(function(e) { e.get("disable") && e.trigger("change:disable"); }); }); }, r.prototype.destroy = function() { this.panels.reset(), this.panels.stopListening(), this.PanelsViewObj && this.PanelsViewObj.remove(); }, r; }(jt), Uh = { stylePrefix: "cm-", inlineCss: !1 }; var Bh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Wh = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }; const $h = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Bh(r, a), r.prototype.build = function(t, e) { e === void 0 && (e = {}); var n = e.em, i = Wh(e, ["em"]); if (e.cleanId && n) { var l = n.Css.getAll().toJSON().map(function(f) { var d = f.selectors, v = d && d.length === 1 && d.models[0]; return v && v.isId() && v.get("name"); }).filter(Boolean); i.attributes || (i.attributes = function(f, d) { var v = d.id; return v && v[0] === "i" && !f.get("script") && !f.get("attributes").id && l.indexOf(v) < 0 && delete d.id, d; }); } return t.toHTML(i); }, r; }(k.Hn); var qh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Gh = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return qh(r, a), r.prototype.build = function(t) { var e = this, n = t.toJSON(); return this.beforeEach(n), (0, S.each)(n, function(i, l) { var f = n[l]; if (f instanceof k.Hn) n[l] = e.build(f); else if (f instanceof k.FE) { var d = f; n[l] = [], d.length && d.forEach(function(v, h) { n[l][h] = e.build(v); }); } }), n; }, r.prototype.beforeEach = function(t) { delete t.status; }, r; }(k.Hn); const Kh = Gh; var Yh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Xh = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Yh(r, a), r.prototype.mapModel = function(t) { var e, n = this, i = "", l = t.get("script-export") || t.get("script"), f = t.get("type"), d = t.get("components"), v = t.getId(); if (l) { var h = t.get("attributes"); h = (0, S.extend)({}, h, { id: v }), t.set("attributes", h, { silent: !0 }); var w = t.getScriptString(l), C = t.get("script-props"); if (t.get("scriptUpdated") && !C) this.mapJs[f + "-" + v] = { ids: [v], code: w }; else { var L = void 0, F = this.mapJs[f]; if (C && (L = t.__getScriptProps()), F) F.ids.push(v), L && (F.props[v] = L); else { var q = { ids: [v], code: w }; L && (q.props = ((e = {})[v] = L, e)), this.mapJs[f] = q; } } } return d.forEach(function(et) { i += n.mapModel(et); }), i; }, r.prototype.build = function(t) { this.mapJs = {}, this.mapModel(t); var e, n, i = ""; for (var l in this.mapJs) { var f = this.mapJs[l]; if (f.code) if (f.props) { if (e = f.code, n = void 0, (((n = e.toString().match(/\{([\s\S]*)\}/m)) === null || n === void 0 ? void 0 : n[1]) || "").replace(/^\s*\/\/.*$/gm, "").trim().length === 0) continue; i += ` var props = `.concat(JSON.stringify(f.props), `; var ids = Object.keys(props).map(function(id) { return '#'+id }).join(','); var els = document.querySelectorAll(ids); for (var i = 0, len = els.length; i < len; i++) { var el = els[i]; (`).concat(f.code, `.bind(el))(props[el.id]); }`); } else { var d = "#" + f.ids.join(", #"); i += ` var items = document.querySelectorAll('`.concat(d, `'); for (var i = 0, len = items.length; i < len; i++) { (function(){ `).concat(f.code, ` }.bind(items[i]))(); }`); } } return i; }, r; }(k.Hn); const Jh = Xh; var Cc, Zh = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), hf = function() { return hf = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, hf.apply(this, arguments); }; (0, H.hasWin)() && (Cc = gn(631), gn(531), gn(629), gn(210)); var id = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Zh(r, a), r.prototype.defaults = function() { return { input: "", label: "", codeName: "", theme: "hopscotch", readOnly: !0, lineNumbers: !0 }; }, r.prototype.init = function(t) { return (0, S.bindAll)(this, "onChange"), this.editor = Cc.fromTextArea(t, hf({ dragDrop: !1, lineWrapping: !0, mode: this.get("codeName") }, this.attributes)), this.element = t, this.editor.on("change", this.onChange), this; }, r.prototype.onChange = function() { this.trigger("update", this); }, r.prototype.getEditor = function() { return this.editor; }, r.prototype.getElement = function() { return this.element; }, r.prototype.setElement = function(t) { return this.element = t, this; }, r.prototype.refresh = function() { return this.getEditor().refresh(), this; }, r.prototype.focus = function() { return this.getEditor().focus(), this; }, r.prototype.getContent = function() { var t = this.getEditor(); return t && t.getValue(); }, r.prototype.setContent = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this.editor; i && (i.setValue(t), i.autoFormatRange && (Cc.commands.selectAll(i), i.autoFormatRange(i.getCursor(!0), i.getCursor(!1)), Cc.commands.goDocStart(i)), !e.noRefresh && setTimeout(function() { return n.refresh(); })); }, r; }(k.Hn); const Qh = id; id.prototype.CodeMirror = Cc; var tg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), eg = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }; const ng = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return tg(r, a), r.prototype.template = function(t) { var e = t.pfx, n = t.codeName, i = t.label; return pt(sd || (sd = eg([`
', `
`], [`
', `
`])), e, e, n, e, i, e); }, r.prototype.initialize = function(t) { this.config = t.config || {}, this.pfx = this.config.stylePrefix; }, r.prototype.render = function() { var t = this, e = t.model, n = t.pfx, i = t.$el, l = e.toJSON(); return l.pfx = n, i.html(this.template(l)), i.attr("class", "".concat(n, "editor-c")), i.find("#".concat(n, "code")).append(e.get("input")), this; }, r; }(k.G7); var sd, rg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), og = "CodeMirror", ig = function(a) { function r(t) { var e = a.call(this, t, "CodeManager", Uh) || this; e.EditorView = ng; var n = e.config, i = n.pStylePrefix; return i && (n.stylePrefix = i + n.stylePrefix), e.generators = {}, e.viewers = {}, e.defGenerators = { html: new $h(), css: new Pp(), json: new Kh(), js: new Jh() }, e.defViewers = { CodeMirror: new Qh() }, e.loadDefaultGenerators().loadDefaultViewers(), e; } return rg(r, a), r.prototype.addGenerator = function(t, e) { return this.generators[t] = e, this; }, r.prototype.getGenerator = function(t) { return this.generators[t]; }, r.prototype.getGenerators = function() { return this.generators; }, r.prototype.addViewer = function(t, e) { return this.viewers[t] = e, this; }, r.prototype.getViewer = function(t) { return this.viewers[t]; }, r.prototype.getViewers = function() { return this.viewers; }, r.prototype.createViewer = function(t) { t === void 0 && (t = {}); var e = (0, S.isUndefined)(t.type) ? og : t.type, n = this.getViewer(e) && this.getViewer(e).clone(), i = document.createElement("div"), l = document.createElement("textarea"); return i.appendChild(l), n.set(t), n.init(l), n.setElement(i), n; }, r.prototype.updateViewer = function(t, e) { t.setContent(e); }, r.prototype.getCode = function(t, e, n) { n === void 0 && (n = {}), n.em = this.em; var i = this.getGenerator(e); return i ? i.build(t, n) : ""; }, r.prototype.loadDefaultGenerators = function() { for (var t in this.defGenerators) this.addGenerator(t, this.defGenerators[t]); return this; }, r.prototype.loadDefaultViewers = function() { for (var t in this.defViewers) this.addViewer(t, this.defViewers[t]); return this; }, r.prototype.destroy = function() { }, r; }(jt); const sg = ig; var ag = gn(410), lg = gn.n(ag); const cg = { maximumStackLength: 500, trackSelection: !0 }; var ug = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ni = function() { return Ni = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Ni.apply(this, arguments); }, pg = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, $u = function(a) { return a.avoidStore || a.noUndo; }, ad = function(a) { return Object.keys(a.changedAttributes()); }, fg = function(a) { function r(t) { var e = a.call(this, t, "UndoManager", cg) || this; e.config._disable && (e.config.maximumStackLength = 0); var n = !0; return e.um = new (lg())(Ni({ track: !0, register: [] }, e.config)), e.um.changeUndoType("change", { condition: function(i) { var l = i.get("_undo"); if (l) { var f = i.get("_undoexc"); if ((0, S.isArray)(f) && ad(i).some(function(d) { return f.indexOf(d) >= 0; })) return !1; if ((0, S.isBoolean)(l) || (0, S.isArray)(l) && ad(i).some(function(d) { return l.indexOf(d) >= 0; })) return !0; } return !1; }, on: function(i, l, f) { var d = this; !this.beforeCache && (this.beforeCache = i.previousAttributes()); var v = f || l || {}; if (v.noUndo && setTimeout(function() { d.beforeCache = null; }), !$u(v)) { var h = i.toJSON({ fromUndo: n }), w = { object: i, before: this.beforeCache, after: h }; if (this.beforeCache = null, !(0, S.isEmpty)(h)) return w; } } }), e.um.changeUndoType("add", { on: function(i, l, f) { if (f === void 0 && (f = {}), !$u(f) && e.isRegistered(l)) return { object: l, before: void 0, after: i, options: Ni(Ni({}, f), { fromUndo: n }) }; } }), e.um.changeUndoType("remove", { on: function(i, l, f) { if (f === void 0 && (f = {}), !$u(f) && e.isRegistered(l)) return { object: l, before: i, after: void 0, options: Ni(Ni({}, f), { fromUndo: n }) }; } }), e.um.changeUndoType("reset", { undo: function(i, l) { i.reset(l, { fromUndo: n }); }, redo: function(i, l, f) { i.reset(f, { fromUndo: n }); }, on: function(i, l) { if (l === void 0 && (l = {}), !$u(l) && e.isRegistered(i)) return { object: i, before: l.previousModels, after: pg([], i.models, !0), options: Ni(Ni({}, l), { fromUndo: n }) }; } }), e.um.on("undo redo", function() { t.trigger("change:canvasOffset"), t.getSelectedAll().map(function(i) { return i.trigger("rerender:layer"); }); }), ["undo", "redo"].forEach(function(i) { return e.um.on(i, function() { return t.trigger(i); }); }), e; } return ug(r, a), r.prototype.postLoad = function() { var t = this.config, e = this.em; t.trackSelection && e && this.add(e.get("selected")); }, r.prototype.add = function(t) { return this.um.register(t), this; }, r.prototype.remove = function(t) { return this.um.unregister(t), this; }, r.prototype.removeAll = function() { return this.um.unregisterAll(), this; }, r.prototype.start = function() { return this.um.startTracking(), this; }, r.prototype.stop = function() { return this.um.stopTracking(), this; }, r.prototype.undo = function(t) { t === void 0 && (t = !0); var e = this.em, n = this.um; return !e.isEditing() && n.undo(t), this; }, r.prototype.undoAll = function() { return this.um.undoAll(), this; }, r.prototype.redo = function(t) { t === void 0 && (t = !0); var e = this.em, n = this.um; return !e.isEditing() && n.redo(t), this; }, r.prototype.redoAll = function() { return this.um.redoAll(), this; }, r.prototype.hasUndo = function() { return !!this.um.isAvailable("undo"); }, r.prototype.hasRedo = function() { return !!this.um.isAvailable("redo"); }, r.prototype.isRegistered = function(t) { return !!this.getInstance().objectRegistry.isRegistered(t); }, r.prototype.getStack = function() { return this.um.stack; }, r.prototype.getStackGroup = function() { var t = [], e = []; return this.getStack().forEach(function(n) { var i = n.get("magicFusionIndex"); e.indexOf(i) < 0 && (e.push(i), t.push(n)); }), t; }, r.prototype.skip = function(t) { this.stop(), t(), this.start(); }, r.prototype.getGroupedStack = function() { var t = {}, e = this.getStack(); return e.forEach(function(n, i) { var l = n.get("magicFusionIndex"), f = function(d, v) { var h = d.attributes, w = h.type, C = h.after, L = h.before, F = h.object, q = h.options; return { index: v, type: w, after: C, before: L, object: F, options: q === void 0 ? {} : q }; }(n, i); t[l] ? t[l].push(f) : t[l] = [f]; }), Object.keys(t).map(function(n) { var i = t[n]; return { index: i[i.length - 1].index, actions: i, labels: (0, S.unique)(i.reduce(function(l, f) { var d, v = (d = f.options) === null || d === void 0 ? void 0 : d.action; return v && l.push(v), l; }, [])) }; }); }, r.prototype.goToGroup = function(t) { var e = this; if (t) { var n = this.getPointer(), i = t.index - n; (0, S.times)(Math.abs(i), function() { e[i < 0 ? "undo" : "redo"](!1); }); } }, r.prototype.getPointer = function() { return this.getStack().pointer; }, r.prototype.clear = function() { return this.um.clear(), this; }, r.prototype.getInstance = function() { return this.um; }, r.prototype.destroy = function() { this.clear().removeAll(); }, r; }(jt); const dg = fg, hg = { stylePrefix: "rte-", adjustToolbar: !0, actions: ["bold", "italic", "underline", "strikethrough", "link", "wrap"], custom: !1 }; var qu, bl = function() { return bl = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, bl.apply(this, arguments); }; (function(a) { a[a.ACTIVE = 1] = "ACTIVE", a[a.INACTIVE = 0] = "INACTIVE", a[a.DISABLED = -1] = "DISABLED"; })(qu || (qu = {})); var gf = "_rte", ld = 1, vf = 0, cd = -1, Gu = function(a, r) { r === void 0 && (r = "A"); var t = a.selection() || {}, e = t.anchorNode, n = t.focusNode, i = e == null ? void 0 : e.parentNode, l = n == null ? void 0 : n.parentNode; return (i == null ? void 0 : i.nodeName) == r || (l == null ? void 0 : l.nodeName) == r; }, Ku = "data-selectme", Sc = { bold: { name: "bold", icon: "B", attributes: { title: "Bold" }, result: function(a) { return a.exec("bold"); } }, italic: { name: "italic", icon: "I", attributes: { title: "Italic" }, result: function(a) { return a.exec("italic"); } }, underline: { name: "underline", icon: "U", attributes: { title: "Underline" }, result: function(a) { return a.exec("underline"); } }, strikethrough: { name: "strikethrough", icon: "S", attributes: { title: "Strike-through" }, result: function(a) { return a.exec("strikeThrough"); } }, link: { icon: ` `, name: "link", attributes: { style: "font-size:1.4rem;padding:0 4px 2px;", title: "Link" }, state: function(a) { return a && a.selection() && Gu(a) ? ld : vf; }, result: function(a) { Gu(a) ? a.exec("unlink") : a.insertHTML('").concat(a.selection(), ""), { select: !0 }); } }, wrap: { name: "wrap", icon: ` `, attributes: { title: "Wrap for style" }, state: function(a) { return a != null && a.selection() && Gu(a, "SPAN") ? cd : vf; }, result: function(a) { !Gu(a, "SPAN") && a.insertHTML("").concat(a.selection(), ""), { select: !0 }); } } }, gg = function() { function a(r, t, e) { e === void 0 && (e = {}); var n = this; if (this.em = r, this.settings = e, t[gf]) return t[gf]; t[gf] = this, this.setEl(t), this.updateActiveActions = this.updateActiveActions.bind(this), this.__onKeydown = this.__onKeydown.bind(this), this.__onPaste = this.__onPaste.bind(this); var i = (e.actions || []).map(function(h) { var w = h; return (0, S.isString)(h) ? w = bl({}, Sc[h]) : Sc[h.name] && (w = bl(bl({}, Sc[h.name]), h)), w; }), l = i.length ? i : Object.keys(Sc).map(function(h) { return Sc[h]; }); e.classes = bl({ actionbar: "actionbar", button: "action", active: "active", disabled: "disabled", inactive: "inactive" }, e.classes); var f = e.classes, d = e.actionbar; if (this.actionbar = d, this.classes = f, this.actions = l, !d) { if (!this.isCustom(e.module)) { var v = e.actionbarContainer; (d = document.createElement("div")).className = f.actionbar, v == null || v.appendChild(d), this.actionbar = d; } l.forEach(function(h) { return n.addAction(h); }); } return e.styleWithCSS && this.exec("styleWithCSS"), this; } return a.prototype.isCustom = function(r) { var t = r || this.em.RichTextEditor; return !(!(t != null && t.config.custom) && !(t != null && t.customRte)); }, a.prototype.destroy = function() { }, a.prototype.setEl = function(r) { this.el = r, this.doc = r.ownerDocument; }, a.prototype.updateActiveActions = function() { var r = this, t = this.getActions(); t.forEach(function(e) { var n = e.update, i = e.btn, l = r.classes, f = l.active, d = l.inactive, v = l.disabled, h = e.state, w = e.name, C = r.doc, L = qu.INACTIVE; if (i && (i.className = i.className.replace(f, "").trim(), i.className = i.className.replace(d, "").trim(), i.className = i.className.replace(v, "").trim()), h) { var F = h(r, C); if (L = F, i) switch (F) { case ld: i.className += " ".concat(f); break; case vf: i.className += " ".concat(d); break; case cd: i.className += " ".concat(v); } } else C.queryCommandSupported(w) && C.queryCommandState(w) && (i && (i.className += " ".concat(f)), L = qu.ACTIVE); e.currentState = L, n == null || n(r, e); }), t.length && this.em.RichTextEditor.__dbdTrgCustom(); }, a.prototype.enable = function(r) { return this.enabled ? this : this.__toggleEffects(!0, r); }, a.prototype.disable = function() { return this.__toggleEffects(!1); }, a.prototype.__toggleEffects = function(r, t) { r === void 0 && (r = !1), t === void 0 && (t = {}); var e = r ? H.on : H.off, n = this.el, i = this.doc, l = this.actionbarEl(); if (l && (l.style.display = r ? "" : "none"), n.contentEditable = "".concat(!!r), e(n, "mouseup keyup", this.updateActiveActions), e(i, "keydown", this.__onKeydown), e(i, "paste", this.__onPaste), this.enabled = r, r) { var f = t.event; if (this.syncActions(), this.updateActiveActions(), f) { var d = null; if (i.caretRangeFromPoint) { var v = (0, H.getPointerEvent)(f); d = i.caretRangeFromPoint(v.clientX, v.clientY); } else f.rangeParent && (d = i.createRange()).setStart(f.rangeParent, f.rangeOffset); var h = i.getSelection(); h == null || h.removeAllRanges(), d && (h == null || h.addRange(d)); } n.focus(); } return this; }, a.prototype.__onKeydown = function(r) { var t = r, e = this.doc; t.key !== "Enter" || ["insertOrderedList", "insertUnorderedList"].some(function(n) { return e.queryCommandState(n); }) || (e.execCommand("insertLineBreak"), t.preventDefault()); }, a.prototype.__onPaste = function(r) { var t = r.clipboardData || window.clipboardData, e = t.getData("text"), n = t.getData("text/html"); if (e && !n) { r.preventDefault(); var i = e.replace(/(?:\r\n|\r|\n)/g, "
"); this.doc.execCommand("insertHTML", !1, i); } }, a.prototype.syncActions = function() { var r = this; this.getActions().forEach(function(t) { if (r.actionbar && (!t.state || t.state && t.state(r, r.doc) >= 0)) { var e = t.event || "click", n = t.btn; n && (n["on".concat(e)] = function() { t.result(r, t), r.updateActiveActions(); }); } }); }, a.prototype.addAction = function(r, t) { t === void 0 && (t = {}); var e = t.sync, n = this.actionbarEl(); if (n) { var i = r.icon, l = r.attributes, f = l === void 0 ? {} : l, d = document.createElement("span"); for (var v in d.className = this.classes.button, r.btn = d, f) d.setAttribute(v, f[v]); typeof i == "string" ? d.innerHTML = i : d.appendChild(i), n.appendChild(d); } e && (this.actions.push(r), this.syncActions()); }, a.prototype.getActions = function() { return this.actions; }, a.prototype.selection = function() { return this.doc.getSelection(); }, a.prototype.exec = function(r, t) { this.doc.execCommand(r, !1, t); }, a.prototype.actionbarEl = function() { return this.actionbar; }, a.prototype.insertHTML = function(r, t) { var e = (t === void 0 ? {} : t).select, n = this, i = n.em, l = n.doc, f = n.el, d = l.getSelection(); if (d && d.rangeCount) { var v = (0, H.getModel)(f), h = l.createElement("div"), w = d.getRangeAt(0); w.deleteContents(), (0, S.isString)(r) ? h.innerHTML = r : r && h.appendChild(r), Array.prototype.slice.call(h.childNodes).forEach(function(C) { w.insertNode(C); }), d.removeAllRanges(), d.addRange(w), f.focus(), e && v && (v.once("rte:disable", function() { var C = v.find("[".concat(Ku, "]"))[0]; C && (i.setSelected(C), C.removeAttributes(Ku)); }), v.trigger("disable")); } }, a; }(); const vg = gg; var mg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ud = function(a, r, t, e) { return new (t || (t = Promise))(function(n, i) { function l(v) { try { d(e.next(v)); } catch (h) { i(h); } } function f(v) { try { d(e.throw(v)); } catch (h) { i(h); } } function d(v) { var h; v.done ? n(v.value) : (h = v.value, h instanceof t ? h : new t(function(w) { w(h); })).then(l, f); } d((e = e.apply(a, r || [])).next()); }); }, pd = function(a, r) { var t, e, n, i, l = { label: 0, sent: function() { if (1 & n[0]) throw n[1]; return n[1]; }, trys: [], ops: [] }; return i = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() { return this; }), i; function f(d) { return function(v) { return function(h) { if (t) throw new TypeError("Generator is already executing."); for (; i && (i = 0, h[0] && (l = 0)), l; ) try { if (t = 1, e && (n = 2 & h[0] ? e.return : h[0] ? e.throw || ((n = e.return) && n.call(e), 0) : e.next) && !(n = n.call(e, h[1])).done) return n; switch (e = 0, n && (h = [2 & h[0], n.value]), h[0]) { case 0: case 1: n = h; break; case 4: return l.label++, { value: h[1], done: !1 }; case 5: l.label++, e = h[1], h = [0]; continue; case 7: h = l.ops.pop(), l.trys.pop(); continue; default: if (n = l.trys, !((n = n.length > 0 && n[n.length - 1]) || h[0] !== 6 && h[0] !== 2)) { l = 0; continue; } if (h[0] === 3 && (!n || h[1] > n[0] && h[1] < n[3])) { l.label = h[1]; break; } if (h[0] === 6 && l.label < n[1]) { l.label = n[1], n = h; break; } if (n && l.label < n[2]) { l.label = n[2], l.ops.push(h); break; } n[2] && l.ops.pop(), l.trys.pop(); continue; } h = r.call(a, l); } catch (w) { h = [6, w], e = 0; } finally { t = n = 0; } if (5 & h[0]) throw h[1]; return { value: h[0] ? h[1] : void 0, done: !0 }; }([d, v]); }; } }, yg = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, mf = "change:canvasOffset frame:scroll component:update", bg = { enable: "rte:enable", disable: "rte:disable", custom: "rte:custom" }, wg = function(a) { function r(t) { var e = a.call(this, t, "RichTextEditor", hg) || this; e.events = bg; var n = e.config, i = n.pStylePrefix; i && (n.stylePrefix = i + n.stylePrefix), e.pfx = n.stylePrefix, e.actions = n.actions || []; var l = new k.Hn(); return e.model = l, l.on("change:currentView", e.__trgCustom, e), e.__dbdTrgCustom = (0, S.debounce)(function() { return e.__trgCustom(); }, 0), e; } return mg(r, a), r.prototype.onLoad = function() { if ((0, H.hasWin)()) { var t = this.config, e = t.pStylePrefix, n = t.custom, i = (0, Ne.ut)("div", { class: (0, Ne.cx)("".concat(e, "rte-toolbar"), !n && "".concat(e, "one-bg ").concat(e, "rte-toolbar-ui")) }); this.toolbar = i, this.initRte((0, Ne.ut)("div")), (0, H.on)(i, "mousedown", function(l) { return l.stopPropagation(); }); } }, r.prototype.__trgCustom = function() { var t = this, e = t.model, n = t.em, i = t.events; n.trigger(i.custom, { enabled: !!e.get("currentView"), container: this.getToolbarEl(), actions: this.getAll() }); }, r.prototype.destroy = function() { var t, e, n; (t = this.globalRte) === null || t === void 0 || t.destroy(), (n = (e = this.customRte) === null || e === void 0 ? void 0 : e.destroy) === null || n === void 0 || n.call(e), this.model.stopListening().clear({ silent: !0 }), this.__dbdTrgCustom.cancel(), (0, Ne.L_)(this.toolbar); }, r.prototype.postRender = function(t) { var e = t.model.get("Canvas"); this.toolbar.style.pointerEvents = "all", this.hideToolbar(), e.getToolsEl().appendChild(this.toolbar); }, r.prototype.initRte = function(t) { var e = this.globalRte, n = this, i = n.em, l = n.pfx, f = n.actionbar, d = n.config, v = this.actions || yg([], d.actions, !0), h = { actionbar: "".concat(l, "actionbar"), button: "".concat(l, "action"), active: "".concat(l, "active"), inactive: "".concat(l, "inactive"), disabled: "".concat(l, "disabled") }; return e ? (e.em = i, e.setEl(t)) : (e = new vg(i, t, { classes: h, actions: v, actionbar: f, actionbarContainer: this.toolbar, module: this }), this.globalRte = e), e.actionbar && (this.actionbar = e.actionbar), e.actions && (this.actions = e.actions), e; }, r.prototype.add = function(t, e) { var n; e === void 0 && (e = {}), e.name = t, (n = this.globalRte) === null || n === void 0 || n.addAction(e, { sync: !0 }); }, r.prototype.get = function(t) { var e, n; return (e = this.globalRte) === null || e === void 0 || e.getActions().forEach(function(i) { i.name == t && (n = i); }), n; }, r.prototype.getAll = function() { var t; return ((t = this.globalRte) === null || t === void 0 ? void 0 : t.getActions()) || []; }, r.prototype.remove = function(t) { var e, n = this.getAll(), i = this.get(t); if (i) { var l = i.btn, f = n.indexOf(i); (e = l == null ? void 0 : l.parentNode) === null || e === void 0 || e.removeChild(l), n.splice(f, 1); } return i; }, r.prototype.run = function(t) { var e = this.globalRte, n = (0, S.isString)(t) ? this.get(t) : t; e && n && (n.result(e, n), e.updateActiveActions()); }, r.prototype.getToolbarEl = function() { return this.toolbar; }, r.prototype.updatePosition = function() { var t = this.em, e = this.toolbar, n = "px", i = t.Canvas, l = e.style, f = i.getTargetToElementFixed(this.lastEl, e, { event: "rteToolbarPosUpdate", left: 0 }); ["top", "left", "bottom", "right"].forEach(function(d) { var v = f[d]; (0, H.isDef)(v) && (l[d] = (0, S.isString)(v) ? v : (v || 0) + n); }); }, r.prototype.enable = function(t, e, n) { return n === void 0 && (n = {}), ud(this, void 0, void 0, function() { var i, l, f, d, v; return pd(this, function(h) { switch (h.label) { case 0: return this.lastEl = t.el, l = (i = this).customRte, f = i.em, d = t.getChildrenContainer(), this.toolbar.style.display = "", [4, l ? l.enable(d, e) : this.initRte(d).enable(n)]; case 1: return v = h.sent(), f && (setTimeout(this.updatePosition.bind(this), 0), f.off(mf, this.updatePosition, this), f.on(mf, this.updatePosition, this), f.trigger("rte:enable", t, v)), this.model.set({ currentView: t }), [2, v]; } }); }); }, r.prototype.getContent = function(t, e) { return ud(this, void 0, void 0, function() { var n; return pd(this, function(i) { switch (i.label) { case 0: return (n = this.customRte) && e && (0, S.isFunction)(n.getContent) ? [4, n.getContent(t.el, e)] : [3, 2]; case 1: return [2, i.sent()]; case 2: return [2, t.getChildrenContainer().innerHTML]; } }); }); }, r.prototype.hideToolbar = function() { var t = this.toolbar.style, e = "-1000px"; t.top = e, t.left = e, t.display = "none"; }, r.prototype.disable = function(t, e) { var n = this.em, i = this.customRte, l = t.getChildrenContainer(); i ? i.disable(l, e) : e && e.disable(), this.hideToolbar(), n && (n.off(mf, this.updatePosition, this), n.trigger("rte:disable", t, e)), this.model.unset("currentView"); }, r; }(jt); const _g = wg; var yf = gn(790); const xg = { stylePrefix: "com-", defaults: {}, strict: !0 }; var Cg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Yu = function() { return Yu = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Yu.apply(this, arguments); }, fd = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, dd = [["preview", "Preview", "preview"], ["resize", "Resize", "resize"], ["fullscreen", "Fullscreen", "fullscreen"], ["copy", "CopyComponent"], ["paste", "PasteComponent"], ["canvas-move", "CanvasMove"], ["canvas-clear", "CanvasClear"], ["open-code", "ExportTemplate", "export-template"], ["open-layers", "OpenLayers", "open-layers"], ["open-styles", "OpenStyleManager", "open-sm"], ["open-traits", "OpenTraitManager", "open-tm"], ["open-blocks", "OpenBlocks", "open-blocks"], ["open-assets", "OpenAssets", "open-assets"], ["component-select", "SelectComponent", "select-comp"], ["component-outline", "SwitchVisibility", "sw-visibility"], ["component-offset", "ShowOffset", "show-offset"], ["component-move", "MoveComponent", "move-comp"], ["component-next", "ComponentNext"], ["component-prev", "ComponentPrev"], ["component-enter", "ComponentEnter"], ["component-exit", "ComponentExit", "select-parent"], ["component-delete", "ComponentDelete"], ["component-style-clear", "ComponentStyleClear"], ["component-drag", "ComponentDrag"]], Sg = function(a) { function r(t) { var e = a.call(this, t, "Commands", xg) || this; e.CommandAbstract = yf.default, e.defaultCommands = {}, e.commands = {}, e.active = {}; var n = e.config, i = n.pStylePrefix, l = e.defaultCommands; for (var f in i && (n.stylePrefix = i + n.stylePrefix), Object.keys(n.defaults).forEach(function(d) { var v = n.defaults[d]; v.id && e.add(v.id, v); }), l["tlb-delete"] = { run: function(d) { return d.runCommand("core:component-delete"); } }, l["tlb-clone"] = { run: function(d) { d.runCommand("core:copy"), d.runCommand("core:paste", { action: "clone-component" }); } }, l["tlb-move"] = { run: function(d, v, h) { h === void 0 && (h = {}); var w = d.getModel(), C = h && h.event, L = h.target, F = L || d.getSelected(), q = L ? [L] : fd([], d.getSelectedAll(), !0), et = C && C.type == "dragstart", X = { preserveSelected: 1 }; if (!F || !F.get("draggable")) return w.logWarning("The element is not draggable"); var At = F.get("dmode") || w.get("dmode"), It = function() { return w.stopDefault(X); }, ie = (0, S.includes)(["absolute", "translate"], At); q.forEach(function(dn) { return dn.trigger("disable"); }), et ? setTimeout(It, 0) : It(); var se = function(dn) { w.trigger("".concat(hr, ":start"), dn); }, Me = function(dn) { w.trigger(hr, dn); }, Ie = function(dn, Er, qr) { q.forEach(function(Gr) { return Gr.set("status", "selected"); }), d.select(q), F.emitUpdate(), w.trigger("".concat(hr, ":end"), qr), setTimeout(function() { return w.runDefault(X); }), (ie || qr.cancelled) && w.set("_cmpDrag", 1); }; if (ie) d.runCommand("core:component-drag", { guidesInfo: 1, mode: At, target: F, onStart: se, onDrag: Me, onEnd: Ie, event: C }); else { et && C.dataTransfer.setDragImage(F.view.el, 0, 0); var Je = d.Commands.get("move-comp"); Je.onStart = se, Je.onDrag = Me, Je.onEndMoveFromModel = Ie, Je.initSorterFromModels(q); } q.forEach(function(dn) { return dn.set("status", "freezed-selected"); }); } }, l["core:undo"] = function(d) { return d.UndoManager.undo(); }, l["core:redo"] = function(d) { return d.UndoManager.redo(); }, dd.forEach(function(d) { var v = d[2], h = gn(828)("./".concat(d[1])).default, w = "core:".concat(d[0]); l[w] = h, v && (l[v] = h, ["run", "stop"].forEach(function(C) { t.on("".concat(C, ":").concat(v), function() { for (var L = [], F = 0; F < arguments.length; F++) L[F] = arguments[F]; return t.trigger.apply(t, fd(["".concat(C, ":").concat(w)], L, !1)); }); })); }), n.model = t.Canvas, l) e.add(f, l[f]); return e; } return Cg(r, a), r.prototype.add = function(t, e) { var n = (0, S.isFunction)(e) ? { run: e } : e; return n.stop || (n.noStop = !0), delete n.initialize, n.id = t, this.commands[t] = yf.default.extend(n), this; }, r.prototype.get = function(t) { var e = this.commands[t]; return (0, S.isFunction)(e) ? (e = new e(this.config), this.commands[t] = e) : e || this.em.logWarning("'".concat(t, "' command not found")), e; }, r.prototype.extend = function(t, e) { e === void 0 && (e = {}); var n = this.get(t); if (n) { var i = Yu(Yu({}, n.constructor.prototype), e); this.add(t, i); var l = dd.filter(function(f) { return "core:".concat(f[0]) === t && f[2]; })[0]; l && this.add(l[2], i); } return this; }, r.prototype.has = function(t) { return !!this.commands[t]; }, r.prototype.getAll = function() { return this.commands; }, r.prototype.run = function(t, e) { return e === void 0 && (e = {}), this.runCommand(this.get(t), e); }, r.prototype.stop = function(t, e) { return e === void 0 && (e = {}), this.stopCommand(this.get(t), e); }, r.prototype.isActive = function(t) { return this.getActive().hasOwnProperty(t); }, r.prototype.getActive = function() { return this.active; }, r.prototype.runCommand = function(t, e) { var n; if (e === void 0 && (e = {}), t && t.run) { var i = this.em, l = this.config, f = t.id, d = i.Editor; this.isActive(f) && !e.force && l.strict || (n = d && t.callRun(d, e), f && t.stop && !t.noStop && !e.abort && (this.active[f] = n)); } return n; }, r.prototype.stopCommand = function(t, e) { var n; if (e === void 0 && (e = {}), t && t.run) { var i = this.em, l = this.config, f = t.id, d = i.Editor; (this.isActive(f) || e.force || !l.strict) && (f && delete this.active[f], n = t.callStop(d, e)); } return n; }, r.prototype.create = function(t) { return t.stop || (t.noStop = !0), new (yf.default.extend(t))(this.config); }, r.prototype.destroy = function() { this.defaultCommands = {}, this.commands = {}, this.active = {}; }, r; }(jt); const Og = Sg, Tg = { sectors: [{ name: "General", open: !1, properties: ["display", "float", "position", "top", "right", "left", "bottom"] }, { name: "Flex", open: !1, properties: ["flex-direction", "flex-wrap", "justify-content", "align-items", "align-content", "order", "flex-basis", "flex-grow", "flex-shrink", "align-self"] }, { name: "Dimension", open: !1, properties: ["width", "height", "max-width", "min-height", "margin", "padding"] }, { name: "Typography", open: !1, properties: ["font-family", "font-size", "font-weight", "letter-spacing", "color", "line-height", "text-align", "text-shadow"] }, { name: "Decorations", open: !1, properties: ["background-color", "border-radius", "border", "box-shadow", "background"] }, { name: "Extra", open: !1, properties: ["opacity", "transition", "transform"] }], appendTo: "", stylePrefix: "sm-", custom: !1, hideNotStylable: !0, highlightChanged: !0, highlightComputed: !0, showComputed: !0, clearProperties: !0, avoidComputed: ["width", "height"] }; var kg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), $r = function() { return $r = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, $r.apply(this, arguments); }, Pg = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, hd = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, bf = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return kg(r, a), r.getDefaults = function() { return (0, S.result)(this.prototype, "defaults"); }, r.prototype.defaults = function() { return { name: "", property: "", type: "", defaults: "", info: "", value: "", icon: "", functionName: "", status: "", visible: !0, fixedValues: ["initial", "inherit"], full: !1, important: !1, toRequire: !1, requires: void 0, requiresParent: null, parentTarget: null }; }, r.prototype.initialize = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}), this.em = e.em; var n = this.getId() || "", i = this.get("name") || this.get("label") || ""; !this.get("property") && this.set("property", (i || n).replace(/ /g, "-")); var l = this.get("property"); !this.get("id") && this.set("id", l), !i && this.set("name", (0, H.capitalize)(l).replace(/-/g, " ")), this.on("change", this.__upTargets), r.callInit(this, t, e); }, r.prototype.__getParentProp = function() { var t, e; return (e = (t = this.collection) === null || t === void 0 ? void 0 : t.opts) === null || e === void 0 ? void 0 : e.parentProp; }, r.prototype.__upTargets = function(t, e) { var n, i = this; e === void 0 && (e = {}); var l = this.em.Styles, f = this.getName(), d = e.__clear, v = d ? "" : this.__getFullValue(e), h = this.__getParentProp(), w = this.changedAttributes(), C = (0, S.keys)(w).reduce(function(At, It) { return At[It] = i.previous(It), At; }, {}), L = hd(hd([], (0, S.keys)(this.__getClearProps()), !0), ["__p"], !1), F = (0, S.keys)(w), q = !e.__up && !h && (d || L.some(function(At) { return F.indexOf(At) >= 0; })), et = this.get("onChange"), X = { property: this, from: C, to: w, value: v, opts: e }; l.__trgEv(l.events.propertyUpdate, X), et && et(X), q && this.__upTargetsStyle(((n = {})[f] = v, n), e); }, r.prototype.__upTargetsStyle = function(t, e) { var n, i = (n = this.em) === null || n === void 0 ? void 0 : n.get("StyleManager"); i == null || i.addStyleTargets($r($r({}, t), { __p: !!e.avoidStore }), e); }, r.prototype._up = function(t, e) { e === void 0 && (e = {}), e.noTarget && (e.__up = !0); var n = e.partial, i = Pg(e, ["partial"]); return t.__p = !(!i.avoidStore && !n), this.set(t, $r($r({}, i), { avoidStore: t.__p })); }, r.prototype.up = function(t, e) { e === void 0 && (e = {}), this.set(t, $r($r({}, e), { __up: !0 })); }, r.prototype.init = function() { }, r.prototype.getId = function() { return this.get("id"); }, r.prototype.getType = function() { return this.get("type"); }, r.prototype.getName = function() { return this.get("property"); }, r.prototype.getLabel = function(t) { var e; t === void 0 && (t = {}); var n = t.locale, i = n === void 0 || n, l = this.getId(), f = this.get("name") || this.get("label"); return i && ((e = this.em) === null || e === void 0 ? void 0 : e.t("styleManager.properties.".concat(l))) || f; }, r.prototype.getValue = function(t) { t === void 0 && (t = {}); var e = t.noDefault, n = this.get("value"); return this.hasValue() || e ? n : this.getDefaultValue(); }, r.prototype.hasValue = function(t) { t === void 0 && (t = {}); var e = t.noParent && this.getParentTarget(), n = this.get("value"); return !(0, S.isUndefined)(n) && n !== "" && !e; }, r.prototype.hasValueParent = function() { return this.hasValue() && !this.hasValue({ noParent: !0 }); }, r.prototype.getStyle = function(t) { var e; t === void 0 && (t = {}); var n = this.getName(); return (e = {})[t.camelCase ? (0, H.camelCase)(n) : n] = this.__getFullValue(t), e; }, r.prototype.getDefaultValue = function() { var t = this.get("default"); return "".concat((0, S.isUndefined)(t) ? this.get("defaults") : t); }, r.prototype.upValue = function(t, e) { e === void 0 && (e = {}); var n = t === null || t === "" ? this.__getClearProps() : this.__parseValue(t, e); return this._up(n, e); }, r.prototype.isVisible = function() { return !!this.get("visible"); }, r.prototype.clear = function(t) { return t === void 0 && (t = {}), this._up(this.__getClearProps(), $r($r({}, t), { __clear: !0 })), this; }, r.prototype.canClear = function() { var t = this.getParent(); return t ? t.__canClearProp(this) : this.hasValue({ noParent: !0 }); }, r.prototype.getParent = function() { return this.__getParentProp() || null; }, r.prototype.isFull = function() { return !!this.get("full"); }, r.prototype.__parseValue = function(t, e) { return this.parseValue(t, e); }, r.prototype.__getClearProps = function() { return { value: "" }; }, r.prototype.setValue = function(t, e, n) { e === void 0 && (e = !0), n === void 0 && (n = {}); var i = this.parseValue(t), l = !e; !l && this.set({ value: void 0 }, { avoidStore: l, silent: !0 }), this.set(i, $r({ avoidStore: l }, n)); }, r.prototype.setValueFromInput = function(t, e, n) { n === void 0 && (n = {}), this.setValue(t, e, $r($r({}, n), { fromInput: 1 })); }, r.prototype.parseValue = function(t, e) { e === void 0 && (e = {}); var n = { value: t }, i = "!important"; if ((0, S.isString)(t) && t.indexOf(i) !== -1 && (n.value = t.replace(i, "").trim(), n.important = !0), !this.get("functionName") && !e.complete) return n; var l = [], f = "".concat(n.value), d = f.indexOf("(") + 1, v = f.lastIndexOf(")"), h = f.substring(0, d - 1); if (h && (n.functionName = h), l.push(d), v >= 0 && l.push(v), n.value = String.prototype.substring.apply(f, l), e.numeric) { var w = parseFloat(n.value); n.unit = n.value.replace(w, ""), n.value = w; } return n; }, r.prototype.__getFullValue = function(t) { var e = (t === void 0 ? {} : t).withDefault; return !this.hasValue() && e ? this.getDefaultValue() : this.getFullValue(); }, r.prototype.getFullValue = function(t, e) { e === void 0 && (e = {}); var n = this.get("functionName"), i = this.getDefaultValue(), l = (0, S.isUndefined)(t) ? this.get("value") : t, f = !(0, S.isUndefined)(l) && l !== ""; if (l && i && l === i) return i; if (n && f) { var d = n === "url" ? "'".concat(l.replace(/'|"/g, ""), "'") : l; l = "".concat(n, "(").concat(d, ")"); } return f && this.get("important") && !e.skipImportant && (l = "".concat(l, " !important")), l || ""; }, r.prototype.__setParentTarget = function(t) { this.up({ parentTarget: t }); }, r.prototype.getParentTarget = function() { return this.get("parentTarget") || null; }, r.prototype.__parseFn = function(t) { t === void 0 && (t = ""); var e = t.indexOf("(") + 1, n = t.lastIndexOf(")"); return { name: t.substring(0, e - 1).trim(), value: String.prototype.substring.apply(t, [e, n >= 0 ? n : void 0]).trim() }; }, r.prototype.__checkVisibility = function(t) { var e = t.target, n = t.component, i = t.sectors, l = n || e; if (!l) return !1; var f = this.getId(), d = this.getName(), v = this.get("toRequire"), h = this.get("requires"), w = this.get("requiresParent"), C = l.get("unstylable"), L = l.get("stylable-require"), F = l.get("stylable"); if ((0, S.isArray)(F) && (F = F.indexOf(d) >= 0), (0, S.isArray)(C) && (F = C.indexOf(d) < 0), v && (F = !e || L && (L.indexOf(f) >= 0 || L.indexOf(d) >= 0)), i && h) { var q = (0, S.keys)(h); i.forEach(function(It) { It.getProperties().forEach(function(ie) { if ((0, S.includes)(q, ie.id)) { var se = h[ie.id]; F = F && (0, S.includes)(se, ie.get("value")); } }); }); } if (w) { var et = n && n.parent(), X = et && et.getEl(); if (X) { var At = (0, H.hasWin)() ? window.getComputedStyle(X) : {}; (0, S.each)(w, function(It, ie) { F = F && At[ie] && (0, S.includes)(It, At[ie]); }); } else F = !1; } return !!F; }, r; }(k.Hn); const On = bf; bf.callParentInit = function(a, r, t, e) { e === void 0 && (e = {}), a.prototype.initialize.apply(r, [t, $r($r({}, e), { skipInit: 1 })]); }, bf.callInit = function(a, r, t) { t === void 0 && (t = {}), !t.skipInit && a.init(r, t); }; var Eg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), wl = function() { return wl = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, wl.apply(this, arguments); }, gd = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, vd = function(a) { return a === "integer" || a === "number"; }, Ag = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Eg(r, a), r.prototype.defaults = function() { return wl(wl({}, On.getDefaults()), { detached: !1, properties: [], separator: " ", join: null, fromStyle: null, toStyle: null, full: !0 }); }, r.prototype.initialize = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}), On.callParentInit(On, this, t, e); var n = this.em, i = new Cf(this.get("properties") || [], { em: n, parentProp: this }); this.set("properties", i, { silent: !0 }), this.listenTo(i, "change", this.__upProperties), On.callInit(this, t, e); }, Object.defineProperty(r.prototype, "properties", { get: function() { return this.get("properties") || []; }, enumerable: !1, configurable: !0 }), r.prototype.getProperties = function() { return gd([], this.get("properties").models, !0); }, r.prototype.getProperty = function(t) { return this.properties.filter(function(e) { return e.getId() === t || e.getName() === t; })[0]; }, r.prototype.getPropertyAt = function(t) { return this.get("properties").at(t); }, r.prototype.isDetached = function() { return !!this.get("detached"); }, r.prototype.getValues = function(t) { var e = (t === void 0 ? {} : t).byName; return this.getProperties().reduce(function(n, i) { return n[e ? i.getName() : i.getId()] = "".concat(i.__getFullValue()), n; }, {}); }, r.prototype.getSeparator = function() { return this.getSplitSeparator(); }, r.prototype.getJoin = function() { return this.__getJoin(); }, r.prototype.getStyleFromProps = function(t) { var e; t === void 0 && (t = {}); var n = this.getName(), i = this.__getJoin(), l = this.get("toStyle"), f = this.getValues(), d = {}; if (l) d = l(f, { join: i, name: n, property: this }); else if (f = this.getValues({ byName: !0 }), this.isDetached()) d = f; else { var v = this.getProperties().map(function(h) { return h.__getFullValue({ withDefault: 1 }); }).filter(Boolean).join(i); (e = {})[n] = v, d = e; } return this.isDetached() ? d[n] = "" : (d[n] = d[n] || "", d = wl(wl({}, d), this.getProperties().reduce(function(h, w) { return h[w.getName()] = "", h; }, {}))), t.camelCase ? Object.keys(d).reduce(function(h, w) { return h[(0, H.camelCase)(w)] = d[w], h; }, {}) : d; }, r.prototype.getSplitSeparator = function() { return new RegExp("".concat(this.get("separator"), "(?![^\\(]*\\))")); }, r.prototype.__upProperties = function(t, e) { if (e === void 0 && (e = {}), !e.__up && !e.__clearIn) { var n = this.__getParentProp(); if (n) return n.__upProperties(this, e); this.__upTargetsStyleProps(e, t); } }, r.prototype.__upTargetsStyleProps = function(t, e) { var n; t === void 0 && (t = {}); var i = this.getStyleFromProps(); if (this.isDetached() && e) { var l = e.getName(); (n = {})[l] = i[l], i = n; } this.__upTargetsStyle(i, t); }, r.prototype._up = function(t, e) { return e === void 0 && (e = {}), this.__setProperties(this.__getSplitValue(t.value), e), On.prototype._up.call(this, t, e), this; }, r.prototype.getStyle = function(t) { return this.getStyleFromProps(t); }, r.prototype.__getFullValue = function(t) { return t === void 0 && (t = {}), this.isDetached() || t.__clear ? "" : this.getStyleFromProps()[this.getName()] || ""; }, r.prototype.__getJoin = function() { var t = this.get("join"); return (0, S.isString)(t) ? t : this.get("separator"); }, r.prototype.__styleHasProps = function(t) { t === void 0 && (t = {}); var e = this.getName(), n = this.getProperties().map(function(i) { return i.getName(); }); return gd([e], n, !0).some(function(i) { return !(0, S.isUndefined)(t[i]) && t[i] !== ""; }); }, r.prototype.__splitValue = function(t, e) { return t.split(e).map(function(n) { return n.trim(); }).filter(Boolean); }, r.prototype.__splitStyleName = function(t, e, n) { return this.__splitValue(t[e] || "", n); }, r.prototype.__getSplitValue = function(t, e) { t === void 0 && (t = ""); var n = (e === void 0 ? {} : e).byName, i = this.getProperties(), l = i.length === 4 && i.every(function(v) { return vd(v.getType()); }), f = this.__splitValue(t, this.getSplitSeparator()), d = {}; return i.forEach(function(v, h) { var w = f[h], C = (0, S.isUndefined)(w) ? "" : w; if (l) { var L = f.length; C = f[h] || f[h % L + (L != 1 && L % 2 ? 1 : 0)] || C; } var F = n ? v.getName() : v.getId(); d[F] = C || ""; }), d; }, r.prototype.__getPropsFromStyle = function(t, e) { if (t === void 0 && (t = {}), e === void 0 && (e = {}), !this.__styleHasProps(t)) return null; var n = e.byName, i = this.getName(), l = this.getProperties(), f = this.getSplitSeparator(), d = this.get("fromStyle"), v = d ? d(t, { property: this, name: i, separator: f }) : {}; return d || (v = this.__getSplitValue(t[i] || "", { byName: n }), l.forEach(function(h) { var w = t[h.getName()], C = n ? h.getName() : h.getId(); (0, S.isUndefined)(w) || w === "" || (v[C] = w); })), v; }, r.prototype.__setProperties = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}), this.getProperties().forEach(function(i) { var l = t[i.getId()]; i.__getFullValue() !== l && i.upValue(l, e); }); var n = (0, S.keys)(t).map(function(i) { return t[i]; }).join(" "); this.set("value", n, { silent: !0 }); }, r.prototype.clear = function() { var t = this; return this.getProperties().map(function(e) { return e.clear({ __clearIn: !t.isDetached() }); }), On.prototype.clear.call(this), this; }, r.prototype.hasValue = function(t) { return this.getProperties().some(function(e) { return e.hasValue(t); }); }, r.prototype.getFullValue = function() { return this.__getFullValue(); }, r.prototype.__canClearProp = function(t) { return this.isDetached() && t.hasValue({ noParent: !0 }); }, r; }(On); const _l = Ag; var jg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Xu = function() { return Xu = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Xu.apply(this, arguments); }, Mg = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return jg(r, a), r.prototype.defaults = function() { return { values: {} }; }, r.prototype.initialize = function() { var t = this.collection; this.prop = t == null ? void 0 : t.prop; }, r.prototype.getId = function() { return this.cid; }, r.prototype.getIndex = function() { var t = this.collection; return t ? t.indexOf(this) : -1; }, r.prototype.getValues = function(t) { t === void 0 && (t = {}); var e = this.get("values"); return t.camelCase ? Object.keys(e).reduce(function(n, i) { return n[(0, H.camelCase)(i)] = e[i], n; }, {}) : e; }, r.prototype.getLabel = function() { var t; return (t = this.prop) === null || t === void 0 ? void 0 : t.getLayerLabel(this); }, r.prototype.isSelected = function() { var t; return ((t = this.prop) === null || t === void 0 ? void 0 : t.getSelectedLayer()) === this; }, r.prototype.select = function() { var t; return (t = this.prop) === null || t === void 0 ? void 0 : t.selectLayer(this); }, r.prototype.remove = function() { var t; return (t = this.prop) === null || t === void 0 ? void 0 : t.removeLayer(this); }, r.prototype.move = function(t) { var e; return (e = this.prop) === null || e === void 0 ? void 0 : e.moveLayer(this, t); }, r.prototype.getStylePreview = function(t) { var e; return t === void 0 && (t = {}), (e = this.prop) === null || e === void 0 ? void 0 : e.getStylePreview(this, t); }, r.prototype.hasPreview = function() { var t; return !!(!((t = this.prop) === null || t === void 0) && t.get("preview")); }, r.prototype.upValues = function(t) { return t === void 0 && (t = {}), this.set("values", Xu(Xu({}, this.getValues()), t)); }, r; }(k.Hn); const Lg = Mg; var Dg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), md = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Dg(r, a), r.prototype.initialize = function(t, e) { e === void 0 && (e = {}), this.prop = e.prop; }, r; }(k.FE); const Ng = md; md.prototype.model = Lg; var Ig = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), oi = function() { return oi = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, oi.apply(this, arguments); }, Fg = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, Vg = /,(?![^\(]*\))/, Rg = /\s(?![^(]*\))/, Hg = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Ig(r, a), r.prototype.defaults = function() { return oi(oi({}, _l.getDefaults()), { layers: [], layerSeparator: ", ", layerJoin: "", prepend: 0, preview: !1, layerLabel: null, selectedLayer: null }); }, r.prototype.initialize = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}), _l.callParentInit(_l, this, t, e); var n = this.get("layers"), i = new Ng(n, { prop: this }); i.property = this, i.properties = this.get("properties"), this.set("layers", i, { silent: !0 }), this.on("change:selectedLayer", this.__upSelected), this.listenTo(i, "add remove", this.__upLayers), _l.callInit(this, t, e); }, r.prototype.getLayers = function() { return this.__getLayers().models; }, r.prototype.__getLayers = function() { return this.get("layers"); }, r.prototype.getLayer = function(t) { return t === void 0 && (t = 0), this.__getLayers().at(t) || void 0; }, r.prototype.getSelectedLayer = function() { var t = this.get("selectedLayer"); return t && t.getIndex() >= 0 ? t : void 0; }, r.prototype.selectLayer = function(t) { return this.set("selectedLayer", t, { __select: !0 }); }, r.prototype.selectLayerAt = function(t) { t === void 0 && (t = 0); var e = this.getLayer(t); return e && this.selectLayer(e); }, r.prototype.moveLayer = function(t, e) { e === void 0 && (e = 0); var n = t ? t.getIndex() : -1; n >= 0 && (0, S.isNumber)(e) && e >= 0 && e < this.getLayers().length && n !== e && (this.removeLayer(t), this.__getLayers().add(t, { at: e })); }, r.prototype.addLayer = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}); var n = {}; return this.getProperties().forEach(function(i) { var l = i.getId(), f = t[l]; n[l] = (0, S.isUndefined)(f) ? i.getDefaultValue() : f; }), this.__getLayers().push({ values: n }, e); }, r.prototype.removeLayer = function(t) { return this.__getLayers().remove(t); }, r.prototype.removeLayerAt = function(t) { t === void 0 && (t = 0); var e = this.getLayer(t); return e ? this.removeLayer(e) : null; }, r.prototype.getLayerLabel = function(t) { var e = ""; if (t) { var n = this.get("layerLabel"), i = t.getValues(), l = t.getIndex(); if (n) e = n(t, { index: l, values: i, property: this }); else { var f = []; this.getProperties().map(function(d) { f.push(i[d.getId()]); }), e = f.filter(Boolean).join(" "); } } return e; }, r.prototype.getStyleFromLayer = function(t, e) { var n; e === void 0 && (e = {}); var i, l = this.__getJoin(), f = this.__getJoinLayers(), d = this.get("toStyle"), v = this.getName(), h = t.getValues(); if (d) i = d(h, { join: l, joinLayers: f, name: v, layer: t, property: this }); else { var w = this.getProperties().map(function(C) { var L = C.getName(), F = h[C.getId()], q = (0, S.isUndefined)(F) ? C.getDefaultValue() : F; if (e.number && vd(C.getType())) { var et = C.parseValue(F, e.number); q = "".concat(et.value).concat(et.unit); } return { name: L, value: q }; }); i = this.isDetached() ? w.reduce(function(C, L) { return C[L.name] = L.value, C; }, {}) : ((n = {})[this.getName()] = w.map(function(C) { return C.value; }).join(l), n); } return e.camelCase ? Object.keys(i).reduce(function(C, L) { return C[(0, H.camelCase)(L)] = i[L], C; }, {}) : i; }, r.prototype.getStylePreview = function(t, e) { e === void 0 && (e = {}); var n = {}; return this.get("preview") && (n = this.getStyleFromLayer(t, e)), n; }, r.prototype.getLayerSeparator = function() { var t = this.get("layerSeparator"); return (0, S.isString)(t) ? new RegExp("".concat(t, "(?![^\\(]*\\))")) : t; }, r.prototype.__upProperties = function(t, e) { var n; e === void 0 && (e = {}); var i = this.getSelectedLayer(); i && (i.upValues(((n = {})[t.getId()] = t.__getFullValue(), n)), e.__up || this.__upTargetsStyleProps(e)); }, r.prototype.__upLayers = function(t, e, n) { this.__upTargetsStyleProps(n || e); }, r.prototype.__upTargets = function(t, e) { if (e === void 0 && (e = {}), !e.__select) return On.prototype.__upTargets.call(this, t, e); }, r.prototype.__upTargetsStyleProps = function(t) { t === void 0 && (t = {}), this.__upTargetsStyle(this.getStyleFromLayers(), t); }, r.prototype.__upTargetsStyle = function(t, e) { return On.prototype.__upTargetsStyle.call(this, t, e); }, r.prototype.__upSelected = function(t, e) { var n = (t === void 0 ? {} : t).noEvent; e === void 0 && (e = {}); var i = this.em.Styles, l = this.getSelectedLayer(), f = l == null ? void 0 : l.getValues(); f && this.getProperties().forEach(function(d) { var v, h = (v = f[d.getId()]) !== null && v !== void 0 ? v : ""; d.__getFullValue() !== h && d.upValue(h, oi(oi({}, e), { __up: !0 })); }), !n && i.__trgEv(i.events.layerSelect, { property: this }); }, r.prototype._up = function(t, e) { e === void 0 && (e = {}); var n = t.__layers, i = n === void 0 ? [] : n, l = Fg(t, ["__layers"]); return !this.isDetached() && this.__setLayers(i), this.__upSelected({ noEvent: !0 }, e), On.prototype._up.call(this, l, e), this; }, r.prototype.__setLayers = function(t) { t === void 0 && (t = []); var e = this.__getLayers(), n = t.map(function(i) { return { values: i }; }); e.length === n.length ? n.map(function(i, l) { var f; return (f = e.at(l)) === null || f === void 0 ? void 0 : f.upValues(i.values); }) : this.__getLayers().reset(n), this.__upSelected({ noEvent: !0 }); }, r.prototype.__parseValue = function(t) { var e = this, n = this.parseValue(t); return n.__layers = t.split(Vg).map(function(i) { return i.trim(); }).map(function(i) { return e.__parseLayer(i); }).filter(Boolean), n; }, r.prototype.__parseLayer = function(t) { var e = this.get("parseLayer"), n = t.split(Rg), i = this.getProperties(); return e ? e({ value: t, values: n }) : i.reduce(function(l, f, d) { var v = n[d]; return l[f.getId()] = (0, S.isUndefined)(v) ? f.getDefaultValue() : v, l; }, {}); }, r.prototype.__getLayersFromStyle = function(t) { var e = this; if (t === void 0 && (t = {}), !this.__styleHasProps(t)) return null; var n = this.getName(), i = this.getProperties(), l = this.getLayerSeparator(), f = this.get("fromStyle"), d = f ? f(t, { property: this, name: n, separatorLayers: l }) : []; if (!f) { var v = this.__splitStyleName(t, n, l).map(function(h) { return h.split(e.getSplitSeparator()); }).map(function(h) { var w = {}; return i.forEach(function(C, L) { var F = h[L]; w[C.getId()] = (0, S.isUndefined)(F) ? C.getDefaultValue() : F; }), w; }); i.forEach(function(h) { var w = h.getId(); e.__splitStyleName(t, h.getName(), l).map(function(C) { var L; return (L = {})[w] = C || h.getDefaultValue(), L; }).forEach(function(C, L) { v[L] = v[L] ? oi(oi({}, v[L]), C) : C; }); }), d = v; } return (0, S.isArray)(d) ? d : [d]; }, r.prototype.getStyle = function(t) { return t === void 0 && (t = {}), this.getStyleFromLayers(t); }, r.prototype.getStyleFromLayers = function(t) { var e = this; t === void 0 && (t = {}); var n = {}, i = this.getName(), l = this.getLayers(), f = this.getProperties(); if (l.map(function(v) { return e.getStyleFromLayer(v, t); }).forEach(function(v) { (0, S.keys)(v).map(function(h) { n[h] || (n[h] = []), n[h].push(v[h]); }); }), (0, S.keys)(n).map(function(v) { n[v] = n[v].join(e.__getJoinLayers()); }), this.isDetached()) n[i] = "", !l.length && f.map(function(v) { n[v.getName()] = ""; }); else { var d = f.reduce(function(v, h) { return v[h.getName()] = "", v; }, {}); n[i] = n[i] || "", n = oi(oi({}, n), d); } return n; }, r.prototype.__getJoinLayers = function() { var t = this.get("layerJoin"), e = this.get("layerSeparator"); return t || ((0, S.isString)(e) ? e : t); }, r.prototype.__getFullValue = function() { return this.get("detached") ? "" : this.getStyleFromLayers()[this.getName()]; }, r.prototype.hasValue = function(t) { t === void 0 && (t = {}); var e = t.noParent && this.getParentTarget(); return this.getLayers().length > 0 && !e; }, r.prototype.clear = function(t) { return t === void 0 && (t = {}), this.__getLayers().reset(), this.__upTargetsStyleProps(t), On.prototype.clear.call(this), this; }, r.prototype.__canClearProp = function() { return !1; }, r; }(_l); const zg = Hg; var Ug = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ju = function() { return Ju = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Ju.apply(this, arguments); }, Bg = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, Wg = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, wf = "data-clear-style", $g = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this; (0, S.bindAll)(e, "__change", "__updateStyle"); var n = t.config || {}, i = n.em; e.config = n, e.em = i, e.pfx = n.stylePrefix || "", e.ppfx = n.pStylePrefix || "", e.__destroyFn = e.destroy ? e.destroy.bind(e) : function() { }; var l = e.model; l.view = e, e.onValueChange = (0, S.debounce)(e.onValueChange.bind(e), 10), e.updateStatus = (0, S.debounce)(e.updateStatus.bind(e), 0), e.listenTo(l, "destroy remove", e.remove), e.listenTo(l, "change:visible", e.updateVisibility), e.listenTo(l, "change:name change:className change:full", e.render), e.listenTo(l, "change:value", e.onValueChange), e.listenTo(l, "change:parentTarget", e.updateStatus), e.listenTo(i, "change:device", e.onValueChange); var f = e.init && e.init.bind(e); return f && f(), e; } return Ug(r, a), r.prototype.events = function() { var t; return (t = { change: "inputValueChanged" })["click [".concat(wf, "]")] = "clear", t; }, r.prototype.template = function(t) { var e = this.pfx, n = this.ppfx; return `
`); }, r.prototype.templateLabel = function(t) { var e = this.pfx, n = this.em, i = t.parent, l = t.attributes, f = l.icon, d = f === void 0 ? "" : f, v = l.info, h = v === void 0 ? "" : v, w = n == null ? void 0 : n.getConfig().icons, C = (w == null ? void 0 : w.close) || ""; return ` `).concat(t.getLabel(), ` `).concat(i ? "" : '"), ` `); }, r.prototype.templateInput = function(t) { return `
`); }, r.prototype.remove = function() { var t = this; return k.G7.prototype.remove.apply(this, arguments), ["em", "input", "$input", "view"].forEach(function(e) { return t[e] = null; }), this.__destroyFn(this._getClbOpts()), this; }, r.prototype.updateStatus = function() { var t, e = this, n = e.model, i = e.pfx, l = e.ppfx, f = e.config, d = "".concat(l, "four-color"), v = "".concat(l, "color-warn"), h = this.$el.children(".".concat(i, "label")), w = this.getClearEl(), C = w ? w.style : {}; h.removeClass("".concat(d, " ").concat(v)), C.display = "none", n.hasValue({ noParent: !0 }) && f.highlightChanged ? (h.addClass(d), f.clearProperties && (C.display = "")) : n.hasValue() && f.highlightComputed && h.addClass(v), (t = this.parent) === null || t === void 0 || t.updateStatus(); }, r.prototype.clear = function(t) { t && t.stopPropagation(), this.model.clear(); }, r.prototype.getClearEl = function() { return this.clearEl || (this.clearEl = this.el.querySelector("[".concat(wf, "]"))), this.clearEl; }, r.prototype.inputValueChanged = function(t) { t && t.stopPropagation(), this.emit || this.model.upValue(t.target.value); }, r.prototype.onValueChange = function(t, e, n) { this.setValue(this.model.getFullValue(void 0, { skipImportant: !0 })), this.updateStatus(); }, r.prototype.setValue = function(t) { var e = this.model, n = (0, S.isUndefined)(t) || t === "" ? e.getDefaultValue() : t; if (this.update) return this.__update(n); this.__setValueInput(n); }, r.prototype.__setValueInput = function(t) { var e = this.getInputEl(); e && (e.value = t); }, r.prototype.getInputEl = function() { return this.input || (this.input = this.el.querySelector("input")), this.input; }, r.prototype.updateVisibility = function() { this.el.style.display = this.model.isVisible() ? "" : "none"; }, r.prototype.clearCached = function() { delete this.clearEl, delete this.input, delete this.$input; }, r.prototype.__unset = function() { var t = this.unset && this.unset.bind(this); t && t(this._getClbOpts()); }, r.prototype.__update = function(t) { var e = this.update && this.update.bind(this); e && e(Ju(Ju({}, this._getClbOpts()), { value: t })); }, r.prototype.__change = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n = this.emit && this.emit.bind(this); n && n.apply(void 0, Wg([this._getClbOpts()], t, !1)); }, r.prototype.__updateStyle = function(t, e) { e === void 0 && (e = {}); var n = e.complete, i = e.partial, l = (Bg(e, ["complete", "partial"]), this.model), f = n !== !1 && i !== !0; (0, H.isObject)(t) ? l.__upTargetsStyle(t, { avoidStore: !f }) : l.upValue(t, { partial: !f }); }, r.prototype._getClbOpts = function() { var t = this, e = t.model; return { el: t.el, createdEl: t.createdEl, property: e, props: e.attributes, change: this.__change, updateStyle: this.__updateStyle }; }, r.prototype.render = function() { this.clearCached(); var t = this, e = t.pfx, n = t.model, i = t.el, l = t.$el, f = n.getName(), d = n.getType(), v = n.get("className") || "", h = "".concat(e, "property"), w = d === "number" ? "".concat(e).concat(d, " ").concat(e, "integer") : "".concat(e).concat(d); this.createdEl && this.__destroyFn(this._getClbOpts()), l.empty().append(this.template(n)), l.find("[data-sm-label]").append(this.templateLabel(n)); var C = this.create && this.create.bind(this); this.createdEl = C && C(this._getClbOpts()), l.find("[data-sm-fields]").append(this.createdEl || this.templateInput(n)), i.className = "".concat(h, " ").concat(w, " ").concat(h, "__").concat(f, " ").concat(v).trim(), i.className += n.isFull() ? " ".concat(h, "--full") : ""; var L = this.onRender && this.onRender.bind(this); return L && L(), this.setValue(n.getValue()), this; }, r.prototype.onRender = function() { }, r; }(k.G7); const Ii = $g; var qg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Gg = function(a) { function r(t) { var e = a.call(this, t) || this; e.config = t.config || {}, e.pfx = e.config.stylePrefix || "", e.properties = [], e.parent = t.parent; var n = e.collection; return e.listenTo(n, "add", e.addTo), e.listenTo(n, "reset", e.render), e; } return qg(r, a), r.prototype.addTo = function(t, e, n) { this.add(t, null, n); }, r.prototype.add = function(t, e, n) { n === void 0 && (n = {}); var i = this.parent, l = this.config, f = e || this.el, d = new t.typeView({ model: t, config: l }); i && (d.parent = i), d.render(); var v = d.el; this.properties.push(d), (0, Ne.$Q)(f, v, n.at); }, r.prototype.remove = function() { return k.G7.prototype.remove.apply(this, arguments), this.clearItems(), this; }, r.prototype.clearItems = function() { this.properties.forEach(function(t) { return t.remove(); }), this.properties = []; }, r.prototype.render = function() { var t = this, e = this.$el, n = this.pfx; this.clearItems(); var i = document.createDocumentFragment(); return this.collection.forEach(function(l) { return t.add(l, i); }), e.empty(), e.append(i), e.attr("class", "".concat(n, "properties")), this; }, r; }(k.G7); const _f = Gg; var Kg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Zu = function() { return Zu = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Zu.apply(this, arguments); }; const Oc = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Kg(r, a), r.prototype.templateInput = function() { var t = this.pfx; return `
`); }, r.prototype.remove = function() { var t; return (t = this.props) === null || t === void 0 || t.remove(), Ii.prototype.remove.apply(this, arguments), this; }, r.prototype.onValueChange = function() { }, r.prototype.onRender = function() { var t = this.pfx, e = this.model, n = e.get("properties"); if (n.length && !this.props) { var i = e.isDetached(), l = new _f({ config: Zu(Zu({}, this.config), { highlightComputed: i, highlightChanged: i }), collection: n, parent: this }); l.render(), this.$el.find("#".concat(t, "input-holder")).append(l.el), this.props = l; } }, r.prototype.clearCached = function() { Ii.prototype.clearCached.apply(this, arguments), delete this.props; }, r; }(Ii); var Yg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Xg = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Yg(r, a), r.prototype.events = function() { return { click: "select", "click [data-close-layer]": "removeItem", "mousedown [data-move-layer]": "initSorter", "touchstart [data-move-layer]": "initSorter" }; }, r.prototype.template = function() { var t = this, e = t.pfx, n = t.ppfx, i = t.em, l = i == null ? void 0 : i.getConfig().icons, f = (l == null ? void 0 : l.close) || "", d = (l == null ? void 0 : l.move) || ""; return `
`).concat(d, `
`).concat(f, `
`); }, r.prototype.initialize = function(t) { t === void 0 && (t = {}); var e = this.model, n = t.config || {}; this.em = n.em, this.config = n, this.sorter = t.sorter, this.pfx = n.stylePrefix || "", this.ppfx = n.pStylePrefix || "", this.propertyView = t.propertyView; var i = this.propertyView.model; this.listenTo(e, "destroy remove", this.remove), this.listenTo(e, "change:values", this.updateLabel), this.listenTo(i, "change:selectedLayer", this.updateVisibility), e.view = this, e.set({ droppable: 0, draggable: 1 }), this.$el.data("model", e); }, r.prototype.initSorter = function() { var t; (t = this.sorter) === null || t === void 0 || t.startSort(this.el); }, r.prototype.removeItem = function(t) { t && t.stopPropagation(), this.model.remove(); }, r.prototype.select = function() { this.model.select(); }, r.prototype.getPropertiesWrapper = function() { return this.propsWrapEl || (this.propsWrapEl = this.el.querySelector("[data-properties]")), this.propsWrapEl; }, r.prototype.getPreviewEl = function() { return this.previewEl || (this.previewEl = this.el.querySelector("[data-preview]")), this.previewEl; }, r.prototype.getLabelEl = function() { return this.labelEl || (this.labelEl = this.el.querySelector("[data-label]")), this.labelEl; }, r.prototype.updateLabel = function() { var t = this.model, e = t.getLabel(); if (this.getLabelEl().innerHTML = e, t.hasPreview()) { var n = this.getPreviewEl(), i = t.getStylePreview({ number: { min: -3, max: 3 } }), l = (0, S.keys)(i).map(function(f) { return "".concat(f, ":").concat(i[f]); }).join(";"); n.setAttribute("style", l); } }, r.prototype.updateVisibility = function() { var t, e = this, n = e.pfx, i = e.model, l = e.propertyView, f = this.getPropertiesWrapper(), d = i.isSelected(); f.style.display = d ? "" : "none", this.$el[d ? "addClass" : "removeClass"]("".concat(n, "active")), d && f.appendChild((t = l.props) === null || t === void 0 ? void 0 : t.el); }, r.prototype.render = function() { var t = this, e = t.el, n = t.pfx, i = t.model; return e.innerHTML = this.template(), e.className = "".concat(n, "layer"), i.hasPreview() && (e.querySelector("[data-preview-box]").style.display = ""), this.updateLabel(), this.updateVisibility(), this; }, r; }(k.G7); const Jg = Xg; var Zg = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Qg = function(a) { function r(t) { var e = a.call(this, t) || this, n = e.collection, i = t.config || {}, l = i.em, f = i.stylePrefix || "", d = i.pStylePrefix || ""; e.config = i, e.pfx = f, e.ppfx = d, e.propertyView = t.propertyView, e.className = "".concat(f, "layers ").concat(d, "field"), e.listenTo(n, "add", e.addTo), e.listenTo(n, "reset", e.reset), e.items = []; var v = l == null ? void 0 : l.Utils; return e.sorter = v ? new v.Sorter({ container: e.el, ignoreViewChildren: 1, containerSel: ".".concat(f, "layers"), itemSel: ".".concat(f, "layer"), pfx: i.pStylePrefix }) : "", n.view = e, e.$el.data("model", n), e.$el.data("collection", n), e; } return Zg(r, a), r.prototype.addTo = function(t) { var e = this.collection.indexOf(t); this.addToCollection(t, null, e); }, r.prototype.addToCollection = function(t, e, n) { var i = e || null, l = this, f = l.propertyView, d = l.config, v = l.sorter, h = l.$el, w = new Jg({ model: t, config: d, sorter: v, propertyView: f }), C = w.render().el; if (this.items.push(w), i) i.appendChild(C); else if (n !== void 0) { var L = "before"; h.children().length === n && (n--, L = "after"), n < 0 ? h.append(C) : h.children().eq(n)[L](C); } else h.append(C); return C; }, r.prototype.reset = function(t, e) { this.clearItems(), this.render(); }, r.prototype.remove = function() { return this.clearItems(), k.G7.prototype.remove.apply(this, arguments), this; }, r.prototype.clearItems = function() { this.items.forEach(function(t) { return t.remove(); }), this.items = []; }, r.prototype.render = function() { var t = this, e = this.$el, n = this.sorter, i = document.createDocumentFragment(); return e.empty(), this.collection.forEach(function(l) { return t.addToCollection(l, i); }), e.append(i), e.attr("class", this.className), n && (n.plh = null), this; }, r; }(k.G7); const tv = Qg; var ev = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), xl = function() { return xl = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, xl.apply(this, arguments); }, nv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return ev(r, a), r.prototype.events = function() { return xl(xl({}, Oc.prototype.events()), { "click [data-add-layer]": "addLayer", change: "" }); }, r.prototype.templateInput = function() { var t = this.pfx, e = this.em, n = e == null ? void 0 : e.getConfig().icons, i = (n == null ? void 0 : n.plus) || "+"; return `
`); }, r.prototype.init = function() { var t = this.model; this.listenTo(t.__getLayers(), "change reset", this.updateStatus); }, r.prototype.addLayer = function() { this.model.addLayer({}, { at: 0 }); }, r.prototype.setValue = function() { }, r.prototype.remove = function() { var t; return (t = this.layersView) === null || t === void 0 || t.remove(), Oc.prototype.remove.apply(this, arguments), this; }, r.prototype.clearCached = function() { Oc.prototype.clearCached.apply(this, arguments), delete this.layersView; }, r.prototype.onRender = function() { var t = this, e = t.model, n = t.el, i = t.config, l = e.get("properties"); if (l.length && !this.props) { var f = new _f({ config: xl(xl({}, i), { highlightComputed: !1, highlightChanged: !1 }), collection: l, parent: this }); f.render(); var d = new tv({ collection: e.__getLayers(), config: i, propertyView: this }); d.render(), n.querySelector("[data-layers-wrapper]").appendChild(d.el), this.props = f, this.layersView = d; } }, r; }(Oc); const rv = nv; var ov = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Qu = function() { return Qu = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Qu.apply(this, arguments); }; const iv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return ov(r, a), r.prototype.events = function() { return Qu(Qu({}, Ii.prototype.events()), { "click [data-clear-asset]": "clear", "click [data-open-assets]": "openAssetManager" }); }, r.prototype.templateInput = function() { var t, e = this.pfx, n = this.em, i = (t = this.em) === null || t === void 0 ? void 0 : t.getConfig().icons, l = i == null ? void 0 : i.close; return `
').concat(l, `
`); }, r.prototype.__setValueInput = function(t) { var e = this.model, n = this.el, i = e.getDefaultValue(), l = n.querySelector("[data-preview-box]"), f = n.querySelector("[data-preview]"); l.style.display = t && t !== i ? "" : "none", f.style.backgroundImage = t || e.getDefaultValue(); }, r.prototype.openAssetManager = function() { var t, e = this, n = (t = this.em) === null || t === void 0 ? void 0 : t.Assets; n == null || n.open({ select: function(i, l) { var f = (0, S.isString)(i) ? i : i.get("src"); e.model.upValue(f, { partial: !l }), l && n.close(); }, types: ["image"], accept: "image/*" }); }, r; }(Ii); var sv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const Fi = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return sv(r, a), r.prototype.templateInput = function(t) { return ""; }, r.prototype.init = function() { var t = this.model; this.listenTo(t, "change:unit", this.onValueChange), this.listenTo(t, "change:units", this.render); }, r.prototype.setValue = function(t) { }, r.prototype.onRender = function() { var t = this, e = t.ppfx, n = t.model, i = t.el; if (!this.inputInst) { var l = n.input; l.ppfx = e, l.render(), i.querySelector(".".concat(e, "fields")).appendChild(l.el), this.input = l.inputEl.get(0), this.inputInst = l; } }, r.prototype.clearCached = function() { Ii.prototype.clearCached.apply(this, arguments), this.inputInst = null; }, r; }(Ii); var av = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const lv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return av(r, a), r.prototype.setValue = function(t) { var e; (e = this.inputInst) === null || e === void 0 || e.setValue(t, { fromTarget: 1, def: this.model.getDefaultValue() }); }, r.prototype.remove = function() { var t = this; Fi.prototype.remove.apply(this, arguments); var e = this.inputInst; return e && e.remove && e.remove(), ["inputInst", "$color"].forEach(function(n) { return t[n] = null; }), this; }, r.prototype.__handleChange = function(t, e) { this.model.upValue(t, { partial: e }); }, r.prototype.onRender = function() { var t; if (!this.inputInst) { this.__handleChange = this.__handleChange.bind(this); var e = this, n = e.ppfx, i = e.model, l = e.em, f = e.el, d = new uc({ target: l, model: i, ppfx: n, onChange: this.__handleChange }).render(); f.querySelector(".".concat(n, "fields")).appendChild(d.el), this.input = (t = d.inputEl) === null || t === void 0 ? void 0 : t.get(0), this.inputInst = d; } }, r; }(Fi); var cv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), tp = function() { return tp = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, tp.apply(this, arguments); }, yd = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }; const xf = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return cv(r, a), r.prototype.defaults = function() { return tp(tp({}, On.getDefaults()), { options: [], full: 0 }); }, r.prototype.getOptions = function() { var t = this.attributes, e = t.options, n = t.list; return (e && e.length ? e : n) || []; }, r.prototype.getOption = function(t) { var e = this, n = (0, H.isDef)(t) ? t : this.getValue(); return this.getOptions().filter(function(i) { return e.getOptionId(i) === n; })[0] || null; }, r.prototype.setOptions = function(t) { return t === void 0 && (t = []), this.set("options", t), this; }, r.prototype.addOption = function(t) { if (t) { var e = this.getOptions(); this.setOptions(yd(yd([], e, !0), [t], !1)); } return this; }, r.prototype.getOptionId = function(t) { return (0, H.isDef)(t.id) ? t.id : t.value; }, r.prototype.getOptionLabel = function(t, e) { var n; e === void 0 && (e = {}); var i = e.locale, l = i === void 0 || i, f = ((0, S.isString)(t) ? this.getOption(t) : t) || {}, d = this.getOptionId(f), v = f.label || f.name || d, h = e.property || this.getId(); return l && ((n = this.em) === null || n === void 0 ? void 0 : n.t("styleManager.options.".concat(h, ".").concat(d))) || v; }, r.prototype.initialize = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; On.prototype.initialize.apply(this, t), this.listenTo(this, "change:options", this.__onOptionChange); }, r.prototype.__onOptionChange = function() { this.set("list", this.get("options")); }, r; }(On); var uv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const bd = function(a) { function r(t) { var e = a.call(this, t) || this; return e.listenTo(e.model, "change:options", e.updateOptions), e; } return uv(r, a), r.prototype.templateInput = function() { var t = this.pfx, e = this.ppfx; return `
`); }, r.prototype.updateOptions = function() { delete this.input, this.onRender(); }, r.prototype.onRender = function() { var t = this.pfx, e = this.model, n = e.getOptions(); if (!this.input) { var i = []; n.forEach(function(f) { var d = e.getOptionId(f), v = e.getOptionLabel(d), h = f.style ? f.style.replace(/"/g, """) : "", w = h ? 'style="'.concat(h, '"') : "", C = d.replace(/"/g, """); i.push('")); }); var l = this.el.querySelector("#".concat(t, "input-holder")); l.innerHTML = ""), this.input = l.firstChild; } }, r.prototype.__setValueInput = function(t) { var e = this.model, n = this.getInputEl(), i = e.getOptions()[0], l = i ? e.getOptionId(i) : ""; n && (n.value = t || l); }, r; }(Ii); var pv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ep = function() { return ep = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ep.apply(this, arguments); }; const fv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return pv(r, a), r.prototype.defaults = function() { return ep(ep({}, xf.getDefaults()), { full: 1 }); }, r; }(xf); var dv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(); const hv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return dv(r, a), r.prototype.templateInput = function() { var t = this.ppfx; return '
'); }, r.prototype.onRender = function() { var t = this.pfx, e = this.ppfx, n = this.model, i = "".concat(e, "radio-item-label"), l = n.getName(), f = n.getOptions(), d = "".concat(t, "radio ").concat(t, "radio-").concat(l), v = n.cid; if (!this.input) { var h = []; f.forEach(function(C) { var L = C.className ? "".concat(C.className, " ").concat(t, "icon ").concat(i) : "", F = n.getOptionId(C), q = "".concat(l, "-").concat(F, "-").concat(v), et = L ? "" : n.getOptionLabel(F), X = C.title ? 'title="'.concat(C.title, '"') : "", At = n.getValue() === F ? "checked" : ""; h.push(`
`)); }); var w = this.el.querySelector(".".concat(e, "field")); w.innerHTML = '
').concat(h.join(""), "
"), this.input = w.firstChild; } }, r.prototype.__setValueInput = function(t) { var e, n = this.model, i = t || n.getDefaultValue(), l = (e = this.getInputEl()) === null || e === void 0 ? void 0 : e.querySelector('[value="'.concat(i, '"]')); l && (l.checked = !0); }, r; }(bd); var gv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), _a = function() { return _a = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, _a.apply(this, arguments); }; const np = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return gv(r, a), r.prototype.defaults = function() { return _a(_a({}, On.getDefaults()), { units: [], unit: "", min: "", max: "", step: 1 }); }, r.prototype.getUnits = function() { return this.get("units") || []; }, r.prototype.getUnit = function() { return this.get("unit"); }, r.prototype.getMin = function() { return this.get("min"); }, r.prototype.getMax = function() { return this.get("max"); }, r.prototype.getStep = function() { return this.get("step"); }, r.prototype.upUnit = function(t, e) { return e === void 0 && (e = {}), this._up({ unit: t }, e); }, r.prototype.initialize = function(t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}), On.callParentInit(On, this, t, e); var n = this.get("unit"), i = this.getUnits(); this.input = (0, H.hasWin)() ? new Du({ model: this }) : void 0, i.length && !n && this.set("unit", i[0], { silent: !0 }), On.callInit(this, t, e); }, r.prototype.__getClearProps = function() { return _a(_a({}, On.prototype.__getClearProps()), { unit: "" }); }, r.prototype.parseValue = function(t, e) { e === void 0 && (e = {}); var n = On.prototype.parseValue.apply(this, arguments), i = this.input.validateInputValue(n.value, _a({ deepCheck: 1 }, e)), l = i.value, f = i.unit; return n.value = l, n.unit = f, n; }, r.prototype.getFullValue = function() { var t = this.get("value"), e = this.get("unit"), n = (0, S.isUndefined)(t) ? "" : "".concat(t), i = !(0, S.isUndefined)(e) && n ? e : "", l = "".concat(n).concat(i); return On.prototype.getFullValue.apply(this, [l]); }, r; }(On); var vv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), rp = function() { return rp = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, rp.apply(this, arguments); }; const mv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return vv(r, a), r.prototype.defaults = function() { return rp(rp({}, np.getDefaults()), { showInput: 1 }); }, r; }(np); var yv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), op = function() { return op = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, op.apply(this, arguments); }; const bv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return yv(r, a), r.prototype.events = function() { return op(op({}, Fi.prototype.events()), { "change [type=range]": "inputValueChanged", "input [type=range]": "inputValueChangedSoft", change: "" }); }, r.prototype.templateInput = function(t) { var e = this.ppfx; return `
`); }, r.prototype.getSliderEl = function() { return this.slider || (this.slider = this.el.querySelector("input[type=range]")), this.slider; }, r.prototype.inputValueChanged = function(t) { t.stopPropagation(), this.model.upValue(this.getSliderEl().value); }, r.prototype.inputValueChangedSoft = function(t) { t.stopPropagation(), this.model.upValue(this.getSliderEl().value, { partial: !0 }); }, r.prototype.setValue = function(t) { var e = this.model, n = e.parseValue(t); this.getSliderEl().value = t === "" ? e.getDefaultValue() : parseFloat(n.value), Fi.prototype.setValue.apply(this, arguments); }, r.prototype.onRender = function() { Fi.prototype.onRender.apply(this, arguments), this.model.get("showInput") || (this.inputInst.el.style.display = "none"); }, r.prototype.clearCached = function() { Fi.prototype.clearCached.apply(this, arguments), delete this.slider; }, r; }(Fi), Cf = k.FE.extend(Ct).extend({ extendViewApi: 1, init: function() { var a = this.opts, r = this.em, t = a.module || (r == null ? void 0 : r.get("StyleManager")); t && (t.__listenAdd(this, t.events.propertyAdd), t.__listenRemove(this, t.events.propertyRemove)); }, types: [{ id: "stack", model: zg, view: rv, isType: function(a) { if (a && a.type == "stack") return a; } }, { id: "composite", model: _l, view: Oc, isType: function(a) { if (a && a.type == "composite") return a; } }, { id: "file", model: On, view: iv, isType: function(a) { if (a && a.type == "file") return a; } }, { id: "color", model: On, view: lv, isType: function(a) { if (a && a.type == "color") return a; } }, { id: "select", model: xf, view: bd, isType: function(a) { if (a && a.type == "select") return a; } }, { id: "radio", model: fv, view: hv, isType: function(a) { if (a && a.type == "radio") return a; } }, { id: "slider", model: mv, view: bv, isType: function(a) { if (a && a.type == "slider") return a; } }, { id: "integer", model: np, view: Fi, isType: function(a) { if (a && a.type == "integer") return a; } }, { id: "number", model: np, view: Fi, isType: function(a) { if (a && a.type == "number") return a; } }, { id: "base", model: On, view: Ii, isType: function(a) { return a.type = "base", a; } }] }); var wv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), ip = function() { return ip = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, ip.apply(this, arguments); }, _v = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, xv = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }; const wd = function(a) { function r(t, e) { e === void 0 && (e = {}); var n = a.call(this, t) || this, i = e.em; n.em = i; var l = t || {}, f = n.buildProperties(l.buildProps), d = n.get("name") || "", v = []; !n.get("id") && n.set("id", d.replace(/ /g, "_").toLowerCase()), v = (v = f ? n.extendProperties(f) : n.get("properties").map(function(w) { return (0, S.isString)(w) ? n.buildProperties(w)[0] : w; }).filter(Boolean)).map(function(w) { return n.checkExtend(w); }); var h = new Cf(v, { em: i }); return h.sector = n, n.set("properties", h), n; } return wv(r, a), r.prototype.defaults = function() { return { id: "", name: "", open: !0, visible: !0, extendBuilded: !0, properties: [] }; }, Object.defineProperty(r.prototype, "properties", { get: function() { return this.get("properties"); }, enumerable: !1, configurable: !0 }), r.prototype.getId = function() { return this.get("id"); }, r.prototype.getName = function() { var t, e = this.getId(); return ((t = this.em) === null || t === void 0 ? void 0 : t.t("styleManager.sectors.".concat(e))) || this.get("name"); }, r.prototype.setName = function(t) { return this.set("name", t); }, r.prototype.isOpen = function() { return !!this.get("open"); }, r.prototype.setOpen = function(t) { return this.set("open", t); }, r.prototype.isVisible = function() { return !!this.get("visible"); }, r.prototype.getProperties = function(t) { t === void 0 && (t = {}); var e = this.get("properties"); return (e.models ? xv([], e.models, !0) : e).filter(function(n) { var i = !0; return t.withValue && (i = n.hasValue({ noParent: !0 })), t.withParentValue && (i = !n.hasValue({ noParent: !0 }) && n.hasValue()), i; }); }, r.prototype.getProperty = function(t) { return this.getProperties().filter(function(e) { return e.get("id") === t; })[0] || void 0; }, r.prototype.addProperty = function(t, e) { return this.get("properties").add(this.checkExtend(t), e); }, r.prototype.extendProperties = function(t, e, n) { n === void 0 && (n = !1); for (var i = t.length, l = e || this.get("properties"), f = this.get("extendBuilded"), d = [], v = 0, h = l.length; v < h; v++) { for (var w = l[v], C = 0, L = 0; L < i; L++) { var F = t[L]; if (!(w.property != F.property && w.id != F.property)) { var q = w.properties; q && q.length && (w.properties = this.extendProperties(F.properties || [], q, 1)), t[L] = f ? (0, S.extend)(F, w) : w, d[L] = t[L], C = 1; } } C || (t.push(w), d.push(w)); } return n ? d.filter(function(et) { return et; }) : t; }, r.prototype.checkExtend = function(t) { var e = ((0, S.isString)(t) ? { extend: t } : t) || {}, n = e.extend, i = _v(e, ["extend"]); return n ? ip(ip({}, this.buildProperties([n])[0] || {}), i) : t; }, r.prototype.buildProperties = function(t) { var e, n = t || []; if (!n.length) return []; var i = (e = this.em) === null || e === void 0 ? void 0 : e.get("StyleManager").builtIn; return i == null ? void 0 : i.build(n); }, r; }(k.Hn); var Cv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), sp = function() { return sp = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, sp.apply(this, arguments); }; const Sv = function(a) { function r() { return a !== null && a.apply(this, arguments) || this; } return Cv(r, a), r.prototype.initialize = function(t, e) { e === void 0 && (e = {}); var n = e.module, i = e.em; this.em = i, this.module = n, this.listenTo(this, "reset", this.onReset); }, r.prototype.model = function(t, e) { e === void 0 && (e = {}); var n = e.collection.em; return new wd(t, sp(sp({}, e), { em: n })); }, r.prototype.onReset = function(t, e) { e === void 0 && (e = {}), (e.previousModels || []).forEach(function(n) { return n.get("properties").reset(); }); }, r; }(k.FE); var Os = function() { return Os = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Os.apply(this, arguments); }, Ov = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, xa = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, lr = function(a) { return a.map(function(r) { return { id: r }; }); }, Tv = function() { function a() { this.props = {}, this.typeNumber = "number", this.typeColor = "color", this.typeRadio = "radio", this.typeSelect = "select", this.typeFile = "file", this.typeSlider = "slider", this.typeComposite = "composite", this.typeStack = "stack", this.unitsSize = ["px", "%", "em", "rem", "vh", "vw"], this.unitsSizeNoPerc = ["px", "em", "rem", "vh", "vw"], this.unitsTime = ["s", "ms"], this.unitsAngle = ["deg", "rad", "grad"], this.fixedValues = ["initial", "inherit", "auto"]; var r = ", sans-serif", t = ["flex-start", "flex-end", "center"], e = xa(xa([], t, !0), ["baseline", "stretch"], !1); this.optsBgSize = lr(["auto", "cover", "contain"]), this.optsBgAttach = lr(["scroll", "fixed", "local"]), this.optsBgRepeat = lr(["repeat", "repeat-x", "repeat-y", "no-repeat"]), this.optsWrap = lr(["nowrap", "wrap", "wrap-reverse"]), this.optsOverflow = lr(["visible", "hidden", "scroll", "auto"]), this.optsDir = lr(["row", "row-reverse", "column", "column-reverse"]), this.opstDisplay = lr(["block", "inline", "inline-block", "flex", "none"]), this.optsTransitFn = lr(["linear", "ease", "ease-in", "ease-out", "ease-in-out"]), this.optsCursor = lr(["auto", "pointer", "copy", "crosshair", "grab", "grabbing", "help", "move", "text"]), this.optsFloat = lr(["none", "left", "right"]), this.optsPos = lr(["static", "relative", "absolute", "fixed"]), this.optsTextAlign = lr(["left", "center", "right", "justify"]), this.optsFlexAlign = lr(e), this.optsJustCont = lr(xa(xa([], t, !0), ["space-between", "space-around", "space-evenly"], !1)), this.optsAlignCont = lr(xa(xa([], t, !0), ["space-between", "space-around", "stretch"], !1)), this.optsAlignSelf = lr(xa(["auto"], e, !0)), this.optsTransitProp = lr(["all", "width", "height", "background-color", "transform", "box-shadow", "opacity"]), this.optsBorderStyle = lr(["none", "solid", "dotted", "dashed", "double", "groove", "ridge", "inset", "outset"]), this.optsBgPos = lr(["left top", "left center", "left bottom", "right top", "right center", "right bottom", "center top", "center center", "center bottom"]), this.optsWeight = [{ id: "100", label: "Thin" }, { id: "200", label: "Extra-Light" }, { id: "300", label: "Light" }, { id: "400", label: "Normal" }, { id: "500", label: "Medium" }, { id: "600", label: "Semi-Bold" }, { id: "700", label: "Bold" }, { id: "800", label: "Extra-Bold" }, { id: "900", label: "Ultra-Bold" }], this.optsShadowType = [{ id: "", label: "Outside" }, { id: "inset", label: "Inside" }], this.optsFonts = ["Arial, Helvetica" + r, "Arial Black, Gadget" + r, "Brush Script MT" + r, "Comic Sans MS, cursive" + r, "Courier New, Courier, monospace", "Georgia, serif", "Helvetica" + r, "Impact, Charcoal" + r, "Lucida Sans Unicode, Lucida Grande" + r, "Tahoma, Geneva" + r, "Times New Roman, Times, serif", "Trebuchet MS, Helvetica" + r, "Verdana, Geneva" + r].map(function(n) { return { id: n, label: n.split(",")[0] }; }), this.fixedFontSizes = ["medium", "xx-small", "x-small", "small", "large", "x-large", "xx-large", "smaller", "larger", "length", "initial", "inherit"], this.fixedLetSpace = ["normal", "initial", "inherit"], this.requireFlex = { display: ["flex"] }, this.init(); } return a.prototype.__sub = function(r) { var t = this; return function() { return r.map(function(e) { if ((0, S.isString)(e)) return t.get(e); var n = e.extend, i = Ov(e, ["extend"]); return Os(Os({}, t.get(n)), i); }); }; }, a.prototype.init = function() { var r = this, t = this, e = t.fixedValues, n = t.requireFlex, i = t.typeNumber; this.props = {}; var l = [["text-shadow-h", { type: i, default: "0", units: this.unitsSizeNoPerc }], ["top", { default: "auto", units: this.unitsSize, fixedValues: e }, "text-shadow-h"], ["right", {}, "top"], ["bottom", {}, "top"], ["left", {}, "top"], ["margin-top", { default: "0" }, "top"], ["margin-right", {}, "margin-top"], ["margin-bottom", {}, "margin-top"], ["margin-left", {}, "margin-top"], ["padding-top", { min: 0 }, "margin-top"], ["padding-right", {}, "padding-top"], ["padding-bottom", {}, "padding-top"], ["padding-left", {}, "padding-top"], ["width", { min: 0 }, "top"], ["min-width", {}, "width"], ["max-width", {}, "width"], ["height", {}, "width"], ["min-height", {}, "width"], ["max-height", {}, "width"], ["flex-basis", { requiresParent: n }, "width"], ["font-size", { default: "medium", fixedValues: this.fixedFontSizes }, "width"], ["letter-spacing", { default: "normal", fixedValues: this.fixedLetSpace }, "top"], ["line-height", {}, "letter-spacing"], ["text-shadow-v", {}, "text-shadow-h"], ["text-shadow-blur", { min: 0 }, "text-shadow-h"], ["border-radius-c", { property: "border-radius", fixedValues: void 0 }, "padding-top"], ["border-top-left-radius", {}, "border-radius-c"], ["border-top-right-radius", {}, "border-radius-c"], ["border-bottom-left-radius", {}, "border-radius-c"], ["border-bottom-right-radius", {}, "border-radius-c"], ["border-width", { units: this.unitsSizeNoPerc }, "border-radius-c"], ["box-shadow-h", {}, "text-shadow-h"], ["box-shadow-v", {}, "text-shadow-h"], ["box-shadow-blur", { default: "5px" }, "text-shadow-blur"], ["box-shadow-spread", {}, "text-shadow-h"], ["transition-duration", { default: "2s", units: this.unitsTime }, "border-radius-c"], ["perspective", {}, "border-radius-c"], ["order", { type: i, default: "0", requiresParent: n }], ["flex-grow", {}, "order"], ["flex-shrink", { default: "1" }, "order"], ["float", { type: this.typeRadio, default: "none", options: this.optsFloat }], ["position", { default: "static", options: this.optsPos }, "float"], ["text-align", { default: "left", options: this.optsTextAlign }, "float"], ["color", { type: this.typeColor, default: "black" }], ["text-shadow-color", {}, "color"], ["border-color", {}, "color"], ["box-shadow-color", {}, "color"], ["background-color", { default: "none" }, "color"], ["background-image", { type: this.typeFile, functionName: "url", default: "none", full: !0 }], ["opacity", { type: this.typeSlider, default: "1", min: 0, max: 1, step: 0.01 }], ["display", { type: this.typeSelect, default: "block", options: this.opstDisplay }], ["flex-direction", { default: "row", options: this.optsDir, requires: n }, "display"], ["flex-wrap", { default: "nowrap", options: this.optsWrap }, "flex-direction"], ["justify-content", { default: "flex-start", options: this.optsJustCont }, "flex-wrap"], ["align-items", { default: "stretch", options: this.optsFlexAlign }, "flex-wrap"], ["align-content", { options: this.optsAlignCont }, "align-items"], ["align-self", { default: "auto", options: this.optsAlignSelf, requiresParent: n }, "display"], ["font-family", { default: "Arial, Helvetica, sans-serif", options: this.optsFonts }, "display"], ["font-weight", { default: "400", options: this.optsWeight }, "display"], ["border-style", { default: "solid", options: this.optsBorderStyle }, "display"], ["box-shadow-type", { default: "", options: this.optsShadowType }, "display"], ["background-repeat", { default: "repeat", options: this.optsBgRepeat }, "display"], ["background-position", { default: "left top", options: this.optsBgPos }, "display"], ["background-attachment", { default: "scroll", options: this.optsBgAttach }, "display"], ["background-size", { default: "auto", options: this.optsBgSize }, "display"], ["transition-property", { default: "width", options: this.optsTransitProp }, "display"], ["transition-timing-function", { default: "ease", options: this.optsTransitFn }, "display"], ["cursor", { default: "auto", options: this.optsCursor }, "display"], ["overflow", { default: "visible", options: this.optsOverflow }, "display"], ["overflow-x", {}, "overflow"], ["overflow-y", {}, "overflow"], ["margin", { type: this.typeComposite, properties: this.__sub([{ extend: "margin-top", id: "margin-top-sub" }, { extend: "margin-right", id: "margin-right-sub" }, { extend: "margin-bottom", id: "margin-bottom-sub" }, { extend: "margin-left", id: "margin-left-sub" }]) }], ["padding", { properties: this.__sub([{ extend: "padding-top", id: "padding-top-sub" }, { extend: "padding-right", id: "padding-right-sub" }, { extend: "padding-bottom", id: "padding-bottom-sub" }, { extend: "padding-left", id: "padding-left-sub" }]) }, "margin"], ["border", { properties: this.__sub([{ extend: "border-width", id: "border-width-sub" }, { extend: "border-style", id: "border-style-sub" }, { extend: "border-color", id: "border-color-sub" }]) }, "margin"], ["border-radius", { properties: this.__sub([{ extend: "border-top-left-radius", id: "border-top-left-radius-sub" }, { extend: "border-top-right-radius", id: "border-top-right-radius-sub" }, { extend: "border-bottom-right-radius", id: "border-bottom-right-radius-sub" }, { extend: "border-bottom-left-radius", id: "border-bottom-left-radius-sub" }]) }, "margin"], ["transition", { type: this.typeStack, properties: this.__sub([{ extend: "transition-property", id: "transition-property-sub" }, { extend: "transition-duration", id: "transition-duration-sub" }, { extend: "transition-timing-function", id: "transition-timing-function-sub" }]) }], ["box-shadow", { preview: !0, layerLabel: function(f, d) { var v = d.values, h = v["box-shadow-h"], w = v["box-shadow-v"], C = v["box-shadow-blur"], L = v["box-shadow-spread"]; return "".concat(h, " ").concat(w, " ").concat(C, " ").concat(L); }, properties: this.__sub(["box-shadow-h", "box-shadow-v", "box-shadow-blur", "box-shadow-spread", "box-shadow-color", "box-shadow-type"]) }, "transition"], ["text-shadow", { default: "none", layerLabel: function(f, d) { var v = d.values, h = v["text-shadow-h"], w = v["text-shadow-v"], C = v["text-shadow-blur"]; return "".concat(h, " ").concat(w, " ").concat(C); }, properties: this.__sub(["text-shadow-h", "text-shadow-v", "text-shadow-blur", "text-shadow-color"]) }, "box-shadow"], ["background", { detached: !0, layerLabel: function(f, d) { var v = d.values; return [v["background-repeat-sub"] || "", v["background-position-sub"] || "", v["background-attachment-sub"] || "", v["background-size-sub"] || ""].join(" "); }, properties: this.__sub([{ extend: "background-image", id: "background-image-sub" }, { extend: "background-repeat", id: "background-repeat-sub" }, { extend: "background-position", id: "background-position-sub" }, { extend: "background-attachment", id: "background-attachment-sub" }, { extend: "background-size", id: "background-size-sub" }]) }, "box-shadow"], ["transform", { type: "stack", layerSeparator: " ", fromStyle: function(f, d) { var v = d.property, h = f[d.name] || "", w = v.getLayerSeparator(); return h ? h.split(w).map(function(C) { var L = v.__parseFn(C); return { "transform-type": L.name, "transform-value": L.value }; }) : []; }, toStyle: function(f, d) { var v; return (v = {})[d.name] = "".concat(f["transform-type"], "(").concat(f["transform-value"], ")"), v; }, properties: [{ property: "transform-type", name: "Type", type: this.typeSelect, default: "rotateZ", full: !0, options: [{ id: "scaleX", propValue: { units: [""], step: 0.01 } }, { id: "scaleY", propValue: { units: [""], step: 0.01 } }, { id: "scaleZ", propValue: { units: [""], step: 0.01 } }, { id: "rotateX", propValue: { units: this.unitsAngle, step: 1 } }, { id: "rotateY", propValue: { units: this.unitsAngle, step: 1 } }, { id: "rotateZ", propValue: { units: this.unitsAngle, step: 1 } }, { id: "translateX", propValue: { units: this.unitsSize, step: 1 } }, { id: "translateY", propValue: { units: this.unitsSize, step: 1 } }], onChange: function(f) { var d = f.property; if (f.to.value) { var v = d.getOption(), h = Os({}, v.propValue || {}), w = d.getParent().getProperty("transform-value"), C = w.getUnit(); (!C || (h == null ? void 0 : h.units.indexOf(C)) < 0) && (h.unit = (h == null ? void 0 : h.units[0]) || ""), w.up(h); } } }, { property: "transform-value", type: this.typeNumber, default: "0", full: !0 }] }]]; return l.forEach(function(f) { var d = f[0], v = f[1], h = f[2]; r.add(d, v || {}, { from: h }); }), this; }, a.prototype.add = function(r, t, e) { t === void 0 && (t = {}), e === void 0 && (e = {}); var n = e.from || "", i = this.props[n || r] || {}, l = Os(Os(Os({}, i), { property: r }), t); return l.properties && (0, S.isFunction)(l.properties) && (l.properties = l.properties()), this.props[r] = l, l; }, a.prototype.get = function(r) { return this.props[r]; }, a.prototype.build = function(r) { var t = this, e = []; return ((0, S.isString)(r) ? [r] : r).forEach(function(n) { e.push(t.get(n) || { property: n }); }), e; }, a; }(); const kv = Tv; var Pv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ev = function(a, r) { return Object.defineProperty ? Object.defineProperty(a, "raw", { value: r }) : a.raw = r, a; }, Av = function(a) { function r(t) { var e = a.call(this, t) || this, n = t.config || {}, i = e.model, l = n.em; return e.config = n, e.em = l, e.pfx = n.stylePrefix || "", e.listenTo(i, "destroy remove", e.remove), e.listenTo(i, "change:open", e.updateOpen), e.listenTo(i, "change:visible", e.updateVisibility), e; } return Pv(r, a), r.prototype.template = function(t) { var e, n = t.pfx, i = t.label, l = (e = this.em) === null || e === void 0 ? void 0 : e.getConfig().icons, f = (l == null ? void 0 : l.caret) || "", d = "".concat(n, "sector-"); return pt(_d || (_d = Ev([`
$', `
', `
`], [`
$', `
', `
`])), d, d, f, d, i); }, r.prototype.events = function() { return { "click [data-sector-title]": "toggle" }; }, r.prototype.updateOpen = function() { var t = this, e = t.$el, n = t.model, i = t.pfx, l = n.isOpen(); e[l ? "addClass" : "removeClass"]("".concat(i, "open")), this.getPropertiesEl().style.display = l ? "" : "none"; }, r.prototype.updateVisibility = function() { this.el.style.display = this.model.isVisible() ? "" : "none"; }, r.prototype.getPropertiesEl = function() { var t = this.$el, e = this.pfx; return t.find(".".concat(e, "properties")).get(0); }, r.prototype.toggle = function() { var t = this.model; t.setOpen(!t.get("open")); }, r.prototype.renderProperties = function() { var t = this.model, e = this.config, n = t.get("properties"); if (n) { var i = new _f({ collection: n, config: e }); this.$el.append(i.render().el); } }, r.prototype.render = function() { var t = this, e = t.pfx, n = t.model, i = t.$el, l = n.getId(), f = n.getName(); return i.html(this.template({ pfx: e, label: f })), this.renderProperties(), i.attr("class", "".concat(e, "sector ").concat(e, "sector__").concat(l, " no-select")), this.updateOpen(), this; }, r; }(k.G7); const jv = Av; var _d, Mv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Lv = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this, t) || this, n = t.module, i = t.config, l = e.collection; return e.pfx = (i == null ? void 0 : i.stylePrefix) || "", e.ppfx = (i == null ? void 0 : i.pStylePrefix) || "", e.config = i, e.module = n, e.listenTo(l, "add", e.addTo), e.listenTo(l, "reset", e.render), e; } return Mv(r, a), r.prototype.remove = function() { var t = this; return k.G7.prototype.remove.apply(this, arguments), ["config", "module", "em"].forEach(function(e) { return t[e] = {}; }), this; }, r.prototype.addTo = function(t, e, n) { n === void 0 && (n = {}), this.addToCollection(t, null, n); }, r.prototype.addToCollection = function(t, e, n) { n === void 0 && (n = {}); var i = this.config, l = this.el, f = e || l, d = new jv({ model: t, config: i }).render().el; return (0, Ne.$Q)(f, d, n.at), d; }, r.prototype.render = function() { var t = this, e = this, n = e.$el, i = e.pfx, l = e.ppfx; n.empty(); var f = document.createDocumentFragment(); return this.collection.each(function(d) { return t.addToCollection(d, f); }), n.append(f), n.addClass("".concat(i, "sectors ").concat(l, "one-bg ").concat(l, "two-color")), this; }, r; }(k.G7); const Dv = Lv; var Nv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Ts = function() { return Ts = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Ts.apply(this, arguments); }, xd = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }, Cd = "style", Tc = "".concat(Cd, ":"), Sf = "".concat(Tc, "sector"), Iv = "".concat(Sf, ":add"), Fv = "".concat(Sf, ":remove"), Vv = "".concat(Sf, ":update"), Of = "".concat(Tc, "property"), Rv = "".concat(Of, ":add"), Hv = "".concat(Of, ":remove"), zv = "".concat(Of, ":update"), Sd = "".concat(Tc, "layer:select"), Tf = "".concat(Tc, "target"), Uv = "".concat(Tc, "custom"), Od = function(a) { return a || a === 0; }, Bv = { all: Cd, sectorAdd: Iv, sectorRemove: Fv, sectorUpdate: Vv, propertyAdd: Rv, propertyRemove: Hv, propertyUpdate: zv, layerSelect: Sd, target: Tf, custom: Uv }, Wv = function(a) { function r(t) { var e = a.call(this, t, "StyleManager", new Sv([], { em: t }), Bv, Tg) || this; e.Sector = wd, e.storageKey = "", (0, S.bindAll)(e, "__clearStateTarget"); var n = e.config, i = n.pStylePrefix; i && (n.stylePrefix = i + n.stylePrefix), e.builtIn = new kv(), e.properties = new Cf([], { em: t, module: e }), e.sectors = e.all; var l = new k.Hn({ targets: [] }); e.model = l, e.upAll = (0, S.debounce)(function() { return e.__upSel(); }, 0), l.listenTo(t, "component:toggled component:update:classes change:state change:device frame:resized selector:type", e.upAll), l.listenTo(t, "component:toggled", e.__clearStateTarget); var f = (0, S.debounce)(function() { e.__upProps(), e.__trgCustom(); }, 0); l.listenTo(t, "styleable:change undo redo", f); var d = (0, S.debounce)(function() { return e.__trgCustom(); }, 0); return l.listenTo(t, "".concat(Sd, " ").concat(Tf), d), l.on("change:lastTarget", function() { return t.trigger(Tf, e.getSelected()); }), e; } return Nv(r, a), r.prototype.__upSel = function() { this.select(this.em.getSelectedAll()); }, r.prototype.__trgCustom = function(t) { t === void 0 && (t = {}), this.__ctn = this.__ctn || t.container, this.em.trigger(this.events.custom, { container: this.__ctn }); }, r.prototype.__trgEv = function(t) { for (var e, n = [], i = 1; i < arguments.length; i++) n[i - 1] = arguments[i]; (e = this.em).trigger.apply(e, xd([t], n, !1)); }, r.prototype.__clearStateTarget = function() { var t = this, e = this.em, n = this.__getStateTarget(); n && (e == null || e.skip(function() { e.Css.remove(n), t.model.set({ stateTarget: null }); })); }, r.prototype.onLoad = function() { this.sectors.add(this.config.sectors, { silent: !0 }); }, r.prototype.postRender = function() { this.__appendTo(); }, r.prototype.addSector = function(t, e, n) { n === void 0 && (n = {}); var i = this.getSector(t); return i || (e.id = t, i = this.sectors.add(e, n)), i; }, r.prototype.getSector = function(t, e) { e === void 0 && (e = {}); var n = this.sectors.where({ id: t })[0]; return !n && e.warn && this._logNoSector(t), n || null; }, r.prototype.getSectors = function(t) { t === void 0 && (t = {}); var e = this.sectors, n = e && e.models ? t.array ? xd([], e.models, !0) : e : []; return t.visible ? n.filter(function(i) { return i.isVisible(); }) : n; }, r.prototype.removeSector = function(t) { return this.getSectors().remove(this.getSector(t, { warn: !0 })); }, r.prototype.addProperty = function(t, e, n) { n === void 0 && (n = {}); var i = this.getSector(t, { warn: !0 }), l = null; return i && (l = i.addProperty(e, n)), l; }, r.prototype.getProperty = function(t, e) { var n, i = this.getSector(t, { warn: !0 }); return i && (n = i.properties.filter(function(l) { return l.get("property") === e || l.get("id") === e; })[0]), n; }, r.prototype.getProperties = function(t) { var e, n = this.getSector(t, { warn: !0 }); return n && (e = n.properties), e; }, r.prototype.removeProperty = function(t, e) { var n = this.getProperties(t); return n ? n.remove(this.getProperty(t, e)) : null; }, r.prototype.select = function(t, e) { var n = this; e === void 0 && (e = {}); var i = this.em, l = (0, S.isArray)(t) ? t : [t], f = e.stylable, d = i.Css, v = []; l.filter(Boolean).forEach(function(q) { var et = q; if ((0, S.isString)(q)) { var X = d.getRule(q) || d.setRule(q); !(0, S.isUndefined)(f) && X.set({ stylable: f }), et = X; } v.push(et); }); var h = e.component || v.filter(function(q) { return (0, H.isComponent)(q); }).reverse()[0]; v = v.map(function(q) { return n.getModelToStyle(q); }); var w = i.getState(), C = v.slice().reverse()[0], L = this.getParentRules(C, { state: w, component: h }), F = this.__getStateTarget(); return i.skip(function() { var q; if (w && (!((q = C == null ? void 0 : C.getState) === null || q === void 0) && q.call(C))) { var et = C.getStyle(); F ? F.setStyle(et) : F = d.getAll().add({ selectors: "gjs-selected", style: et, shallow: !0, important: !0 }); } else F && (d.remove(F), F = void 0); }), this.model.set({ targets: v, lastTarget: C, lastTargetParents: L, stateTarget: F, component: h }), this.__upProps(e), v; }, r.prototype.getSelected = function() { return this.model.get("lastTarget") || null; }, r.prototype.getSelectedAll = function() { return this.model.get("targets"); }, r.prototype.getSelectedParents = function() { return this.model.get("lastTargetParents") || []; }, r.prototype.__getStateTarget = function() { return this.model.get("stateTarget"); }, r.prototype.addStyleTargets = function(t, e) { this.getSelectedAll().map(function(l) { return l.addStyle(t, e); }); var n = this.getSelected(); n && this.__emitCmpStyleUpdate(t); var i = this.__getStateTarget(); n && (i == null || i.setStyle(n.getStyle(), e)); }, r.prototype.getBuiltIn = function(t) { return this.builtIn.get(t); }, r.prototype.getBuiltInAll = function() { return this.builtIn.props; }, r.prototype.addBuiltIn = function(t, e) { return this.builtIn.add(t, e); }, r.prototype.getModelToStyle = function(t, e) { e === void 0 && (e = {}); var n = this.em, i = e.skipAdd; if (n && (t != null && t.toHTML)) { var l = n.getConfig(), f = n.UndoManager, d = n.Css, v = n.Selectors, h = v ? v.getConfig() : {}, w = l.devicePreviewMode ? "" : n.get("state"), C = t.get("classes").getStyleable(), L = C.length, F = !h.componentFirst || e.useClasses, q = { noCount: 1 }, et = { state: w, addOpts: q }, X = void 0; if (f.stop(), L && F) { var At = n.getCurrentMedia(); (X = d.get(C, w, At)) || i || (X = d.add(C, w, At, {}, q)); } else if (l.avoidInlineStyle) { var It = t.getId(); !(X = d.getIdRule(It, et)) && !i && (X = d.setIdRule(It, {}, et)), t.is("wrapper") && X.set("wrapper", 1, q); } X && (t = X), f.start(); } return t; }, r.prototype.getParentRules = function(t, e) { var n = e === void 0 ? {} : e, i = n.state, l = n.component, f = this.em, d = []; if (f && t) { var v = l, h = f.Css, w = f.CodeManager.getGenerator("css"), C = t.toHTML ? t : t.getComponent(), L = { combination: !0, array: !0 }, F = [], q = [], et = []; C ? (F = h.getRules("#".concat(C.getId())), et = (q = v ? h.getRules(v.getSelectors().getFullName(L)) : []).concat(F)) : (F = v ? h.getRules("#".concat(v.getId())) : [], q = h.getRules(t.getSelectors().getFullName(L)), et = F.concat(q)); var X = et.filter(function(At) { return (0, S.isUndefined)(i) ? 1 : At.get("state") === i; }).sort(w.sortRules).reverse(); d = X.slice(X.indexOf(t) + 1); } return d; }, r.prototype.addType = function(t, e) { this.properties.addType(t, e); }, r.prototype.getType = function(t) { return this.properties.getType(t); }, r.prototype.getTypes = function() { return this.properties.getTypes(); }, r.prototype.createType = function(t, e) { var n = e === void 0 ? {} : e, i = n.model, l = i === void 0 ? {} : i, f = n.view, d = f === void 0 ? {} : f, v = this.config, h = this.getType(t); if (h) return new h.view(Ts({ model: new h.model(l), config: v }, d)); }, r.prototype.render = function() { var t = this, e = t.config, n = t.em, i = t.SectView, l = i && i.el; return this.SectView = new Dv({ el: l, em: n, config: e, module: this, collection: this.sectors }), this.SectView.render().el; }, r.prototype._logNoSector = function(t) { var e = this.em; e && e.logWarning("'".concat(t, "' sector not found")); }, r.prototype.__emitCmpStyleUpdate = function(t, e) { e === void 0 && (e = {}); var n = this.em, i = "component:styleUpdate"; if (!t.__p) { var l = e.components || n.getSelectedAll(), f = Array.isArray(l) ? l : [l], d = Ts({}, t); delete d.__p; var v = Object.keys(d), h = { style: d }; f.forEach(function(w) { n.trigger(i, w, h), v.forEach(function(C) { return n.trigger("".concat(i, ":").concat(C), w, h); }); }); } }, r.prototype.__upProps = function(t) { var e = this; t === void 0 && (t = {}); var n = this.getSelected(); if (n) { var i = this.sectors, l = this.model.get("component"), f = this.getSelectedParents(), d = n.getStyle(), v = f.map(function(h) { return { target: h, style: h.getStyle() }; }); i.map(function(h) { h.getProperties().map(function(w) { e.__upProp(w, d, v, t); }); }), i.forEach(function(h) { var w = h.getProperties(); w.forEach(function(L) { var F = L.__checkVisibility({ target: n, component: l, sectors: i }); L.set("visible", F); }); var C = w.some(function(L) { return L.isVisible(); }); h.set("visible", C); }); } }, r.prototype.__upProp = function(t, e, n, i) { var l = this, f = t.getName(), d = e[f], v = Od(d), h = t.getType() === "stack", w = t.getType() === "composite", C = Ts(Ts({}, i), { __up: !0 }), L = !w && !h, F = h ? t.__getLayersFromStyle(e) : [], q = w ? t.__getPropsFromStyle(e) : {}, et = v ? d : null, X = null; if (h && F === null || w && q === null) { var At = h ? "__getLayersFromStyle" : "__getPropsFromStyle"; if (ie = n.filter(function(Je) { return t[At](Je.style) !== null; })[0]) { et = ie.style[f], X = ie.target; var It = t[At](ie.style); h ? F = It : q = It; } } else if (!v) { var ie; et = null, (ie = n.filter(function(Je) { return Od(Je.style[f]); })[0]) && (et = ie.style[f], X = ie.target); } if (t.__setParentTarget(X), L && t.__getFullValue() !== et && t.upValue(et, C), h && t.__setLayers(F || []), w) { var se = t.getProperties(); if (t.isDetached()) { var Me = t.__getPropsFromStyle(e, { byName: !0 }) || {}, Ie = n.map(function(Je) { return Ts(Ts({}, Je), { style: t.__getPropsFromStyle(Je.style, { byName: !0 }) || {} }); }); se.map(function(Je) { return l.__upProp(Je, Me, Ie, i); }); } else t.__setProperties(q || {}, C), t.getProperties().map(function(Je) { return Je.__setParentTarget(X); }); } }, r.prototype.destroy = function() { var t; [this.properties, this.sectors].forEach(function(e) { e.reset(), e.stopListening(); }), (t = this.SectView) === null || t === void 0 || t.remove(), this.model.stopListening(), this.upAll.cancel(); }, r; }(Dt); const $v = Wv; var qv = function() { var a = function(r, t) { return a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) { e.__proto__ = n; } || function(e, n) { for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]); }, a(r, t); }; return function(r, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function e() { this.constructor = r; } a(r, t), r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); }; }(), Pr = function() { return Pr = Object.assign || function(a) { for (var r, t = 1, e = arguments.length; t < e; t++) for (var n in r = arguments[t]) Object.prototype.hasOwnProperty.call(r, n) && (a[n] = r[n]); return a; }, Pr.apply(this, arguments); }, kf = function(a, r, t, e) { return new (t || (t = Promise))(function(n, i) { function l(v) { try { d(e.next(v)); } catch (h) { i(h); } } function f(v) { try { d(e.throw(v)); } catch (h) { i(h); } } function d(v) { var h; v.done ? n(v.value) : (h = v.value, h instanceof t ? h : new t(function(w) { w(h); })).then(l, f); } d((e = e.apply(a, r || [])).next()); }); }, Pf = function(a, r) { var t, e, n, i, l = { label: 0, sent: function() { if (1 & n[0]) throw n[1]; return n[1]; }, trys: [], ops: [] }; return i = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() { return this; }), i; function f(d) { return function(v) { return function(h) { if (t) throw new TypeError("Generator is already executing."); for (; i && (i = 0, h[0] && (l = 0)), l; ) try { if (t = 1, e && (n = 2 & h[0] ? e.return : h[0] ? e.throw || ((n = e.return) && n.call(e), 0) : e.next) && !(n = n.call(e, h[1])).done) return n; switch (e = 0, n && (h = [2 & h[0], n.value]), h[0]) { case 0: case 1: n = h; break; case 4: return l.label++, { value: h[1], done: !1 }; case 5: l.label++, e = h[1], h = [0]; continue; case 7: h = l.ops.pop(), l.trys.pop(); continue; default: if (n = l.trys, !((n = n.length > 0 && n[n.length - 1]) || h[0] !== 6 && h[0] !== 2)) { l = 0; continue; } if (h[0] === 3 && (!n || h[1] > n[0] && h[1] < n[3])) { l.label = h[1]; break; } if (h[0] === 6 && l.label < n[1]) { l.label = n[1], n = h; break; } if (n && l.label < n[2]) { l.label = n[2], l.ops.push(h); break; } n[2] && l.ops.pop(), l.trys.pop(); continue; } h = r.call(a, l); } catch (w) { h = [6, w], e = 0; } finally { t = n = 0; } if (5 & h[0]) throw h[1]; return { value: h[0] ? h[1] : void 0, done: !0 }; }([d, v]); }; } }, Gv = function(a, r) { var t = {}; for (var e in a) Object.prototype.hasOwnProperty.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]); if (a != null && typeof Object.getOwnPropertySymbols == "function") { var n = 0; for (e = Object.getOwnPropertySymbols(a); n < e.length; n++) r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(a, e[n]) && (t[e[n]] = a[e[n]]); } return t; }, Kv = function(a, r, t) { if (t || arguments.length === 2) for (var e, n = 0, i = r.length; n < i; n++) !e && n in r || (e || (e = Array.prototype.slice.call(r, 0, n)), e[n] = r[n]); return a.concat(e || Array.prototype.slice.call(r)); }; J().$ = W.default; var Yv = [lh, th, mh, dg, cl, Yt, zp, $v, ds, Sh, sg, zh, _g, dc, Pn, Bt, Og, ql], Xv = [Xd, Ul, Ae, Op]; (function(a) { var r = a.$; if (r && r.prototype && r.prototype.constructor.name !== "jQuery") { var t = r.fn; t.hide = function() { return this.css("display", "none"); }, t.show = function() { return this.css("display", "block"); }, t.focus = function() { var i = this.get(0); return i && i.focus(), this; }, t.bind = function(i, l) { return this.on(i, l); }, t.unbind = function(i, l) { if ((0, S.isObject)(i)) { for (var f in i) i.hasOwnProperty(f) && this.off(f, i[f]); return this; } return this.off(i, l); }, t.click = function(i) { return i ? this.on("click", i) : this.trigger("click"); }, t.change = function(i) { return i ? this.on("change", i) : this.trigger("change"); }, t.keydown = function(i) { return i ? this.on("keydown", i) : this.trigger("keydown"); }, t.delegate = function(i, l, f, d) { return d || (d = f), this.on(l, i, function(v) { v.data = f, d(v); }); }, t.scrollLeft = function() { var i = this.get(0), l = (i = i.nodeType == 9 ? i.defaultView : i) instanceof Window ? i : null; return l ? l.pageXOffset : i.scrollLeft || 0; }, t.scrollTop = function() { var i = this.get(0), l = (i = i.nodeType == 9 ? i.defaultView : i) instanceof Window ? i : null; return l ? l.pageYOffset : i.scrollTop || 0; }; var e = r.prototype.offset; t.offset = function(i) { var l, f; return i && (l = i.top, f = i.left), l !== void 0 && this.css("top", "".concat(l, "px")), f !== void 0 && this.css("left", "".concat(f, "px")), e.call(this); }, r.map = function(i, l) { for (var f = [], d = 0; d < i.length; d++) f.push(l(i[d], d)); return f; }; var n = Array.prototype.indexOf; r.inArray = function(i, l, f) { return l == null ? -1 : n.call(l, i, f); }, r.Event = function(i, l) { if (!(this instanceof r.Event)) return new r.Event(i, l); this.type = i, this.isDefaultPrevented = function() { return !1; }; }; } })({ $: W.default }); var Td = { debug: console.log, info: console.info, warning: console.warn, error: console.error }, Jv = function(a) { function r(t) { t === void 0 && (t = {}); var e = a.call(this) || this; e.__skip = !1, e.defaultRunning = !1, e.destroyed = !1, e._config = t; var n = e.config; e.set("Config", t), e.set("modules", []), e.set("toLoad", []), e.set("storables", []), e.set("selected", new M()), e.set("dmode", n.dragMode); var i = n.el, l = n.log, f = l === !0 ? (0, S.keys)(Td) : (0, S.isArray)(l) ? l : []; return (0, S.bindAll)(e, "initBaseColorPicker"), i && n.fromElement && (n.components = i.innerHTML), e.attrsOrig = i ? (0, S.toArray)(i.attributes).reduce(function(d, v) { return d[v.nodeName] = v.nodeValue, d; }, {}) : "", n.components && !n.pageManager && (n.pageManager = { pages: [{ component: n.components }] }), Yv.forEach(function(d) { return e.loadModule(d); }), Xv.forEach(function(d) { return e.loadStorableModule(d); }), e.on("change:componentHovered", e.componentHovered, e), e.on("change:changesCount", e.updateChanges, e), e.on("change:readyLoad change:readyCanvas", e._checkReady, e), f.forEach(function(d) { return e.listenLog(d); }), [{ from: "change:selectedComponent", to: "component:toggled" }].forEach(function(d) { var v = d.from, h = d.to; e.listenTo(e, v, function() { for (var w = [], C = 0; C < arguments.length; C++) w[C] = arguments[C]; e.trigger.apply(e, Kv([h], w, !1)), e.logWarning("The event '".concat(v, "' is deprecated, replace it with '").concat(h, "'")); }); }), e; } return qv(r, a), r.prototype.defaults = function() { return { editing: 0, selected: 0, clipboard: null, dmode: 0, componentHovered: null, previousModel: null, changesCount: 0, storables: [], modules: [], toLoad: [], opened: {}, device: "" }; }, Object.defineProperty(r.prototype, "storables", { get: function() { return this.get("storables"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "modules", { get: function() { return this.get("modules"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "toLoad", { get: function() { return this.get("toLoad"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "selected", { get: function() { return this.get("selected"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "shallow", { get: function() { return this.get("shallow"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "I18n", { get: function() { return this.get("I18n"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Utils", { get: function() { return this.get("Utils"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Commands", { get: function() { return this.get("Commands"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Keymaps", { get: function() { return this.get("Keymaps"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Modal", { get: function() { return this.get("Modal"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Panels", { get: function() { return this.get("Panels"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "CodeManager", { get: function() { return this.get("CodeManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "UndoManager", { get: function() { return this.get("UndoManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "RichTextEditor", { get: function() { return this.get("RichTextEditor"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Canvas", { get: function() { return this.get("Canvas"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Editor", { get: function() { return this.get("Editor"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Components", { get: function() { return this.get("DomComponents"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Css", { get: function() { return this.get("CssComposer"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Blocks", { get: function() { return this.get("BlockManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Selectors", { get: function() { return this.get("SelectorManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Storage", { get: function() { return this.get("StorageManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Traits", { get: function() { return this.get("TraitManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Parser", { get: function() { return this.get("Parser"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Layers", { get: function() { return this.get("LayerManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Assets", { get: function() { return this.get("AssetManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Devices", { get: function() { return this.get("DeviceManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Pages", { get: function() { return this.get("PageManager"); }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, "Styles", { get: function() { return this.get("StyleManager"); }, enumerable: !1, configurable: !0 }), r.prototype._checkReady = function() { this.get("readyLoad") && this.get("readyCanvas") && !this.get("ready") && this.set("ready", !0); }, r.prototype.getContainer = function() { return this.config.el; }, r.prototype.listenLog = function(t) { this.listenTo(this, "log:".concat(t), Td[t]); }, Object.defineProperty(r.prototype, "config", { get: function() { return this._config; }, enumerable: !1, configurable: !0 }), r.prototype.getConfig = function(t) { var e = this.config; return (0, S.isUndefined)(t) ? e : e[t]; }, r.prototype.loadOnStart = function() { var t = this, e = this.config, n = e.projectData, i = e.headless, l = this.get("StorageManager"); this.toLoad.reverse().forEach(function(v) { return v.onLoad(); }); var f = function() { t.modules.forEach(function(v) { return v.postLoad && v.postLoad(t); }), t.set("readyLoad", 1); }; i ? (n && this.loadData(n), f()) : this._storageTimeout = setTimeout(function() { return kf(t, void 0, void 0, function() { var v; return Pf(this, function(h) { switch (h.label) { case 0: return n ? (this.loadData(n), [3, 5]) : [3, 1]; case 1: if (!(l != null && l.canAutoload())) return [3, 5]; h.label = 2; case 2: return h.trys.push([2, 4, , 5]), [4, this.load()]; case 3: return h.sent(), [3, 5]; case 4: return v = h.sent(), this.logError(v), [3, 5]; case 5: return f(), [2]; } }); }); }); var d = new r({ noticeOnUnload: !1, storageManager: !1, undoManager: !1 }); ["PageManager", "Canvas"].forEach(function(v) { return d.get(v).onLoad(); }), this.set("shallow", d); }, r.prototype.updateChanges = function() { var t = this, e = this.get("StorageManager"), n = this.getDirtyCount(); this.updateItr && clearTimeout(this.updateItr), this.updateItr = setTimeout(function() { return t.trigger("update"); }), this.config.noticeOnUnload && (window.onbeforeunload = n ? function() { return !0; } : null), e.isAutosave() && n >= e.getStepsBeforeSave() && this.store().catch(function(i) { return t.logError(i); }); }, r.prototype.loadModule = function(t) { var e = new t(this); return this.set(e.name, e), e.onLoad && this.toLoad.push(e), this.modules.push(e), e; }, r.prototype.loadStorableModule = function(t) { var e = this.loadModule(t); return this.storables.push(e), e; }, r.prototype.init = function(t, e) { e === void 0 && (e = {}), this.destroyed && (this.initialize(e), this.destroyed = !1), this.set("Editor", t); }, r.prototype.getEditor = function() { return this.get("Editor"); }, r.prototype.handleUpdates = function(t, e, n) { var i = this; n === void 0 && (n = {}), this.__skip || n.temporary || n.noCount || n.avoidStore || !this.get("ready") || (this.timedInterval && clearTimeout(this.timedInterval), this.timedInterval = setTimeout(function() { var l = i.getDirtyCount() || 0, f = (n.unset, Gv(n, ["unset"])); i.set("changesCount", l + 1, f); }, 0)); }, r.prototype.changesUp = function(t) { this.handleUpdates(0, 0, t); }, r.prototype.componentHovered = function(t, e, n) { var i = this.previous("componentHovered"); i && this.trigger("component:unhovered", i, n), e && this.trigger("component:hovered", e, n); }, r.prototype.getSelected = function() { return this.selected.lastComponent(); }, r.prototype.getSelectedAll = function() { return this.selected.allComponents(); }, r.prototype.setSelected = function(t, e) { var n = this; e === void 0 && (e = {}); var i = e.event, l = i && (i.ctrlKey || i.metaKey), f = (i || {}).shiftKey, d = ((0, S.isArray)(t) ? t : [t]).map(function(C) { return (0, H.getModel)(C, W.default); }), v = this.getSelectedAll(), h = this.getConfig().multipleSelection, w = (0, S.isArray)(t); w && this.removeSelected(v.filter(function(C) { return !(0, S.contains)(d, C); })), d.forEach(function(C) { var L = (0, H.getModel)(C, void 0); if (L && (n.trigger("component:select:before", L, e), !L.get("selectable") || e.abort)) { if (!e.useValid) return; for (var F = L.parent(); F && !F.get("selectable"); ) F = F.parent(); L = F; } if (l && h) return n.toggleSelected(L); if (f && h) { n.clearSelection(n.get("Canvas").getWindow()); var q, et, X = L.collection, At = L.index(); if (n.getSelectedAll().forEach(function(It) { var ie = It.collection, se = It.index(); ie === X && (se < At ? q = (0, S.isUndefined)(q) ? se : Math.max(q, se) : se > At && (et = (0, S.isUndefined)(et) ? se : Math.min(et, se))); }), !(0, S.isUndefined)(q)) for (; q !== At; ) n.addSelected(X.at(q)), q++; if (!(0, S.isUndefined)(et)) for (; et !== At; ) n.addSelected(X.at(et)), et--; return n.addSelected(L); } !w && n.removeSelected(v.filter(function(It) { return It !== L; })), n.addSelected(L, e); }); }, r.prototype.addSelected = function(t, e) { var n = this; e === void 0 && (e = {}); var i = (0, H.getModel)(t, W.default); ((0, S.isArray)(i) ? i : [i]).forEach(function(l) { var f = n.selected; l && l.get("selectable") && !l.parents().some(function(d) { return f.hasComponent(d); }) && (e.forceChange && n.removeSelected(l, e), f.allComponents().filter(function(d) { return (0, S.contains)(d.parents(), l); }).forEach(function(d) { return n.removeSelected(d, e); }), f.addComponent(l, e), l && n.trigger("component:select", l, e)); }); }, r.prototype.removeSelected = function(t, e) { e === void 0 && (e = {}), this.selected.removeComponent((0, H.getModel)(t, W.default), e); }, r.prototype.toggleSelected = function(t, e) { var n = this; e === void 0 && (e = {}); var i = (0, H.getModel)(t, W.default); ((0, S.isArray)(i) ? i : [i]).forEach(function(l) { n.selected.hasComponent(l) ? n.removeSelected(l, e) : n.addSelected(l, e); }); }, r.prototype.setHovered = function(t, e) { if (e === void 0 && (e = {}), !t) return this.set("componentHovered", ""); var n = "component:hover", i = (0, H.getModel)(t, void 0); if (i) { if (e.forceChange && this.set("componentHovered", ""), this.trigger("".concat(n, ":before"), i, e), !i.get("hoverable")) { if (!e.useValid || e.abort) return; for (var l = i && i.parent(); l && !l.get("hoverable"); ) l = l.parent(); i = l; } e.abort || (this.set("componentHovered", i, e), this.trigger(n, i, e)); } }, r.prototype.getHovered = function() { return this.get("componentHovered"); }, r.prototype.setComponents = function(t, e) { return e === void 0 && (e = {}), this.get("DomComponents").setComponents(t, e); }, r.prototype.getComponents = function() { var t = this.get("DomComponents"), e = this.get("CodeManager"); if (t && e) { var n = t.getComponents(); return e.getCode(n, "json"); } }, r.prototype.setStyle = function(t, e) { e === void 0 && (e = {}); var n = this.get("CssComposer"); return n.clear(e), n.getAll().add(t, e), this; }, r.prototype.addStyle = function(t, e) { e === void 0 && (e = {}); var n = this.getStyle().add(t, e); return (0, S.isArray)(n) ? n : [n]; }, r.prototype.getStyle = function() { return this.Css.getAll(); }, r.prototype.setState = function(t) { return this.set("state", t), this; }, r.prototype.getState = function() { return this.get("state") || ""; }, r.prototype.getHtml = function(t) { t === void 0 && (t = {}); var e = this.config, n = e.optsHtml, i = e.jsInHtml ? this.getJs(t) : "", l = t.component || this.get("DomComponents").getComponent(), f = l ? this.get("CodeManager").getCode(l, "html", Pr(Pr({}, n), t)) : ""; return f += i ? "