const grapes_min$1 = ""; const app = ""; const pageInjection = ""; var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; function getDefaultExportFromCjs(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } var grapes_min = { exports: {} }; /*! grapesjs - 0.21.2 */ (function(module, exports) { !function(t, e) { module.exports = e(); }("undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : commonjsGlobal, () => (() => { var t = { 410: (t2, e2, n2) => { var o2, r, i; r = [n2(50), n2(316)], void 0 === (i = "function" == typeof (o2 = function(t3, e3) { var n3 = Array.prototype.slice; function o3(t4, e4, n4) { return n4.length <= 4 ? t4.call(e4, n4[0], n4[1], n4[2], n4[3]) : t4.apply(e4, n4); } function r2(t4, e4) { return n3.call(t4, e4); } function i2(e4, n4) { return null != e4 && (t3.isArray(n4) || (n4 = r2(arguments, 1)), t3.all(n4, function(t4) { return t4 in e4; })); } var s = function() { var e4 = false, n4 = -1; function o4() { n4++, e4 = true, t3.defer(function() { e4 = false; }); } return function() { return e4 || o4(), n4; }; }(); function a() { this.registeredObjects = [], this.cidIndexes = []; } function l(e4, n4, o4, r3) { for (var i3, s2 = 0, a2 = n4.length; s2 < a2; s2++) if (i3 = n4[s2]) { if ("on" === e4) { if (!r3.objectRegistry.register(i3)) continue; } else if (!r3.objectRegistry.unregister(i3)) continue; t3.isFunction(i3[e4]) && i3[e4]("all", o4, r3); } } function c(e4, n4) { var o4 = n4.type, r3 = n4.undoTypes, i3 = !r3[o4] || r3[o4][e4]; t3.isFunction(i3) && i3(n4.object, n4.before, n4.after, n4.options); } function u(e4, o4, r3, i3, s2) { if (!(r3.isCurrentlyUndoRedoing || "undo" === e4 && -1 === r3.pointer || "redo" === e4 && r3.pointer === r3.length - 1)) { r3.isCurrentlyUndoRedoing = true; var a2, l2, c2 = "undo" === e4; for (s2 ? l2 = c2 && r3.pointer === r3.length - 1 || !c2 && -1 === r3.pointer ? t3.clone(r3.models) : n3.apply(r3.models, c2 ? [0, r3.pointer] : [r3.pointer, r3.length - 1]) : (a2 = r3.at(c2 ? r3.pointer : r3.pointer + 1), l2 = i3 ? r3.where({ magicFusionIndex: a2.get("magicFusionIndex") }) : [a2]), r3.pointer += (c2 ? -1 : 1) * l2.length; a2 = c2 ? l2.pop() : l2.shift(); ) a2[e4](); r3.isCurrentlyUndoRedoing = false, o4.trigger(e4, o4); } } function p(t4, e4) { var n4 = t4.condition, r3 = typeof n4; return "function" === r3 ? !!o3(n4, t4, e4) : "boolean" !== r3 || n4; } function d(t4, e4, n4, r3) { if (t4.track && !t4.isCurrentlyUndoRedoing && e4 in r3 && p(r3[e4], n4)) { var a2 = o3(r3[e4]["on"], r3[e4], n4); if (i2(a2, "object", "before", "after")) { if (a2.type = e4, a2.magicFusionIndex = s(), a2.undoTypes = r3, t4.pointer < t4.length - 1) for (var l2 = t4.length - t4.pointer - 1; l2--; ) t4.pop(); t4.pointer = t4.length, t4.add(a2), t4.length > t4.maximumStackLength && (t4.shift(), t4.pointer--); } } } a.prototype = { isRegistered: function(e4) { return e4 && e4.cid ? this.registeredObjects[e4.cid] : t3.contains(this.registeredObjects, e4); }, register: function(t4) { return !this.isRegistered(t4) && (t4 && t4.cid ? (this.registeredObjects[t4.cid] = t4, this.cidIndexes.push(t4.cid)) : this.registeredObjects.push(t4), true); }, unregister: function(e4) { if (this.isRegistered(e4)) { if (e4 && e4.cid) delete this.registeredObjects[e4.cid], this.cidIndexes.splice(t3.indexOf(this.cidIndexes, e4.cid), 1); else { var n4 = t3.indexOf(this.registeredObjects, e4); this.registeredObjects.splice(n4, 1); } return true; } return false; }, get: function() { return t3.map(this.cidIndexes, function(t4) { return this.registeredObjects[t4]; }, this).concat(this.registeredObjects); } }; var f = { add: { undo: function(t4, e4, n4, o4) { t4.remove(n4, o4); }, redo: function(t4, e4, n4, o4) { o4.index && (o4.at = o4.index), t4.add(n4, o4); }, on: function(e4, n4, o4) { return { object: n4, before: void 0, after: e4, options: t3.clone(o4) }; } }, remove: { undo: function(t4, e4, n4, o4) { "index" in o4 && (o4.at = o4.index), t4.add(e4, o4); }, redo: function(t4, e4, n4, o4) { t4.remove(e4, o4); }, on: function(e4, n4, o4) { return { object: n4, before: e4, after: void 0, options: t3.clone(o4) }; } }, change: { undo: function(e4, n4, o4, r3) { t3.isEmpty(n4) ? t3.each(t3.keys(o4), e4.unset, e4) : (e4.set(n4), r3 && r3.unsetData && r3.unsetData.before && r3.unsetData.before.length && t3.each(r3.unsetData.before, e4.unset, e4)); }, redo: function(e4, n4, o4, r3) { t3.isEmpty(o4) ? t3.each(t3.keys(n4), e4.unset, e4) : (e4.set(o4), r3 && r3.unsetData && r3.unsetData.after && r3.unsetData.after.length && t3.each(r3.unsetData.after, e4.unset, e4)); }, on: function(e4, n4) { var o4 = e4.changedAttributes(), r3 = t3.keys(o4), i3 = t3.pick(e4.previousAttributes(), r3), s2 = t3.keys(i3), a2 = (n4 || (n4 = {})).unsetData = { after: [], before: [] }; return r3.length != s2.length && (r3.length > s2.length ? t3.each(r3, function(t4) { t4 in i3 || a2.before.push(t4); }, this) : t3.each(s2, function(t4) { t4 in o4 || a2.after.push(t4); })), { object: e4, before: i3, after: o4, options: t3.clone(n4) }; } }, reset: { undo: function(t4, e4, n4) { t4.reset(e4); }, redo: function(t4, e4, n4) { t4.reset(n4); }, on: function(e4, n4) { return { object: e4, before: n4.previousModels, after: t3.clone(e4.models) }; } } }; function h() { } function g(e4, n4, o4, r3) { if ("object" == typeof n4) return t3.each(n4, function(t4, n5) { 2 === e4 ? g(e4, t4, o4, r3) : g(e4, n5, t4, o4); }); switch (e4) { case 0: i2(o4, "undo", "redo", "on") && t3.all(t3.pick(o4, "undo", "redo", "on"), t3.isFunction) && (r3[n4] = o4); break; case 1: r3[n4] && t3.isObject(o4) && (r3[n4] = t3.extend({}, r3[n4], o4)); break; case 2: delete r3[n4]; } return this; } h.prototype = f; var v = e3.Model.extend({ defaults: { type: null, object: null, before: null, after: null, magicFusionIndex: null }, undo: function(t4) { c("undo", this.attributes); }, redo: function(t4) { c("redo", this.attributes); } }), y = e3.Collection.extend({ model: v, pointer: -1, track: false, isCurrentlyUndoRedoing: false, maximumStackLength: 1 / 0, setMaxLength: function(t4) { this.maximumStackLength = t4; } }), m = e3.Model.extend({ defaults: { maximumStackLength: 1 / 0, track: false }, initialize: function(e4) { this.stack = new y(), this.objectRegistry = new a(), this.undoTypes = new h(), this.stack.setMaxLength(this.get("maximumStackLength")), this.on("change:maximumStackLength", function(t4, e5) { this.stack.setMaxLength(e5); }, this), e4 && e4.track && this.startTracking(), e4 && e4.register && (t3.isArray(e4.register) || t3.isArguments(e4.register) ? o3(this.register, this, e4.register) : this.register(e4.register)); }, startTracking: function() { this.set("track", true), this.stack.track = true; }, stopTracking: function() { this.set("track", false), this.stack.track = false; }, isTracking: function() { return this.get("track"); }, _addToStack: function(t4) { d(this.stack, t4, r2(arguments, 1), this.undoTypes); }, register: function() { l("on", arguments, this._addToStack, this); }, unregister: function() { l("off", arguments, this._addToStack, this); }, unregisterAll: function() { o3(this.unregister, this, this.objectRegistry.get()); }, undo: function(t4) { u("undo", this, this.stack, t4); }, undoAll: function() { u("undo", this, this.stack, false, true); }, redo: function(t4) { u("redo", this, this.stack, t4); }, redoAll: function() { u("redo", this, this.stack, false, true); }, isAvailable: function(t4) { var e4 = this.stack, n4 = e4.length; switch (t4) { case "undo": return n4 > 0 && e4.pointer > -1; case "redo": return n4 > 0 && e4.pointer < n4 - 1; default: return false; } }, merge: function(e4) { for (var n4, o4 = t3.isArray(e4) ? e4 : r2(arguments); n4 = o4.pop(); ) n4 instanceof m && n4.stack instanceof y && (n4.stack = this.stack); }, addUndoType: function(t4, e4) { g(0, t4, e4, this.undoTypes); }, changeUndoType: function(t4, e4) { g(1, t4, e4, this.undoTypes); }, removeUndoType: function(t4) { g(2, t4, void 0, this.undoTypes); }, clear: function() { this.stack.reset(), this.stack.pointer = -1; } }); return t3.extend(m, { defaults: function(e4) { t3.extend(m.prototype.defaults, e4); }, addUndoType: function(t4, e4) { g(0, t4, e4, f); }, changeUndoType: function(t4, e4) { g(1, t4, e4, f); }, removeUndoType: function(t4) { g(2, t4, void 0, f); } }), e3.UndoManager = m; }) ? o2.apply(e2, r) : o2) || (t2.exports = i); }, 316: (t2, e2, n2) => { var o2, r; !function(i) { var s = "object" == typeof self && self.self === self && self || "object" == typeof n2.g && n2.g.global === n2.g && n2.g; o2 = [n2(50), n2(895), e2], r = function(t3, e3, n3) { s.Backbone = function(t4, e4, n4, o3) { var r2 = t4.Backbone, i2 = Array.prototype.slice; e4.VERSION = "1.4.1", e4.$ = o3, e4.noConflict = function() { return t4.Backbone = r2, this; }, e4.emulateHTTP = false, e4.emulateJSON = false; var s2, a = e4.Events = {}, l = /\s+/, c = function(t5, e5, o4, r3, i3) { var s3, a2 = 0; if (o4 && "object" == typeof o4) { void 0 !== r3 && "context" in i3 && void 0 === i3.context && (i3.context = r3); for (s3 = n4.keys(o4); a2 < s3.length; a2++) e5 = c(t5, e5, s3[a2], o4[s3[a2]], i3); } else if (o4 && l.test(o4)) for (s3 = o4.split(l); a2 < s3.length; a2++) e5 = t5(e5, s3[a2], r3, i3); else e5 = t5(e5, o4, r3, i3); return e5; }; a.on = function(t5, e5, n5) { (this._events = c(u, this._events || {}, t5, e5, { context: n5, ctx: this, listening: s2 }), s2) && ((this._listeners || (this._listeners = {}))[s2.id] = s2, s2.interop = false); return this; }, a.listenTo = function(t5, e5, o4) { if (!t5) return this; var r3 = t5._listenId || (t5._listenId = n4.uniqueId("l")), i3 = this._listeningTo || (this._listeningTo = {}), a2 = s2 = i3[r3]; a2 || (this._listenId || (this._listenId = n4.uniqueId("l")), a2 = s2 = i3[r3] = new v(this, t5)); var l2 = p(t5, e5, o4, this); if (s2 = void 0, l2) throw l2; return a2.interop && a2.on(e5, o4), this; }; var u = function(t5, e5, n5, o4) { if (n5) { var r3 = t5[e5] || (t5[e5] = []), i3 = o4.context, s3 = o4.ctx, a2 = o4.listening; a2 && a2.count++, r3.push({ callback: n5, context: i3, ctx: i3 || s3, listening: a2 }); } return t5; }, p = function(t5, e5, n5, o4) { try { t5.on(e5, n5, o4); } catch (t6) { return t6; } }; a.off = function(t5, e5, n5) { return this._events ? (this._events = c(d, this._events, t5, e5, { context: n5, listeners: this._listeners }), this) : this; }, a.stopListening = function(t5, e5, o4) { var r3 = this._listeningTo; if (!r3) return this; for (var i3 = t5 ? [t5._listenId] : n4.keys(r3), s3 = 0; s3 < i3.length; s3++) { var a2 = r3[i3[s3]]; if (!a2) break; a2.obj.off(e5, o4, this), a2.interop && a2.off(e5, o4); } return n4.isEmpty(r3) && (this._listeningTo = void 0), this; }; var d = function(t5, e5, o4, r3) { if (t5) { var i3, s3 = r3.context, a2 = r3.listeners, l2 = 0; if (e5 || s3 || o4) { for (i3 = e5 ? [e5] : n4.keys(t5); l2 < i3.length; l2++) { var c2 = t5[e5 = i3[l2]]; if (!c2) break; for (var u2 = [], p2 = 0; p2 < c2.length; p2++) { var d2 = c2[p2]; if (o4 && o4 !== d2.callback && o4 !== d2.callback._callback || s3 && s3 !== d2.context) u2.push(d2); else { var f2 = d2.listening; f2 && f2.off(e5, o4); } } u2.length ? t5[e5] = u2 : delete t5[e5]; } return t5; } for (i3 = n4.keys(a2); l2 < i3.length; l2++) a2[i3[l2]].cleanup(); } }; a.once = function(t5, e5, n5) { var o4 = c(f, {}, t5, e5, this.off.bind(this)); return "string" == typeof t5 && null == n5 && (e5 = void 0), this.on(o4, e5, n5); }, a.listenToOnce = function(t5, e5, n5) { var o4 = c(f, {}, e5, n5, this.stopListening.bind(this, t5)); return this.listenTo(t5, o4); }; var f = function(t5, e5, o4, r3) { if (o4) { var i3 = t5[e5] = n4.once(function() { r3(e5, i3), o4.apply(this, arguments); }); i3._callback = o4; } return t5; }; a.trigger = function(t5) { if (!this._events) return this; for (var e5 = Math.max(0, arguments.length - 1), n5 = Array(e5), o4 = 0; o4 < e5; o4++) n5[o4] = arguments[o4 + 1]; return c(h, this._events, t5, void 0, n5), this; }; var h = function(t5, e5, n5, o4) { if (t5) { var r3 = t5[e5], i3 = t5.all; r3 && i3 && (i3 = i3.slice()), r3 && g(r3, o4), i3 && g(i3, [e5].concat(o4)); } return t5; }, g = function(t5, e5) { var n5, o4 = -1, r3 = t5.length, i3 = e5[0], s3 = e5[1], a2 = e5[2]; switch (e5.length) { case 0: for (; ++o4 < r3; ) (n5 = t5[o4]).callback.call(n5.ctx); return; case 1: for (; ++o4 < r3; ) (n5 = t5[o4]).callback.call(n5.ctx, i3); return; case 2: for (; ++o4 < r3; ) (n5 = t5[o4]).callback.call(n5.ctx, i3, s3); return; case 3: for (; ++o4 < r3; ) (n5 = t5[o4]).callback.call(n5.ctx, i3, s3, a2); return; default: for (; ++o4 < r3; ) (n5 = t5[o4]).callback.apply(n5.ctx, e5); return; } }, v = function(t5, e5) { this.id = t5._listenId, this.listener = t5, this.obj = e5, this.interop = true, this.count = 0, this._events = void 0; }; v.prototype.on = a.on, v.prototype.off = function(t5, e5) { var n5; this.interop ? (this._events = c(d, this._events, t5, e5, { context: void 0, listeners: void 0 }), n5 = !this._events) : (this.count--, n5 = 0 === this.count), n5 && this.cleanup(); }, v.prototype.cleanup = function() { delete this.listener._listeningTo[this.obj._listenId], this.interop || delete this.obj._listeners[this.id]; }, a.bind = a.on, a.unbind = a.off, n4.extend(e4, a); var y = e4.Model = function(t5, e5) { var o4 = t5 || {}; e5 || (e5 = {}), this.preinitialize.apply(this, arguments), this.cid = n4.uniqueId(this.cidPrefix), this.attributes = {}, e5.collection && (this.collection = e5.collection), e5.parse && (o4 = this.parse(o4, e5) || {}); var r3 = n4.result(this, "defaults"); o4 = n4.defaults(n4.extend({}, r3, o4), r3), this.set(o4, e5), this.changed = {}, this.initialize.apply(this, arguments); }; n4.extend(y.prototype, a, { changed: null, validationError: null, idAttribute: "id", cidPrefix: "c", preinitialize: function() { }, initialize: function() { }, toJSON: function(t5) { return n4.clone(this.attributes); }, sync: function() { return e4.sync.apply(this, arguments); }, get: function(t5) { return this.attributes[t5]; }, escape: function(t5) { return n4.escape(this.get(t5)); }, has: function(t5) { return null != this.get(t5); }, matches: function(t5) { return !!n4.iteratee(t5, this)(this.attributes); }, set: function(t5, e5, o4) { if (null == t5) return this; var r3; if ("object" == typeof t5 ? (r3 = t5, o4 = e5) : (r3 = {})[t5] = e5, o4 || (o4 = {}), !this._validate(r3, o4)) return false; var i3 = o4.unset, s3 = o4.silent, a2 = [], l2 = this._changing; this._changing = true, l2 || (this._previousAttributes = n4.clone(this.attributes), this.changed = {}); var c2 = this.attributes, u2 = this.changed, p2 = this._previousAttributes; for (var d2 in r3) e5 = r3[d2], n4.isEqual(c2[d2], e5) || a2.push(d2), n4.isEqual(p2[d2], e5) ? delete u2[d2] : u2[d2] = e5, i3 ? delete c2[d2] : c2[d2] = e5; if (this.idAttribute in r3) { var f2 = this.id; this.id = this.get(this.idAttribute), this.trigger("changeId", this, f2, o4); } if (!s3) { a2.length && (this._pending = o4); for (var h2 = 0; h2 < a2.length; h2++) this.trigger("change:" + a2[h2], this, c2[a2[h2]], o4); } if (l2) return this; if (!s3) for (; this._pending; ) o4 = this._pending, this._pending = false, this.trigger("change", this, o4); return this._pending = false, this._changing = false, this; }, unset: function(t5, e5) { return this.set(t5, void 0, n4.extend({}, e5, { unset: true })); }, clear: function(t5) { var e5 = {}; for (var o4 in this.attributes) e5[o4] = void 0; return this.set(e5, n4.extend({}, t5, { unset: true })); }, hasChanged: function(t5) { return null == t5 ? !n4.isEmpty(this.changed) : n4.has(this.changed, t5); }, changedAttributes: function(t5) { if (!t5) return !!this.hasChanged() && n4.clone(this.changed); var e5, o4 = this._changing ? this._previousAttributes : this.attributes, r3 = {}; for (var i3 in t5) { var s3 = t5[i3]; n4.isEqual(o4[i3], s3) || (r3[i3] = s3, e5 = true); } return !!e5 && r3; }, previous: function(t5) { return null != t5 && this._previousAttributes ? this._previousAttributes[t5] : null; }, previousAttributes: function() { return n4.clone(this._previousAttributes); }, fetch: function(t5) { t5 = n4.extend({ parse: true }, t5); var e5 = this, o4 = t5.success; return t5.success = function(n5) { var r3 = t5.parse ? e5.parse(n5, t5) : n5; if (!e5.set(r3, t5)) return false; o4 && o4.call(t5.context, e5, n5, t5), e5.trigger("sync", e5, n5, t5); }, K(this, t5), this.sync("read", this, t5); }, save: function(t5, e5, o4) { var r3; null == t5 || "object" == typeof t5 ? (r3 = t5, o4 = e5) : (r3 = {})[t5] = e5; var i3 = (o4 = n4.extend({ validate: true, parse: true }, o4)).wait; if (r3 && !i3) { if (!this.set(r3, o4)) return false; } else if (!this._validate(r3, o4)) return false; var s3 = this, a2 = o4.success, l2 = this.attributes; o4.success = function(t6) { s3.attributes = l2; var e6 = o4.parse ? s3.parse(t6, o4) : t6; if (i3 && (e6 = n4.extend({}, r3, e6)), e6 && !s3.set(e6, o4)) return false; a2 && a2.call(o4.context, s3, t6, o4), s3.trigger("sync", s3, t6, o4); }, K(this, o4), r3 && i3 && (this.attributes = n4.extend({}, l2, r3)); var c2 = this.isNew() ? "create" : o4.patch ? "patch" : "update"; "patch" !== c2 || o4.attrs || (o4.attrs = r3); var u2 = this.sync(c2, this, o4); return this.attributes = l2, u2; }, destroy: function(t5) { t5 = t5 ? n4.clone(t5) : {}; var e5 = this, o4 = t5.success, r3 = t5.wait, i3 = function() { e5.stopListening(), e5.trigger("destroy", e5, e5.collection, t5); }; t5.success = function(n5) { r3 && i3(), o4 && o4.call(t5.context, e5, n5, t5), e5.isNew() || e5.trigger("sync", e5, n5, t5); }; var s3 = false; return this.isNew() ? n4.defer(t5.success) : (K(this, t5), s3 = this.sync("delete", this, t5)), r3 || i3(), s3; }, url: function() { var t5 = n4.result(this, "urlRoot") || n4.result(this.collection, "url") || G(); if (this.isNew()) return t5; var e5 = this.get(this.idAttribute); return t5.replace(/[^\/]$/, "$&/") + encodeURIComponent(e5); }, parse: function(t5, e5) { return t5; }, clone: function() { return new this.constructor(this.attributes); }, isNew: function() { return !this.has(this.idAttribute); }, isValid: function(t5) { return this._validate({}, n4.extend({}, t5, { validate: true })); }, _validate: function(t5, e5) { if (!e5.validate || !this.validate) return true; t5 = n4.extend({}, this.attributes, t5); var o4 = this.validationError = this.validate(t5, e5) || null; return !o4 || (this.trigger("invalid", this, o4, n4.extend(e5, { validationError: o4 })), false); } }); var m = e4.Collection = function(t5, e5) { e5 || (e5 = {}), this.preinitialize.apply(this, arguments), e5.model && (this.model = e5.model), void 0 !== e5.comparator && (this.comparator = e5.comparator), this._reset(), this.initialize.apply(this, arguments), t5 && this.reset(t5, n4.extend({ silent: true }, e5)); }, b = { add: true, remove: true, merge: true }, _ = { add: true, remove: false }, w = function(t5, e5, n5) { n5 = Math.min(Math.max(n5, 0), t5.length); var o4, r3 = Array(t5.length - n5), i3 = e5.length; for (o4 = 0; o4 < r3.length; o4++) r3[o4] = t5[o4 + n5]; for (o4 = 0; o4 < i3; o4++) t5[o4 + n5] = e5[o4]; for (o4 = 0; o4 < r3.length; o4++) t5[o4 + i3 + n5] = r3[o4]; }; n4.extend(m.prototype, a, { model: y, preinitialize: function() { }, initialize: function() { }, toJSON: function(t5) { return this.map(function(e5) { return e5.toJSON(t5); }); }, sync: function() { return e4.sync.apply(this, arguments); }, add: function(t5, e5) { return this.set(t5, n4.extend({ merge: false }, e5, _)); }, remove: function(t5, e5) { e5 = n4.extend({}, e5); var o4 = !n4.isArray(t5); t5 = o4 ? [t5] : t5.slice(); var r3 = this._removeModels(t5, e5); return !e5.silent && r3.length && (e5.changes = { added: [], merged: [], removed: r3 }, this.trigger("update", this, e5)), o4 ? r3[0] : r3; }, set: function(t5, e5) { if (null != t5) { (e5 = n4.extend({}, b, e5)).parse && !this._isModel(t5) && (t5 = this.parse(t5, e5) || []); var o4 = !n4.isArray(t5); t5 = o4 ? [t5] : t5.slice(); var r3 = e5.at; null != r3 && (r3 = +r3), r3 > this.length && (r3 = this.length), r3 < 0 && (r3 += this.length + 1); var i3, s3, a2 = [], l2 = [], c2 = [], u2 = [], p2 = {}, d2 = e5.add, f2 = e5.merge, h2 = e5.remove, g2 = false, v2 = this.comparator && null == r3 && false !== e5.sort, y2 = n4.isString(this.comparator) ? this.comparator : null; for (s3 = 0; s3 < t5.length; s3++) { i3 = t5[s3]; var m2 = this.get(i3); if (m2) { if (f2 && i3 !== m2) { var _2 = this._isModel(i3) ? i3.attributes : i3; e5.parse && (_2 = m2.parse(_2, e5)), m2.set(_2, e5), c2.push(m2), v2 && !g2 && (g2 = m2.hasChanged(y2)); } p2[m2.cid] || (p2[m2.cid] = true, a2.push(m2)), t5[s3] = m2; } else d2 && (i3 = t5[s3] = this._prepareModel(i3, e5)) && (l2.push(i3), this._addReference(i3, e5), p2[i3.cid] = true, a2.push(i3)); } if (h2) { for (s3 = 0; s3 < this.length; s3++) p2[(i3 = this.models[s3]).cid] || u2.push(i3); u2.length && this._removeModels(u2, e5); } var x2 = false, C2 = !v2 && d2 && h2; if (a2.length && C2 ? (x2 = this.length !== a2.length || n4.some(this.models, function(t6, e6) { return t6 !== a2[e6]; }), this.models.length = 0, w(this.models, a2, 0), this.length = this.models.length) : l2.length && (v2 && (g2 = true), w(this.models, l2, null == r3 ? this.length : r3), this.length = this.models.length), g2 && this.sort({ silent: true }), !e5.silent) { for (s3 = 0; s3 < l2.length; s3++) null != r3 && (e5.index = r3 + s3), (i3 = l2[s3]).trigger("add", i3, this, e5); (g2 || x2) && this.trigger("sort", this, e5), (l2.length || u2.length || c2.length) && (e5.changes = { added: l2, removed: u2, merged: c2 }, this.trigger("update", this, e5)); } return o4 ? t5[0] : t5; } }, reset: function(t5, e5) { e5 = e5 ? n4.clone(e5) : {}; for (var o4 = 0; o4 < this.models.length; o4++) this._removeReference(this.models[o4], e5); return e5.previousModels = this.models, this._reset(), t5 = this.add(t5, n4.extend({ silent: true }, e5)), e5.silent || this.trigger("reset", this, e5), t5; }, push: function(t5, e5) { return this.add(t5, n4.extend({ at: this.length }, e5)); }, pop: function(t5) { var e5 = this.at(this.length - 1); return this.remove(e5, t5); }, unshift: function(t5, e5) { return this.add(t5, n4.extend({ at: 0 }, e5)); }, shift: function(t5) { var e5 = this.at(0); return this.remove(e5, t5); }, slice: function() { return i2.apply(this.models, arguments); }, get: function(t5) { if (null != t5) return this._byId[t5] || this._byId[this.modelId(this._isModel(t5) ? t5.attributes : t5, t5.idAttribute)] || t5.cid && this._byId[t5.cid]; }, has: function(t5) { return null != this.get(t5); }, at: function(t5) { return t5 < 0 && (t5 += this.length), this.models[t5]; }, where: function(t5, e5) { return this[e5 ? "find" : "filter"](t5); }, findWhere: function(t5) { return this.where(t5, true); }, sort: function(t5) { var e5 = this.comparator; if (!e5) throw new Error("Cannot sort a set without a comparator"); t5 || (t5 = {}); var o4 = e5.length; return n4.isFunction(e5) && (e5 = e5.bind(this)), 1 === o4 || n4.isString(e5) ? this.models = this.sortBy(e5) : this.models.sort(e5), t5.silent || this.trigger("sort", this, t5), this; }, pluck: function(t5) { return this.map(t5 + ""); }, fetch: function(t5) { var e5 = (t5 = n4.extend({ parse: true }, t5)).success, o4 = this; return t5.success = function(n5) { var r3 = t5.reset ? "reset" : "set"; o4[r3](n5, t5), e5 && e5.call(t5.context, o4, n5, t5), o4.trigger("sync", o4, n5, t5); }, K(this, t5), this.sync("read", this, t5); }, create: function(t5, e5) { var o4 = (e5 = e5 ? n4.clone(e5) : {}).wait; if (!(t5 = this._prepareModel(t5, e5))) return false; o4 || this.add(t5, e5); var r3 = this, i3 = e5.success; return e5.success = function(t6, e6, n5) { o4 && r3.add(t6, n5), i3 && i3.call(n5.context, t6, e6, n5); }, t5.save(null, e5), t5; }, parse: function(t5, e5) { return t5; }, clone: function() { return new this.constructor(this.models, { model: this.model, comparator: this.comparator }); }, modelId: function(t5, e5) { return t5[e5 || this.model.prototype.idAttribute || "id"]; }, values: function() { return new C(this, S); }, keys: function() { return new C(this, O); }, entries: function() { return new C(this, T); }, _reset: function() { this.length = 0, this.models = [], this._byId = {}; }, _prepareModel: function(t5, e5) { return this._isModel(t5) ? (t5.collection || (t5.collection = this), t5) : ((e5 = e5 ? n4.clone(e5) : {}).collection = this, (o4 = this.model.prototype ? new this.model(t5, e5) : this.model(t5, e5)).validationError ? (this.trigger("invalid", this, o4.validationError, e5), false) : o4); var o4; }, _removeModels: function(t5, e5) { for (var n5 = [], o4 = 0; o4 < t5.length; o4++) { var r3 = this.get(t5[o4]); if (r3) { var i3 = this.indexOf(r3); this.models.splice(i3, 1), this.length--, delete this._byId[r3.cid]; var s3 = this.modelId(r3.attributes, r3.idAttribute); null != s3 && delete this._byId[s3], e5.silent || (e5.index = i3, r3.trigger("remove", r3, this, e5)), n5.push(r3), this._removeReference(r3, e5); } } return n5; }, _isModel: function(t5) { return t5 instanceof y; }, _addReference: function(t5, e5) { this._byId[t5.cid] = t5; var n5 = this.modelId(t5.attributes, t5.idAttribute); null != n5 && (this._byId[n5] = t5), t5.on("all", this._onModelEvent, this); }, _removeReference: function(t5, e5) { delete this._byId[t5.cid]; var n5 = this.modelId(t5.attributes, t5.idAttribute); null != n5 && delete this._byId[n5], this === t5.collection && delete t5.collection, t5.off("all", this._onModelEvent, this); }, _onModelEvent: function(t5, e5, n5, o4) { if (e5) { if (("add" === t5 || "remove" === t5) && n5 !== this) return; if ("destroy" === t5 && this.remove(e5, o4), "changeId" === t5) { var r3 = this.modelId(e5.previousAttributes(), e5.idAttribute), i3 = this.modelId(e5.attributes, e5.idAttribute); null != r3 && delete this._byId[r3], null != i3 && (this._byId[i3] = e5); } } this.trigger.apply(this, arguments); } }); var x = "function" == typeof Symbol && Symbol.iterator; x && (m.prototype[x] = m.prototype.values); var C = function(t5, e5) { this._collection = t5, this._kind = e5, this._index = 0; }, S = 1, O = 2, T = 3; x && (C.prototype[x] = function() { return this; }); C.prototype.next = function() { if (this._collection) { if (this._index < this._collection.length) { var t5, e5 = this._collection.at(this._index); if (this._index++, this._kind === S) t5 = e5; else { var n5 = this._collection.modelId(e5.attributes, e5.idAttribute); t5 = this._kind === O ? n5 : [n5, e5]; } return { value: t5, done: false }; } this._collection = void 0; } return { value: void 0, done: true }; }; var k = e4.View = function(t5) { this.cid = n4.uniqueId("view"), this.preinitialize.apply(this, arguments), n4.extend(this, n4.pick(t5, E)), this._ensureElement(), this.initialize.apply(this, arguments); }, P = /^(\S+)\s*(.*)$/, E = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"]; n4.extend(k.prototype, a, { tagName: "div", $: function(t5) { return this.$el.find(t5); }, preinitialize: function() { }, initialize: function() { }, render: function() { return this; }, remove: function() { return this._removeElement(), this.stopListening(), this; }, _removeElement: function() { this.$el.remove(); }, setElement: function(t5) { return this.undelegateEvents(), this._setElement(t5), this.delegateEvents(), this; }, _setElement: function(t5) { this.$el = t5 instanceof e4.$ ? t5 : e4.$(t5), this.el = this.$el[0]; }, delegateEvents: function(t5) { if (t5 || (t5 = n4.result(this, "events")), !t5) return this; for (var e5 in this.undelegateEvents(), t5) { var o4 = t5[e5]; if (n4.isFunction(o4) || (o4 = this[o4]), o4) { var r3 = e5.match(P); this.delegate(r3[1], r3[2], o4.bind(this)); } } return this; }, delegate: function(t5, e5, n5) { return this.$el.on(t5 + ".delegateEvents" + this.cid, e5, n5), this; }, undelegateEvents: function() { return this.$el && this.$el.off(".delegateEvents" + this.cid), this; }, undelegate: function(t5, e5, n5) { return this.$el.off(t5 + ".delegateEvents" + this.cid, e5, n5), this; }, _createElement: function(t5) { return document.createElement(t5); }, _ensureElement: function() { if (this.el) this.setElement(n4.result(this, "el")); else { var t5 = n4.extend({}, n4.result(this, "attributes")); this.id && (t5.id = n4.result(this, "id")), this.className && (t5["class"] = n4.result(this, "className")), this.setElement(this._createElement(n4.result(this, "tagName"))), this._setAttributes(t5); } }, _setAttributes: function(t5) { this.$el.attr(t5); } }); var A = function(t5, e5, n5, o4) { switch (e5) { case 1: return function() { return t5[n5](this[o4]); }; case 2: return function(e6) { return t5[n5](this[o4], e6); }; case 3: return function(e6, r3) { return t5[n5](this[o4], M(e6, this), r3); }; case 4: return function(e6, r3, i3) { return t5[n5](this[o4], M(e6, this), r3, i3); }; default: return function() { var e6 = i2.call(arguments); return e6.unshift(this[o4]), t5[n5].apply(t5, e6); }; } }, j = function(t5, e5, o4, r3) { n4.each(o4, function(n5, o5) { e5[o5] && (t5.prototype[o5] = A(e5, n5, o5, r3)); }); }, M = function(t5, e5) { return n4.isFunction(t5) ? t5 : n4.isObject(t5) && !e5._isModel(t5) ? L(t5) : n4.isString(t5) ? function(e6) { return e6.get(t5); } : t5; }, L = function(t5) { var e5 = n4.matches(t5); return function(t6) { return e5(t6.attributes); }; }, D = { 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 }, N = { keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, omit: 0, chain: 1, isEmpty: 1 }; n4.each([[m, D, "models"], [y, N, "attributes"]], function(t5) { var e5 = t5[0], o4 = t5[1], r3 = t5[2]; e5.mixin = function(t6) { var o5 = n4.reduce(n4.functions(t6), function(t7, e6) { return t7[e6] = 0, t7; }, {}); j(e5, t6, o5, r3); }, j(e5, n4, o4, r3); }), e4.sync = function(t5, o4, r3) { var i3 = I[t5]; n4.defaults(r3 || (r3 = {}), { emulateHTTP: e4.emulateHTTP, emulateJSON: e4.emulateJSON }); var s3 = { type: i3, dataType: "json" }; if (r3.url || (s3.url = n4.result(o4, "url") || G()), null != r3.data || !o4 || "create" !== t5 && "update" !== t5 && "patch" !== t5 || (s3.contentType = "application/json", s3.data = JSON.stringify(r3.attrs || o4.toJSON(r3))), r3.emulateJSON && (s3.contentType = "application/x-www-form-urlencoded", s3.data = s3.data ? { model: s3.data } : {}), r3.emulateHTTP && ("PUT" === i3 || "DELETE" === i3 || "PATCH" === i3)) { s3.type = "POST", r3.emulateJSON && (s3.data._method = i3); var a2 = r3.beforeSend; r3.beforeSend = function(t6) { if (t6.setRequestHeader("X-HTTP-Method-Override", i3), a2) return a2.apply(this, arguments); }; } "GET" === s3.type || r3.emulateJSON || (s3.processData = false); var l2 = r3.error; r3.error = function(t6, e5, n5) { r3.textStatus = e5, r3.errorThrown = n5, l2 && l2.call(r3.context, t6, e5, n5); }; var c2 = r3.xhr = e4.ajax(n4.extend(s3, r3)); return o4.trigger("request", o4, c2, r3), c2; }; var I = { create: "POST", update: "PUT", patch: "PATCH", delete: "DELETE", read: "GET" }; e4.ajax = function() { return e4.$.ajax.apply(e4.$, arguments); }; var F = e4.Router = function(t5) { t5 || (t5 = {}), this.preinitialize.apply(this, arguments), t5.routes && (this.routes = t5.routes), this._bindRoutes(), this.initialize.apply(this, arguments); }, V = /\((.*?)\)/g, R = /(\(\?)?:\w+/g, H = /\*\w+/g, z = /[\-{}\[\]+?.,\\\^$|#\s]/g; n4.extend(F.prototype, a, { preinitialize: function() { }, initialize: function() { }, route: function(t5, o4, r3) { n4.isRegExp(t5) || (t5 = this._routeToRegExp(t5)), n4.isFunction(o4) && (r3 = o4, o4 = ""), r3 || (r3 = this[o4]); var i3 = this; return e4.history.route(t5, function(n5) { var s3 = i3._extractParameters(t5, n5); false !== i3.execute(r3, s3, o4) && (i3.trigger.apply(i3, ["route:" + o4].concat(s3)), i3.trigger("route", o4, s3), e4.history.trigger("route", i3, o4, s3)); }), this; }, execute: function(t5, e5, n5) { t5 && t5.apply(this, e5); }, navigate: function(t5, n5) { return e4.history.navigate(t5, n5), this; }, _bindRoutes: function() { if (this.routes) { this.routes = n4.result(this, "routes"); for (var t5, e5 = n4.keys(this.routes); null != (t5 = e5.pop()); ) this.route(t5, this.routes[t5]); } }, _routeToRegExp: function(t5) { return t5 = t5.replace(z, "\\$&").replace(V, "(?:$1)?").replace(R, function(t6, e5) { return e5 ? t6 : "([^/?]+)"; }).replace(H, "([^?]*?)"), new RegExp("^" + t5 + "(?:\\?([\\s\\S]*))?$"); }, _extractParameters: function(t5, e5) { var o4 = t5.exec(e5).slice(1); return n4.map(o4, function(t6, e6) { return e6 === o4.length - 1 ? t6 || null : t6 ? decodeURIComponent(t6) : null; }); } }); var B = e4.History = function() { this.handlers = [], this.checkUrl = this.checkUrl.bind(this), "undefined" != typeof window && (this.location = window.location, this.history = window.history); }, U = /^[#\/]|\s+$/g, W = /^\/+|\/+$/g, $ = /#.*$/; B.started = false, n4.extend(B.prototype, a, { 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(t5) { return decodeURI(t5.replace(/%25/g, "%2525")); }, getSearch: function() { var t5 = this.location.href.replace(/#.*/, "").match(/\?.+/); return t5 ? t5[0] : ""; }, getHash: function(t5) { var e5 = (t5 || this).location.href.match(/#(.*)$/); return e5 ? e5[1] : ""; }, getPath: function() { var t5 = this.decodeFragment(this.location.pathname + this.getSearch()).slice(this.root.length - 1); return "/" === t5.charAt(0) ? t5.slice(1) : t5; }, getFragment: function(t5) { return null == t5 && (t5 = this._usePushState || !this._wantsHashChange ? this.getPath() : this.getHash()), t5.replace(U, ""); }, start: function(t5) { if (B.started) throw new Error("Backbone.history has already been started"); if (B.started = true, this.options = n4.extend({ root: "/" }, this.options, t5), this.root = this.options.root, this._wantsHashChange = false !== this.options.hashChange, this._hasHashChange = "onhashchange" in window && (void 0 === document.documentMode || 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(W, "/"), this._wantsHashChange && this._wantsPushState) { if (!this._hasPushState && !this.atRoot()) { var e5 = this.root.slice(0, -1) || "/"; return this.location.replace(e5 + "#" + this.getPath()), true; } this._hasPushState && this.atRoot() && this.navigate(this.getHash(), { replace: true }); } 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 o4 = document.body, r3 = o4.insertBefore(this.iframe, o4.firstChild).contentWindow; r3.document.open(), r3.document.close(), r3.location.hash = "#" + this.fragment; } var i3 = window.addEventListener || function(t6, e6) { return attachEvent("on" + t6, e6); }; if (this._usePushState ? i3("popstate", this.checkUrl, false) : this._useHashChange && !this.iframe ? i3("hashchange", this.checkUrl, false) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), !this.options.silent) return this.loadUrl(); }, stop: function() { var t5 = window.removeEventListener || function(t6, e5) { return detachEvent("on" + t6, e5); }; this._usePushState ? t5("popstate", this.checkUrl, false) : this._useHashChange && !this.iframe && t5("hashchange", this.checkUrl, false), this.iframe && (document.body.removeChild(this.iframe), this.iframe = null), this._checkUrlInterval && clearInterval(this._checkUrlInterval), B.started = false; }, route: function(t5, e5) { this.handlers.unshift({ route: t5, callback: e5 }); }, checkUrl: function(t5) { var e5 = this.getFragment(); if (e5 === this.fragment && this.iframe && (e5 = this.getHash(this.iframe.contentWindow)), e5 === this.fragment) return false; this.iframe && this.navigate(e5), this.loadUrl(); }, loadUrl: function(t5) { return !!this.matchRoot() && (t5 = this.fragment = this.getFragment(t5), n4.some(this.handlers, function(e5) { if (e5.route.test(t5)) return e5.callback(t5), true; })); }, navigate: function(t5, e5) { if (!B.started) return false; e5 && true !== e5 || (e5 = { trigger: !!e5 }), t5 = this.getFragment(t5 || ""); var n5 = this.root; "" !== t5 && "?" !== t5.charAt(0) || (n5 = n5.slice(0, -1) || "/"); var o4 = n5 + t5; t5 = t5.replace($, ""); var r3 = this.decodeFragment(t5); if (this.fragment !== r3) { if (this.fragment = r3, this._usePushState) this.history[e5.replace ? "replaceState" : "pushState"]({}, document.title, o4); else { if (!this._wantsHashChange) return this.location.assign(o4); if (this._updateHash(this.location, t5, e5.replace), this.iframe && t5 !== this.getHash(this.iframe.contentWindow)) { var i3 = this.iframe.contentWindow; e5.replace || (i3.document.open(), i3.document.close()), this._updateHash(i3.location, t5, e5.replace); } } return e5.trigger ? this.loadUrl(t5) : void 0; } }, _updateHash: function(t5, e5, n5) { if (n5) { var o4 = t5.href.replace(/(javascript:|#).*$/, ""); t5.replace(o4 + "#" + e5); } else t5.hash = "#" + e5; } }), e4.history = new B(); var q = function(t5, e5) { var o4, r3 = this; return o4 = t5 && n4.has(t5, "constructor") ? t5.constructor : function() { return r3.apply(this, arguments); }, n4.extend(o4, r3, e5), o4.prototype = n4.create(r3.prototype, t5), o4.prototype.constructor = o4, o4.__super__ = r3.prototype, o4; }; y.extend = m.extend = F.extend = k.extend = B.extend = q; var G = function() { throw new Error('A "url" property or function must be specified'); }, K = function(t5, e5) { var n5 = e5.error; e5.error = function(o4) { n5 && n5.call(e5.context, t5, o4, e5), t5.trigger("error", t5, o4, e5); }; }; return e4; }(s, n3, t3, e3); }.apply(e2, o2), void 0 === r || (t2.exports = r); }(); }, 210: (t2, e2, n2) => { (function(t3) { t3.extendMode("css", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(t4, e4) { return /^[;{}]$/.test(e4); } }), t3.extendMode("javascript", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(t4, e4, n3, o2) { return this.jsonMode ? /^[\[,{]$/.test(e4) || /^}/.test(n3) : (";" != e4 || !o2.lexical || ")" != o2.lexical.type) && /^[;{}]$/.test(e4) && !/^;/.test(n3); } }); var e3 = /^(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)$/; t3.extendMode("xml", { commentStart: "", newlineAfterToken: function(t4, n3, o2, r) { var i = false; return "html" == this.configuration && (i = !!r.context && e3.test(r.context.tagName)), !i && ("tag" == t4 && />$/.test(n3) && r.context || /^ -1 && a > -1 && a > s && (t4 = t4.substr(0, s) + t4.substring(s + i.commentStart.length, a) + t4.substr(a + i.commentEnd.length)), r.replaceRange(t4, n3, o2); } }); }), t3.defineExtension("autoIndentRange", function(t4, e4) { var n3 = this; this.operation(function() { for (var o2 = t4.line; o2 <= e4.line; o2++) n3.indentLine(o2, "smart"); }); }), t3.defineExtension("autoFormatRange", function(e4, n3) { var o2 = this, r = o2.getMode(), i = o2.getRange(e4, n3).split("\n"), s = t3.copyState(r, o2.getTokenAt(e4).state), a = o2.getOption("tabSize"), l = "", c = 0, u = 0 === e4.ch; function p() { l += "\n", u = true, ++c; } for (var d = 0; d < i.length; ++d) { for (var f = new t3.StringStream(i[d], a); !f.eol(); ) { var h = t3.innerMode(r, s), g = r.token(f, s), v = f.current(); f.start = f.pos, u && !/\S/.test(v) || (l += v, u = false), !u && h.mode.newlineAfterToken && h.mode.newlineAfterToken(g, v, f.string.slice(f.pos) || i[d + 1] || "", h.state) && p(); } !f.pos && r.blankLine && r.blankLine(s), !u && d < i.length - 1 && p(); } o2.operation(function() { o2.replaceRange(l, e4, n3); for (var t4 = e4.line + 1, r2 = e4.line + c; t4 <= r2; ++t4) o2.indentLine(t4, "smart"); o2.setSelection(e4, o2.getCursor(false)); }); }); })(n2(631)); }, 631: function(t2) { t2.exports = function() { var t3 = navigator.userAgent, e2 = navigator.platform, n2 = /gecko\/\d/i.test(t3), o2 = /MSIE \d/.test(t3), r = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t3), i = /Edge\/(\d+)/.exec(t3), s = o2 || r || i, a = s && (o2 ? document.documentMode || 6 : +(i || r)[1]), l = !i && /WebKit\//.test(t3), c = l && /Qt\/\d+\.\d+/.test(t3), u = !i && /Chrome\/(\d+)/.exec(t3), p = u && +u[1], d = /Opera\//.test(t3), f = /Apple Computer/.test(navigator.vendor), h = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t3), g = /PhantomJS/.test(t3), v = f && (/Mobile\/\w+/.test(t3) || navigator.maxTouchPoints > 2), y = /Android/.test(t3), m = v || y || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t3), b = v || /Mac/.test(e2), _ = /\bCrOS\b/.test(t3), w = /win/i.test(e2), x = d && t3.match(/Version\/(\d*\.\d*)/); x && (x = Number(x[1])), x && x >= 15 && (d = false, l = true); var C = b && (c || d && (null == x || x < 12.11)), S = n2 || s && a >= 9; function O(t4) { return new RegExp("(^|\\s)" + t4 + "(?:$|\\s)\\s*"); } var T, k = function(t4, e3) { var n3 = t4.className, o3 = O(e3).exec(n3); if (o3) { var r2 = n3.slice(o3.index + o3[0].length); t4.className = n3.slice(0, o3.index) + (r2 ? o3[1] + r2 : ""); } }; function P(t4) { for (var e3 = t4.childNodes.length; e3 > 0; --e3) t4.removeChild(t4.firstChild); return t4; } function E(t4, e3) { return P(t4).appendChild(e3); } function A(t4, e3, n3, o3) { var r2 = document.createElement(t4); if (n3 && (r2.className = n3), o3 && (r2.style.cssText = o3), "string" == typeof e3) r2.appendChild(document.createTextNode(e3)); else if (e3) for (var i2 = 0; i2 < e3.length; ++i2) r2.appendChild(e3[i2]); return r2; } function j(t4, e3, n3, o3) { var r2 = A(t4, e3, n3, o3); return r2.setAttribute("role", "presentation"), r2; } function M(t4, e3) { if (3 == e3.nodeType && (e3 = e3.parentNode), t4.contains) return t4.contains(e3); do { if (11 == e3.nodeType && (e3 = e3.host), e3 == t4) return true; } while (e3 = e3.parentNode); } function L() { var t4; try { t4 = document.activeElement; } catch (e3) { t4 = document.body || null; } for (; t4 && t4.shadowRoot && t4.shadowRoot.activeElement; ) t4 = t4.shadowRoot.activeElement; return t4; } function D(t4, e3) { var n3 = t4.className; O(e3).test(n3) || (t4.className += (n3 ? " " : "") + e3); } function N(t4, e3) { for (var n3 = t4.split(" "), o3 = 0; o3 < n3.length; o3++) n3[o3] && !O(n3[o3]).test(e3) && (e3 += " " + n3[o3]); return e3; } T = document.createRange ? function(t4, e3, n3, o3) { var r2 = document.createRange(); return r2.setEnd(o3 || t4, n3), r2.setStart(t4, e3), r2; } : function(t4, e3, n3) { var o3 = document.body.createTextRange(); try { o3.moveToElementText(t4.parentNode); } catch (t5) { return o3; } return o3.collapse(true), o3.moveEnd("character", n3), o3.moveStart("character", e3), o3; }; var I = function(t4) { t4.select(); }; function F(t4) { var e3 = Array.prototype.slice.call(arguments, 1); return function() { return t4.apply(null, e3); }; } function V(t4, e3, n3) { for (var o3 in e3 || (e3 = {}), t4) !t4.hasOwnProperty(o3) || false === n3 && e3.hasOwnProperty(o3) || (e3[o3] = t4[o3]); return e3; } function R(t4, e3, n3, o3, r2) { null == e3 && -1 == (e3 = t4.search(/[^\s\u00a0]/)) && (e3 = t4.length); for (var i2 = o3 || 0, s2 = r2 || 0; ; ) { var a2 = t4.indexOf(" ", i2); if (a2 < 0 || a2 >= e3) return s2 + (e3 - i2); s2 += a2 - i2, s2 += n3 - s2 % n3, i2 = a2 + 1; } } v ? I = function(t4) { t4.selectionStart = 0, t4.selectionEnd = t4.value.length; } : s && (I = function(t4) { try { t4.select(); } catch (t5) { } }); var H = function() { this.id = null, this.f = null, this.time = 0, this.handler = F(this.onTimeout, this); }; function z(t4, e3) { for (var n3 = 0; n3 < t4.length; ++n3) if (t4[n3] == e3) return n3; return -1; } H.prototype.onTimeout = function(t4) { t4.id = 0, t4.time <= +/* @__PURE__ */ new Date() ? t4.f() : setTimeout(t4.handler, t4.time - +/* @__PURE__ */ new Date()); }, H.prototype.set = function(t4, e3) { this.f = e3; var n3 = +/* @__PURE__ */ new Date() + t4; (!this.id || n3 < this.time) && (clearTimeout(this.id), this.id = setTimeout(this.handler, t4), this.time = n3); }; var B = 50, U = { toString: function() { return "CodeMirror.Pass"; } }, W = { scroll: false }, $ = { origin: "*mouse" }, q = { origin: "+move" }; function G(t4, e3, n3) { for (var o3 = 0, r2 = 0; ; ) { var i2 = t4.indexOf(" ", o3); -1 == i2 && (i2 = t4.length); var s2 = i2 - o3; if (i2 == t4.length || r2 + s2 >= e3) return o3 + Math.min(s2, e3 - r2); if (r2 += i2 - o3, o3 = i2 + 1, (r2 += n3 - r2 % n3) >= e3) return o3; } } var K = [""]; function Y(t4) { for (; K.length <= t4; ) K.push(X(K) + " "); return K[t4]; } function X(t4) { return t4[t4.length - 1]; } function J(t4, e3) { for (var n3 = [], o3 = 0; o3 < t4.length; o3++) n3[o3] = e3(t4[o3], o3); return n3; } function Z(t4, e3, n3) { for (var o3 = 0, r2 = n3(e3); o3 < t4.length && n3(t4[o3]) <= r2; ) o3++; t4.splice(o3, 0, e3); } function Q() { } function tt(t4, e3) { var n3; return Object.create ? n3 = Object.create(t4) : (Q.prototype = t4, n3 = new Q()), e3 && V(e3, n3), n3; } var et = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; function nt(t4) { return /\w/.test(t4) || t4 > "€" && (t4.toUpperCase() != t4.toLowerCase() || et.test(t4)); } function ot(t4, e3) { return e3 ? !!(e3.source.indexOf("\\w") > -1 && nt(t4)) || e3.test(t4) : nt(t4); } function rt(t4) { for (var e3 in t4) if (t4.hasOwnProperty(e3) && t4[e3]) return false; return true; } var it = /[\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 st(t4) { return t4.charCodeAt(0) >= 768 && it.test(t4); } function at(t4, e3, n3) { for (; (n3 < 0 ? e3 > 0 : e3 < t4.length) && st(t4.charAt(e3)); ) e3 += n3; return e3; } function lt(t4, e3, n3) { for (var o3 = e3 > n3 ? -1 : 1; ; ) { if (e3 == n3) return e3; var r2 = (e3 + n3) / 2, i2 = o3 < 0 ? Math.ceil(r2) : Math.floor(r2); if (i2 == e3) return t4(i2) ? e3 : n3; t4(i2) ? n3 = i2 : e3 = i2 + o3; } } function ct(t4, e3, n3, o3) { if (!t4) return o3(e3, n3, "ltr", 0); for (var r2 = false, i2 = 0; i2 < t4.length; ++i2) { var s2 = t4[i2]; (s2.from < n3 && s2.to > e3 || e3 == n3 && s2.to == e3) && (o3(Math.max(s2.from, e3), Math.min(s2.to, n3), 1 == s2.level ? "rtl" : "ltr", i2), r2 = true); } r2 || o3(e3, n3, "ltr"); } var ut = null; function pt(t4, e3, n3) { var o3; ut = null; for (var r2 = 0; r2 < t4.length; ++r2) { var i2 = t4[r2]; if (i2.from < e3 && i2.to > e3) return r2; i2.to == e3 && (i2.from != i2.to && "before" == n3 ? o3 = r2 : ut = r2), i2.from == e3 && (i2.from != i2.to && "before" != n3 ? o3 = r2 : ut = r2); } return null != o3 ? o3 : ut; } var dt = function() { var t4 = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", e3 = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; function n3(n4) { return n4 <= 247 ? t4.charAt(n4) : 1424 <= n4 && n4 <= 1524 ? "R" : 1536 <= n4 && n4 <= 1785 ? e3.charAt(n4 - 1536) : 1774 <= n4 && n4 <= 2220 ? "r" : 8192 <= n4 && n4 <= 8203 ? "w" : 8204 == n4 ? "b" : "L"; } var o3 = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/, r2 = /[stwN]/, i2 = /[LRr]/, s2 = /[Lb1n]/, a2 = /[1n]/; function l2(t5, e4, n4) { this.level = t5, this.from = e4, this.to = n4; } return function(t5, e4) { var c2 = "ltr" == e4 ? "L" : "R"; if (0 == t5.length || "ltr" == e4 && !o3.test(t5)) return false; for (var u2 = t5.length, p2 = [], d2 = 0; d2 < u2; ++d2) p2.push(n3(t5.charCodeAt(d2))); for (var f2 = 0, h2 = c2; f2 < u2; ++f2) { var g2 = p2[f2]; "m" == g2 ? p2[f2] = h2 : h2 = g2; } for (var v2 = 0, y2 = c2; v2 < u2; ++v2) { var m2 = p2[v2]; "1" == m2 && "r" == y2 ? p2[v2] = "n" : i2.test(m2) && (y2 = m2, "r" == m2 && (p2[v2] = "R")); } for (var b2 = 1, _2 = p2[0]; b2 < u2 - 1; ++b2) { var w2 = p2[b2]; "+" == w2 && "1" == _2 && "1" == p2[b2 + 1] ? p2[b2] = "1" : "," != w2 || _2 != p2[b2 + 1] || "1" != _2 && "n" != _2 || (p2[b2] = _2), _2 = w2; } for (var x2 = 0; x2 < u2; ++x2) { var C2 = p2[x2]; if ("," == C2) p2[x2] = "N"; else if ("%" == C2) { var S2 = void 0; for (S2 = x2 + 1; S2 < u2 && "%" == p2[S2]; ++S2) ; for (var O2 = x2 && "!" == p2[x2 - 1] || S2 < u2 && "1" == p2[S2] ? "1" : "N", T2 = x2; T2 < S2; ++T2) p2[T2] = O2; x2 = S2 - 1; } } for (var k2 = 0, P2 = c2; k2 < u2; ++k2) { var E2 = p2[k2]; "L" == P2 && "1" == E2 ? p2[k2] = "L" : i2.test(E2) && (P2 = E2); } for (var A2 = 0; A2 < u2; ++A2) if (r2.test(p2[A2])) { var j2 = void 0; for (j2 = A2 + 1; j2 < u2 && r2.test(p2[j2]); ++j2) ; for (var M2 = "L" == (A2 ? p2[A2 - 1] : c2), L2 = M2 == ("L" == (j2 < u2 ? p2[j2] : c2)) ? M2 ? "L" : "R" : c2, D2 = A2; D2 < j2; ++D2) p2[D2] = L2; A2 = j2 - 1; } for (var N2, I2 = [], F2 = 0; F2 < u2; ) if (s2.test(p2[F2])) { var V2 = F2; for (++F2; F2 < u2 && s2.test(p2[F2]); ++F2) ; I2.push(new l2(0, V2, F2)); } else { var R2 = F2, H2 = I2.length, z2 = "rtl" == e4 ? 1 : 0; for (++F2; F2 < u2 && "L" != p2[F2]; ++F2) ; for (var B2 = R2; B2 < F2; ) if (a2.test(p2[B2])) { R2 < B2 && (I2.splice(H2, 0, new l2(1, R2, B2)), H2 += z2); var U2 = B2; for (++B2; B2 < F2 && a2.test(p2[B2]); ++B2) ; I2.splice(H2, 0, new l2(2, U2, B2)), H2 += z2, R2 = B2; } else ++B2; R2 < F2 && I2.splice(H2, 0, new l2(1, R2, F2)); } return "ltr" == e4 && (1 == I2[0].level && (N2 = t5.match(/^\s+/)) && (I2[0].from = N2[0].length, I2.unshift(new l2(0, 0, N2[0].length))), 1 == X(I2).level && (N2 = t5.match(/\s+$/)) && (X(I2).to -= N2[0].length, I2.push(new l2(0, u2 - N2[0].length, u2)))), "rtl" == e4 ? I2.reverse() : I2; }; }(); function ft(t4, e3) { var n3 = t4.order; return null == n3 && (n3 = t4.order = dt(t4.text, e3)), n3; } var ht = [], gt = function(t4, e3, n3) { if (t4.addEventListener) t4.addEventListener(e3, n3, false); else if (t4.attachEvent) t4.attachEvent("on" + e3, n3); else { var o3 = t4._handlers || (t4._handlers = {}); o3[e3] = (o3[e3] || ht).concat(n3); } }; function vt(t4, e3) { return t4._handlers && t4._handlers[e3] || ht; } function yt(t4, e3, n3) { if (t4.removeEventListener) t4.removeEventListener(e3, n3, false); else if (t4.detachEvent) t4.detachEvent("on" + e3, n3); else { var o3 = t4._handlers, r2 = o3 && o3[e3]; if (r2) { var i2 = z(r2, n3); i2 > -1 && (o3[e3] = r2.slice(0, i2).concat(r2.slice(i2 + 1))); } } } function mt(t4, e3) { var n3 = vt(t4, e3); if (n3.length) for (var o3 = Array.prototype.slice.call(arguments, 2), r2 = 0; r2 < n3.length; ++r2) n3[r2].apply(null, o3); } function bt(t4, e3, n3) { return "string" == typeof e3 && (e3 = { type: e3, preventDefault: function() { this.defaultPrevented = true; } }), mt(t4, n3 || e3.type, t4, e3), Ot(e3) || e3.codemirrorIgnore; } function _t(t4) { var e3 = t4._handlers && t4._handlers.cursorActivity; if (e3) for (var n3 = t4.curOp.cursorActivityHandlers || (t4.curOp.cursorActivityHandlers = []), o3 = 0; o3 < e3.length; ++o3) -1 == z(n3, e3[o3]) && n3.push(e3[o3]); } function wt(t4, e3) { return vt(t4, e3).length > 0; } function xt(t4) { t4.prototype.on = function(t5, e3) { gt(this, t5, e3); }, t4.prototype.off = function(t5, e3) { yt(this, t5, e3); }; } function Ct(t4) { t4.preventDefault ? t4.preventDefault() : t4.returnValue = false; } function St(t4) { t4.stopPropagation ? t4.stopPropagation() : t4.cancelBubble = true; } function Ot(t4) { return null != t4.defaultPrevented ? t4.defaultPrevented : 0 == t4.returnValue; } function Tt(t4) { Ct(t4), St(t4); } function kt(t4) { return t4.target || t4.srcElement; } function Pt(t4) { var e3 = t4.which; return null == e3 && (1 & t4.button ? e3 = 1 : 2 & t4.button ? e3 = 3 : 4 & t4.button && (e3 = 2)), b && t4.ctrlKey && 1 == e3 && (e3 = 3), e3; } var Et, At, jt = function() { if (s && a < 9) return false; var t4 = A("div"); return "draggable" in t4 || "dragDrop" in t4; }(); function Mt(t4) { if (null == Et) { var e3 = A("span", "​"); E(t4, A("span", [e3, document.createTextNode("x")])), 0 != t4.firstChild.offsetHeight && (Et = e3.offsetWidth <= 1 && e3.offsetHeight > 2 && !(s && a < 8)); } var n3 = Et ? A("span", "​") : A("span", " ", null, "display: inline-block; width: 1px; margin-right: -1px"); return n3.setAttribute("cm-text", ""), n3; } function Lt(t4) { if (null != At) return At; var e3 = E(t4, document.createTextNode("AخA")), n3 = T(e3, 0, 1).getBoundingClientRect(), o3 = T(e3, 1, 2).getBoundingClientRect(); return P(t4), !(!n3 || n3.left == n3.right) && (At = o3.right - n3.right < 3); } var Dt, Nt = 3 != "\n\nb".split(/\n/).length ? function(t4) { for (var e3 = 0, n3 = [], o3 = t4.length; e3 <= o3; ) { var r2 = t4.indexOf("\n", e3); -1 == r2 && (r2 = t4.length); var i2 = t4.slice(e3, "\r" == t4.charAt(r2 - 1) ? r2 - 1 : r2), s2 = i2.indexOf("\r"); -1 != s2 ? (n3.push(i2.slice(0, s2)), e3 += s2 + 1) : (n3.push(i2), e3 = r2 + 1); } return n3; } : function(t4) { return t4.split(/\r\n?|\n/); }, It = window.getSelection ? function(t4) { try { return t4.selectionStart != t4.selectionEnd; } catch (t5) { return false; } } : function(t4) { var e3; try { e3 = t4.ownerDocument.selection.createRange(); } catch (t5) { } return !(!e3 || e3.parentElement() != t4) && 0 != e3.compareEndPoints("StartToEnd", e3); }, Ft = "oncopy" in (Dt = A("div")) || (Dt.setAttribute("oncopy", "return;"), "function" == typeof Dt.oncopy), Vt = null; function Rt(t4) { if (null != Vt) return Vt; var e3 = E(t4, A("span", "x")), n3 = e3.getBoundingClientRect(), o3 = T(e3, 0, 1).getBoundingClientRect(); return Vt = Math.abs(n3.left - o3.left) > 1; } var Ht = {}, zt = {}; function Bt(t4, e3) { arguments.length > 2 && (e3.dependencies = Array.prototype.slice.call(arguments, 2)), Ht[t4] = e3; } function Ut(t4, e3) { zt[t4] = e3; } function Wt(t4) { if ("string" == typeof t4 && zt.hasOwnProperty(t4)) t4 = zt[t4]; else if (t4 && "string" == typeof t4.name && zt.hasOwnProperty(t4.name)) { var e3 = zt[t4.name]; "string" == typeof e3 && (e3 = { name: e3 }), (t4 = tt(e3, t4)).name = e3.name; } else { if ("string" == typeof t4 && /^[\w\-]+\/[\w\-]+\+xml$/.test(t4)) return Wt("application/xml"); if ("string" == typeof t4 && /^[\w\-]+\/[\w\-]+\+json$/.test(t4)) return Wt("application/json"); } return "string" == typeof t4 ? { name: t4 } : t4 || { name: "null" }; } function $t(t4, e3) { e3 = Wt(e3); var n3 = Ht[e3.name]; if (!n3) return $t(t4, "text/plain"); var o3 = n3(t4, e3); if (qt.hasOwnProperty(e3.name)) { var r2 = qt[e3.name]; for (var i2 in r2) r2.hasOwnProperty(i2) && (o3.hasOwnProperty(i2) && (o3["_" + i2] = o3[i2]), o3[i2] = r2[i2]); } if (o3.name = e3.name, e3.helperType && (o3.helperType = e3.helperType), e3.modeProps) for (var s2 in e3.modeProps) o3[s2] = e3.modeProps[s2]; return o3; } var qt = {}; function Gt(t4, e3) { V(e3, qt.hasOwnProperty(t4) ? qt[t4] : qt[t4] = {}); } function Kt(t4, e3) { if (true === e3) return e3; if (t4.copyState) return t4.copyState(e3); var n3 = {}; for (var o3 in e3) { var r2 = e3[o3]; r2 instanceof Array && (r2 = r2.concat([])), n3[o3] = r2; } return n3; } function Yt(t4, e3) { for (var n3; t4.innerMode && (n3 = t4.innerMode(e3)) && n3.mode != t4; ) e3 = n3.state, t4 = n3.mode; return n3 || { mode: t4, state: e3 }; } function Xt(t4, e3, n3) { return !t4.startState || t4.startState(e3, n3); } var Jt = function(t4, e3, n3) { this.pos = this.start = 0, this.string = t4, this.tabSize = e3 || 8, this.lastColumnPos = this.lastColumnValue = 0, this.lineStart = 0, this.lineOracle = n3; }; function Zt(t4, e3) { if ((e3 -= t4.first) < 0 || e3 >= t4.size) throw new Error("There is no line " + (e3 + t4.first) + " in the document."); for (var n3 = t4; !n3.lines; ) for (var o3 = 0; ; ++o3) { var r2 = n3.children[o3], i2 = r2.chunkSize(); if (e3 < i2) { n3 = r2; break; } e3 -= i2; } return n3.lines[e3]; } function Qt(t4, e3, n3) { var o3 = [], r2 = e3.line; return t4.iter(e3.line, n3.line + 1, function(t5) { var i2 = t5.text; r2 == n3.line && (i2 = i2.slice(0, n3.ch)), r2 == e3.line && (i2 = i2.slice(e3.ch)), o3.push(i2), ++r2; }), o3; } function te(t4, e3, n3) { var o3 = []; return t4.iter(e3, n3, function(t5) { o3.push(t5.text); }), o3; } function ee(t4, e3) { var n3 = e3 - t4.height; if (n3) for (var o3 = t4; o3; o3 = o3.parent) o3.height += n3; } function ne(t4) { if (null == t4.parent) return null; for (var e3 = t4.parent, n3 = z(e3.lines, t4), o3 = e3.parent; o3; e3 = o3, o3 = o3.parent) for (var r2 = 0; o3.children[r2] != e3; ++r2) n3 += o3.children[r2].chunkSize(); return n3 + e3.first; } function oe(t4, e3) { var n3 = t4.first; t: do { for (var o3 = 0; o3 < t4.children.length; ++o3) { var r2 = t4.children[o3], i2 = r2.height; if (e3 < i2) { t4 = r2; continue t; } e3 -= i2, n3 += r2.chunkSize(); } return n3; } while (!t4.lines); for (var s2 = 0; s2 < t4.lines.length; ++s2) { var a2 = t4.lines[s2].height; if (e3 < a2) break; e3 -= a2; } return n3 + s2; } function re(t4, e3) { return e3 >= t4.first && e3 < t4.first + t4.size; } function ie(t4, e3) { return String(t4.lineNumberFormatter(e3 + t4.firstLineNumber)); } function se(t4, e3, n3) { if (void 0 === n3 && (n3 = null), !(this instanceof se)) return new se(t4, e3, n3); this.line = t4, this.ch = e3, this.sticky = n3; } function ae(t4, e3) { return t4.line - e3.line || t4.ch - e3.ch; } function le(t4, e3) { return t4.sticky == e3.sticky && 0 == ae(t4, e3); } function ce(t4) { return se(t4.line, t4.ch); } function ue(t4, e3) { return ae(t4, e3) < 0 ? e3 : t4; } function pe(t4, e3) { return ae(t4, e3) < 0 ? t4 : e3; } function de(t4, e3) { return Math.max(t4.first, Math.min(e3, t4.first + t4.size - 1)); } function fe(t4, e3) { if (e3.line < t4.first) return se(t4.first, 0); var n3 = t4.first + t4.size - 1; return e3.line > n3 ? se(n3, Zt(t4, n3).text.length) : he(e3, Zt(t4, e3.line).text.length); } function he(t4, e3) { var n3 = t4.ch; return null == n3 || n3 > e3 ? se(t4.line, e3) : n3 < 0 ? se(t4.line, 0) : t4; } function ge(t4, e3) { for (var n3 = [], o3 = 0; o3 < e3.length; o3++) n3[o3] = fe(t4, e3[o3]); return n3; } Jt.prototype.eol = function() { return this.pos >= this.string.length; }, Jt.prototype.sol = function() { return this.pos == this.lineStart; }, Jt.prototype.peek = function() { return this.string.charAt(this.pos) || void 0; }, Jt.prototype.next = function() { if (this.pos < this.string.length) return this.string.charAt(this.pos++); }, Jt.prototype.eat = function(t4) { var e3 = this.string.charAt(this.pos); if ("string" == typeof t4 ? e3 == t4 : e3 && (t4.test ? t4.test(e3) : t4(e3))) return ++this.pos, e3; }, Jt.prototype.eatWhile = function(t4) { for (var e3 = this.pos; this.eat(t4); ) ; return this.pos > e3; }, Jt.prototype.eatSpace = function() { for (var t4 = this.pos; /[\s\u00a0]/.test(this.string.charAt(this.pos)); ) ++this.pos; return this.pos > t4; }, Jt.prototype.skipToEnd = function() { this.pos = this.string.length; }, Jt.prototype.skipTo = function(t4) { var e3 = this.string.indexOf(t4, this.pos); if (e3 > -1) return this.pos = e3, true; }, Jt.prototype.backUp = function(t4) { this.pos -= t4; }, Jt.prototype.column = function() { return this.lastColumnPos < this.start && (this.lastColumnValue = R(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue - (this.lineStart ? R(this.string, this.lineStart, this.tabSize) : 0); }, Jt.prototype.indentation = function() { return R(this.string, null, this.tabSize) - (this.lineStart ? R(this.string, this.lineStart, this.tabSize) : 0); }, Jt.prototype.match = function(t4, e3, n3) { if ("string" != typeof t4) { var o3 = this.string.slice(this.pos).match(t4); return o3 && o3.index > 0 ? null : (o3 && false !== e3 && (this.pos += o3[0].length), o3); } var r2 = function(t5) { return n3 ? t5.toLowerCase() : t5; }; if (r2(this.string.substr(this.pos, t4.length)) == r2(t4)) return false !== e3 && (this.pos += t4.length), true; }, Jt.prototype.current = function() { return this.string.slice(this.start, this.pos); }, Jt.prototype.hideFirstChars = function(t4, e3) { this.lineStart += t4; try { return e3(); } finally { this.lineStart -= t4; } }, Jt.prototype.lookAhead = function(t4) { var e3 = this.lineOracle; return e3 && e3.lookAhead(t4); }, Jt.prototype.baseToken = function() { var t4 = this.lineOracle; return t4 && t4.baseToken(this.pos); }; var ve = function(t4, e3) { this.state = t4, this.lookAhead = e3; }, ye = function(t4, e3, n3, o3) { this.state = e3, this.doc = t4, this.line = n3, this.maxLookAhead = o3 || 0, this.baseTokens = null, this.baseTokenPos = 1; }; function me(t4, e3, n3, o3) { var r2 = [t4.state.modeGen], i2 = {}; ke(t4, e3.text, t4.doc.mode, n3, function(t5, e4) { return r2.push(t5, e4); }, i2, o3); for (var s2 = n3.state, a2 = function(o4) { n3.baseTokens = r2; var a3 = t4.state.overlays[o4], l3 = 1, c2 = 0; n3.state = true, ke(t4, e3.text, a3.mode, n3, function(t5, e4) { for (var n4 = l3; c2 < t5; ) { var o5 = r2[l3]; o5 > t5 && r2.splice(l3, 1, t5, r2[l3 + 1], o5), l3 += 2, c2 = Math.min(t5, o5); } if (e4) if (a3.opaque) r2.splice(n4, l3 - n4, t5, "overlay " + e4), l3 = n4 + 2; else for (; n4 < l3; n4 += 2) { var i3 = r2[n4 + 1]; r2[n4 + 1] = (i3 ? i3 + " " : "") + "overlay " + e4; } }, i2), n3.state = s2, n3.baseTokens = null, n3.baseTokenPos = 1; }, l2 = 0; l2 < t4.state.overlays.length; ++l2) a2(l2); return { styles: r2, classes: i2.bgClass || i2.textClass ? i2 : null }; } function be(t4, e3, n3) { if (!e3.styles || e3.styles[0] != t4.state.modeGen) { var o3 = _e(t4, ne(e3)), r2 = e3.text.length > t4.options.maxHighlightLength && Kt(t4.doc.mode, o3.state), i2 = me(t4, e3, o3); r2 && (o3.state = r2), e3.stateAfter = o3.save(!r2), e3.styles = i2.styles, i2.classes ? e3.styleClasses = i2.classes : e3.styleClasses && (e3.styleClasses = null), n3 === t4.doc.highlightFrontier && (t4.doc.modeFrontier = Math.max(t4.doc.modeFrontier, ++t4.doc.highlightFrontier)); } return e3.styles; } function _e(t4, e3, n3) { var o3 = t4.doc, r2 = t4.display; if (!o3.mode.startState) return new ye(o3, true, e3); var i2 = Pe(t4, e3, n3), s2 = i2 > o3.first && Zt(o3, i2 - 1).stateAfter, a2 = s2 ? ye.fromSaved(o3, s2, i2) : new ye(o3, Xt(o3.mode), i2); return o3.iter(i2, e3, function(n4) { we(t4, n4.text, a2); var o4 = a2.line; n4.stateAfter = o4 == e3 - 1 || o4 % 5 == 0 || o4 >= r2.viewFrom && o4 < r2.viewTo ? a2.save() : null, a2.nextLine(); }), n3 && (o3.modeFrontier = a2.line), a2; } function we(t4, e3, n3, o3) { var r2 = t4.doc.mode, i2 = new Jt(e3, t4.options.tabSize, n3); for (i2.start = i2.pos = o3 || 0, "" == e3 && xe(r2, n3.state); !i2.eol(); ) Ce(r2, i2, n3.state), i2.start = i2.pos; } function xe(t4, e3) { if (t4.blankLine) return t4.blankLine(e3); if (t4.innerMode) { var n3 = Yt(t4, e3); return n3.mode.blankLine ? n3.mode.blankLine(n3.state) : void 0; } } function Ce(t4, e3, n3, o3) { for (var r2 = 0; r2 < 10; r2++) { o3 && (o3[0] = Yt(t4, n3).mode); var i2 = t4.token(e3, n3); if (e3.pos > e3.start) return i2; } throw new Error("Mode " + t4.name + " failed to advance stream."); } ye.prototype.lookAhead = function(t4) { var e3 = this.doc.getLine(this.line + t4); return null != e3 && t4 > this.maxLookAhead && (this.maxLookAhead = t4), e3; }, ye.prototype.baseToken = function(t4) { if (!this.baseTokens) return null; for (; this.baseTokens[this.baseTokenPos] <= t4; ) this.baseTokenPos += 2; var e3 = this.baseTokens[this.baseTokenPos + 1]; return { type: e3 && e3.replace(/( |^)overlay .*/, ""), size: this.baseTokens[this.baseTokenPos] - t4 }; }, ye.prototype.nextLine = function() { this.line++, this.maxLookAhead > 0 && this.maxLookAhead--; }, ye.fromSaved = function(t4, e3, n3) { return e3 instanceof ve ? new ye(t4, Kt(t4.mode, e3.state), n3, e3.lookAhead) : new ye(t4, Kt(t4.mode, e3), n3); }, ye.prototype.save = function(t4) { var e3 = false !== t4 ? Kt(this.doc.mode, this.state) : this.state; return this.maxLookAhead > 0 ? new ve(e3, this.maxLookAhead) : e3; }; var Se = function(t4, e3, n3) { this.start = t4.start, this.end = t4.pos, this.string = t4.current(), this.type = e3 || null, this.state = n3; }; function Oe(t4, e3, n3, o3) { var r2, i2, s2 = t4.doc, a2 = s2.mode, l2 = Zt(s2, (e3 = fe(s2, e3)).line), c2 = _e(t4, e3.line, n3), u2 = new Jt(l2.text, t4.options.tabSize, c2); for (o3 && (i2 = []); (o3 || u2.pos < e3.ch) && !u2.eol(); ) u2.start = u2.pos, r2 = Ce(a2, u2, c2.state), o3 && i2.push(new Se(u2, r2, Kt(s2.mode, c2.state))); return o3 ? i2 : new Se(u2, r2, c2.state); } function Te(t4, e3) { if (t4) for (; ; ) { var n3 = t4.match(/(?:^|\s+)line-(background-)?(\S+)/); if (!n3) break; t4 = t4.slice(0, n3.index) + t4.slice(n3.index + n3[0].length); var o3 = n3[1] ? "bgClass" : "textClass"; null == e3[o3] ? e3[o3] = n3[2] : new RegExp("(?:^|\\s)" + n3[2] + "(?:$|\\s)").test(e3[o3]) || (e3[o3] += " " + n3[2]); } return t4; } function ke(t4, e3, n3, o3, r2, i2, s2) { var a2 = n3.flattenSpans; null == a2 && (a2 = t4.options.flattenSpans); var l2, c2 = 0, u2 = null, p2 = new Jt(e3, t4.options.tabSize, o3), d2 = t4.options.addModeClass && [null]; for ("" == e3 && Te(xe(n3, o3.state), i2); !p2.eol(); ) { if (p2.pos > t4.options.maxHighlightLength ? (a2 = false, s2 && we(t4, e3, o3, p2.pos), p2.pos = e3.length, l2 = null) : l2 = Te(Ce(n3, p2, o3.state, d2), i2), d2) { var f2 = d2[0].name; f2 && (l2 = "m-" + (l2 ? f2 + " " + l2 : f2)); } if (!a2 || u2 != l2) { for (; c2 < p2.start; ) r2(c2 = Math.min(p2.start, c2 + 5e3), u2); u2 = l2; } p2.start = p2.pos; } for (; c2 < p2.pos; ) { var h2 = Math.min(p2.pos, c2 + 5e3); r2(h2, u2), c2 = h2; } } function Pe(t4, e3, n3) { for (var o3, r2, i2 = t4.doc, s2 = n3 ? -1 : e3 - (t4.doc.mode.innerMode ? 1e3 : 100), a2 = e3; a2 > s2; --a2) { if (a2 <= i2.first) return i2.first; var l2 = Zt(i2, a2 - 1), c2 = l2.stateAfter; if (c2 && (!n3 || a2 + (c2 instanceof ve ? c2.lookAhead : 0) <= i2.modeFrontier)) return a2; var u2 = R(l2.text, null, t4.options.tabSize); (null == r2 || o3 > u2) && (r2 = a2 - 1, o3 = u2); } return r2; } function Ee(t4, e3) { if (t4.modeFrontier = Math.min(t4.modeFrontier, e3), !(t4.highlightFrontier < e3 - 10)) { for (var n3 = t4.first, o3 = e3 - 1; o3 > n3; o3--) { var r2 = Zt(t4, o3).stateAfter; if (r2 && (!(r2 instanceof ve) || o3 + r2.lookAhead < e3)) { n3 = o3 + 1; break; } } t4.highlightFrontier = Math.min(t4.highlightFrontier, n3); } } var Ae = false, je = false; function Me() { Ae = true; } function Le() { je = true; } function De(t4, e3, n3) { this.marker = t4, this.from = e3, this.to = n3; } function Ne(t4, e3) { if (t4) for (var n3 = 0; n3 < t4.length; ++n3) { var o3 = t4[n3]; if (o3.marker == e3) return o3; } } function Ie(t4, e3) { for (var n3, o3 = 0; o3 < t4.length; ++o3) t4[o3] != e3 && (n3 || (n3 = [])).push(t4[o3]); return n3; } function Fe(t4, e3, n3) { var o3 = n3 && window.WeakSet && (n3.markedSpans || (n3.markedSpans = /* @__PURE__ */ new WeakSet())); o3 && t4.markedSpans && o3.has(t4.markedSpans) ? t4.markedSpans.push(e3) : (t4.markedSpans = t4.markedSpans ? t4.markedSpans.concat([e3]) : [e3], o3 && o3.add(t4.markedSpans)), e3.marker.attachLine(t4); } function Ve(t4, e3, n3) { var o3; if (t4) for (var r2 = 0; r2 < t4.length; ++r2) { var i2 = t4[r2], s2 = i2.marker; if (null == i2.from || (s2.inclusiveLeft ? i2.from <= e3 : i2.from < e3) || i2.from == e3 && "bookmark" == s2.type && (!n3 || !i2.marker.insertLeft)) { var a2 = null == i2.to || (s2.inclusiveRight ? i2.to >= e3 : i2.to > e3); (o3 || (o3 = [])).push(new De(s2, i2.from, a2 ? null : i2.to)); } } return o3; } function Re(t4, e3, n3) { var o3; if (t4) for (var r2 = 0; r2 < t4.length; ++r2) { var i2 = t4[r2], s2 = i2.marker; if (null == i2.to || (s2.inclusiveRight ? i2.to >= e3 : i2.to > e3) || i2.from == e3 && "bookmark" == s2.type && (!n3 || i2.marker.insertLeft)) { var a2 = null == i2.from || (s2.inclusiveLeft ? i2.from <= e3 : i2.from < e3); (o3 || (o3 = [])).push(new De(s2, a2 ? null : i2.from - e3, null == i2.to ? null : i2.to - e3)); } } return o3; } function He(t4, e3) { if (e3.full) return null; var n3 = re(t4, e3.from.line) && Zt(t4, e3.from.line).markedSpans, o3 = re(t4, e3.to.line) && Zt(t4, e3.to.line).markedSpans; if (!n3 && !o3) return null; var r2 = e3.from.ch, i2 = e3.to.ch, s2 = 0 == ae(e3.from, e3.to), a2 = Ve(n3, r2, s2), l2 = Re(o3, i2, s2), c2 = 1 == e3.text.length, u2 = X(e3.text).length + (c2 ? r2 : 0); if (a2) for (var p2 = 0; p2 < a2.length; ++p2) { var d2 = a2[p2]; if (null == d2.to) { var f2 = Ne(l2, d2.marker); f2 ? c2 && (d2.to = null == f2.to ? null : f2.to + u2) : d2.to = r2; } } if (l2) for (var h2 = 0; h2 < l2.length; ++h2) { var g2 = l2[h2]; null != g2.to && (g2.to += u2), null == g2.from ? Ne(a2, g2.marker) || (g2.from = u2, c2 && (a2 || (a2 = [])).push(g2)) : (g2.from += u2, c2 && (a2 || (a2 = [])).push(g2)); } a2 && (a2 = ze(a2)), l2 && l2 != a2 && (l2 = ze(l2)); var v2 = [a2]; if (!c2) { var y2, m2 = e3.text.length - 2; if (m2 > 0 && a2) for (var b2 = 0; b2 < a2.length; ++b2) null == a2[b2].to && (y2 || (y2 = [])).push(new De(a2[b2].marker, null, null)); for (var _2 = 0; _2 < m2; ++_2) v2.push(y2); v2.push(l2); } return v2; } function ze(t4) { for (var e3 = 0; e3 < t4.length; ++e3) { var n3 = t4[e3]; null != n3.from && n3.from == n3.to && false !== n3.marker.clearWhenEmpty && t4.splice(e3--, 1); } return t4.length ? t4 : null; } function Be(t4, e3, n3) { var o3 = null; if (t4.iter(e3.line, n3.line + 1, function(t5) { if (t5.markedSpans) for (var e4 = 0; e4 < t5.markedSpans.length; ++e4) { var n4 = t5.markedSpans[e4].marker; !n4.readOnly || o3 && -1 != z(o3, n4) || (o3 || (o3 = [])).push(n4); } }), !o3) return null; for (var r2 = [{ from: e3, to: n3 }], i2 = 0; i2 < o3.length; ++i2) for (var s2 = o3[i2], a2 = s2.find(0), l2 = 0; l2 < r2.length; ++l2) { var c2 = r2[l2]; if (!(ae(c2.to, a2.from) < 0 || ae(c2.from, a2.to) > 0)) { var u2 = [l2, 1], p2 = ae(c2.from, a2.from), d2 = ae(c2.to, a2.to); (p2 < 0 || !s2.inclusiveLeft && !p2) && u2.push({ from: c2.from, to: a2.from }), (d2 > 0 || !s2.inclusiveRight && !d2) && u2.push({ from: a2.to, to: c2.to }), r2.splice.apply(r2, u2), l2 += u2.length - 3; } } return r2; } function Ue(t4) { var e3 = t4.markedSpans; if (e3) { for (var n3 = 0; n3 < e3.length; ++n3) e3[n3].marker.detachLine(t4); t4.markedSpans = null; } } function We(t4, e3) { if (e3) { for (var n3 = 0; n3 < e3.length; ++n3) e3[n3].marker.attachLine(t4); t4.markedSpans = e3; } } function $e(t4) { return t4.inclusiveLeft ? -1 : 0; } function qe(t4) { return t4.inclusiveRight ? 1 : 0; } function Ge(t4, e3) { var n3 = t4.lines.length - e3.lines.length; if (0 != n3) return n3; var o3 = t4.find(), r2 = e3.find(), i2 = ae(o3.from, r2.from) || $e(t4) - $e(e3); if (i2) return -i2; var s2 = ae(o3.to, r2.to) || qe(t4) - qe(e3); return s2 || e3.id - t4.id; } function Ke(t4, e3) { var n3, o3 = je && t4.markedSpans; if (o3) for (var r2 = void 0, i2 = 0; i2 < o3.length; ++i2) (r2 = o3[i2]).marker.collapsed && null == (e3 ? r2.from : r2.to) && (!n3 || Ge(n3, r2.marker) < 0) && (n3 = r2.marker); return n3; } function Ye(t4) { return Ke(t4, true); } function Xe(t4) { return Ke(t4, false); } function Je(t4, e3) { var n3, o3 = je && t4.markedSpans; if (o3) for (var r2 = 0; r2 < o3.length; ++r2) { var i2 = o3[r2]; i2.marker.collapsed && (null == i2.from || i2.from < e3) && (null == i2.to || i2.to > e3) && (!n3 || Ge(n3, i2.marker) < 0) && (n3 = i2.marker); } return n3; } function Ze(t4, e3, n3, o3, r2) { var i2 = Zt(t4, e3), s2 = je && i2.markedSpans; if (s2) for (var a2 = 0; a2 < s2.length; ++a2) { var l2 = s2[a2]; if (l2.marker.collapsed) { var c2 = l2.marker.find(0), u2 = ae(c2.from, n3) || $e(l2.marker) - $e(r2), p2 = ae(c2.to, o3) || qe(l2.marker) - qe(r2); if (!(u2 >= 0 && p2 <= 0 || u2 <= 0 && p2 >= 0) && (u2 <= 0 && (l2.marker.inclusiveRight && r2.inclusiveLeft ? ae(c2.to, n3) >= 0 : ae(c2.to, n3) > 0) || u2 >= 0 && (l2.marker.inclusiveRight && r2.inclusiveLeft ? ae(c2.from, o3) <= 0 : ae(c2.from, o3) < 0))) return true; } } } function Qe(t4) { for (var e3; e3 = Ye(t4); ) t4 = e3.find(-1, true).line; return t4; } function tn(t4) { for (var e3; e3 = Xe(t4); ) t4 = e3.find(1, true).line; return t4; } function en(t4) { for (var e3, n3; e3 = Xe(t4); ) t4 = e3.find(1, true).line, (n3 || (n3 = [])).push(t4); return n3; } function nn(t4, e3) { var n3 = Zt(t4, e3), o3 = Qe(n3); return n3 == o3 ? e3 : ne(o3); } function on(t4, e3) { if (e3 > t4.lastLine()) return e3; var n3, o3 = Zt(t4, e3); if (!rn(t4, o3)) return e3; for (; n3 = Xe(o3); ) o3 = n3.find(1, true).line; return ne(o3) + 1; } function rn(t4, e3) { var n3 = je && e3.markedSpans; if (n3) { for (var o3 = void 0, r2 = 0; r2 < n3.length; ++r2) if ((o3 = n3[r2]).marker.collapsed) { if (null == o3.from) return true; if (!o3.marker.widgetNode && 0 == o3.from && o3.marker.inclusiveLeft && sn(t4, e3, o3)) return true; } } } function sn(t4, e3, n3) { if (null == n3.to) { var o3 = n3.marker.find(1, true); return sn(t4, o3.line, Ne(o3.line.markedSpans, n3.marker)); } if (n3.marker.inclusiveRight && n3.to == e3.text.length) return true; for (var r2 = void 0, i2 = 0; i2 < e3.markedSpans.length; ++i2) if ((r2 = e3.markedSpans[i2]).marker.collapsed && !r2.marker.widgetNode && r2.from == n3.to && (null == r2.to || r2.to != n3.from) && (r2.marker.inclusiveLeft || n3.marker.inclusiveRight) && sn(t4, e3, r2)) return true; } function an(t4) { for (var e3 = 0, n3 = (t4 = Qe(t4)).parent, o3 = 0; o3 < n3.lines.length; ++o3) { var r2 = n3.lines[o3]; if (r2 == t4) break; e3 += r2.height; } for (var i2 = n3.parent; i2; i2 = (n3 = i2).parent) for (var s2 = 0; s2 < i2.children.length; ++s2) { var a2 = i2.children[s2]; if (a2 == n3) break; e3 += a2.height; } return e3; } function ln(t4) { if (0 == t4.height) return 0; for (var e3, n3 = t4.text.length, o3 = t4; e3 = Ye(o3); ) { var r2 = e3.find(0, true); o3 = r2.from.line, n3 += r2.from.ch - r2.to.ch; } for (o3 = t4; e3 = Xe(o3); ) { var i2 = e3.find(0, true); n3 -= o3.text.length - i2.from.ch, n3 += (o3 = i2.to.line).text.length - i2.to.ch; } return n3; } function cn(t4) { var e3 = t4.display, n3 = t4.doc; e3.maxLine = Zt(n3, n3.first), e3.maxLineLength = ln(e3.maxLine), e3.maxLineChanged = true, n3.iter(function(t5) { var n4 = ln(t5); n4 > e3.maxLineLength && (e3.maxLineLength = n4, e3.maxLine = t5); }); } var un = function(t4, e3, n3) { this.text = t4, We(this, e3), this.height = n3 ? n3(this) : 1; }; function pn(t4, e3, n3, o3) { t4.text = e3, t4.stateAfter && (t4.stateAfter = null), t4.styles && (t4.styles = null), null != t4.order && (t4.order = null), Ue(t4), We(t4, n3); var r2 = o3 ? o3(t4) : 1; r2 != t4.height && ee(t4, r2); } function dn(t4) { t4.parent = null, Ue(t4); } un.prototype.lineNo = function() { return ne(this); }, xt(un); var fn = {}, hn = {}; function gn(t4, e3) { if (!t4 || /^\s*$/.test(t4)) return null; var n3 = e3.addModeClass ? hn : fn; return n3[t4] || (n3[t4] = t4.replace(/\S+/g, "cm-$&")); } function vn(t4, e3) { var n3 = j("span", null, null, l ? "padding-right: .1px" : null), o3 = { pre: j("pre", [n3], "CodeMirror-line"), content: n3, col: 0, pos: 0, cm: t4, trailingSpace: false, splitSpaces: t4.getOption("lineWrapping") }; e3.measure = {}; for (var r2 = 0; r2 <= (e3.rest ? e3.rest.length : 0); r2++) { var i2 = r2 ? e3.rest[r2 - 1] : e3.line, s2 = void 0; o3.pos = 0, o3.addToken = mn, Lt(t4.display.measure) && (s2 = ft(i2, t4.doc.direction)) && (o3.addToken = _n(o3.addToken, s2)), o3.map = [], xn(i2, o3, be(t4, i2, e3 != t4.display.externalMeasured && ne(i2))), i2.styleClasses && (i2.styleClasses.bgClass && (o3.bgClass = N(i2.styleClasses.bgClass, o3.bgClass || "")), i2.styleClasses.textClass && (o3.textClass = N(i2.styleClasses.textClass, o3.textClass || ""))), 0 == o3.map.length && o3.map.push(0, 0, o3.content.appendChild(Mt(t4.display.measure))), 0 == r2 ? (e3.measure.map = o3.map, e3.measure.cache = {}) : ((e3.measure.maps || (e3.measure.maps = [])).push(o3.map), (e3.measure.caches || (e3.measure.caches = [])).push({})); } if (l) { var a2 = o3.content.lastChild; (/\bcm-tab\b/.test(a2.className) || a2.querySelector && a2.querySelector(".cm-tab")) && (o3.content.className = "cm-tab-wrap-hack"); } return mt(t4, "renderLine", t4, e3.line, o3.pre), o3.pre.className && (o3.textClass = N(o3.pre.className, o3.textClass || "")), o3; } function yn(t4) { var e3 = A("span", "•", "cm-invalidchar"); return e3.title = "\\u" + t4.charCodeAt(0).toString(16), e3.setAttribute("aria-label", e3.title), e3; } function mn(t4, e3, n3, o3, r2, i2, l2) { if (e3) { var c2, u2 = t4.splitSpaces ? bn(e3, t4.trailingSpace) : e3, p2 = t4.cm.state.specialChars, d2 = false; if (p2.test(e3)) { c2 = document.createDocumentFragment(); for (var f2 = 0; 1; ) { p2.lastIndex = f2; var h2 = p2.exec(e3), g2 = h2 ? h2.index - f2 : e3.length - f2; if (g2) { var v2 = document.createTextNode(u2.slice(f2, f2 + g2)); s && a < 9 ? c2.appendChild(A("span", [v2])) : c2.appendChild(v2), t4.map.push(t4.pos, t4.pos + g2, v2), t4.col += g2, t4.pos += g2; } if (!h2) break; f2 += g2 + 1; var y2 = void 0; if (" " == h2[0]) { var m2 = t4.cm.options.tabSize, b2 = m2 - t4.col % m2; (y2 = c2.appendChild(A("span", Y(b2), "cm-tab"))).setAttribute("role", "presentation"), y2.setAttribute("cm-text", " "), t4.col += b2; } else "\r" == h2[0] || "\n" == h2[0] ? ((y2 = c2.appendChild(A("span", "\r" == h2[0] ? "␍" : "␤", "cm-invalidchar"))).setAttribute("cm-text", h2[0]), t4.col += 1) : ((y2 = t4.cm.options.specialCharPlaceholder(h2[0])).setAttribute("cm-text", h2[0]), s && a < 9 ? c2.appendChild(A("span", [y2])) : c2.appendChild(y2), t4.col += 1); t4.map.push(t4.pos, t4.pos + 1, y2), t4.pos++; } } else t4.col += e3.length, c2 = document.createTextNode(u2), t4.map.push(t4.pos, t4.pos + e3.length, c2), s && a < 9 && (d2 = true), t4.pos += e3.length; if (t4.trailingSpace = 32 == u2.charCodeAt(e3.length - 1), n3 || o3 || r2 || d2 || i2 || l2) { var _2 = n3 || ""; o3 && (_2 += o3), r2 && (_2 += r2); var w2 = A("span", [c2], _2, i2); if (l2) for (var x2 in l2) l2.hasOwnProperty(x2) && "style" != x2 && "class" != x2 && w2.setAttribute(x2, l2[x2]); return t4.content.appendChild(w2); } t4.content.appendChild(c2); } } function bn(t4, e3) { if (t4.length > 1 && !/ /.test(t4)) return t4; for (var n3 = e3, o3 = "", r2 = 0; r2 < t4.length; r2++) { var i2 = t4.charAt(r2); " " != i2 || !n3 || r2 != t4.length - 1 && 32 != t4.charCodeAt(r2 + 1) || (i2 = " "), o3 += i2, n3 = " " == i2; } return o3; } function _n(t4, e3) { return function(n3, o3, r2, i2, s2, a2, l2) { r2 = r2 ? r2 + " cm-force-border" : "cm-force-border"; for (var c2 = n3.pos, u2 = c2 + o3.length; ; ) { for (var p2 = void 0, d2 = 0; d2 < e3.length && !((p2 = e3[d2]).to > c2 && p2.from <= c2); d2++) ; if (p2.to >= u2) return t4(n3, o3, r2, i2, s2, a2, l2); t4(n3, o3.slice(0, p2.to - c2), r2, i2, null, a2, l2), i2 = null, o3 = o3.slice(p2.to - c2), c2 = p2.to; } }; } function wn(t4, e3, n3, o3) { var r2 = !o3 && n3.widgetNode; r2 && t4.map.push(t4.pos, t4.pos + e3, r2), !o3 && t4.cm.display.input.needsContentAttribute && (r2 || (r2 = t4.content.appendChild(document.createElement("span"))), r2.setAttribute("cm-marker", n3.id)), r2 && (t4.cm.display.input.setUneditable(r2), t4.content.appendChild(r2)), t4.pos += e3, t4.trailingSpace = false; } function xn(t4, e3, n3) { var o3 = t4.markedSpans, r2 = t4.text, i2 = 0; if (o3) for (var s2, a2, l2, c2, u2, p2, d2, f2 = r2.length, h2 = 0, g2 = 1, v2 = "", y2 = 0; ; ) { if (y2 == h2) { l2 = c2 = u2 = a2 = "", d2 = null, p2 = null, y2 = 1 / 0; for (var m2 = [], b2 = void 0, _2 = 0; _2 < o3.length; ++_2) { var w2 = o3[_2], x2 = w2.marker; if ("bookmark" == x2.type && w2.from == h2 && x2.widgetNode) m2.push(x2); else if (w2.from <= h2 && (null == w2.to || w2.to > h2 || x2.collapsed && w2.to == h2 && w2.from == h2)) { if (null != w2.to && w2.to != h2 && y2 > w2.to && (y2 = w2.to, c2 = ""), x2.className && (l2 += " " + x2.className), x2.css && (a2 = (a2 ? a2 + ";" : "") + x2.css), x2.startStyle && w2.from == h2 && (u2 += " " + x2.startStyle), x2.endStyle && w2.to == y2 && (b2 || (b2 = [])).push(x2.endStyle, w2.to), x2.title && ((d2 || (d2 = {})).title = x2.title), x2.attributes) for (var C2 in x2.attributes) (d2 || (d2 = {}))[C2] = x2.attributes[C2]; x2.collapsed && (!p2 || Ge(p2.marker, x2) < 0) && (p2 = w2); } else w2.from > h2 && y2 > w2.from && (y2 = w2.from); } if (b2) for (var S2 = 0; S2 < b2.length; S2 += 2) b2[S2 + 1] == y2 && (c2 += " " + b2[S2]); if (!p2 || p2.from == h2) for (var O2 = 0; O2 < m2.length; ++O2) wn(e3, 0, m2[O2]); if (p2 && (p2.from || 0) == h2) { if (wn(e3, (null == p2.to ? f2 + 1 : p2.to) - h2, p2.marker, null == p2.from), null == p2.to) return; p2.to == h2 && (p2 = false); } } if (h2 >= f2) break; for (var T2 = Math.min(f2, y2); 1; ) { if (v2) { var k2 = h2 + v2.length; if (!p2) { var P2 = k2 > T2 ? v2.slice(0, T2 - h2) : v2; e3.addToken(e3, P2, s2 ? s2 + l2 : l2, u2, h2 + P2.length == y2 ? c2 : "", a2, d2); } if (k2 >= T2) { v2 = v2.slice(T2 - h2), h2 = T2; break; } h2 = k2, u2 = ""; } v2 = r2.slice(i2, i2 = n3[g2++]), s2 = gn(n3[g2++], e3.cm.options); } } else for (var E2 = 1; E2 < n3.length; E2 += 2) e3.addToken(e3, r2.slice(i2, i2 = n3[E2]), gn(n3[E2 + 1], e3.cm.options)); } function Cn(t4, e3, n3) { this.line = e3, this.rest = en(e3), this.size = this.rest ? ne(X(this.rest)) - n3 + 1 : 1, this.node = this.text = null, this.hidden = rn(t4, e3); } function Sn(t4, e3, n3) { for (var o3, r2 = [], i2 = e3; i2 < n3; i2 = o3) { var s2 = new Cn(t4.doc, Zt(t4.doc, i2), i2); o3 = i2 + s2.size, r2.push(s2); } return r2; } var On = null; function Tn(t4) { On ? On.ops.push(t4) : t4.ownsGroup = On = { ops: [t4], delayedCallbacks: [] }; } function kn(t4) { var e3 = t4.delayedCallbacks, n3 = 0; do { for (; n3 < e3.length; n3++) e3[n3].call(null); for (var o3 = 0; o3 < t4.ops.length; o3++) { var r2 = t4.ops[o3]; if (r2.cursorActivityHandlers) for (; r2.cursorActivityCalled < r2.cursorActivityHandlers.length; ) r2.cursorActivityHandlers[r2.cursorActivityCalled++].call(null, r2.cm); } } while (n3 < e3.length); } function Pn(t4, e3) { var n3 = t4.ownsGroup; if (n3) try { kn(n3); } finally { On = null, e3(n3); } } var En = null; function An(t4, e3) { var n3 = vt(t4, e3); if (n3.length) { var o3, r2 = Array.prototype.slice.call(arguments, 2); On ? o3 = On.delayedCallbacks : En ? o3 = En : (o3 = En = [], setTimeout(jn, 0)); for (var i2 = function(t5) { o3.push(function() { return n3[t5].apply(null, r2); }); }, s2 = 0; s2 < n3.length; ++s2) i2(s2); } } function jn() { var t4 = En; En = null; for (var e3 = 0; e3 < t4.length; ++e3) t4[e3](); } function Mn(t4, e3, n3, o3) { for (var r2 = 0; r2 < e3.changes.length; r2++) { var i2 = e3.changes[r2]; "text" == i2 ? In(t4, e3) : "gutter" == i2 ? Vn(t4, e3, n3, o3) : "class" == i2 ? Fn(t4, e3) : "widget" == i2 && Rn(t4, e3, o3); } e3.changes = null; } function Ln(t4) { return t4.node == t4.text && (t4.node = A("div", null, null, "position: relative"), t4.text.parentNode && t4.text.parentNode.replaceChild(t4.node, t4.text), t4.node.appendChild(t4.text), s && a < 8 && (t4.node.style.zIndex = 2)), t4.node; } function Dn(t4, e3) { var n3 = e3.bgClass ? e3.bgClass + " " + (e3.line.bgClass || "") : e3.line.bgClass; if (n3 && (n3 += " CodeMirror-linebackground"), e3.background) n3 ? e3.background.className = n3 : (e3.background.parentNode.removeChild(e3.background), e3.background = null); else if (n3) { var o3 = Ln(e3); e3.background = o3.insertBefore(A("div", null, n3), o3.firstChild), t4.display.input.setUneditable(e3.background); } } function Nn(t4, e3) { var n3 = t4.display.externalMeasured; return n3 && n3.line == e3.line ? (t4.display.externalMeasured = null, e3.measure = n3.measure, n3.built) : vn(t4, e3); } function In(t4, e3) { var n3 = e3.text.className, o3 = Nn(t4, e3); e3.text == e3.node && (e3.node = o3.pre), e3.text.parentNode.replaceChild(o3.pre, e3.text), e3.text = o3.pre, o3.bgClass != e3.bgClass || o3.textClass != e3.textClass ? (e3.bgClass = o3.bgClass, e3.textClass = o3.textClass, Fn(t4, e3)) : n3 && (e3.text.className = n3); } function Fn(t4, e3) { Dn(t4, e3), e3.line.wrapClass ? Ln(e3).className = e3.line.wrapClass : e3.node != e3.text && (e3.node.className = ""); var n3 = e3.textClass ? e3.textClass + " " + (e3.line.textClass || "") : e3.line.textClass; e3.text.className = n3 || ""; } function Vn(t4, e3, n3, o3) { if (e3.gutter && (e3.node.removeChild(e3.gutter), e3.gutter = null), e3.gutterBackground && (e3.node.removeChild(e3.gutterBackground), e3.gutterBackground = null), e3.line.gutterClass) { var r2 = Ln(e3); e3.gutterBackground = A("div", null, "CodeMirror-gutter-background " + e3.line.gutterClass, "left: " + (t4.options.fixedGutter ? o3.fixedPos : -o3.gutterTotalWidth) + "px; width: " + o3.gutterTotalWidth + "px"), t4.display.input.setUneditable(e3.gutterBackground), r2.insertBefore(e3.gutterBackground, e3.text); } var i2 = e3.line.gutterMarkers; if (t4.options.lineNumbers || i2) { var s2 = Ln(e3), a2 = e3.gutter = A("div", null, "CodeMirror-gutter-wrapper", "left: " + (t4.options.fixedGutter ? o3.fixedPos : -o3.gutterTotalWidth) + "px"); if (a2.setAttribute("aria-hidden", "true"), t4.display.input.setUneditable(a2), s2.insertBefore(a2, e3.text), e3.line.gutterClass && (a2.className += " " + e3.line.gutterClass), !t4.options.lineNumbers || i2 && i2["CodeMirror-linenumbers"] || (e3.lineNumber = a2.appendChild(A("div", ie(t4.options, n3), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + o3.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + t4.display.lineNumInnerWidth + "px"))), i2) for (var l2 = 0; l2 < t4.display.gutterSpecs.length; ++l2) { var c2 = t4.display.gutterSpecs[l2].className, u2 = i2.hasOwnProperty(c2) && i2[c2]; u2 && a2.appendChild(A("div", [u2], "CodeMirror-gutter-elt", "left: " + o3.gutterLeft[c2] + "px; width: " + o3.gutterWidth[c2] + "px")); } } } function Rn(t4, e3, n3) { e3.alignable && (e3.alignable = null); for (var o3 = O("CodeMirror-linewidget"), r2 = e3.node.firstChild, i2 = void 0; r2; r2 = i2) i2 = r2.nextSibling, o3.test(r2.className) && e3.node.removeChild(r2); zn(t4, e3, n3); } function Hn(t4, e3, n3, o3) { var r2 = Nn(t4, e3); return e3.text = e3.node = r2.pre, r2.bgClass && (e3.bgClass = r2.bgClass), r2.textClass && (e3.textClass = r2.textClass), Fn(t4, e3), Vn(t4, e3, n3, o3), zn(t4, e3, o3), e3.node; } function zn(t4, e3, n3) { if (Bn(t4, e3.line, e3, n3, true), e3.rest) for (var o3 = 0; o3 < e3.rest.length; o3++) Bn(t4, e3.rest[o3], e3, n3, false); } function Bn(t4, e3, n3, o3, r2) { if (e3.widgets) for (var i2 = Ln(n3), s2 = 0, a2 = e3.widgets; s2 < a2.length; ++s2) { var l2 = a2[s2], c2 = A("div", [l2.node], "CodeMirror-linewidget" + (l2.className ? " " + l2.className : "")); l2.handleMouseEvents || c2.setAttribute("cm-ignore-events", "true"), Un(l2, c2, n3, o3), t4.display.input.setUneditable(c2), r2 && l2.above ? i2.insertBefore(c2, n3.gutter || n3.text) : i2.appendChild(c2), An(l2, "redraw"); } } function Un(t4, e3, n3, o3) { if (t4.noHScroll) { (n3.alignable || (n3.alignable = [])).push(e3); var r2 = o3.wrapperWidth; e3.style.left = o3.fixedPos + "px", t4.coverGutter || (r2 -= o3.gutterTotalWidth, e3.style.paddingLeft = o3.gutterTotalWidth + "px"), e3.style.width = r2 + "px"; } t4.coverGutter && (e3.style.zIndex = 5, e3.style.position = "relative", t4.noHScroll || (e3.style.marginLeft = -o3.gutterTotalWidth + "px")); } function Wn(t4) { if (null != t4.height) return t4.height; var e3 = t4.doc.cm; if (!e3) return 0; if (!M(document.body, t4.node)) { var n3 = "position: relative;"; t4.coverGutter && (n3 += "margin-left: -" + e3.display.gutters.offsetWidth + "px;"), t4.noHScroll && (n3 += "width: " + e3.display.wrapper.clientWidth + "px;"), E(e3.display.measure, A("div", [t4.node], null, n3)); } return t4.height = t4.node.parentNode.offsetHeight; } function $n(t4, e3) { for (var n3 = kt(e3); n3 != t4.wrapper; n3 = n3.parentNode) if (!n3 || 1 == n3.nodeType && "true" == n3.getAttribute("cm-ignore-events") || n3.parentNode == t4.sizer && n3 != t4.mover) return true; } function qn(t4) { return t4.lineSpace.offsetTop; } function Gn(t4) { return t4.mover.offsetHeight - t4.lineSpace.offsetHeight; } function Kn(t4) { if (t4.cachedPaddingH) return t4.cachedPaddingH; var e3 = E(t4.measure, A("pre", "x", "CodeMirror-line-like")), n3 = window.getComputedStyle ? window.getComputedStyle(e3) : e3.currentStyle, o3 = { left: parseInt(n3.paddingLeft), right: parseInt(n3.paddingRight) }; return isNaN(o3.left) || isNaN(o3.right) || (t4.cachedPaddingH = o3), o3; } function Yn(t4) { return B - t4.display.nativeBarWidth; } function Xn(t4) { return t4.display.scroller.clientWidth - Yn(t4) - t4.display.barWidth; } function Jn(t4) { return t4.display.scroller.clientHeight - Yn(t4) - t4.display.barHeight; } function Zn(t4, e3, n3) { var o3 = t4.options.lineWrapping, r2 = o3 && Xn(t4); if (!e3.measure.heights || o3 && e3.measure.width != r2) { var i2 = e3.measure.heights = []; if (o3) { e3.measure.width = r2; for (var s2 = e3.text.firstChild.getClientRects(), a2 = 0; a2 < s2.length - 1; a2++) { var l2 = s2[a2], c2 = s2[a2 + 1]; Math.abs(l2.bottom - c2.bottom) > 2 && i2.push((l2.bottom + c2.top) / 2 - n3.top); } } i2.push(n3.bottom - n3.top); } } function Qn(t4, e3, n3) { if (t4.line == e3) return { map: t4.measure.map, cache: t4.measure.cache }; if (t4.rest) { for (var o3 = 0; o3 < t4.rest.length; o3++) if (t4.rest[o3] == e3) return { map: t4.measure.maps[o3], cache: t4.measure.caches[o3] }; for (var r2 = 0; r2 < t4.rest.length; r2++) if (ne(t4.rest[r2]) > n3) return { map: t4.measure.maps[r2], cache: t4.measure.caches[r2], before: true }; } } function to(t4, e3) { var n3 = ne(e3 = Qe(e3)), o3 = t4.display.externalMeasured = new Cn(t4.doc, e3, n3); o3.lineN = n3; var r2 = o3.built = vn(t4, o3); return o3.text = r2.pre, E(t4.display.lineMeasure, r2.pre), o3; } function eo(t4, e3, n3, o3) { return ro(t4, oo(t4, e3), n3, o3); } function no(t4, e3) { if (e3 >= t4.display.viewFrom && e3 < t4.display.viewTo) return t4.display.view[Vo(t4, e3)]; var n3 = t4.display.externalMeasured; return n3 && e3 >= n3.lineN && e3 < n3.lineN + n3.size ? n3 : void 0; } function oo(t4, e3) { var n3 = ne(e3), o3 = no(t4, n3); o3 && !o3.text ? o3 = null : o3 && o3.changes && (Mn(t4, o3, n3, Lo(t4)), t4.curOp.forceUpdate = true), o3 || (o3 = to(t4, e3)); var r2 = Qn(o3, e3, n3); return { line: e3, view: o3, rect: null, map: r2.map, cache: r2.cache, before: r2.before, hasHeights: false }; } function ro(t4, e3, n3, o3, r2) { e3.before && (n3 = -1); var i2, s2 = n3 + (o3 || ""); return e3.cache.hasOwnProperty(s2) ? i2 = e3.cache[s2] : (e3.rect || (e3.rect = e3.view.text.getBoundingClientRect()), e3.hasHeights || (Zn(t4, e3.view, e3.rect), e3.hasHeights = true), (i2 = co(t4, e3, n3, o3)).bogus || (e3.cache[s2] = i2)), { left: i2.left, right: i2.right, top: r2 ? i2.rtop : i2.top, bottom: r2 ? i2.rbottom : i2.bottom }; } var io, so = { left: 0, right: 0, top: 0, bottom: 0 }; function ao(t4, e3, n3) { for (var o3, r2, i2, s2, a2, l2, c2 = 0; c2 < t4.length; c2 += 3) if (a2 = t4[c2], l2 = t4[c2 + 1], e3 < a2 ? (r2 = 0, i2 = 1, s2 = "left") : e3 < l2 ? i2 = (r2 = e3 - a2) + 1 : (c2 == t4.length - 3 || e3 == l2 && t4[c2 + 3] > e3) && (r2 = (i2 = l2 - a2) - 1, e3 >= l2 && (s2 = "right")), null != r2) { if (o3 = t4[c2 + 2], a2 == l2 && n3 == (o3.insertLeft ? "left" : "right") && (s2 = n3), "left" == n3 && 0 == r2) for (; c2 && t4[c2 - 2] == t4[c2 - 3] && t4[c2 - 1].insertLeft; ) o3 = t4[(c2 -= 3) + 2], s2 = "left"; if ("right" == n3 && r2 == l2 - a2) for (; c2 < t4.length - 3 && t4[c2 + 3] == t4[c2 + 4] && !t4[c2 + 5].insertLeft; ) o3 = t4[(c2 += 3) + 2], s2 = "right"; break; } return { node: o3, start: r2, end: i2, collapse: s2, coverStart: a2, coverEnd: l2 }; } function lo(t4, e3) { var n3 = so; if ("left" == e3) for (var o3 = 0; o3 < t4.length && (n3 = t4[o3]).left == n3.right; o3++) ; else for (var r2 = t4.length - 1; r2 >= 0 && (n3 = t4[r2]).left == n3.right; r2--) ; return n3; } function co(t4, e3, n3, o3) { var r2, i2 = ao(e3.map, n3, o3), l2 = i2.node, c2 = i2.start, u2 = i2.end, p2 = i2.collapse; if (3 == l2.nodeType) { for (var d2 = 0; d2 < 4; d2++) { for (; c2 && st(e3.line.text.charAt(i2.coverStart + c2)); ) --c2; for (; i2.coverStart + u2 < i2.coverEnd && st(e3.line.text.charAt(i2.coverStart + u2)); ) ++u2; if ((r2 = s && a < 9 && 0 == c2 && u2 == i2.coverEnd - i2.coverStart ? l2.parentNode.getBoundingClientRect() : lo(T(l2, c2, u2).getClientRects(), o3)).left || r2.right || 0 == c2) break; u2 = c2, c2 -= 1, p2 = "right"; } s && a < 11 && (r2 = uo(t4.display.measure, r2)); } else { var f2; c2 > 0 && (p2 = o3 = "right"), r2 = t4.options.lineWrapping && (f2 = l2.getClientRects()).length > 1 ? f2["right" == o3 ? f2.length - 1 : 0] : l2.getBoundingClientRect(); } if (s && a < 9 && !c2 && (!r2 || !r2.left && !r2.right)) { var h2 = l2.parentNode.getClientRects()[0]; r2 = h2 ? { left: h2.left, right: h2.left + Mo(t4.display), top: h2.top, bottom: h2.bottom } : so; } for (var g2 = r2.top - e3.rect.top, v2 = r2.bottom - e3.rect.top, y2 = (g2 + v2) / 2, m2 = e3.view.measure.heights, b2 = 0; b2 < m2.length - 1 && !(y2 < m2[b2]); b2++) ; var _2 = b2 ? m2[b2 - 1] : 0, w2 = m2[b2], x2 = { left: ("right" == p2 ? r2.right : r2.left) - e3.rect.left, right: ("left" == p2 ? r2.left : r2.right) - e3.rect.left, top: _2, bottom: w2 }; return r2.left || r2.right || (x2.bogus = true), t4.options.singleCursorHeightPerLine || (x2.rtop = g2, x2.rbottom = v2), x2; } function uo(t4, e3) { if (!window.screen || null == screen.logicalXDPI || screen.logicalXDPI == screen.deviceXDPI || !Rt(t4)) return e3; var n3 = screen.logicalXDPI / screen.deviceXDPI, o3 = screen.logicalYDPI / screen.deviceYDPI; return { left: e3.left * n3, right: e3.right * n3, top: e3.top * o3, bottom: e3.bottom * o3 }; } function po(t4) { if (t4.measure && (t4.measure.cache = {}, t4.measure.heights = null, t4.rest)) for (var e3 = 0; e3 < t4.rest.length; e3++) t4.measure.caches[e3] = {}; } function fo(t4) { t4.display.externalMeasure = null, P(t4.display.lineMeasure); for (var e3 = 0; e3 < t4.display.view.length; e3++) po(t4.display.view[e3]); } function ho(t4) { fo(t4), t4.display.cachedCharWidth = t4.display.cachedTextHeight = t4.display.cachedPaddingH = null, t4.options.lineWrapping || (t4.display.maxLineChanged = true), t4.display.lineNumChars = null; } function go() { return u && y ? -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) : window.pageXOffset || (document.documentElement || document.body).scrollLeft; } function vo() { return u && y ? -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) : window.pageYOffset || (document.documentElement || document.body).scrollTop; } function yo(t4) { var e3 = Qe(t4).widgets, n3 = 0; if (e3) for (var o3 = 0; o3 < e3.length; ++o3) e3[o3].above && (n3 += Wn(e3[o3])); return n3; } function mo(t4, e3, n3, o3, r2) { if (!r2) { var i2 = yo(e3); n3.top += i2, n3.bottom += i2; } if ("line" == o3) return n3; o3 || (o3 = "local"); var s2 = an(e3); if ("local" == o3 ? s2 += qn(t4.display) : s2 -= t4.display.viewOffset, "page" == o3 || "window" == o3) { var a2 = t4.display.lineSpace.getBoundingClientRect(); s2 += a2.top + ("window" == o3 ? 0 : vo()); var l2 = a2.left + ("window" == o3 ? 0 : go()); n3.left += l2, n3.right += l2; } return n3.top += s2, n3.bottom += s2, n3; } function bo(t4, e3, n3) { if ("div" == n3) return e3; var o3 = e3.left, r2 = e3.top; if ("page" == n3) o3 -= go(), r2 -= vo(); else if ("local" == n3 || !n3) { var i2 = t4.display.sizer.getBoundingClientRect(); o3 += i2.left, r2 += i2.top; } var s2 = t4.display.lineSpace.getBoundingClientRect(); return { left: o3 - s2.left, top: r2 - s2.top }; } function _o(t4, e3, n3, o3, r2) { return o3 || (o3 = Zt(t4.doc, e3.line)), mo(t4, o3, eo(t4, o3, e3.ch, r2), n3); } function wo(t4, e3, n3, o3, r2, i2) { function s2(e4, s3) { var a3 = ro(t4, r2, e4, s3 ? "right" : "left", i2); return s3 ? a3.left = a3.right : a3.right = a3.left, mo(t4, o3, a3, n3); } o3 = o3 || Zt(t4.doc, e3.line), r2 || (r2 = oo(t4, o3)); var a2 = ft(o3, t4.doc.direction), l2 = e3.ch, c2 = e3.sticky; if (l2 >= o3.text.length ? (l2 = o3.text.length, c2 = "before") : l2 <= 0 && (l2 = 0, c2 = "after"), !a2) return s2("before" == c2 ? l2 - 1 : l2, "before" == c2); function u2(t5, e4, n4) { return s2(n4 ? t5 - 1 : t5, 1 == a2[e4].level != n4); } var p2 = pt(a2, l2, c2), d2 = ut, f2 = u2(l2, p2, "before" == c2); return null != d2 && (f2.other = u2(l2, d2, "before" != c2)), f2; } function xo(t4, e3) { var n3 = 0; e3 = fe(t4.doc, e3), t4.options.lineWrapping || (n3 = Mo(t4.display) * e3.ch); var o3 = Zt(t4.doc, e3.line), r2 = an(o3) + qn(t4.display); return { left: n3, right: n3, top: r2, bottom: r2 + o3.height }; } function Co(t4, e3, n3, o3, r2) { var i2 = se(t4, e3, n3); return i2.xRel = r2, o3 && (i2.outside = o3), i2; } function So(t4, e3, n3) { var o3 = t4.doc; if ((n3 += t4.display.viewOffset) < 0) return Co(o3.first, 0, null, -1, -1); var r2 = oe(o3, n3), i2 = o3.first + o3.size - 1; if (r2 > i2) return Co(o3.first + o3.size - 1, Zt(o3, i2).text.length, null, 1, 1); e3 < 0 && (e3 = 0); for (var s2 = Zt(o3, r2); ; ) { var a2 = Po(t4, s2, r2, e3, n3), l2 = Je(s2, a2.ch + (a2.xRel > 0 || a2.outside > 0 ? 1 : 0)); if (!l2) return a2; var c2 = l2.find(1); if (c2.line == r2) return c2; s2 = Zt(o3, r2 = c2.line); } } function Oo(t4, e3, n3, o3) { o3 -= yo(e3); var r2 = e3.text.length, i2 = lt(function(e4) { return ro(t4, n3, e4 - 1).bottom <= o3; }, r2, 0); return { begin: i2, end: r2 = lt(function(e4) { return ro(t4, n3, e4).top > o3; }, i2, r2) }; } function To(t4, e3, n3, o3) { return n3 || (n3 = oo(t4, e3)), Oo(t4, e3, n3, mo(t4, e3, ro(t4, n3, o3), "line").top); } function ko(t4, e3, n3, o3) { return !(t4.bottom <= n3) && (t4.top > n3 || (o3 ? t4.left : t4.right) > e3); } function Po(t4, e3, n3, o3, r2) { r2 -= an(e3); var i2 = oo(t4, e3), s2 = yo(e3), a2 = 0, l2 = e3.text.length, c2 = true, u2 = ft(e3, t4.doc.direction); if (u2) { var p2 = (t4.options.lineWrapping ? Ao : Eo)(t4, e3, n3, i2, u2, o3, r2); a2 = (c2 = 1 != p2.level) ? p2.from : p2.to - 1, l2 = c2 ? p2.to : p2.from - 1; } var d2, f2, h2 = null, g2 = null, v2 = lt(function(e4) { var n4 = ro(t4, i2, e4); return n4.top += s2, n4.bottom += s2, !!ko(n4, o3, r2, false) && (n4.top <= r2 && n4.left <= o3 && (h2 = e4, g2 = n4), true); }, a2, l2), y2 = false; if (g2) { var m2 = o3 - g2.left < g2.right - o3, b2 = m2 == c2; v2 = h2 + (b2 ? 0 : 1), f2 = b2 ? "after" : "before", d2 = m2 ? g2.left : g2.right; } else { c2 || v2 != l2 && v2 != a2 || v2++, f2 = 0 == v2 ? "after" : v2 == e3.text.length ? "before" : ro(t4, i2, v2 - (c2 ? 1 : 0)).bottom + s2 <= r2 == c2 ? "after" : "before"; var _2 = wo(t4, se(n3, v2, f2), "line", e3, i2); d2 = _2.left, y2 = r2 < _2.top ? -1 : r2 >= _2.bottom ? 1 : 0; } return Co(n3, v2 = at(e3.text, v2, 1), f2, y2, o3 - d2); } function Eo(t4, e3, n3, o3, r2, i2, s2) { var a2 = lt(function(a3) { var l3 = r2[a3], c3 = 1 != l3.level; return ko(wo(t4, se(n3, c3 ? l3.to : l3.from, c3 ? "before" : "after"), "line", e3, o3), i2, s2, true); }, 0, r2.length - 1), l2 = r2[a2]; if (a2 > 0) { var c2 = 1 != l2.level, u2 = wo(t4, se(n3, c2 ? l2.from : l2.to, c2 ? "after" : "before"), "line", e3, o3); ko(u2, i2, s2, true) && u2.top > s2 && (l2 = r2[a2 - 1]); } return l2; } function Ao(t4, e3, n3, o3, r2, i2, s2) { var a2 = Oo(t4, e3, o3, s2), l2 = a2.begin, c2 = a2.end; /\s/.test(e3.text.charAt(c2 - 1)) && c2--; for (var u2 = null, p2 = null, d2 = 0; d2 < r2.length; d2++) { var f2 = r2[d2]; if (!(f2.from >= c2 || f2.to <= l2)) { var h2 = ro(t4, o3, 1 != f2.level ? Math.min(c2, f2.to) - 1 : Math.max(l2, f2.from)).right, g2 = h2 < i2 ? i2 - h2 + 1e9 : h2 - i2; (!u2 || p2 > g2) && (u2 = f2, p2 = g2); } } return u2 || (u2 = r2[r2.length - 1]), u2.from < l2 && (u2 = { from: l2, to: u2.to, level: u2.level }), u2.to > c2 && (u2 = { from: u2.from, to: c2, level: u2.level }), u2; } function jo(t4) { if (null != t4.cachedTextHeight) return t4.cachedTextHeight; if (null == io) { io = A("pre", null, "CodeMirror-line-like"); for (var e3 = 0; e3 < 49; ++e3) io.appendChild(document.createTextNode("x")), io.appendChild(A("br")); io.appendChild(document.createTextNode("x")); } E(t4.measure, io); var n3 = io.offsetHeight / 50; return n3 > 3 && (t4.cachedTextHeight = n3), P(t4.measure), n3 || 1; } function Mo(t4) { if (null != t4.cachedCharWidth) return t4.cachedCharWidth; var e3 = A("span", "xxxxxxxxxx"), n3 = A("pre", [e3], "CodeMirror-line-like"); E(t4.measure, n3); var o3 = e3.getBoundingClientRect(), r2 = (o3.right - o3.left) / 10; return r2 > 2 && (t4.cachedCharWidth = r2), r2 || 10; } function Lo(t4) { for (var e3 = t4.display, n3 = {}, o3 = {}, r2 = e3.gutters.clientLeft, i2 = e3.gutters.firstChild, s2 = 0; i2; i2 = i2.nextSibling, ++s2) { var a2 = t4.display.gutterSpecs[s2].className; n3[a2] = i2.offsetLeft + i2.clientLeft + r2, o3[a2] = i2.clientWidth; } return { fixedPos: Do(e3), gutterTotalWidth: e3.gutters.offsetWidth, gutterLeft: n3, gutterWidth: o3, wrapperWidth: e3.wrapper.clientWidth }; } function Do(t4) { return t4.scroller.getBoundingClientRect().left - t4.sizer.getBoundingClientRect().left; } function No(t4) { var e3 = jo(t4.display), n3 = t4.options.lineWrapping, o3 = n3 && Math.max(5, t4.display.scroller.clientWidth / Mo(t4.display) - 3); return function(r2) { if (rn(t4.doc, r2)) return 0; var i2 = 0; if (r2.widgets) for (var s2 = 0; s2 < r2.widgets.length; s2++) r2.widgets[s2].height && (i2 += r2.widgets[s2].height); return n3 ? i2 + (Math.ceil(r2.text.length / o3) || 1) * e3 : i2 + e3; }; } function Io(t4) { var e3 = t4.doc, n3 = No(t4); e3.iter(function(t5) { var e4 = n3(t5); e4 != t5.height && ee(t5, e4); }); } function Fo(t4, e3, n3, o3) { var r2 = t4.display; if (!n3 && "true" == kt(e3).getAttribute("cm-not-content")) return null; var i2, s2, a2 = r2.lineSpace.getBoundingClientRect(); try { i2 = e3.clientX - a2.left, s2 = e3.clientY - a2.top; } catch (t5) { return null; } var l2, c2 = So(t4, i2, s2); if (o3 && c2.xRel > 0 && (l2 = Zt(t4.doc, c2.line).text).length == c2.ch) { var u2 = R(l2, l2.length, t4.options.tabSize) - l2.length; c2 = se(c2.line, Math.max(0, Math.round((i2 - Kn(t4.display).left) / Mo(t4.display)) - u2)); } return c2; } function Vo(t4, e3) { if (e3 >= t4.display.viewTo) return null; if ((e3 -= t4.display.viewFrom) < 0) return null; for (var n3 = t4.display.view, o3 = 0; o3 < n3.length; o3++) if ((e3 -= n3[o3].size) < 0) return o3; } function Ro(t4, e3, n3, o3) { null == e3 && (e3 = t4.doc.first), null == n3 && (n3 = t4.doc.first + t4.doc.size), o3 || (o3 = 0); var r2 = t4.display; if (o3 && n3 < r2.viewTo && (null == r2.updateLineNumbers || r2.updateLineNumbers > e3) && (r2.updateLineNumbers = e3), t4.curOp.viewChanged = true, e3 >= r2.viewTo) je && nn(t4.doc, e3) < r2.viewTo && zo(t4); else if (n3 <= r2.viewFrom) je && on(t4.doc, n3 + o3) > r2.viewFrom ? zo(t4) : (r2.viewFrom += o3, r2.viewTo += o3); else if (e3 <= r2.viewFrom && n3 >= r2.viewTo) zo(t4); else if (e3 <= r2.viewFrom) { var i2 = Bo(t4, n3, n3 + o3, 1); i2 ? (r2.view = r2.view.slice(i2.index), r2.viewFrom = i2.lineN, r2.viewTo += o3) : zo(t4); } else if (n3 >= r2.viewTo) { var s2 = Bo(t4, e3, e3, -1); s2 ? (r2.view = r2.view.slice(0, s2.index), r2.viewTo = s2.lineN) : zo(t4); } else { var a2 = Bo(t4, e3, e3, -1), l2 = Bo(t4, n3, n3 + o3, 1); a2 && l2 ? (r2.view = r2.view.slice(0, a2.index).concat(Sn(t4, a2.lineN, l2.lineN)).concat(r2.view.slice(l2.index)), r2.viewTo += o3) : zo(t4); } var c2 = r2.externalMeasured; c2 && (n3 < c2.lineN ? c2.lineN += o3 : e3 < c2.lineN + c2.size && (r2.externalMeasured = null)); } function Ho(t4, e3, n3) { t4.curOp.viewChanged = true; var o3 = t4.display, r2 = t4.display.externalMeasured; if (r2 && e3 >= r2.lineN && e3 < r2.lineN + r2.size && (o3.externalMeasured = null), !(e3 < o3.viewFrom || e3 >= o3.viewTo)) { var i2 = o3.view[Vo(t4, e3)]; if (null != i2.node) { var s2 = i2.changes || (i2.changes = []); -1 == z(s2, n3) && s2.push(n3); } } } function zo(t4) { t4.display.viewFrom = t4.display.viewTo = t4.doc.first, t4.display.view = [], t4.display.viewOffset = 0; } function Bo(t4, e3, n3, o3) { var r2, i2 = Vo(t4, e3), s2 = t4.display.view; if (!je || n3 == t4.doc.first + t4.doc.size) return { index: i2, lineN: n3 }; for (var a2 = t4.display.viewFrom, l2 = 0; l2 < i2; l2++) a2 += s2[l2].size; if (a2 != e3) { if (o3 > 0) { if (i2 == s2.length - 1) return null; r2 = a2 + s2[i2].size - e3, i2++; } else r2 = a2 - e3; e3 += r2, n3 += r2; } for (; nn(t4.doc, n3) != n3; ) { if (i2 == (o3 < 0 ? 0 : s2.length - 1)) return null; n3 += o3 * s2[i2 - (o3 < 0 ? 1 : 0)].size, i2 += o3; } return { index: i2, lineN: n3 }; } function Uo(t4, e3, n3) { var o3 = t4.display; 0 == o3.view.length || e3 >= o3.viewTo || n3 <= o3.viewFrom ? (o3.view = Sn(t4, e3, n3), o3.viewFrom = e3) : (o3.viewFrom > e3 ? o3.view = Sn(t4, e3, o3.viewFrom).concat(o3.view) : o3.viewFrom < e3 && (o3.view = o3.view.slice(Vo(t4, e3))), o3.viewFrom = e3, o3.viewTo < n3 ? o3.view = o3.view.concat(Sn(t4, o3.viewTo, n3)) : o3.viewTo > n3 && (o3.view = o3.view.slice(0, Vo(t4, n3)))), o3.viewTo = n3; } function Wo(t4) { for (var e3 = t4.display.view, n3 = 0, o3 = 0; o3 < e3.length; o3++) { var r2 = e3[o3]; r2.hidden || r2.node && !r2.changes || ++n3; } return n3; } function $o(t4) { t4.display.input.showSelection(t4.display.input.prepareSelection()); } function qo(t4, e3) { void 0 === e3 && (e3 = true); var n3 = t4.doc, o3 = {}, r2 = o3.cursors = document.createDocumentFragment(), i2 = o3.selection = document.createDocumentFragment(), s2 = t4.options.$customCursor; s2 && (e3 = true); for (var a2 = 0; a2 < n3.sel.ranges.length; a2++) if (e3 || a2 != n3.sel.primIndex) { var l2 = n3.sel.ranges[a2]; if (!(l2.from().line >= t4.display.viewTo || l2.to().line < t4.display.viewFrom)) { var c2 = l2.empty(); if (s2) { var u2 = s2(t4, l2); u2 && Go(t4, u2, r2); } else (c2 || t4.options.showCursorWhenSelecting) && Go(t4, l2.head, r2); c2 || Yo(t4, l2, i2); } } return o3; } function Go(t4, e3, n3) { var o3 = wo(t4, e3, "div", null, null, !t4.options.singleCursorHeightPerLine), r2 = n3.appendChild(A("div", " ", "CodeMirror-cursor")); if (r2.style.left = o3.left + "px", r2.style.top = o3.top + "px", r2.style.height = Math.max(0, o3.bottom - o3.top) * t4.options.cursorHeight + "px", /\bcm-fat-cursor\b/.test(t4.getWrapperElement().className)) { var i2 = _o(t4, e3, "div", null, null), s2 = i2.right - i2.left; r2.style.width = (s2 > 0 ? s2 : t4.defaultCharWidth()) + "px"; } if (o3.other) { var a2 = n3.appendChild(A("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor")); a2.style.display = "", a2.style.left = o3.other.left + "px", a2.style.top = o3.other.top + "px", a2.style.height = 0.85 * (o3.other.bottom - o3.other.top) + "px"; } } function Ko(t4, e3) { return t4.top - e3.top || t4.left - e3.left; } function Yo(t4, e3, n3) { var o3 = t4.display, r2 = t4.doc, i2 = document.createDocumentFragment(), s2 = Kn(t4.display), a2 = s2.left, l2 = Math.max(o3.sizerWidth, Xn(t4) - o3.sizer.offsetLeft) - s2.right, c2 = "ltr" == r2.direction; function u2(t5, e4, n4, o4) { e4 < 0 && (e4 = 0), e4 = Math.round(e4), o4 = Math.round(o4), i2.appendChild(A("div", null, "CodeMirror-selected", "position: absolute; left: " + t5 + "px;\n top: " + e4 + "px; width: " + (null == n4 ? l2 - t5 : n4) + "px;\n height: " + (o4 - e4) + "px")); } function p2(e4, n4, o4) { var i3, s3, p3 = Zt(r2, e4), d3 = p3.text.length; function f3(n5, o5) { return _o(t4, se(e4, n5), "div", p3, o5); } function h3(e5, n5, o5) { var r3 = To(t4, p3, null, e5), i4 = "ltr" == n5 == ("after" == o5) ? "left" : "right"; return f3("after" == o5 ? r3.begin : r3.end - (/\s/.test(p3.text.charAt(r3.end - 1)) ? 2 : 1), i4)[i4]; } var g3 = ft(p3, r2.direction); return ct(g3, n4 || 0, null == o4 ? d3 : o4, function(t5, e5, r3, p4) { var v3 = "ltr" == r3, y3 = f3(t5, v3 ? "left" : "right"), m3 = f3(e5 - 1, v3 ? "right" : "left"), b2 = null == n4 && 0 == t5, _2 = null == o4 && e5 == d3, w2 = 0 == p4, x2 = !g3 || p4 == g3.length - 1; if (m3.top - y3.top <= 3) { var C2 = (c2 ? _2 : b2) && x2, S2 = (c2 ? b2 : _2) && w2 ? a2 : (v3 ? y3 : m3).left, O2 = C2 ? l2 : (v3 ? m3 : y3).right; u2(S2, y3.top, O2 - S2, y3.bottom); } else { var T2, k2, P2, E2; v3 ? (T2 = c2 && b2 && w2 ? a2 : y3.left, k2 = c2 ? l2 : h3(t5, r3, "before"), P2 = c2 ? a2 : h3(e5, r3, "after"), E2 = c2 && _2 && x2 ? l2 : m3.right) : (T2 = c2 ? h3(t5, r3, "before") : a2, k2 = !c2 && b2 && w2 ? l2 : y3.right, P2 = !c2 && _2 && x2 ? a2 : m3.left, E2 = c2 ? h3(e5, r3, "after") : l2), u2(T2, y3.top, k2 - T2, y3.bottom), y3.bottom < m3.top && u2(a2, y3.bottom, null, m3.top), u2(P2, m3.top, E2 - P2, m3.bottom); } (!i3 || Ko(y3, i3) < 0) && (i3 = y3), Ko(m3, i3) < 0 && (i3 = m3), (!s3 || Ko(y3, s3) < 0) && (s3 = y3), Ko(m3, s3) < 0 && (s3 = m3); }), { start: i3, end: s3 }; } var d2 = e3.from(), f2 = e3.to(); if (d2.line == f2.line) p2(d2.line, d2.ch, f2.ch); else { var h2 = Zt(r2, d2.line), g2 = Zt(r2, f2.line), v2 = Qe(h2) == Qe(g2), y2 = p2(d2.line, d2.ch, v2 ? h2.text.length + 1 : null).end, m2 = p2(f2.line, v2 ? 0 : null, f2.ch).start; v2 && (y2.top < m2.top - 2 ? (u2(y2.right, y2.top, null, y2.bottom), u2(a2, m2.top, m2.left, m2.bottom)) : u2(y2.right, y2.top, m2.left - y2.right, y2.bottom)), y2.bottom < m2.top && u2(a2, y2.bottom, null, m2.top); } n3.appendChild(i2); } function Xo(t4) { if (t4.state.focused) { var e3 = t4.display; clearInterval(e3.blinker); var n3 = true; e3.cursorDiv.style.visibility = "", t4.options.cursorBlinkRate > 0 ? e3.blinker = setInterval(function() { t4.hasFocus() || tr(t4), e3.cursorDiv.style.visibility = (n3 = !n3) ? "" : "hidden"; }, t4.options.cursorBlinkRate) : t4.options.cursorBlinkRate < 0 && (e3.cursorDiv.style.visibility = "hidden"); } } function Jo(t4) { t4.hasFocus() || (t4.display.input.focus(), t4.state.focused || Qo(t4)); } function Zo(t4) { t4.state.delayingBlurEvent = true, setTimeout(function() { t4.state.delayingBlurEvent && (t4.state.delayingBlurEvent = false, t4.state.focused && tr(t4)); }, 100); } function Qo(t4, e3) { t4.state.delayingBlurEvent && !t4.state.draggingText && (t4.state.delayingBlurEvent = false), "nocursor" != t4.options.readOnly && (t4.state.focused || (mt(t4, "focus", t4, e3), t4.state.focused = true, D(t4.display.wrapper, "CodeMirror-focused"), t4.curOp || t4.display.selForContextMenu == t4.doc.sel || (t4.display.input.reset(), l && setTimeout(function() { return t4.display.input.reset(true); }, 20)), t4.display.input.receivedFocus()), Xo(t4)); } function tr(t4, e3) { t4.state.delayingBlurEvent || (t4.state.focused && (mt(t4, "blur", t4, e3), t4.state.focused = false, k(t4.display.wrapper, "CodeMirror-focused")), clearInterval(t4.display.blinker), setTimeout(function() { t4.state.focused || (t4.display.shift = false); }, 150)); } function er(t4) { for (var e3 = t4.display, n3 = e3.lineDiv.offsetTop, o3 = Math.max(0, e3.scroller.getBoundingClientRect().top), r2 = e3.lineDiv.getBoundingClientRect().top, i2 = 0, l2 = 0; l2 < e3.view.length; l2++) { var c2 = e3.view[l2], u2 = t4.options.lineWrapping, p2 = void 0, d2 = 0; if (!c2.hidden) { if (r2 += c2.line.height, s && a < 8) { var f2 = c2.node.offsetTop + c2.node.offsetHeight; p2 = f2 - n3, n3 = f2; } else { var h2 = c2.node.getBoundingClientRect(); p2 = h2.bottom - h2.top, !u2 && c2.text.firstChild && (d2 = c2.text.firstChild.getBoundingClientRect().right - h2.left - 1); } var g2 = c2.line.height - p2; if ((g2 > 5e-3 || g2 < -5e-3) && (r2 < o3 && (i2 -= g2), ee(c2.line, p2), nr(c2.line), c2.rest)) for (var v2 = 0; v2 < c2.rest.length; v2++) nr(c2.rest[v2]); if (d2 > t4.display.sizerWidth) { var y2 = Math.ceil(d2 / Mo(t4.display)); y2 > t4.display.maxLineLength && (t4.display.maxLineLength = y2, t4.display.maxLine = c2.line, t4.display.maxLineChanged = true); } } } Math.abs(i2) > 2 && (e3.scroller.scrollTop += i2); } function nr(t4) { if (t4.widgets) for (var e3 = 0; e3 < t4.widgets.length; ++e3) { var n3 = t4.widgets[e3], o3 = n3.node.parentNode; o3 && (n3.height = o3.offsetHeight); } } function or(t4, e3, n3) { var o3 = n3 && null != n3.top ? Math.max(0, n3.top) : t4.scroller.scrollTop; o3 = Math.floor(o3 - qn(t4)); var r2 = n3 && null != n3.bottom ? n3.bottom : o3 + t4.wrapper.clientHeight, i2 = oe(e3, o3), s2 = oe(e3, r2); if (n3 && n3.ensure) { var a2 = n3.ensure.from.line, l2 = n3.ensure.to.line; a2 < i2 ? (i2 = a2, s2 = oe(e3, an(Zt(e3, a2)) + t4.wrapper.clientHeight)) : Math.min(l2, e3.lastLine()) >= s2 && (i2 = oe(e3, an(Zt(e3, l2)) - t4.wrapper.clientHeight), s2 = l2); } return { from: i2, to: Math.max(s2, i2 + 1) }; } function rr(t4, e3) { if (!bt(t4, "scrollCursorIntoView")) { var n3 = t4.display, o3 = n3.sizer.getBoundingClientRect(), r2 = null; if (e3.top + o3.top < 0 ? r2 = true : e3.bottom + o3.top > (window.innerHeight || document.documentElement.clientHeight) && (r2 = false), null != r2 && !g) { var i2 = A("div", "​", null, "position: absolute;\n top: " + (e3.top - n3.viewOffset - qn(t4.display)) + "px;\n height: " + (e3.bottom - e3.top + Yn(t4) + n3.barHeight) + "px;\n left: " + e3.left + "px; width: " + Math.max(2, e3.right - e3.left) + "px;"); t4.display.lineSpace.appendChild(i2), i2.scrollIntoView(r2), t4.display.lineSpace.removeChild(i2); } } } function ir(t4, e3, n3, o3) { var r2; null == o3 && (o3 = 0), t4.options.lineWrapping || e3 != n3 || (n3 = "before" == e3.sticky ? se(e3.line, e3.ch + 1, "before") : e3, e3 = e3.ch ? se(e3.line, "before" == e3.sticky ? e3.ch - 1 : e3.ch, "after") : e3); for (var i2 = 0; i2 < 5; i2++) { var s2 = false, a2 = wo(t4, e3), l2 = n3 && n3 != e3 ? wo(t4, n3) : a2, c2 = ar(t4, r2 = { left: Math.min(a2.left, l2.left), top: Math.min(a2.top, l2.top) - o3, right: Math.max(a2.left, l2.left), bottom: Math.max(a2.bottom, l2.bottom) + o3 }), u2 = t4.doc.scrollTop, p2 = t4.doc.scrollLeft; if (null != c2.scrollTop && (hr(t4, c2.scrollTop), Math.abs(t4.doc.scrollTop - u2) > 1 && (s2 = true)), null != c2.scrollLeft && (vr(t4, c2.scrollLeft), Math.abs(t4.doc.scrollLeft - p2) > 1 && (s2 = true)), !s2) break; } return r2; } function sr(t4, e3) { var n3 = ar(t4, e3); null != n3.scrollTop && hr(t4, n3.scrollTop), null != n3.scrollLeft && vr(t4, n3.scrollLeft); } function ar(t4, e3) { var n3 = t4.display, o3 = jo(t4.display); e3.top < 0 && (e3.top = 0); var r2 = t4.curOp && null != t4.curOp.scrollTop ? t4.curOp.scrollTop : n3.scroller.scrollTop, i2 = Jn(t4), s2 = {}; e3.bottom - e3.top > i2 && (e3.bottom = e3.top + i2); var a2 = t4.doc.height + Gn(n3), l2 = e3.top < o3, c2 = e3.bottom > a2 - o3; if (e3.top < r2) s2.scrollTop = l2 ? 0 : e3.top; else if (e3.bottom > r2 + i2) { var u2 = Math.min(e3.top, (c2 ? a2 : e3.bottom) - i2); u2 != r2 && (s2.scrollTop = u2); } var p2 = t4.options.fixedGutter ? 0 : n3.gutters.offsetWidth, d2 = t4.curOp && null != t4.curOp.scrollLeft ? t4.curOp.scrollLeft : n3.scroller.scrollLeft - p2, f2 = Xn(t4) - n3.gutters.offsetWidth, h2 = e3.right - e3.left > f2; return h2 && (e3.right = e3.left + f2), e3.left < 10 ? s2.scrollLeft = 0 : e3.left < d2 ? s2.scrollLeft = Math.max(0, e3.left + p2 - (h2 ? 0 : 10)) : e3.right > f2 + d2 - 3 && (s2.scrollLeft = e3.right + (h2 ? 0 : 10) - f2), s2; } function lr(t4, e3) { null != e3 && (dr(t4), t4.curOp.scrollTop = (null == t4.curOp.scrollTop ? t4.doc.scrollTop : t4.curOp.scrollTop) + e3); } function cr(t4) { dr(t4); var e3 = t4.getCursor(); t4.curOp.scrollToPos = { from: e3, to: e3, margin: t4.options.cursorScrollMargin }; } function ur(t4, e3, n3) { null == e3 && null == n3 || dr(t4), null != e3 && (t4.curOp.scrollLeft = e3), null != n3 && (t4.curOp.scrollTop = n3); } function pr(t4, e3) { dr(t4), t4.curOp.scrollToPos = e3; } function dr(t4) { var e3 = t4.curOp.scrollToPos; e3 && (t4.curOp.scrollToPos = null, fr(t4, xo(t4, e3.from), xo(t4, e3.to), e3.margin)); } function fr(t4, e3, n3, o3) { var r2 = ar(t4, { left: Math.min(e3.left, n3.left), top: Math.min(e3.top, n3.top) - o3, right: Math.max(e3.right, n3.right), bottom: Math.max(e3.bottom, n3.bottom) + o3 }); ur(t4, r2.scrollLeft, r2.scrollTop); } function hr(t4, e3) { Math.abs(t4.doc.scrollTop - e3) < 2 || (n2 || $r(t4, { top: e3 }), gr(t4, e3, true), n2 && $r(t4), Fr(t4, 100)); } function gr(t4, e3, n3) { e3 = Math.max(0, Math.min(t4.display.scroller.scrollHeight - t4.display.scroller.clientHeight, e3)), (t4.display.scroller.scrollTop != e3 || n3) && (t4.doc.scrollTop = e3, t4.display.scrollbars.setScrollTop(e3), t4.display.scroller.scrollTop != e3 && (t4.display.scroller.scrollTop = e3)); } function vr(t4, e3, n3, o3) { e3 = Math.max(0, Math.min(e3, t4.display.scroller.scrollWidth - t4.display.scroller.clientWidth)), (n3 ? e3 == t4.doc.scrollLeft : Math.abs(t4.doc.scrollLeft - e3) < 2) && !o3 || (t4.doc.scrollLeft = e3, Yr(t4), t4.display.scroller.scrollLeft != e3 && (t4.display.scroller.scrollLeft = e3), t4.display.scrollbars.setScrollLeft(e3)); } function yr(t4) { var e3 = t4.display, n3 = e3.gutters.offsetWidth, o3 = Math.round(t4.doc.height + Gn(t4.display)); return { clientHeight: e3.scroller.clientHeight, viewHeight: e3.wrapper.clientHeight, scrollWidth: e3.scroller.scrollWidth, clientWidth: e3.scroller.clientWidth, viewWidth: e3.wrapper.clientWidth, barLeft: t4.options.fixedGutter ? n3 : 0, docHeight: o3, scrollHeight: o3 + Yn(t4) + e3.barHeight, nativeBarWidth: e3.nativeBarWidth, gutterWidth: n3 }; } var mr = function(t4, e3, n3) { this.cm = n3; var o3 = this.vert = A("div", [A("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"), r2 = this.horiz = A("div", [A("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); o3.tabIndex = r2.tabIndex = -1, t4(o3), t4(r2), gt(o3, "scroll", function() { o3.clientHeight && e3(o3.scrollTop, "vertical"); }), gt(r2, "scroll", function() { r2.clientWidth && e3(r2.scrollLeft, "horizontal"); }), this.checkedZeroWidth = false, s && a < 8 && (this.horiz.style.minHeight = this.vert.style.minWidth = "18px"); }; mr.prototype.update = function(t4) { var e3 = t4.scrollWidth > t4.clientWidth + 1, n3 = t4.scrollHeight > t4.clientHeight + 1, o3 = t4.nativeBarWidth; if (n3) { this.vert.style.display = "block", this.vert.style.bottom = e3 ? o3 + "px" : "0"; var r2 = t4.viewHeight - (e3 ? o3 : 0); this.vert.firstChild.style.height = Math.max(0, t4.scrollHeight - t4.clientHeight + r2) + "px"; } else this.vert.scrollTop = 0, this.vert.style.display = "", this.vert.firstChild.style.height = "0"; if (e3) { this.horiz.style.display = "block", this.horiz.style.right = n3 ? o3 + "px" : "0", this.horiz.style.left = t4.barLeft + "px"; var i2 = t4.viewWidth - t4.barLeft - (n3 ? o3 : 0); this.horiz.firstChild.style.width = Math.max(0, t4.scrollWidth - t4.clientWidth + i2) + "px"; } else this.horiz.style.display = "", this.horiz.firstChild.style.width = "0"; return !this.checkedZeroWidth && t4.clientHeight > 0 && (0 == o3 && this.zeroWidthHack(), this.checkedZeroWidth = true), { right: n3 ? o3 : 0, bottom: e3 ? o3 : 0 }; }, mr.prototype.setScrollLeft = function(t4) { this.horiz.scrollLeft != t4 && (this.horiz.scrollLeft = t4), this.disableHoriz && this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); }, mr.prototype.setScrollTop = function(t4) { this.vert.scrollTop != t4 && (this.vert.scrollTop = t4), this.disableVert && this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); }, mr.prototype.zeroWidthHack = function() { var t4 = b && !h ? "12px" : "18px"; this.horiz.style.height = this.vert.style.width = t4, this.horiz.style.visibility = this.vert.style.visibility = "hidden", this.disableHoriz = new H(), this.disableVert = new H(); }, mr.prototype.enableZeroWidthBar = function(t4, e3, n3) { function o3() { var r2 = t4.getBoundingClientRect(); ("vert" == n3 ? document.elementFromPoint(r2.right - 1, (r2.top + r2.bottom) / 2) : document.elementFromPoint((r2.right + r2.left) / 2, r2.bottom - 1)) != t4 ? t4.style.visibility = "hidden" : e3.set(1e3, o3); } t4.style.visibility = "", e3.set(1e3, o3); }, mr.prototype.clear = function() { var t4 = this.horiz.parentNode; t4.removeChild(this.horiz), t4.removeChild(this.vert); }; var br = function() { }; function _r(t4, e3) { e3 || (e3 = yr(t4)); var n3 = t4.display.barWidth, o3 = t4.display.barHeight; wr(t4, e3); for (var r2 = 0; r2 < 4 && n3 != t4.display.barWidth || o3 != t4.display.barHeight; r2++) n3 != t4.display.barWidth && t4.options.lineWrapping && er(t4), wr(t4, yr(t4)), n3 = t4.display.barWidth, o3 = t4.display.barHeight; } function wr(t4, e3) { var n3 = t4.display, o3 = n3.scrollbars.update(e3); n3.sizer.style.paddingRight = (n3.barWidth = o3.right) + "px", n3.sizer.style.paddingBottom = (n3.barHeight = o3.bottom) + "px", n3.heightForcer.style.borderBottom = o3.bottom + "px solid transparent", o3.right && o3.bottom ? (n3.scrollbarFiller.style.display = "block", n3.scrollbarFiller.style.height = o3.bottom + "px", n3.scrollbarFiller.style.width = o3.right + "px") : n3.scrollbarFiller.style.display = "", o3.bottom && t4.options.coverGutterNextToScrollbar && t4.options.fixedGutter ? (n3.gutterFiller.style.display = "block", n3.gutterFiller.style.height = o3.bottom + "px", n3.gutterFiller.style.width = e3.gutterWidth + "px") : n3.gutterFiller.style.display = ""; } br.prototype.update = function() { return { bottom: 0, right: 0 }; }, br.prototype.setScrollLeft = function() { }, br.prototype.setScrollTop = function() { }, br.prototype.clear = function() { }; var xr = { native: mr, null: br }; function Cr(t4) { t4.display.scrollbars && (t4.display.scrollbars.clear(), t4.display.scrollbars.addClass && k(t4.display.wrapper, t4.display.scrollbars.addClass)), t4.display.scrollbars = new xr[t4.options.scrollbarStyle](function(e3) { t4.display.wrapper.insertBefore(e3, t4.display.scrollbarFiller), gt(e3, "mousedown", function() { t4.state.focused && setTimeout(function() { return t4.display.input.focus(); }, 0); }), e3.setAttribute("cm-not-content", "true"); }, function(e3, n3) { "horizontal" == n3 ? vr(t4, e3) : hr(t4, e3); }, t4), t4.display.scrollbars.addClass && D(t4.display.wrapper, t4.display.scrollbars.addClass); } var Sr = 0; function Or(t4) { t4.curOp = { cm: t4, viewChanged: false, startHeight: t4.doc.height, forceUpdate: false, updateInput: 0, typing: false, changeObjs: null, cursorActivityHandlers: null, cursorActivityCalled: 0, selectionChanged: false, updateMaxLine: false, scrollLeft: null, scrollTop: null, scrollToPos: null, focus: false, id: ++Sr, markArrays: null }, Tn(t4.curOp); } function Tr(t4) { var e3 = t4.curOp; e3 && Pn(e3, function(t5) { for (var e4 = 0; e4 < t5.ops.length; e4++) t5.ops[e4].cm.curOp = null; kr(t5); }); } function kr(t4) { for (var e3 = t4.ops, n3 = 0; n3 < e3.length; n3++) Pr(e3[n3]); for (var o3 = 0; o3 < e3.length; o3++) Er(e3[o3]); for (var r2 = 0; r2 < e3.length; r2++) Ar(e3[r2]); for (var i2 = 0; i2 < e3.length; i2++) jr(e3[i2]); for (var s2 = 0; s2 < e3.length; s2++) Mr(e3[s2]); } function Pr(t4) { var e3 = t4.cm, n3 = e3.display; Hr(e3), t4.updateMaxLine && cn(e3), t4.mustUpdate = t4.viewChanged || t4.forceUpdate || null != t4.scrollTop || t4.scrollToPos && (t4.scrollToPos.from.line < n3.viewFrom || t4.scrollToPos.to.line >= n3.viewTo) || n3.maxLineChanged && e3.options.lineWrapping, t4.update = t4.mustUpdate && new Rr(e3, t4.mustUpdate && { top: t4.scrollTop, ensure: t4.scrollToPos }, t4.forceUpdate); } function Er(t4) { t4.updatedDisplay = t4.mustUpdate && Ur(t4.cm, t4.update); } function Ar(t4) { var e3 = t4.cm, n3 = e3.display; t4.updatedDisplay && er(e3), t4.barMeasure = yr(e3), n3.maxLineChanged && !e3.options.lineWrapping && (t4.adjustWidthTo = eo(e3, n3.maxLine, n3.maxLine.text.length).left + 3, e3.display.sizerWidth = t4.adjustWidthTo, t4.barMeasure.scrollWidth = Math.max(n3.scroller.clientWidth, n3.sizer.offsetLeft + t4.adjustWidthTo + Yn(e3) + e3.display.barWidth), t4.maxScrollLeft = Math.max(0, n3.sizer.offsetLeft + t4.adjustWidthTo - Xn(e3))), (t4.updatedDisplay || t4.selectionChanged) && (t4.preparedSelection = n3.input.prepareSelection()); } function jr(t4) { var e3 = t4.cm; null != t4.adjustWidthTo && (e3.display.sizer.style.minWidth = t4.adjustWidthTo + "px", t4.maxScrollLeft < e3.doc.scrollLeft && vr(e3, Math.min(e3.display.scroller.scrollLeft, t4.maxScrollLeft), true), e3.display.maxLineChanged = false); var n3 = t4.focus && t4.focus == L(); t4.preparedSelection && e3.display.input.showSelection(t4.preparedSelection, n3), (t4.updatedDisplay || t4.startHeight != e3.doc.height) && _r(e3, t4.barMeasure), t4.updatedDisplay && Kr(e3, t4.barMeasure), t4.selectionChanged && Xo(e3), e3.state.focused && t4.updateInput && e3.display.input.reset(t4.typing), n3 && Jo(t4.cm); } function Mr(t4) { var e3 = t4.cm, n3 = e3.display, o3 = e3.doc; t4.updatedDisplay && Wr(e3, t4.update), null == n3.wheelStartX || null == t4.scrollTop && null == t4.scrollLeft && !t4.scrollToPos || (n3.wheelStartX = n3.wheelStartY = null), null != t4.scrollTop && gr(e3, t4.scrollTop, t4.forceScroll), null != t4.scrollLeft && vr(e3, t4.scrollLeft, true, true), t4.scrollToPos && rr(e3, ir(e3, fe(o3, t4.scrollToPos.from), fe(o3, t4.scrollToPos.to), t4.scrollToPos.margin)); var r2 = t4.maybeHiddenMarkers, i2 = t4.maybeUnhiddenMarkers; if (r2) for (var s2 = 0; s2 < r2.length; ++s2) r2[s2].lines.length || mt(r2[s2], "hide"); if (i2) for (var a2 = 0; a2 < i2.length; ++a2) i2[a2].lines.length && mt(i2[a2], "unhide"); n3.wrapper.offsetHeight && (o3.scrollTop = e3.display.scroller.scrollTop), t4.changeObjs && mt(e3, "changes", e3, t4.changeObjs), t4.update && t4.update.finish(); } function Lr(t4, e3) { if (t4.curOp) return e3(); Or(t4); try { return e3(); } finally { Tr(t4); } } function Dr(t4, e3) { return function() { if (t4.curOp) return e3.apply(t4, arguments); Or(t4); try { return e3.apply(t4, arguments); } finally { Tr(t4); } }; } function Nr(t4) { return function() { if (this.curOp) return t4.apply(this, arguments); Or(this); try { return t4.apply(this, arguments); } finally { Tr(this); } }; } function Ir(t4) { return function() { var e3 = this.cm; if (!e3 || e3.curOp) return t4.apply(this, arguments); Or(e3); try { return t4.apply(this, arguments); } finally { Tr(e3); } }; } function Fr(t4, e3) { t4.doc.highlightFrontier < t4.display.viewTo && t4.state.highlight.set(e3, F(Vr, t4)); } function Vr(t4) { var e3 = t4.doc; if (!(e3.highlightFrontier >= t4.display.viewTo)) { var n3 = +/* @__PURE__ */ new Date() + t4.options.workTime, o3 = _e(t4, e3.highlightFrontier), r2 = []; e3.iter(o3.line, Math.min(e3.first + e3.size, t4.display.viewTo + 500), function(i2) { if (o3.line >= t4.display.viewFrom) { var s2 = i2.styles, a2 = i2.text.length > t4.options.maxHighlightLength ? Kt(e3.mode, o3.state) : null, l2 = me(t4, i2, o3, true); a2 && (o3.state = a2), i2.styles = l2.styles; var c2 = i2.styleClasses, u2 = l2.classes; u2 ? i2.styleClasses = u2 : c2 && (i2.styleClasses = null); for (var p2 = !s2 || s2.length != i2.styles.length || c2 != u2 && (!c2 || !u2 || c2.bgClass != u2.bgClass || c2.textClass != u2.textClass), d2 = 0; !p2 && d2 < s2.length; ++d2) p2 = s2[d2] != i2.styles[d2]; p2 && r2.push(o3.line), i2.stateAfter = o3.save(), o3.nextLine(); } else i2.text.length <= t4.options.maxHighlightLength && we(t4, i2.text, o3), i2.stateAfter = o3.line % 5 == 0 ? o3.save() : null, o3.nextLine(); if (+/* @__PURE__ */ new Date() > n3) return Fr(t4, t4.options.workDelay), true; }), e3.highlightFrontier = o3.line, e3.modeFrontier = Math.max(e3.modeFrontier, o3.line), r2.length && Lr(t4, function() { for (var e4 = 0; e4 < r2.length; e4++) Ho(t4, r2[e4], "text"); }); } } var Rr = function(t4, e3, n3) { var o3 = t4.display; this.viewport = e3, this.visible = or(o3, t4.doc, e3), this.editorIsHidden = !o3.wrapper.offsetWidth, this.wrapperHeight = o3.wrapper.clientHeight, this.wrapperWidth = o3.wrapper.clientWidth, this.oldDisplayWidth = Xn(t4), this.force = n3, this.dims = Lo(t4), this.events = []; }; function Hr(t4) { var e3 = t4.display; !e3.scrollbarsClipped && e3.scroller.offsetWidth && (e3.nativeBarWidth = e3.scroller.offsetWidth - e3.scroller.clientWidth, e3.heightForcer.style.height = Yn(t4) + "px", e3.sizer.style.marginBottom = -e3.nativeBarWidth + "px", e3.sizer.style.borderRightWidth = Yn(t4) + "px", e3.scrollbarsClipped = true); } function zr(t4) { if (t4.hasFocus()) return null; var e3 = L(); if (!e3 || !M(t4.display.lineDiv, e3)) return null; var n3 = { activeElt: e3 }; if (window.getSelection) { var o3 = window.getSelection(); o3.anchorNode && o3.extend && M(t4.display.lineDiv, o3.anchorNode) && (n3.anchorNode = o3.anchorNode, n3.anchorOffset = o3.anchorOffset, n3.focusNode = o3.focusNode, n3.focusOffset = o3.focusOffset); } return n3; } function Br(t4) { if (t4 && t4.activeElt && t4.activeElt != L() && (t4.activeElt.focus(), !/^(INPUT|TEXTAREA)$/.test(t4.activeElt.nodeName) && t4.anchorNode && M(document.body, t4.anchorNode) && M(document.body, t4.focusNode))) { var e3 = window.getSelection(), n3 = document.createRange(); n3.setEnd(t4.anchorNode, t4.anchorOffset), n3.collapse(false), e3.removeAllRanges(), e3.addRange(n3), e3.extend(t4.focusNode, t4.focusOffset); } } function Ur(t4, e3) { var n3 = t4.display, o3 = t4.doc; if (e3.editorIsHidden) return zo(t4), false; if (!e3.force && e3.visible.from >= n3.viewFrom && e3.visible.to <= n3.viewTo && (null == n3.updateLineNumbers || n3.updateLineNumbers >= n3.viewTo) && n3.renderedView == n3.view && 0 == Wo(t4)) return false; Xr(t4) && (zo(t4), e3.dims = Lo(t4)); var r2 = o3.first + o3.size, i2 = Math.max(e3.visible.from - t4.options.viewportMargin, o3.first), s2 = Math.min(r2, e3.visible.to + t4.options.viewportMargin); n3.viewFrom < i2 && i2 - n3.viewFrom < 20 && (i2 = Math.max(o3.first, n3.viewFrom)), n3.viewTo > s2 && n3.viewTo - s2 < 20 && (s2 = Math.min(r2, n3.viewTo)), je && (i2 = nn(t4.doc, i2), s2 = on(t4.doc, s2)); var a2 = i2 != n3.viewFrom || s2 != n3.viewTo || n3.lastWrapHeight != e3.wrapperHeight || n3.lastWrapWidth != e3.wrapperWidth; Uo(t4, i2, s2), n3.viewOffset = an(Zt(t4.doc, n3.viewFrom)), t4.display.mover.style.top = n3.viewOffset + "px"; var l2 = Wo(t4); if (!a2 && 0 == l2 && !e3.force && n3.renderedView == n3.view && (null == n3.updateLineNumbers || n3.updateLineNumbers >= n3.viewTo)) return false; var c2 = zr(t4); return l2 > 4 && (n3.lineDiv.style.display = "none"), qr(t4, n3.updateLineNumbers, e3.dims), l2 > 4 && (n3.lineDiv.style.display = ""), n3.renderedView = n3.view, Br(c2), P(n3.cursorDiv), P(n3.selectionDiv), n3.gutters.style.height = n3.sizer.style.minHeight = 0, a2 && (n3.lastWrapHeight = e3.wrapperHeight, n3.lastWrapWidth = e3.wrapperWidth, Fr(t4, 400)), n3.updateLineNumbers = null, true; } function Wr(t4, e3) { for (var n3 = e3.viewport, o3 = true; ; o3 = false) { if (o3 && t4.options.lineWrapping && e3.oldDisplayWidth != Xn(t4)) o3 && (e3.visible = or(t4.display, t4.doc, n3)); else if (n3 && null != n3.top && (n3 = { top: Math.min(t4.doc.height + Gn(t4.display) - Jn(t4), n3.top) }), e3.visible = or(t4.display, t4.doc, n3), e3.visible.from >= t4.display.viewFrom && e3.visible.to <= t4.display.viewTo) break; if (!Ur(t4, e3)) break; er(t4); var r2 = yr(t4); $o(t4), _r(t4, r2), Kr(t4, r2), e3.force = false; } e3.signal(t4, "update", t4), t4.display.viewFrom == t4.display.reportedViewFrom && t4.display.viewTo == t4.display.reportedViewTo || (e3.signal(t4, "viewportChange", t4, t4.display.viewFrom, t4.display.viewTo), t4.display.reportedViewFrom = t4.display.viewFrom, t4.display.reportedViewTo = t4.display.viewTo); } function $r(t4, e3) { var n3 = new Rr(t4, e3); if (Ur(t4, n3)) { er(t4), Wr(t4, n3); var o3 = yr(t4); $o(t4), _r(t4, o3), Kr(t4, o3), n3.finish(); } } function qr(t4, e3, n3) { var o3 = t4.display, r2 = t4.options.lineNumbers, i2 = o3.lineDiv, s2 = i2.firstChild; function a2(e4) { var n4 = e4.nextSibling; return l && b && t4.display.currentWheelTarget == e4 ? e4.style.display = "none" : e4.parentNode.removeChild(e4), n4; } for (var c2 = o3.view, u2 = o3.viewFrom, p2 = 0; p2 < c2.length; p2++) { var d2 = c2[p2]; if (d2.hidden) ; else if (d2.node && d2.node.parentNode == i2) { for (; s2 != d2.node; ) s2 = a2(s2); var f2 = r2 && null != e3 && e3 <= u2 && d2.lineNumber; d2.changes && (z(d2.changes, "gutter") > -1 && (f2 = false), Mn(t4, d2, u2, n3)), f2 && (P(d2.lineNumber), d2.lineNumber.appendChild(document.createTextNode(ie(t4.options, u2)))), s2 = d2.node.nextSibling; } else { var h2 = Hn(t4, d2, u2, n3); i2.insertBefore(h2, s2); } u2 += d2.size; } for (; s2; ) s2 = a2(s2); } function Gr(t4) { var e3 = t4.gutters.offsetWidth; t4.sizer.style.marginLeft = e3 + "px", An(t4, "gutterChanged", t4); } function Kr(t4, e3) { t4.display.sizer.style.minHeight = e3.docHeight + "px", t4.display.heightForcer.style.top = e3.docHeight + "px", t4.display.gutters.style.height = e3.docHeight + t4.display.barHeight + Yn(t4) + "px"; } function Yr(t4) { var e3 = t4.display, n3 = e3.view; if (e3.alignWidgets || e3.gutters.firstChild && t4.options.fixedGutter) { for (var o3 = Do(e3) - e3.scroller.scrollLeft + t4.doc.scrollLeft, r2 = e3.gutters.offsetWidth, i2 = o3 + "px", s2 = 0; s2 < n3.length; s2++) if (!n3[s2].hidden) { t4.options.fixedGutter && (n3[s2].gutter && (n3[s2].gutter.style.left = i2), n3[s2].gutterBackground && (n3[s2].gutterBackground.style.left = i2)); var a2 = n3[s2].alignable; if (a2) for (var l2 = 0; l2 < a2.length; l2++) a2[l2].style.left = i2; } t4.options.fixedGutter && (e3.gutters.style.left = o3 + r2 + "px"); } } function Xr(t4) { if (!t4.options.lineNumbers) return false; var e3 = t4.doc, n3 = ie(t4.options, e3.first + e3.size - 1), o3 = t4.display; if (n3.length != o3.lineNumChars) { var r2 = o3.measure.appendChild(A("div", [A("div", n3)], "CodeMirror-linenumber CodeMirror-gutter-elt")), i2 = r2.firstChild.offsetWidth, s2 = r2.offsetWidth - i2; return o3.lineGutter.style.width = "", o3.lineNumInnerWidth = Math.max(i2, o3.lineGutter.offsetWidth - s2) + 1, o3.lineNumWidth = o3.lineNumInnerWidth + s2, o3.lineNumChars = o3.lineNumInnerWidth ? n3.length : -1, o3.lineGutter.style.width = o3.lineNumWidth + "px", Gr(t4.display), true; } return false; } function Jr(t4, e3) { for (var n3 = [], o3 = false, r2 = 0; r2 < t4.length; r2++) { var i2 = t4[r2], s2 = null; if ("string" != typeof i2 && (s2 = i2.style, i2 = i2.className), "CodeMirror-linenumbers" == i2) { if (!e3) continue; o3 = true; } n3.push({ className: i2, style: s2 }); } return e3 && !o3 && n3.push({ className: "CodeMirror-linenumbers", style: null }), n3; } function Zr(t4) { var e3 = t4.gutters, n3 = t4.gutterSpecs; P(e3), t4.lineGutter = null; for (var o3 = 0; o3 < n3.length; ++o3) { var r2 = n3[o3], i2 = r2.className, s2 = r2.style, a2 = e3.appendChild(A("div", null, "CodeMirror-gutter " + i2)); s2 && (a2.style.cssText = s2), "CodeMirror-linenumbers" == i2 && (t4.lineGutter = a2, a2.style.width = (t4.lineNumWidth || 1) + "px"); } e3.style.display = n3.length ? "" : "none", Gr(t4); } function Qr(t4) { Zr(t4.display), Ro(t4), Yr(t4); } function ti(t4, e3, o3, r2) { var i2 = this; this.input = o3, i2.scrollbarFiller = A("div", null, "CodeMirror-scrollbar-filler"), i2.scrollbarFiller.setAttribute("cm-not-content", "true"), i2.gutterFiller = A("div", null, "CodeMirror-gutter-filler"), i2.gutterFiller.setAttribute("cm-not-content", "true"), i2.lineDiv = j("div", null, "CodeMirror-code"), i2.selectionDiv = A("div", null, null, "position: relative; z-index: 1"), i2.cursorDiv = A("div", null, "CodeMirror-cursors"), i2.measure = A("div", null, "CodeMirror-measure"), i2.lineMeasure = A("div", null, "CodeMirror-measure"), i2.lineSpace = j("div", [i2.measure, i2.lineMeasure, i2.selectionDiv, i2.cursorDiv, i2.lineDiv], null, "position: relative; outline: none"); var c2 = j("div", [i2.lineSpace], "CodeMirror-lines"); i2.mover = A("div", [c2], null, "position: relative"), i2.sizer = A("div", [i2.mover], "CodeMirror-sizer"), i2.sizerWidth = null, i2.heightForcer = A("div", null, null, "position: absolute; height: " + B + "px; width: 1px;"), i2.gutters = A("div", null, "CodeMirror-gutters"), i2.lineGutter = null, i2.scroller = A("div", [i2.sizer, i2.heightForcer, i2.gutters], "CodeMirror-scroll"), i2.scroller.setAttribute("tabIndex", "-1"), i2.wrapper = A("div", [i2.scrollbarFiller, i2.gutterFiller, i2.scroller], "CodeMirror"), i2.wrapper.setAttribute("translate", "no"), s && a < 8 && (i2.gutters.style.zIndex = -1, i2.scroller.style.paddingRight = 0), l || n2 && m || (i2.scroller.draggable = true), t4 && (t4.appendChild ? t4.appendChild(i2.wrapper) : t4(i2.wrapper)), i2.viewFrom = i2.viewTo = e3.first, i2.reportedViewFrom = i2.reportedViewTo = e3.first, i2.view = [], i2.renderedView = null, i2.externalMeasured = null, i2.viewOffset = 0, i2.lastWrapHeight = i2.lastWrapWidth = 0, i2.updateLineNumbers = null, i2.nativeBarWidth = i2.barHeight = i2.barWidth = 0, i2.scrollbarsClipped = false, i2.lineNumWidth = i2.lineNumInnerWidth = i2.lineNumChars = null, i2.alignWidgets = false, i2.cachedCharWidth = i2.cachedTextHeight = i2.cachedPaddingH = null, i2.maxLine = null, i2.maxLineLength = 0, i2.maxLineChanged = false, i2.wheelDX = i2.wheelDY = i2.wheelStartX = i2.wheelStartY = null, i2.shift = false, i2.selForContextMenu = null, i2.activeTouch = null, i2.gutterSpecs = Jr(r2.gutters, r2.lineNumbers), Zr(i2), o3.init(i2); } Rr.prototype.signal = function(t4, e3) { wt(t4, e3) && this.events.push(arguments); }, Rr.prototype.finish = function() { for (var t4 = 0; t4 < this.events.length; t4++) mt.apply(null, this.events[t4]); }; var ei = 0, ni = null; function oi(t4) { var e3 = t4.wheelDeltaX, n3 = t4.wheelDeltaY; return null == e3 && t4.detail && t4.axis == t4.HORIZONTAL_AXIS && (e3 = t4.detail), null == n3 && t4.detail && t4.axis == t4.VERTICAL_AXIS ? n3 = t4.detail : null == n3 && (n3 = t4.wheelDelta), { x: e3, y: n3 }; } function ri(t4) { var e3 = oi(t4); return e3.x *= ni, e3.y *= ni, e3; } function ii(t4, e3) { u && p >= 102 && (null == t4.display.chromeScrollHack ? t4.display.sizer.style.pointerEvents = "none" : clearTimeout(t4.display.chromeScrollHack), t4.display.chromeScrollHack = setTimeout(function() { t4.display.chromeScrollHack = null, t4.display.sizer.style.pointerEvents = ""; }, 100)); var o3 = oi(e3), r2 = o3.x, i2 = o3.y, s2 = ni; 0 === e3.deltaMode && (r2 = e3.deltaX, i2 = e3.deltaY, s2 = 1); var a2 = t4.display, c2 = a2.scroller, f2 = c2.scrollWidth > c2.clientWidth, h2 = c2.scrollHeight > c2.clientHeight; if (r2 && f2 || i2 && h2) { if (i2 && b && l) { t: for (var g2 = e3.target, v2 = a2.view; g2 != c2; g2 = g2.parentNode) for (var y2 = 0; y2 < v2.length; y2++) if (v2[y2].node == g2) { t4.display.currentWheelTarget = g2; break t; } } if (r2 && !n2 && !d && null != s2) return i2 && h2 && hr(t4, Math.max(0, c2.scrollTop + i2 * s2)), vr(t4, Math.max(0, c2.scrollLeft + r2 * s2)), (!i2 || i2 && h2) && Ct(e3), void (a2.wheelStartX = null); if (i2 && null != s2) { var m2 = i2 * s2, _2 = t4.doc.scrollTop, w2 = _2 + a2.wrapper.clientHeight; m2 < 0 ? _2 = Math.max(0, _2 + m2 - 50) : w2 = Math.min(t4.doc.height, w2 + m2 + 50), $r(t4, { top: _2, bottom: w2 }); } ei < 20 && 0 !== e3.deltaMode && (null == a2.wheelStartX ? (a2.wheelStartX = c2.scrollLeft, a2.wheelStartY = c2.scrollTop, a2.wheelDX = r2, a2.wheelDY = i2, setTimeout(function() { if (null != a2.wheelStartX) { var t5 = c2.scrollLeft - a2.wheelStartX, e4 = c2.scrollTop - a2.wheelStartY, n3 = e4 && a2.wheelDY && e4 / a2.wheelDY || t5 && a2.wheelDX && t5 / a2.wheelDX; a2.wheelStartX = a2.wheelStartY = null, n3 && (ni = (ni * ei + n3) / (ei + 1), ++ei); } }, 200)) : (a2.wheelDX += r2, a2.wheelDY += i2)); } } s ? ni = -0.53 : n2 ? ni = 15 : u ? ni = -0.7 : f && (ni = -1 / 3); var si = function(t4, e3) { this.ranges = t4, this.primIndex = e3; }; si.prototype.primary = function() { return this.ranges[this.primIndex]; }, si.prototype.equals = function(t4) { if (t4 == this) return true; if (t4.primIndex != this.primIndex || t4.ranges.length != this.ranges.length) return false; for (var e3 = 0; e3 < this.ranges.length; e3++) { var n3 = this.ranges[e3], o3 = t4.ranges[e3]; if (!le(n3.anchor, o3.anchor) || !le(n3.head, o3.head)) return false; } return true; }, si.prototype.deepCopy = function() { for (var t4 = [], e3 = 0; e3 < this.ranges.length; e3++) t4[e3] = new ai(ce(this.ranges[e3].anchor), ce(this.ranges[e3].head)); return new si(t4, this.primIndex); }, si.prototype.somethingSelected = function() { for (var t4 = 0; t4 < this.ranges.length; t4++) if (!this.ranges[t4].empty()) return true; return false; }, si.prototype.contains = function(t4, e3) { e3 || (e3 = t4); for (var n3 = 0; n3 < this.ranges.length; n3++) { var o3 = this.ranges[n3]; if (ae(e3, o3.from()) >= 0 && ae(t4, o3.to()) <= 0) return n3; } return -1; }; var ai = function(t4, e3) { this.anchor = t4, this.head = e3; }; function li(t4, e3, n3) { var o3 = t4 && t4.options.selectionsMayTouch, r2 = e3[n3]; e3.sort(function(t5, e4) { return ae(t5.from(), e4.from()); }), n3 = z(e3, r2); for (var i2 = 1; i2 < e3.length; i2++) { var s2 = e3[i2], a2 = e3[i2 - 1], l2 = ae(a2.to(), s2.from()); if (o3 && !s2.empty() ? l2 > 0 : l2 >= 0) { var c2 = pe(a2.from(), s2.from()), u2 = ue(a2.to(), s2.to()), p2 = a2.empty() ? s2.from() == s2.head : a2.from() == a2.head; i2 <= n3 && --n3, e3.splice(--i2, 2, new ai(p2 ? u2 : c2, p2 ? c2 : u2)); } } return new si(e3, n3); } function ci(t4, e3) { return new si([new ai(t4, e3 || t4)], 0); } function ui(t4) { return t4.text ? se(t4.from.line + t4.text.length - 1, X(t4.text).length + (1 == t4.text.length ? t4.from.ch : 0)) : t4.to; } function pi(t4, e3) { if (ae(t4, e3.from) < 0) return t4; if (ae(t4, e3.to) <= 0) return ui(e3); var n3 = t4.line + e3.text.length - (e3.to.line - e3.from.line) - 1, o3 = t4.ch; return t4.line == e3.to.line && (o3 += ui(e3).ch - e3.to.ch), se(n3, o3); } function di(t4, e3) { for (var n3 = [], o3 = 0; o3 < t4.sel.ranges.length; o3++) { var r2 = t4.sel.ranges[o3]; n3.push(new ai(pi(r2.anchor, e3), pi(r2.head, e3))); } return li(t4.cm, n3, t4.sel.primIndex); } function fi(t4, e3, n3) { return t4.line == e3.line ? se(n3.line, t4.ch - e3.ch + n3.ch) : se(n3.line + (t4.line - e3.line), t4.ch); } function hi(t4, e3, n3) { for (var o3 = [], r2 = se(t4.first, 0), i2 = r2, s2 = 0; s2 < e3.length; s2++) { var a2 = e3[s2], l2 = fi(a2.from, r2, i2), c2 = fi(ui(a2), r2, i2); if (r2 = a2.to, i2 = c2, "around" == n3) { var u2 = t4.sel.ranges[s2], p2 = ae(u2.head, u2.anchor) < 0; o3[s2] = new ai(p2 ? c2 : l2, p2 ? l2 : c2); } else o3[s2] = new ai(l2, l2); } return new si(o3, t4.sel.primIndex); } function gi(t4) { t4.doc.mode = $t(t4.options, t4.doc.modeOption), vi(t4); } function vi(t4) { t4.doc.iter(function(t5) { t5.stateAfter && (t5.stateAfter = null), t5.styles && (t5.styles = null); }), t4.doc.modeFrontier = t4.doc.highlightFrontier = t4.doc.first, Fr(t4, 100), t4.state.modeGen++, t4.curOp && Ro(t4); } function yi(t4, e3) { return 0 == e3.from.ch && 0 == e3.to.ch && "" == X(e3.text) && (!t4.cm || t4.cm.options.wholeLineUpdateBefore); } function mi(t4, e3, n3, o3) { function r2(t5) { return n3 ? n3[t5] : null; } function i2(t5, n4, r3) { pn(t5, n4, r3, o3), An(t5, "change", t5, e3); } function s2(t5, e4) { for (var n4 = [], i3 = t5; i3 < e4; ++i3) n4.push(new un(c2[i3], r2(i3), o3)); return n4; } var a2 = e3.from, l2 = e3.to, c2 = e3.text, u2 = Zt(t4, a2.line), p2 = Zt(t4, l2.line), d2 = X(c2), f2 = r2(c2.length - 1), h2 = l2.line - a2.line; if (e3.full) t4.insert(0, s2(0, c2.length)), t4.remove(c2.length, t4.size - c2.length); else if (yi(t4, e3)) { var g2 = s2(0, c2.length - 1); i2(p2, p2.text, f2), h2 && t4.remove(a2.line, h2), g2.length && t4.insert(a2.line, g2); } else if (u2 == p2) if (1 == c2.length) i2(u2, u2.text.slice(0, a2.ch) + d2 + u2.text.slice(l2.ch), f2); else { var v2 = s2(1, c2.length - 1); v2.push(new un(d2 + u2.text.slice(l2.ch), f2, o3)), i2(u2, u2.text.slice(0, a2.ch) + c2[0], r2(0)), t4.insert(a2.line + 1, v2); } else if (1 == c2.length) i2(u2, u2.text.slice(0, a2.ch) + c2[0] + p2.text.slice(l2.ch), r2(0)), t4.remove(a2.line + 1, h2); else { i2(u2, u2.text.slice(0, a2.ch) + c2[0], r2(0)), i2(p2, d2 + p2.text.slice(l2.ch), f2); var y2 = s2(1, c2.length - 1); h2 > 1 && t4.remove(a2.line + 1, h2 - 1), t4.insert(a2.line + 1, y2); } An(t4, "change", t4, e3); } function bi(t4, e3, n3) { function o3(t5, r2, i2) { if (t5.linked) for (var s2 = 0; s2 < t5.linked.length; ++s2) { var a2 = t5.linked[s2]; if (a2.doc != r2) { var l2 = i2 && a2.sharedHist; n3 && !l2 || (e3(a2.doc, l2), o3(a2.doc, t5, l2)); } } } o3(t4, null, true); } function _i(t4, e3) { if (e3.cm) throw new Error("This document is already in use."); t4.doc = e3, e3.cm = t4, Io(t4), gi(t4), wi(t4), t4.options.direction = e3.direction, t4.options.lineWrapping || cn(t4), t4.options.mode = e3.modeOption, Ro(t4); } function wi(t4) { ("rtl" == t4.doc.direction ? D : k)(t4.display.lineDiv, "CodeMirror-rtl"); } function xi(t4) { Lr(t4, function() { wi(t4), Ro(t4); }); } function Ci(t4) { this.done = [], this.undone = [], this.undoDepth = t4 ? t4.undoDepth : 1 / 0, this.lastModTime = this.lastSelTime = 0, this.lastOp = this.lastSelOp = null, this.lastOrigin = this.lastSelOrigin = null, this.generation = this.maxGeneration = t4 ? t4.maxGeneration : 1; } function Si(t4, e3) { var n3 = { from: ce(e3.from), to: ui(e3), text: Qt(t4, e3.from, e3.to) }; return ji(t4, n3, e3.from.line, e3.to.line + 1), bi(t4, function(t5) { return ji(t5, n3, e3.from.line, e3.to.line + 1); }, true), n3; } function Oi(t4) { for (; t4.length && X(t4).ranges; ) t4.pop(); } function Ti(t4, e3) { return e3 ? (Oi(t4.done), X(t4.done)) : t4.done.length && !X(t4.done).ranges ? X(t4.done) : t4.done.length > 1 && !t4.done[t4.done.length - 2].ranges ? (t4.done.pop(), X(t4.done)) : void 0; } function ki(t4, e3, n3, o3) { var r2 = t4.history; r2.undone.length = 0; var i2, s2, a2 = +/* @__PURE__ */ new Date(); if ((r2.lastOp == o3 || r2.lastOrigin == e3.origin && e3.origin && ("+" == e3.origin.charAt(0) && r2.lastModTime > a2 - (t4.cm ? t4.cm.options.historyEventDelay : 500) || "*" == e3.origin.charAt(0))) && (i2 = Ti(r2, r2.lastOp == o3))) s2 = X(i2.changes), 0 == ae(e3.from, e3.to) && 0 == ae(e3.from, s2.to) ? s2.to = ui(e3) : i2.changes.push(Si(t4, e3)); else { var l2 = X(r2.done); for (l2 && l2.ranges || Ai(t4.sel, r2.done), i2 = { changes: [Si(t4, e3)], generation: r2.generation }, r2.done.push(i2); r2.done.length > r2.undoDepth; ) r2.done.shift(), r2.done[0].ranges || r2.done.shift(); } r2.done.push(n3), r2.generation = ++r2.maxGeneration, r2.lastModTime = r2.lastSelTime = a2, r2.lastOp = r2.lastSelOp = o3, r2.lastOrigin = r2.lastSelOrigin = e3.origin, s2 || mt(t4, "historyAdded"); } function Pi(t4, e3, n3, o3) { var r2 = e3.charAt(0); return "*" == r2 || "+" == r2 && n3.ranges.length == o3.ranges.length && n3.somethingSelected() == o3.somethingSelected() && /* @__PURE__ */ new Date() - t4.history.lastSelTime <= (t4.cm ? t4.cm.options.historyEventDelay : 500); } function Ei(t4, e3, n3, o3) { var r2 = t4.history, i2 = o3 && o3.origin; n3 == r2.lastSelOp || i2 && r2.lastSelOrigin == i2 && (r2.lastModTime == r2.lastSelTime && r2.lastOrigin == i2 || Pi(t4, i2, X(r2.done), e3)) ? r2.done[r2.done.length - 1] = e3 : Ai(e3, r2.done), r2.lastSelTime = +/* @__PURE__ */ new Date(), r2.lastSelOrigin = i2, r2.lastSelOp = n3, o3 && false !== o3.clearRedo && Oi(r2.undone); } function Ai(t4, e3) { var n3 = X(e3); n3 && n3.ranges && n3.equals(t4) || e3.push(t4); } function ji(t4, e3, n3, o3) { var r2 = e3["spans_" + t4.id], i2 = 0; t4.iter(Math.max(t4.first, n3), Math.min(t4.first + t4.size, o3), function(n4) { n4.markedSpans && ((r2 || (r2 = e3["spans_" + t4.id] = {}))[i2] = n4.markedSpans), ++i2; }); } function Mi(t4) { if (!t4) return null; for (var e3, n3 = 0; n3 < t4.length; ++n3) t4[n3].marker.explicitlyCleared ? e3 || (e3 = t4.slice(0, n3)) : e3 && e3.push(t4[n3]); return e3 ? e3.length ? e3 : null : t4; } function Li(t4, e3) { var n3 = e3["spans_" + t4.id]; if (!n3) return null; for (var o3 = [], r2 = 0; r2 < e3.text.length; ++r2) o3.push(Mi(n3[r2])); return o3; } function Di(t4, e3) { var n3 = Li(t4, e3), o3 = He(t4, e3); if (!n3) return o3; if (!o3) return n3; for (var r2 = 0; r2 < n3.length; ++r2) { var i2 = n3[r2], s2 = o3[r2]; if (i2 && s2) t: for (var a2 = 0; a2 < s2.length; ++a2) { for (var l2 = s2[a2], c2 = 0; c2 < i2.length; ++c2) if (i2[c2].marker == l2.marker) continue t; i2.push(l2); } else s2 && (n3[r2] = s2); } return n3; } function Ni(t4, e3, n3) { for (var o3 = [], r2 = 0; r2 < t4.length; ++r2) { var i2 = t4[r2]; if (i2.ranges) o3.push(n3 ? si.prototype.deepCopy.call(i2) : i2); else { var s2 = i2.changes, a2 = []; o3.push({ changes: a2 }); for (var l2 = 0; l2 < s2.length; ++l2) { var c2 = s2[l2], u2 = void 0; if (a2.push({ from: c2.from, to: c2.to, text: c2.text }), e3) for (var p2 in c2) (u2 = p2.match(/^spans_(\d+)$/)) && z(e3, Number(u2[1])) > -1 && (X(a2)[p2] = c2[p2], delete c2[p2]); } } } return o3; } function Ii(t4, e3, n3, o3) { if (o3) { var r2 = t4.anchor; if (n3) { var i2 = ae(e3, r2) < 0; i2 != ae(n3, r2) < 0 ? (r2 = e3, e3 = n3) : i2 != ae(e3, n3) < 0 && (e3 = n3); } return new ai(r2, e3); } return new ai(n3 || e3, e3); } function Fi(t4, e3, n3, o3, r2) { null == r2 && (r2 = t4.cm && (t4.cm.display.shift || t4.extend)), Ui(t4, new si([Ii(t4.sel.primary(), e3, n3, r2)], 0), o3); } function Vi(t4, e3, n3) { for (var o3 = [], r2 = t4.cm && (t4.cm.display.shift || t4.extend), i2 = 0; i2 < t4.sel.ranges.length; i2++) o3[i2] = Ii(t4.sel.ranges[i2], e3[i2], null, r2); Ui(t4, li(t4.cm, o3, t4.sel.primIndex), n3); } function Ri(t4, e3, n3, o3) { var r2 = t4.sel.ranges.slice(0); r2[e3] = n3, Ui(t4, li(t4.cm, r2, t4.sel.primIndex), o3); } function Hi(t4, e3, n3, o3) { Ui(t4, ci(e3, n3), o3); } function zi(t4, e3, n3) { var o3 = { ranges: e3.ranges, update: function(e4) { this.ranges = []; for (var n4 = 0; n4 < e4.length; n4++) this.ranges[n4] = new ai(fe(t4, e4[n4].anchor), fe(t4, e4[n4].head)); }, origin: n3 && n3.origin }; return mt(t4, "beforeSelectionChange", t4, o3), t4.cm && mt(t4.cm, "beforeSelectionChange", t4.cm, o3), o3.ranges != e3.ranges ? li(t4.cm, o3.ranges, o3.ranges.length - 1) : e3; } function Bi(t4, e3, n3) { var o3 = t4.history.done, r2 = X(o3); r2 && r2.ranges ? (o3[o3.length - 1] = e3, Wi(t4, e3, n3)) : Ui(t4, e3, n3); } function Ui(t4, e3, n3) { Wi(t4, e3, n3), Ei(t4, t4.sel, t4.cm ? t4.cm.curOp.id : NaN, n3); } function Wi(t4, e3, n3) { (wt(t4, "beforeSelectionChange") || t4.cm && wt(t4.cm, "beforeSelectionChange")) && (e3 = zi(t4, e3, n3)); var o3 = n3 && n3.bias || (ae(e3.primary().head, t4.sel.primary().head) < 0 ? -1 : 1); $i(t4, Gi(t4, e3, o3, true)), n3 && false === n3.scroll || !t4.cm || "nocursor" == t4.cm.getOption("readOnly") || cr(t4.cm); } function $i(t4, e3) { e3.equals(t4.sel) || (t4.sel = e3, t4.cm && (t4.cm.curOp.updateInput = 1, t4.cm.curOp.selectionChanged = true, _t(t4.cm)), An(t4, "cursorActivity", t4)); } function qi(t4) { $i(t4, Gi(t4, t4.sel, null, false)); } function Gi(t4, e3, n3, o3) { for (var r2, i2 = 0; i2 < e3.ranges.length; i2++) { var s2 = e3.ranges[i2], a2 = e3.ranges.length == t4.sel.ranges.length && t4.sel.ranges[i2], l2 = Yi(t4, s2.anchor, a2 && a2.anchor, n3, o3), c2 = s2.head == s2.anchor ? l2 : Yi(t4, s2.head, a2 && a2.head, n3, o3); (r2 || l2 != s2.anchor || c2 != s2.head) && (r2 || (r2 = e3.ranges.slice(0, i2)), r2[i2] = new ai(l2, c2)); } return r2 ? li(t4.cm, r2, e3.primIndex) : e3; } function Ki(t4, e3, n3, o3, r2) { var i2 = Zt(t4, e3.line); if (i2.markedSpans) for (var s2 = 0; s2 < i2.markedSpans.length; ++s2) { var a2 = i2.markedSpans[s2], l2 = a2.marker, c2 = "selectLeft" in l2 ? !l2.selectLeft : l2.inclusiveLeft, u2 = "selectRight" in l2 ? !l2.selectRight : l2.inclusiveRight; if ((null == a2.from || (c2 ? a2.from <= e3.ch : a2.from < e3.ch)) && (null == a2.to || (u2 ? a2.to >= e3.ch : a2.to > e3.ch))) { if (r2 && (mt(l2, "beforeCursorEnter"), l2.explicitlyCleared)) { if (i2.markedSpans) { --s2; continue; } break; } if (!l2.atomic) continue; if (n3) { var p2 = l2.find(o3 < 0 ? 1 : -1), d2 = void 0; if ((o3 < 0 ? u2 : c2) && (p2 = Xi(t4, p2, -o3, p2 && p2.line == e3.line ? i2 : null)), p2 && p2.line == e3.line && (d2 = ae(p2, n3)) && (o3 < 0 ? d2 < 0 : d2 > 0)) return Ki(t4, p2, e3, o3, r2); } var f2 = l2.find(o3 < 0 ? -1 : 1); return (o3 < 0 ? c2 : u2) && (f2 = Xi(t4, f2, o3, f2.line == e3.line ? i2 : null)), f2 ? Ki(t4, f2, e3, o3, r2) : null; } } return e3; } function Yi(t4, e3, n3, o3, r2) { var i2 = o3 || 1, s2 = Ki(t4, e3, n3, i2, r2) || !r2 && Ki(t4, e3, n3, i2, true) || Ki(t4, e3, n3, -i2, r2) || !r2 && Ki(t4, e3, n3, -i2, true); return s2 || (t4.cantEdit = true, se(t4.first, 0)); } function Xi(t4, e3, n3, o3) { return n3 < 0 && 0 == e3.ch ? e3.line > t4.first ? fe(t4, se(e3.line - 1)) : null : n3 > 0 && e3.ch == (o3 || Zt(t4, e3.line)).text.length ? e3.line < t4.first + t4.size - 1 ? se(e3.line + 1, 0) : null : new se(e3.line, e3.ch + n3); } function Ji(t4) { t4.setSelection(se(t4.firstLine(), 0), se(t4.lastLine()), W); } function Zi(t4, e3, n3) { var o3 = { canceled: false, from: e3.from, to: e3.to, text: e3.text, origin: e3.origin, cancel: function() { return o3.canceled = true; } }; return n3 && (o3.update = function(e4, n4, r2, i2) { e4 && (o3.from = fe(t4, e4)), n4 && (o3.to = fe(t4, n4)), r2 && (o3.text = r2), void 0 !== i2 && (o3.origin = i2); }), mt(t4, "beforeChange", t4, o3), t4.cm && mt(t4.cm, "beforeChange", t4.cm, o3), o3.canceled ? (t4.cm && (t4.cm.curOp.updateInput = 2), null) : { from: o3.from, to: o3.to, text: o3.text, origin: o3.origin }; } function Qi(t4, e3, n3) { if (t4.cm) { if (!t4.cm.curOp) return Dr(t4.cm, Qi)(t4, e3, n3); if (t4.cm.state.suppressEdits) return; } if (!(wt(t4, "beforeChange") || t4.cm && wt(t4.cm, "beforeChange")) || (e3 = Zi(t4, e3, true))) { var o3 = Ae && !n3 && Be(t4, e3.from, e3.to); if (o3) for (var r2 = o3.length - 1; r2 >= 0; --r2) ts(t4, { from: o3[r2].from, to: o3[r2].to, text: r2 ? [""] : e3.text, origin: e3.origin }); else ts(t4, e3); } } function ts(t4, e3) { if (1 != e3.text.length || "" != e3.text[0] || 0 != ae(e3.from, e3.to)) { var n3 = di(t4, e3); ki(t4, e3, n3, t4.cm ? t4.cm.curOp.id : NaN), os(t4, e3, n3, He(t4, e3)); var o3 = []; bi(t4, function(t5, n4) { n4 || -1 != z(o3, t5.history) || (ls(t5.history, e3), o3.push(t5.history)), os(t5, e3, null, He(t5, e3)); }); } } function es(t4, e3, n3) { var o3 = t4.cm && t4.cm.state.suppressEdits; if (!o3 || n3) { for (var r2, i2 = t4.history, s2 = t4.sel, a2 = "undo" == e3 ? i2.done : i2.undone, l2 = "undo" == e3 ? i2.undone : i2.done, c2 = 0; c2 < a2.length && (r2 = a2[c2], n3 ? !r2.ranges || r2.equals(t4.sel) : r2.ranges); c2++) ; if (c2 != a2.length) { for (i2.lastOrigin = i2.lastSelOrigin = null; ; ) { if (!(r2 = a2.pop()).ranges) { if (o3) return void a2.push(r2); break; } if (Ai(r2, l2), n3 && !r2.equals(t4.sel)) return void Ui(t4, r2, { clearRedo: false }); s2 = r2; } var u2 = []; Ai(s2, l2), l2.push({ changes: u2, generation: i2.generation }), i2.generation = r2.generation || ++i2.maxGeneration; for (var p2 = wt(t4, "beforeChange") || t4.cm && wt(t4.cm, "beforeChange"), d2 = function(n4) { var o4 = r2.changes[n4]; if (o4.origin = e3, p2 && !Zi(t4, o4, false)) return a2.length = 0, {}; u2.push(Si(t4, o4)); var i3 = n4 ? di(t4, o4) : X(a2); os(t4, o4, i3, Di(t4, o4)), !n4 && t4.cm && t4.cm.scrollIntoView({ from: o4.from, to: ui(o4) }); var s3 = []; bi(t4, function(t5, e4) { e4 || -1 != z(s3, t5.history) || (ls(t5.history, o4), s3.push(t5.history)), os(t5, o4, null, Di(t5, o4)); }); }, f2 = r2.changes.length - 1; f2 >= 0; --f2) { var h2 = d2(f2); if (h2) return h2.v; } } } } function ns(t4, e3) { if (0 != e3 && (t4.first += e3, t4.sel = new si(J(t4.sel.ranges, function(t5) { return new ai(se(t5.anchor.line + e3, t5.anchor.ch), se(t5.head.line + e3, t5.head.ch)); }), t4.sel.primIndex), t4.cm)) { Ro(t4.cm, t4.first, t4.first - e3, e3); for (var n3 = t4.cm.display, o3 = n3.viewFrom; o3 < n3.viewTo; o3++) Ho(t4.cm, o3, "gutter"); } } function os(t4, e3, n3, o3) { if (t4.cm && !t4.cm.curOp) return Dr(t4.cm, os)(t4, e3, n3, o3); if (e3.to.line < t4.first) ns(t4, e3.text.length - 1 - (e3.to.line - e3.from.line)); else if (!(e3.from.line > t4.lastLine())) { if (e3.from.line < t4.first) { var r2 = e3.text.length - 1 - (t4.first - e3.from.line); ns(t4, r2), e3 = { from: se(t4.first, 0), to: se(e3.to.line + r2, e3.to.ch), text: [X(e3.text)], origin: e3.origin }; } var i2 = t4.lastLine(); e3.to.line > i2 && (e3 = { from: e3.from, to: se(i2, Zt(t4, i2).text.length), text: [e3.text[0]], origin: e3.origin }), e3.removed = Qt(t4, e3.from, e3.to), n3 || (n3 = di(t4, e3)), t4.cm ? rs(t4.cm, e3, o3) : mi(t4, e3, o3), Wi(t4, n3, W), t4.cantEdit && Yi(t4, se(t4.firstLine(), 0)) && (t4.cantEdit = false); } } function rs(t4, e3, n3) { var o3 = t4.doc, r2 = t4.display, i2 = e3.from, s2 = e3.to, a2 = false, l2 = i2.line; t4.options.lineWrapping || (l2 = ne(Qe(Zt(o3, i2.line))), o3.iter(l2, s2.line + 1, function(t5) { if (t5 == r2.maxLine) return a2 = true, true; })), o3.sel.contains(e3.from, e3.to) > -1 && _t(t4), mi(o3, e3, n3, No(t4)), t4.options.lineWrapping || (o3.iter(l2, i2.line + e3.text.length, function(t5) { var e4 = ln(t5); e4 > r2.maxLineLength && (r2.maxLine = t5, r2.maxLineLength = e4, r2.maxLineChanged = true, a2 = false); }), a2 && (t4.curOp.updateMaxLine = true)), Ee(o3, i2.line), Fr(t4, 400); var c2 = e3.text.length - (s2.line - i2.line) - 1; e3.full ? Ro(t4) : i2.line != s2.line || 1 != e3.text.length || yi(t4.doc, e3) ? Ro(t4, i2.line, s2.line + 1, c2) : Ho(t4, i2.line, "text"); var u2 = wt(t4, "changes"), p2 = wt(t4, "change"); if (p2 || u2) { var d2 = { from: i2, to: s2, text: e3.text, removed: e3.removed, origin: e3.origin }; p2 && An(t4, "change", t4, d2), u2 && (t4.curOp.changeObjs || (t4.curOp.changeObjs = [])).push(d2); } t4.display.selForContextMenu = null; } function is(t4, e3, n3, o3, r2) { var i2; o3 || (o3 = n3), ae(o3, n3) < 0 && (n3 = (i2 = [o3, n3])[0], o3 = i2[1]), "string" == typeof e3 && (e3 = t4.splitLines(e3)), Qi(t4, { from: n3, to: o3, text: e3, origin: r2 }); } function ss(t4, e3, n3, o3) { n3 < t4.line ? t4.line += o3 : e3 < t4.line && (t4.line = e3, t4.ch = 0); } function as(t4, e3, n3, o3) { for (var r2 = 0; r2 < t4.length; ++r2) { var i2 = t4[r2], s2 = true; if (i2.ranges) { i2.copied || ((i2 = t4[r2] = i2.deepCopy()).copied = true); for (var a2 = 0; a2 < i2.ranges.length; a2++) ss(i2.ranges[a2].anchor, e3, n3, o3), ss(i2.ranges[a2].head, e3, n3, o3); } else { for (var l2 = 0; l2 < i2.changes.length; ++l2) { var c2 = i2.changes[l2]; if (n3 < c2.from.line) c2.from = se(c2.from.line + o3, c2.from.ch), c2.to = se(c2.to.line + o3, c2.to.ch); else if (e3 <= c2.to.line) { s2 = false; break; } } s2 || (t4.splice(0, r2 + 1), r2 = 0); } } } function ls(t4, e3) { var n3 = e3.from.line, o3 = e3.to.line, r2 = e3.text.length - (o3 - n3) - 1; as(t4.done, n3, o3, r2), as(t4.undone, n3, o3, r2); } function cs(t4, e3, n3, o3) { var r2 = e3, i2 = e3; return "number" == typeof e3 ? i2 = Zt(t4, de(t4, e3)) : r2 = ne(e3), null == r2 ? null : (o3(i2, r2) && t4.cm && Ho(t4.cm, r2, n3), i2); } function us(t4) { this.lines = t4, this.parent = null; for (var e3 = 0, n3 = 0; n3 < t4.length; ++n3) t4[n3].parent = this, e3 += t4[n3].height; this.height = e3; } function ps(t4) { this.children = t4; for (var e3 = 0, n3 = 0, o3 = 0; o3 < t4.length; ++o3) { var r2 = t4[o3]; e3 += r2.chunkSize(), n3 += r2.height, r2.parent = this; } this.size = e3, this.height = n3, this.parent = null; } ai.prototype.from = function() { return pe(this.anchor, this.head); }, ai.prototype.to = function() { return ue(this.anchor, this.head); }, ai.prototype.empty = function() { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; }, us.prototype = { chunkSize: function() { return this.lines.length; }, removeInner: function(t4, e3) { for (var n3 = t4, o3 = t4 + e3; n3 < o3; ++n3) { var r2 = this.lines[n3]; this.height -= r2.height, dn(r2), An(r2, "delete"); } this.lines.splice(t4, e3); }, collapse: function(t4) { t4.push.apply(t4, this.lines); }, insertInner: function(t4, e3, n3) { this.height += n3, this.lines = this.lines.slice(0, t4).concat(e3).concat(this.lines.slice(t4)); for (var o3 = 0; o3 < e3.length; ++o3) e3[o3].parent = this; }, iterN: function(t4, e3, n3) { for (var o3 = t4 + e3; t4 < o3; ++t4) if (n3(this.lines[t4])) return true; } }, ps.prototype = { chunkSize: function() { return this.size; }, removeInner: function(t4, e3) { this.size -= e3; for (var n3 = 0; n3 < this.children.length; ++n3) { var o3 = this.children[n3], r2 = o3.chunkSize(); if (t4 < r2) { var i2 = Math.min(e3, r2 - t4), s2 = o3.height; if (o3.removeInner(t4, i2), this.height -= s2 - o3.height, r2 == i2 && (this.children.splice(n3--, 1), o3.parent = null), 0 == (e3 -= i2)) break; t4 = 0; } else t4 -= r2; } if (this.size - e3 < 25 && (this.children.length > 1 || !(this.children[0] instanceof us))) { var a2 = []; this.collapse(a2), this.children = [new us(a2)], this.children[0].parent = this; } }, collapse: function(t4) { for (var e3 = 0; e3 < this.children.length; ++e3) this.children[e3].collapse(t4); }, insertInner: function(t4, e3, n3) { this.size += e3.length, this.height += n3; for (var o3 = 0; o3 < this.children.length; ++o3) { var r2 = this.children[o3], i2 = r2.chunkSize(); if (t4 <= i2) { if (r2.insertInner(t4, e3, n3), r2.lines && r2.lines.length > 50) { for (var s2 = r2.lines.length % 25 + 25, a2 = s2; a2 < r2.lines.length; ) { var l2 = new us(r2.lines.slice(a2, a2 += 25)); r2.height -= l2.height, this.children.splice(++o3, 0, l2), l2.parent = this; } r2.lines = r2.lines.slice(0, s2), this.maybeSpill(); } break; } t4 -= i2; } }, maybeSpill: function() { if (!(this.children.length <= 10)) { var t4 = this; do { var e3 = new ps(t4.children.splice(t4.children.length - 5, 5)); if (t4.parent) { t4.size -= e3.size, t4.height -= e3.height; var n3 = z(t4.parent.children, t4); t4.parent.children.splice(n3 + 1, 0, e3); } else { var o3 = new ps(t4.children); o3.parent = t4, t4.children = [o3, e3], t4 = o3; } e3.parent = t4.parent; } while (t4.children.length > 10); t4.parent.maybeSpill(); } }, iterN: function(t4, e3, n3) { for (var o3 = 0; o3 < this.children.length; ++o3) { var r2 = this.children[o3], i2 = r2.chunkSize(); if (t4 < i2) { var s2 = Math.min(e3, i2 - t4); if (r2.iterN(t4, s2, n3)) return true; if (0 == (e3 -= s2)) break; t4 = 0; } else t4 -= i2; } } }; var ds = function(t4, e3, n3) { if (n3) for (var o3 in n3) n3.hasOwnProperty(o3) && (this[o3] = n3[o3]); this.doc = t4, this.node = e3; }; function fs(t4, e3, n3) { an(e3) < (t4.curOp && t4.curOp.scrollTop || t4.doc.scrollTop) && lr(t4, n3); } function hs(t4, e3, n3, o3) { var r2 = new ds(t4, n3, o3), i2 = t4.cm; return i2 && r2.noHScroll && (i2.display.alignWidgets = true), cs(t4, e3, "widget", function(e4) { var n4 = e4.widgets || (e4.widgets = []); if (null == r2.insertAt ? n4.push(r2) : n4.splice(Math.min(n4.length, Math.max(0, r2.insertAt)), 0, r2), r2.line = e4, i2 && !rn(t4, e4)) { var o4 = an(e4) < t4.scrollTop; ee(e4, e4.height + Wn(r2)), o4 && lr(i2, r2.height), i2.curOp.forceUpdate = true; } return true; }), i2 && An(i2, "lineWidgetAdded", i2, r2, "number" == typeof e3 ? e3 : ne(e3)), r2; } ds.prototype.clear = function() { var t4 = this.doc.cm, e3 = this.line.widgets, n3 = this.line, o3 = ne(n3); if (null != o3 && e3) { for (var r2 = 0; r2 < e3.length; ++r2) e3[r2] == this && e3.splice(r2--, 1); e3.length || (n3.widgets = null); var i2 = Wn(this); ee(n3, Math.max(0, n3.height - i2)), t4 && (Lr(t4, function() { fs(t4, n3, -i2), Ho(t4, o3, "widget"); }), An(t4, "lineWidgetCleared", t4, this, o3)); } }, ds.prototype.changed = function() { var t4 = this, e3 = this.height, n3 = this.doc.cm, o3 = this.line; this.height = null; var r2 = Wn(this) - e3; r2 && (rn(this.doc, o3) || ee(o3, o3.height + r2), n3 && Lr(n3, function() { n3.curOp.forceUpdate = true, fs(n3, o3, r2), An(n3, "lineWidgetChanged", n3, t4, ne(o3)); })); }, xt(ds); var gs = 0, vs = function(t4, e3) { this.lines = [], this.type = e3, this.doc = t4, this.id = ++gs; }; function ys(t4, e3, n3, o3, r2) { if (o3 && o3.shared) return bs(t4, e3, n3, o3, r2); if (t4.cm && !t4.cm.curOp) return Dr(t4.cm, ys)(t4, e3, n3, o3, r2); var i2 = new vs(t4, r2), s2 = ae(e3, n3); if (o3 && V(o3, i2, false), s2 > 0 || 0 == s2 && false !== i2.clearWhenEmpty) return i2; if (i2.replacedWith && (i2.collapsed = true, i2.widgetNode = j("span", [i2.replacedWith], "CodeMirror-widget"), o3.handleMouseEvents || i2.widgetNode.setAttribute("cm-ignore-events", "true"), o3.insertLeft && (i2.widgetNode.insertLeft = true)), i2.collapsed) { if (Ze(t4, e3.line, e3, n3, i2) || e3.line != n3.line && Ze(t4, n3.line, e3, n3, i2)) throw new Error("Inserting collapsed marker partially overlapping an existing one"); Le(); } i2.addToHistory && ki(t4, { from: e3, to: n3, origin: "markText" }, t4.sel, NaN); var a2, l2 = e3.line, c2 = t4.cm; if (t4.iter(l2, n3.line + 1, function(o4) { c2 && i2.collapsed && !c2.options.lineWrapping && Qe(o4) == c2.display.maxLine && (a2 = true), i2.collapsed && l2 != e3.line && ee(o4, 0), Fe(o4, new De(i2, l2 == e3.line ? e3.ch : null, l2 == n3.line ? n3.ch : null), t4.cm && t4.cm.curOp), ++l2; }), i2.collapsed && t4.iter(e3.line, n3.line + 1, function(e4) { rn(t4, e4) && ee(e4, 0); }), i2.clearOnEnter && gt(i2, "beforeCursorEnter", function() { return i2.clear(); }), i2.readOnly && (Me(), (t4.history.done.length || t4.history.undone.length) && t4.clearHistory()), i2.collapsed && (i2.id = ++gs, i2.atomic = true), c2) { if (a2 && (c2.curOp.updateMaxLine = true), i2.collapsed) Ro(c2, e3.line, n3.line + 1); else if (i2.className || i2.startStyle || i2.endStyle || i2.css || i2.attributes || i2.title) for (var u2 = e3.line; u2 <= n3.line; u2++) Ho(c2, u2, "text"); i2.atomic && qi(c2.doc), An(c2, "markerAdded", c2, i2); } return i2; } vs.prototype.clear = function() { if (!this.explicitlyCleared) { var t4 = this.doc.cm, e3 = t4 && !t4.curOp; if (e3 && Or(t4), wt(this, "clear")) { var n3 = this.find(); n3 && An(this, "clear", n3.from, n3.to); } for (var o3 = null, r2 = null, i2 = 0; i2 < this.lines.length; ++i2) { var s2 = this.lines[i2], a2 = Ne(s2.markedSpans, this); t4 && !this.collapsed ? Ho(t4, ne(s2), "text") : t4 && (null != a2.to && (r2 = ne(s2)), null != a2.from && (o3 = ne(s2))), s2.markedSpans = Ie(s2.markedSpans, a2), null == a2.from && this.collapsed && !rn(this.doc, s2) && t4 && ee(s2, jo(t4.display)); } if (t4 && this.collapsed && !t4.options.lineWrapping) for (var l2 = 0; l2 < this.lines.length; ++l2) { var c2 = Qe(this.lines[l2]), u2 = ln(c2); u2 > t4.display.maxLineLength && (t4.display.maxLine = c2, t4.display.maxLineLength = u2, t4.display.maxLineChanged = true); } null != o3 && t4 && this.collapsed && Ro(t4, o3, r2 + 1), this.lines.length = 0, this.explicitlyCleared = true, this.atomic && this.doc.cantEdit && (this.doc.cantEdit = false, t4 && qi(t4.doc)), t4 && An(t4, "markerCleared", t4, this, o3, r2), e3 && Tr(t4), this.parent && this.parent.clear(); } }, vs.prototype.find = function(t4, e3) { var n3, o3; null == t4 && "bookmark" == this.type && (t4 = 1); for (var r2 = 0; r2 < this.lines.length; ++r2) { var i2 = this.lines[r2], s2 = Ne(i2.markedSpans, this); if (null != s2.from && (n3 = se(e3 ? i2 : ne(i2), s2.from), -1 == t4)) return n3; if (null != s2.to && (o3 = se(e3 ? i2 : ne(i2), s2.to), 1 == t4)) return o3; } return n3 && { from: n3, to: o3 }; }, vs.prototype.changed = function() { var t4 = this, e3 = this.find(-1, true), n3 = this, o3 = this.doc.cm; e3 && o3 && Lr(o3, function() { var r2 = e3.line, i2 = ne(e3.line), s2 = no(o3, i2); if (s2 && (po(s2), o3.curOp.selectionChanged = o3.curOp.forceUpdate = true), o3.curOp.updateMaxLine = true, !rn(n3.doc, r2) && null != n3.height) { var a2 = n3.height; n3.height = null; var l2 = Wn(n3) - a2; l2 && ee(r2, r2.height + l2); } An(o3, "markerChanged", o3, t4); }); }, vs.prototype.attachLine = function(t4) { if (!this.lines.length && this.doc.cm) { var e3 = this.doc.cm.curOp; e3.maybeHiddenMarkers && -1 != z(e3.maybeHiddenMarkers, this) || (e3.maybeUnhiddenMarkers || (e3.maybeUnhiddenMarkers = [])).push(this); } this.lines.push(t4); }, vs.prototype.detachLine = function(t4) { if (this.lines.splice(z(this.lines, t4), 1), !this.lines.length && this.doc.cm) { var e3 = this.doc.cm.curOp; (e3.maybeHiddenMarkers || (e3.maybeHiddenMarkers = [])).push(this); } }, xt(vs); var ms = function(t4, e3) { this.markers = t4, this.primary = e3; for (var n3 = 0; n3 < t4.length; ++n3) t4[n3].parent = this; }; function bs(t4, e3, n3, o3, r2) { (o3 = V(o3)).shared = false; var i2 = [ys(t4, e3, n3, o3, r2)], s2 = i2[0], a2 = o3.widgetNode; return bi(t4, function(t5) { a2 && (o3.widgetNode = a2.cloneNode(true)), i2.push(ys(t5, fe(t5, e3), fe(t5, n3), o3, r2)); for (var l2 = 0; l2 < t5.linked.length; ++l2) if (t5.linked[l2].isParent) return; s2 = X(i2); }), new ms(i2, s2); } function _s(t4) { return t4.findMarks(se(t4.first, 0), t4.clipPos(se(t4.lastLine())), function(t5) { return t5.parent; }); } function ws(t4, e3) { for (var n3 = 0; n3 < e3.length; n3++) { var o3 = e3[n3], r2 = o3.find(), i2 = t4.clipPos(r2.from), s2 = t4.clipPos(r2.to); if (ae(i2, s2)) { var a2 = ys(t4, i2, s2, o3.primary, o3.primary.type); o3.markers.push(a2), a2.parent = o3; } } } function xs(t4) { for (var e3 = function(e4) { var n4 = t4[e4], o3 = [n4.primary.doc]; bi(n4.primary.doc, function(t5) { return o3.push(t5); }); for (var r2 = 0; r2 < n4.markers.length; r2++) { var i2 = n4.markers[r2]; -1 == z(o3, i2.doc) && (i2.parent = null, n4.markers.splice(r2--, 1)); } }, n3 = 0; n3 < t4.length; n3++) e3(n3); } ms.prototype.clear = function() { if (!this.explicitlyCleared) { this.explicitlyCleared = true; for (var t4 = 0; t4 < this.markers.length; ++t4) this.markers[t4].clear(); An(this, "clear"); } }, ms.prototype.find = function(t4, e3) { return this.primary.find(t4, e3); }, xt(ms); var Cs = 0, Ss = function(t4, e3, n3, o3, r2) { if (!(this instanceof Ss)) return new Ss(t4, e3, n3, o3, r2); null == n3 && (n3 = 0), ps.call(this, [new us([new un("", null)])]), this.first = n3, this.scrollTop = this.scrollLeft = 0, this.cantEdit = false, this.cleanGeneration = 1, this.modeFrontier = this.highlightFrontier = n3; var i2 = se(n3, 0); this.sel = ci(i2), this.history = new Ci(null), this.id = ++Cs, this.modeOption = e3, this.lineSep = o3, this.direction = "rtl" == r2 ? "rtl" : "ltr", this.extend = false, "string" == typeof t4 && (t4 = this.splitLines(t4)), mi(this, { from: i2, to: i2, text: t4 }), Ui(this, ci(i2), W); }; Ss.prototype = tt(ps.prototype, { constructor: Ss, iter: function(t4, e3, n3) { n3 ? this.iterN(t4 - this.first, e3 - t4, n3) : this.iterN(this.first, this.first + this.size, t4); }, insert: function(t4, e3) { for (var n3 = 0, o3 = 0; o3 < e3.length; ++o3) n3 += e3[o3].height; this.insertInner(t4 - this.first, e3, n3); }, remove: function(t4, e3) { this.removeInner(t4 - this.first, e3); }, getValue: function(t4) { var e3 = te(this, this.first, this.first + this.size); return false === t4 ? e3 : e3.join(t4 || this.lineSeparator()); }, setValue: Ir(function(t4) { var e3 = se(this.first, 0), n3 = this.first + this.size - 1; Qi(this, { from: e3, to: se(n3, Zt(this, n3).text.length), text: this.splitLines(t4), origin: "setValue", full: true }, true), this.cm && ur(this.cm, 0, 0), Ui(this, ci(e3), W); }), replaceRange: function(t4, e3, n3, o3) { is(this, t4, e3 = fe(this, e3), n3 = n3 ? fe(this, n3) : e3, o3); }, getRange: function(t4, e3, n3) { var o3 = Qt(this, fe(this, t4), fe(this, e3)); return false === n3 ? o3 : "" === n3 ? o3.join("") : o3.join(n3 || this.lineSeparator()); }, getLine: function(t4) { var e3 = this.getLineHandle(t4); return e3 && e3.text; }, getLineHandle: function(t4) { if (re(this, t4)) return Zt(this, t4); }, getLineNumber: function(t4) { return ne(t4); }, getLineHandleVisualStart: function(t4) { return "number" == typeof t4 && (t4 = Zt(this, t4)), Qe(t4); }, lineCount: function() { return this.size; }, firstLine: function() { return this.first; }, lastLine: function() { return this.first + this.size - 1; }, clipPos: function(t4) { return fe(this, t4); }, getCursor: function(t4) { var e3 = this.sel.primary(); return null == t4 || "head" == t4 ? e3.head : "anchor" == t4 ? e3.anchor : "end" == t4 || "to" == t4 || false === t4 ? e3.to() : e3.from(); }, listSelections: function() { return this.sel.ranges; }, somethingSelected: function() { return this.sel.somethingSelected(); }, setCursor: Ir(function(t4, e3, n3) { Hi(this, fe(this, "number" == typeof t4 ? se(t4, e3 || 0) : t4), null, n3); }), setSelection: Ir(function(t4, e3, n3) { Hi(this, fe(this, t4), fe(this, e3 || t4), n3); }), extendSelection: Ir(function(t4, e3, n3) { Fi(this, fe(this, t4), e3 && fe(this, e3), n3); }), extendSelections: Ir(function(t4, e3) { Vi(this, ge(this, t4), e3); }), extendSelectionsBy: Ir(function(t4, e3) { Vi(this, ge(this, J(this.sel.ranges, t4)), e3); }), setSelections: Ir(function(t4, e3, n3) { if (t4.length) { for (var o3 = [], r2 = 0; r2 < t4.length; r2++) o3[r2] = new ai(fe(this, t4[r2].anchor), fe(this, t4[r2].head || t4[r2].anchor)); null == e3 && (e3 = Math.min(t4.length - 1, this.sel.primIndex)), Ui(this, li(this.cm, o3, e3), n3); } }), addSelection: Ir(function(t4, e3, n3) { var o3 = this.sel.ranges.slice(0); o3.push(new ai(fe(this, t4), fe(this, e3 || t4))), Ui(this, li(this.cm, o3, o3.length - 1), n3); }), getSelection: function(t4) { for (var e3, n3 = this.sel.ranges, o3 = 0; o3 < n3.length; o3++) { var r2 = Qt(this, n3[o3].from(), n3[o3].to()); e3 = e3 ? e3.concat(r2) : r2; } return false === t4 ? e3 : e3.join(t4 || this.lineSeparator()); }, getSelections: function(t4) { for (var e3 = [], n3 = this.sel.ranges, o3 = 0; o3 < n3.length; o3++) { var r2 = Qt(this, n3[o3].from(), n3[o3].to()); false !== t4 && (r2 = r2.join(t4 || this.lineSeparator())), e3[o3] = r2; } return e3; }, replaceSelection: function(t4, e3, n3) { for (var o3 = [], r2 = 0; r2 < this.sel.ranges.length; r2++) o3[r2] = t4; this.replaceSelections(o3, e3, n3 || "+input"); }, replaceSelections: Ir(function(t4, e3, n3) { for (var o3 = [], r2 = this.sel, i2 = 0; i2 < r2.ranges.length; i2++) { var s2 = r2.ranges[i2]; o3[i2] = { from: s2.from(), to: s2.to(), text: this.splitLines(t4[i2]), origin: n3 }; } for (var a2 = e3 && "end" != e3 && hi(this, o3, e3), l2 = o3.length - 1; l2 >= 0; l2--) Qi(this, o3[l2]); a2 ? Bi(this, a2) : this.cm && cr(this.cm); }), undo: Ir(function() { es(this, "undo"); }), redo: Ir(function() { es(this, "redo"); }), undoSelection: Ir(function() { es(this, "undo", true); }), redoSelection: Ir(function() { es(this, "redo", true); }), setExtending: function(t4) { this.extend = t4; }, getExtending: function() { return this.extend; }, historySize: function() { for (var t4 = this.history, e3 = 0, n3 = 0, o3 = 0; o3 < t4.done.length; o3++) t4.done[o3].ranges || ++e3; for (var r2 = 0; r2 < t4.undone.length; r2++) t4.undone[r2].ranges || ++n3; return { undo: e3, redo: n3 }; }, clearHistory: function() { var t4 = this; this.history = new Ci(this.history), bi(this, function(e3) { return e3.history = t4.history; }, true); }, markClean: function() { this.cleanGeneration = this.changeGeneration(true); }, changeGeneration: function(t4) { return t4 && (this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null), this.history.generation; }, isClean: function(t4) { return this.history.generation == (t4 || this.cleanGeneration); }, getHistory: function() { return { done: Ni(this.history.done), undone: Ni(this.history.undone) }; }, setHistory: function(t4) { var e3 = this.history = new Ci(this.history); e3.done = Ni(t4.done.slice(0), null, true), e3.undone = Ni(t4.undone.slice(0), null, true); }, setGutterMarker: Ir(function(t4, e3, n3) { return cs(this, t4, "gutter", function(t5) { var o3 = t5.gutterMarkers || (t5.gutterMarkers = {}); return o3[e3] = n3, !n3 && rt(o3) && (t5.gutterMarkers = null), true; }); }), clearGutter: Ir(function(t4) { var e3 = this; this.iter(function(n3) { n3.gutterMarkers && n3.gutterMarkers[t4] && cs(e3, n3, "gutter", function() { return n3.gutterMarkers[t4] = null, rt(n3.gutterMarkers) && (n3.gutterMarkers = null), true; }); }); }), lineInfo: function(t4) { var e3; if ("number" == typeof t4) { if (!re(this, t4)) return null; if (e3 = t4, !(t4 = Zt(this, t4))) return null; } else if (null == (e3 = ne(t4))) return null; return { line: e3, handle: t4, text: t4.text, gutterMarkers: t4.gutterMarkers, textClass: t4.textClass, bgClass: t4.bgClass, wrapClass: t4.wrapClass, widgets: t4.widgets }; }, addLineClass: Ir(function(t4, e3, n3) { return cs(this, t4, "gutter" == e3 ? "gutter" : "class", function(t5) { var o3 = "text" == e3 ? "textClass" : "background" == e3 ? "bgClass" : "gutter" == e3 ? "gutterClass" : "wrapClass"; if (t5[o3]) { if (O(n3).test(t5[o3])) return false; t5[o3] += " " + n3; } else t5[o3] = n3; return true; }); }), removeLineClass: Ir(function(t4, e3, n3) { return cs(this, t4, "gutter" == e3 ? "gutter" : "class", function(t5) { var o3 = "text" == e3 ? "textClass" : "background" == e3 ? "bgClass" : "gutter" == e3 ? "gutterClass" : "wrapClass", r2 = t5[o3]; if (!r2) return false; if (null == n3) t5[o3] = null; else { var i2 = r2.match(O(n3)); if (!i2) return false; var s2 = i2.index + i2[0].length; t5[o3] = r2.slice(0, i2.index) + (i2.index && s2 != r2.length ? " " : "") + r2.slice(s2) || null; } return true; }); }), addLineWidget: Ir(function(t4, e3, n3) { return hs(this, t4, e3, n3); }), removeLineWidget: function(t4) { t4.clear(); }, markText: function(t4, e3, n3) { return ys(this, fe(this, t4), fe(this, e3), n3, n3 && n3.type || "range"); }, setBookmark: function(t4, e3) { var n3 = { replacedWith: e3 && (null == e3.nodeType ? e3.widget : e3), insertLeft: e3 && e3.insertLeft, clearWhenEmpty: false, shared: e3 && e3.shared, handleMouseEvents: e3 && e3.handleMouseEvents }; return ys(this, t4 = fe(this, t4), t4, n3, "bookmark"); }, findMarksAt: function(t4) { var e3 = [], n3 = Zt(this, (t4 = fe(this, t4)).line).markedSpans; if (n3) for (var o3 = 0; o3 < n3.length; ++o3) { var r2 = n3[o3]; (null == r2.from || r2.from <= t4.ch) && (null == r2.to || r2.to >= t4.ch) && e3.push(r2.marker.parent || r2.marker); } return e3; }, findMarks: function(t4, e3, n3) { t4 = fe(this, t4), e3 = fe(this, e3); var o3 = [], r2 = t4.line; return this.iter(t4.line, e3.line + 1, function(i2) { var s2 = i2.markedSpans; if (s2) for (var a2 = 0; a2 < s2.length; a2++) { var l2 = s2[a2]; null != l2.to && r2 == t4.line && t4.ch >= l2.to || null == l2.from && r2 != t4.line || null != l2.from && r2 == e3.line && l2.from >= e3.ch || n3 && !n3(l2.marker) || o3.push(l2.marker.parent || l2.marker); } ++r2; }), o3; }, getAllMarks: function() { var t4 = []; return this.iter(function(e3) { var n3 = e3.markedSpans; if (n3) for (var o3 = 0; o3 < n3.length; ++o3) null != n3[o3].from && t4.push(n3[o3].marker); }), t4; }, posFromIndex: function(t4) { var e3, n3 = this.first, o3 = this.lineSeparator().length; return this.iter(function(r2) { var i2 = r2.text.length + o3; if (i2 > t4) return e3 = t4, true; t4 -= i2, ++n3; }), fe(this, se(n3, e3)); }, indexFromPos: function(t4) { var e3 = (t4 = fe(this, t4)).ch; if (t4.line < this.first || t4.ch < 0) return 0; var n3 = this.lineSeparator().length; return this.iter(this.first, t4.line, function(t5) { e3 += t5.text.length + n3; }), e3; }, copy: function(t4) { var e3 = new Ss(te(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction); return e3.scrollTop = this.scrollTop, e3.scrollLeft = this.scrollLeft, e3.sel = this.sel, e3.extend = false, t4 && (e3.history.undoDepth = this.history.undoDepth, e3.setHistory(this.getHistory())), e3; }, linkedDoc: function(t4) { t4 || (t4 = {}); var e3 = this.first, n3 = this.first + this.size; null != t4.from && t4.from > e3 && (e3 = t4.from), null != t4.to && t4.to < n3 && (n3 = t4.to); var o3 = new Ss(te(this, e3, n3), t4.mode || this.modeOption, e3, this.lineSep, this.direction); return t4.sharedHist && (o3.history = this.history), (this.linked || (this.linked = [])).push({ doc: o3, sharedHist: t4.sharedHist }), o3.linked = [{ doc: this, isParent: true, sharedHist: t4.sharedHist }], ws(o3, _s(this)), o3; }, unlinkDoc: function(t4) { if (t4 instanceof Va && (t4 = t4.doc), this.linked) { for (var e3 = 0; e3 < this.linked.length; ++e3) if (this.linked[e3].doc == t4) { this.linked.splice(e3, 1), t4.unlinkDoc(this), xs(_s(this)); break; } } if (t4.history == this.history) { var n3 = [t4.id]; bi(t4, function(t5) { return n3.push(t5.id); }, true), t4.history = new Ci(null), t4.history.done = Ni(this.history.done, n3), t4.history.undone = Ni(this.history.undone, n3); } }, iterLinkedDocs: function(t4) { bi(this, t4); }, getMode: function() { return this.mode; }, getEditor: function() { return this.cm; }, splitLines: function(t4) { return this.lineSep ? t4.split(this.lineSep) : Nt(t4); }, lineSeparator: function() { return this.lineSep || "\n"; }, setDirection: Ir(function(t4) { "rtl" != t4 && (t4 = "ltr"), t4 != this.direction && (this.direction = t4, this.iter(function(t5) { return t5.order = null; }), this.cm && xi(this.cm)); }) }), Ss.prototype.eachLine = Ss.prototype.iter; var Os = 0; function Ts(t4) { var e3 = this; if (Es(e3), !bt(e3, t4) && !$n(e3.display, t4)) { Ct(t4), s && (Os = +/* @__PURE__ */ new Date()); var n3 = Fo(e3, t4, true), o3 = t4.dataTransfer.files; if (n3 && !e3.isReadOnly()) if (o3 && o3.length && window.FileReader && window.File) for (var r2 = o3.length, i2 = Array(r2), a2 = 0, l2 = function() { ++a2 == r2 && Dr(e3, function() { var t5 = { from: n3 = fe(e3.doc, n3), to: n3, text: e3.doc.splitLines(i2.filter(function(t6) { return null != t6; }).join(e3.doc.lineSeparator())), origin: "paste" }; Qi(e3.doc, t5), Bi(e3.doc, ci(fe(e3.doc, n3), fe(e3.doc, ui(t5)))); })(); }, c2 = function(t5, n4) { if (e3.options.allowDropFileTypes && -1 == z(e3.options.allowDropFileTypes, t5.type)) l2(); else { var o4 = new FileReader(); o4.onerror = function() { return l2(); }, o4.onload = function() { var t6 = o4.result; /[\x00-\x08\x0e-\x1f]{2}/.test(t6) || (i2[n4] = t6), l2(); }, o4.readAsText(t5); } }, u2 = 0; u2 < o3.length; u2++) c2(o3[u2], u2); else { if (e3.state.draggingText && e3.doc.sel.contains(n3) > -1) return e3.state.draggingText(t4), void setTimeout(function() { return e3.display.input.focus(); }, 20); try { var p2 = t4.dataTransfer.getData("Text"); if (p2) { var d2; if (e3.state.draggingText && !e3.state.draggingText.copy && (d2 = e3.listSelections()), Wi(e3.doc, ci(n3, n3)), d2) for (var f2 = 0; f2 < d2.length; ++f2) is(e3.doc, "", d2[f2].anchor, d2[f2].head, "drag"); e3.replaceSelection(p2, "around", "paste"), e3.display.input.focus(); } } catch (t5) { } } } } function ks(t4, e3) { if (s && (!t4.state.draggingText || +/* @__PURE__ */ new Date() - Os < 100)) Tt(e3); else if (!bt(t4, e3) && !$n(t4.display, e3) && (e3.dataTransfer.setData("Text", t4.getSelection()), e3.dataTransfer.effectAllowed = "copyMove", e3.dataTransfer.setDragImage && !f)) { var n3 = A("img", null, null, "position: fixed; left: 0; top: 0;"); n3.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", d && (n3.width = n3.height = 1, t4.display.wrapper.appendChild(n3), n3._top = n3.offsetTop), e3.dataTransfer.setDragImage(n3, 0, 0), d && n3.parentNode.removeChild(n3); } } function Ps(t4, e3) { var n3 = Fo(t4, e3); if (n3) { var o3 = document.createDocumentFragment(); Go(t4, n3, o3), t4.display.dragCursor || (t4.display.dragCursor = A("div", null, "CodeMirror-cursors CodeMirror-dragcursors"), t4.display.lineSpace.insertBefore(t4.display.dragCursor, t4.display.cursorDiv)), E(t4.display.dragCursor, o3); } } function Es(t4) { t4.display.dragCursor && (t4.display.lineSpace.removeChild(t4.display.dragCursor), t4.display.dragCursor = null); } function As(t4) { if (document.getElementsByClassName) { for (var e3 = document.getElementsByClassName("CodeMirror"), n3 = [], o3 = 0; o3 < e3.length; o3++) { var r2 = e3[o3].CodeMirror; r2 && n3.push(r2); } n3.length && n3[0].operation(function() { for (var e4 = 0; e4 < n3.length; e4++) t4(n3[e4]); }); } } var js = false; function Ms() { js || (Ls(), js = true); } function Ls() { var t4; gt(window, "resize", function() { null == t4 && (t4 = setTimeout(function() { t4 = null, As(Ds); }, 100)); }), gt(window, "blur", function() { return As(tr); }); } function Ds(t4) { var e3 = t4.display; e3.cachedCharWidth = e3.cachedTextHeight = e3.cachedPaddingH = null, e3.scrollbarsClipped = false, t4.setSize(); } for (var Ns = { 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" }, Is = 0; Is < 10; Is++) Ns[Is + 48] = Ns[Is + 96] = String(Is); for (var Fs = 65; Fs <= 90; Fs++) Ns[Fs] = String.fromCharCode(Fs); for (var Vs = 1; Vs <= 12; Vs++) Ns[Vs + 111] = Ns[Vs + 63235] = "F" + Vs; var Rs = {}; function Hs(t4) { var e3, n3, o3, r2, i2 = t4.split(/-(?!$)/); t4 = i2[i2.length - 1]; for (var s2 = 0; s2 < i2.length - 1; s2++) { var a2 = i2[s2]; if (/^(cmd|meta|m)$/i.test(a2)) r2 = true; else if (/^a(lt)?$/i.test(a2)) e3 = true; else if (/^(c|ctrl|control)$/i.test(a2)) n3 = true; else { if (!/^s(hift)?$/i.test(a2)) throw new Error("Unrecognized modifier name: " + a2); o3 = true; } } return e3 && (t4 = "Alt-" + t4), n3 && (t4 = "Ctrl-" + t4), r2 && (t4 = "Cmd-" + t4), o3 && (t4 = "Shift-" + t4), t4; } function zs(t4) { var e3 = {}; for (var n3 in t4) if (t4.hasOwnProperty(n3)) { var o3 = t4[n3]; if (/^(name|fallthrough|(de|at)tach)$/.test(n3)) continue; if ("..." == o3) { delete t4[n3]; continue; } for (var r2 = J(n3.split(" "), Hs), i2 = 0; i2 < r2.length; i2++) { var s2 = void 0, a2 = void 0; i2 == r2.length - 1 ? (a2 = r2.join(" "), s2 = o3) : (a2 = r2.slice(0, i2 + 1).join(" "), s2 = "..."); var l2 = e3[a2]; if (l2) { if (l2 != s2) throw new Error("Inconsistent bindings for " + a2); } else e3[a2] = s2; } delete t4[n3]; } for (var c2 in e3) t4[c2] = e3[c2]; return t4; } function Bs(t4, e3, n3, o3) { var r2 = (e3 = qs(e3)).call ? e3.call(t4, o3) : e3[t4]; if (false === r2) return "nothing"; if ("..." === r2) return "multi"; if (null != r2 && n3(r2)) return "handled"; if (e3.fallthrough) { if ("[object Array]" != Object.prototype.toString.call(e3.fallthrough)) return Bs(t4, e3.fallthrough, n3, o3); for (var i2 = 0; i2 < e3.fallthrough.length; i2++) { var s2 = Bs(t4, e3.fallthrough[i2], n3, o3); if (s2) return s2; } } } function Us(t4) { var e3 = "string" == typeof t4 ? t4 : Ns[t4.keyCode]; return "Ctrl" == e3 || "Alt" == e3 || "Shift" == e3 || "Mod" == e3; } function Ws(t4, e3, n3) { var o3 = t4; return e3.altKey && "Alt" != o3 && (t4 = "Alt-" + t4), (C ? e3.metaKey : e3.ctrlKey) && "Ctrl" != o3 && (t4 = "Ctrl-" + t4), (C ? e3.ctrlKey : e3.metaKey) && "Mod" != o3 && (t4 = "Cmd-" + t4), !n3 && e3.shiftKey && "Shift" != o3 && (t4 = "Shift-" + t4), t4; } function $s(t4, e3) { if (d && 34 == t4.keyCode && t4["char"]) return false; var n3 = Ns[t4.keyCode]; return null != n3 && !t4.altGraphKey && (3 == t4.keyCode && t4.code && (n3 = t4.code), Ws(n3, t4, e3)); } function qs(t4) { return "string" == typeof t4 ? Rs[t4] : t4; } function Gs(t4, e3) { for (var n3 = t4.doc.sel.ranges, o3 = [], r2 = 0; r2 < n3.length; r2++) { for (var i2 = e3(n3[r2]); o3.length && ae(i2.from, X(o3).to) <= 0; ) { var s2 = o3.pop(); if (ae(s2.from, i2.from) < 0) { i2.from = s2.from; break; } } o3.push(i2); } Lr(t4, function() { for (var e4 = o3.length - 1; e4 >= 0; e4--) is(t4.doc, "", o3[e4].from, o3[e4].to, "+delete"); cr(t4); }); } function Ks(t4, e3, n3) { var o3 = at(t4.text, e3 + n3, n3); return o3 < 0 || o3 > t4.text.length ? null : o3; } function Ys(t4, e3, n3) { var o3 = Ks(t4, e3.ch, n3); return null == o3 ? null : new se(e3.line, o3, n3 < 0 ? "after" : "before"); } function Xs(t4, e3, n3, o3, r2) { if (t4) { "rtl" == e3.doc.direction && (r2 = -r2); var i2 = ft(n3, e3.doc.direction); if (i2) { var s2, a2 = r2 < 0 ? X(i2) : i2[0], l2 = r2 < 0 == (1 == a2.level) ? "after" : "before"; if (a2.level > 0 || "rtl" == e3.doc.direction) { var c2 = oo(e3, n3); s2 = r2 < 0 ? n3.text.length - 1 : 0; var u2 = ro(e3, c2, s2).top; s2 = lt(function(t5) { return ro(e3, c2, t5).top == u2; }, r2 < 0 == (1 == a2.level) ? a2.from : a2.to - 1, s2), "before" == l2 && (s2 = Ks(n3, s2, 1)); } else s2 = r2 < 0 ? a2.to : a2.from; return new se(o3, s2, l2); } } return new se(o3, r2 < 0 ? n3.text.length : 0, r2 < 0 ? "before" : "after"); } function Js(t4, e3, n3, o3) { var r2 = ft(e3, t4.doc.direction); if (!r2) return Ys(e3, n3, o3); n3.ch >= e3.text.length ? (n3.ch = e3.text.length, n3.sticky = "before") : n3.ch <= 0 && (n3.ch = 0, n3.sticky = "after"); var i2 = pt(r2, n3.ch, n3.sticky), s2 = r2[i2]; if ("ltr" == t4.doc.direction && s2.level % 2 == 0 && (o3 > 0 ? s2.to > n3.ch : s2.from < n3.ch)) return Ys(e3, n3, o3); var a2, l2 = function(t5, n4) { return Ks(e3, t5 instanceof se ? t5.ch : t5, n4); }, c2 = function(n4) { return t4.options.lineWrapping ? (a2 = a2 || oo(t4, e3), To(t4, e3, a2, n4)) : { begin: 0, end: e3.text.length }; }, u2 = c2("before" == n3.sticky ? l2(n3, -1) : n3.ch); if ("rtl" == t4.doc.direction || 1 == s2.level) { var p2 = 1 == s2.level == o3 < 0, d2 = l2(n3, p2 ? 1 : -1); if (null != d2 && (p2 ? d2 <= s2.to && d2 <= u2.end : d2 >= s2.from && d2 >= u2.begin)) { var f2 = p2 ? "before" : "after"; return new se(n3.line, d2, f2); } } var h2 = function(t5, e4, o4) { for (var i3 = function(t6, e5) { return e5 ? new se(n3.line, l2(t6, 1), "before") : new se(n3.line, t6, "after"); }; t5 >= 0 && t5 < r2.length; t5 += e4) { var s3 = r2[t5], a3 = e4 > 0 == (1 != s3.level), c3 = a3 ? o4.begin : l2(o4.end, -1); if (s3.from <= c3 && c3 < s3.to) return i3(c3, a3); if (c3 = a3 ? s3.from : l2(s3.to, -1), o4.begin <= c3 && c3 < o4.end) return i3(c3, a3); } }, g2 = h2(i2 + o3, o3, u2); if (g2) return g2; var v2 = o3 > 0 ? u2.end : l2(u2.begin, -1); return null == v2 || o3 > 0 && v2 == e3.text.length || !(g2 = h2(o3 > 0 ? 0 : r2.length - 1, o3, c2(v2))) ? null : g2; } Rs.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" }, Rs.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" }, Rs.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" }, Rs.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"] }, Rs["default"] = b ? Rs.macDefault : Rs.pcDefault; var Zs = { selectAll: Ji, singleSelection: function(t4) { return t4.setSelection(t4.getCursor("anchor"), t4.getCursor("head"), W); }, killLine: function(t4) { return Gs(t4, function(e3) { if (e3.empty()) { var n3 = Zt(t4.doc, e3.head.line).text.length; return e3.head.ch == n3 && e3.head.line < t4.lastLine() ? { from: e3.head, to: se(e3.head.line + 1, 0) } : { from: e3.head, to: se(e3.head.line, n3) }; } return { from: e3.from(), to: e3.to() }; }); }, deleteLine: function(t4) { return Gs(t4, function(e3) { return { from: se(e3.from().line, 0), to: fe(t4.doc, se(e3.to().line + 1, 0)) }; }); }, delLineLeft: function(t4) { return Gs(t4, function(t5) { return { from: se(t5.from().line, 0), to: t5.from() }; }); }, delWrappedLineLeft: function(t4) { return Gs(t4, function(e3) { var n3 = t4.charCoords(e3.head, "div").top + 5; return { from: t4.coordsChar({ left: 0, top: n3 }, "div"), to: e3.from() }; }); }, delWrappedLineRight: function(t4) { return Gs(t4, function(e3) { var n3 = t4.charCoords(e3.head, "div").top + 5, o3 = t4.coordsChar({ left: t4.display.lineDiv.offsetWidth + 100, top: n3 }, "div"); return { from: e3.from(), to: o3 }; }); }, undo: function(t4) { return t4.undo(); }, redo: function(t4) { return t4.redo(); }, undoSelection: function(t4) { return t4.undoSelection(); }, redoSelection: function(t4) { return t4.redoSelection(); }, goDocStart: function(t4) { return t4.extendSelection(se(t4.firstLine(), 0)); }, goDocEnd: function(t4) { return t4.extendSelection(se(t4.lastLine())); }, goLineStart: function(t4) { return t4.extendSelectionsBy(function(e3) { return Qs(t4, e3.head.line); }, { origin: "+move", bias: 1 }); }, goLineStartSmart: function(t4) { return t4.extendSelectionsBy(function(e3) { return ea(t4, e3.head); }, { origin: "+move", bias: 1 }); }, goLineEnd: function(t4) { return t4.extendSelectionsBy(function(e3) { return ta(t4, e3.head.line); }, { origin: "+move", bias: -1 }); }, goLineRight: function(t4) { return t4.extendSelectionsBy(function(e3) { var n3 = t4.cursorCoords(e3.head, "div").top + 5; return t4.coordsChar({ left: t4.display.lineDiv.offsetWidth + 100, top: n3 }, "div"); }, q); }, goLineLeft: function(t4) { return t4.extendSelectionsBy(function(e3) { var n3 = t4.cursorCoords(e3.head, "div").top + 5; return t4.coordsChar({ left: 0, top: n3 }, "div"); }, q); }, goLineLeftSmart: function(t4) { return t4.extendSelectionsBy(function(e3) { var n3 = t4.cursorCoords(e3.head, "div").top + 5, o3 = t4.coordsChar({ left: 0, top: n3 }, "div"); return o3.ch < t4.getLine(o3.line).search(/\S/) ? ea(t4, e3.head) : o3; }, q); }, goLineUp: function(t4) { return t4.moveV(-1, "line"); }, goLineDown: function(t4) { return t4.moveV(1, "line"); }, goPageUp: function(t4) { return t4.moveV(-1, "page"); }, goPageDown: function(t4) { return t4.moveV(1, "page"); }, goCharLeft: function(t4) { return t4.moveH(-1, "char"); }, goCharRight: function(t4) { return t4.moveH(1, "char"); }, goColumnLeft: function(t4) { return t4.moveH(-1, "column"); }, goColumnRight: function(t4) { return t4.moveH(1, "column"); }, goWordLeft: function(t4) { return t4.moveH(-1, "word"); }, goGroupRight: function(t4) { return t4.moveH(1, "group"); }, goGroupLeft: function(t4) { return t4.moveH(-1, "group"); }, goWordRight: function(t4) { return t4.moveH(1, "word"); }, delCharBefore: function(t4) { return t4.deleteH(-1, "codepoint"); }, delCharAfter: function(t4) { return t4.deleteH(1, "char"); }, delWordBefore: function(t4) { return t4.deleteH(-1, "word"); }, delWordAfter: function(t4) { return t4.deleteH(1, "word"); }, delGroupBefore: function(t4) { return t4.deleteH(-1, "group"); }, delGroupAfter: function(t4) { return t4.deleteH(1, "group"); }, indentAuto: function(t4) { return t4.indentSelection("smart"); }, indentMore: function(t4) { return t4.indentSelection("add"); }, indentLess: function(t4) { return t4.indentSelection("subtract"); }, insertTab: function(t4) { return t4.replaceSelection(" "); }, insertSoftTab: function(t4) { for (var e3 = [], n3 = t4.listSelections(), o3 = t4.options.tabSize, r2 = 0; r2 < n3.length; r2++) { var i2 = n3[r2].from(), s2 = R(t4.getLine(i2.line), i2.ch, o3); e3.push(Y(o3 - s2 % o3)); } t4.replaceSelections(e3); }, defaultTab: function(t4) { t4.somethingSelected() ? t4.indentSelection("add") : t4.execCommand("insertTab"); }, transposeChars: function(t4) { return Lr(t4, function() { for (var e3 = t4.listSelections(), n3 = [], o3 = 0; o3 < e3.length; o3++) if (e3[o3].empty()) { var r2 = e3[o3].head, i2 = Zt(t4.doc, r2.line).text; if (i2) { if (r2.ch == i2.length && (r2 = new se(r2.line, r2.ch - 1)), r2.ch > 0) r2 = new se(r2.line, r2.ch + 1), t4.replaceRange(i2.charAt(r2.ch - 1) + i2.charAt(r2.ch - 2), se(r2.line, r2.ch - 2), r2, "+transpose"); else if (r2.line > t4.doc.first) { var s2 = Zt(t4.doc, r2.line - 1).text; s2 && (r2 = new se(r2.line, 1), t4.replaceRange(i2.charAt(0) + t4.doc.lineSeparator() + s2.charAt(s2.length - 1), se(r2.line - 1, s2.length - 1), r2, "+transpose")); } } n3.push(new ai(r2, r2)); } t4.setSelections(n3); }); }, newlineAndIndent: function(t4) { return Lr(t4, function() { for (var e3 = t4.listSelections(), n3 = e3.length - 1; n3 >= 0; n3--) t4.replaceRange(t4.doc.lineSeparator(), e3[n3].anchor, e3[n3].head, "+input"); e3 = t4.listSelections(); for (var o3 = 0; o3 < e3.length; o3++) t4.indentLine(e3[o3].from().line, null, true); cr(t4); }); }, openLine: function(t4) { return t4.replaceSelection("\n", "start"); }, toggleOverwrite: function(t4) { return t4.toggleOverwrite(); } }; function Qs(t4, e3) { var n3 = Zt(t4.doc, e3), o3 = Qe(n3); return o3 != n3 && (e3 = ne(o3)), Xs(true, t4, o3, e3, 1); } function ta(t4, e3) { var n3 = Zt(t4.doc, e3), o3 = tn(n3); return o3 != n3 && (e3 = ne(o3)), Xs(true, t4, n3, e3, -1); } function ea(t4, e3) { var n3 = Qs(t4, e3.line), o3 = Zt(t4.doc, n3.line), r2 = ft(o3, t4.doc.direction); if (!r2 || 0 == r2[0].level) { var i2 = Math.max(n3.ch, o3.text.search(/\S/)), s2 = e3.line == n3.line && e3.ch <= i2 && e3.ch; return se(n3.line, s2 ? 0 : i2, n3.sticky); } return n3; } function na(t4, e3, n3) { if ("string" == typeof e3 && !(e3 = Zs[e3])) return false; t4.display.input.ensurePolled(); var o3 = t4.display.shift, r2 = false; try { t4.isReadOnly() && (t4.state.suppressEdits = true), n3 && (t4.display.shift = false), r2 = e3(t4) != U; } finally { t4.display.shift = o3, t4.state.suppressEdits = false; } return r2; } function oa(t4, e3, n3) { for (var o3 = 0; o3 < t4.state.keyMaps.length; o3++) { var r2 = Bs(e3, t4.state.keyMaps[o3], n3, t4); if (r2) return r2; } return t4.options.extraKeys && Bs(e3, t4.options.extraKeys, n3, t4) || Bs(e3, t4.options.keyMap, n3, t4); } var ra = new H(); function ia(t4, e3, n3, o3) { var r2 = t4.state.keySeq; if (r2) { if (Us(e3)) return "handled"; if (/\'$/.test(e3) ? t4.state.keySeq = null : ra.set(50, function() { t4.state.keySeq == r2 && (t4.state.keySeq = null, t4.display.input.reset()); }), sa(t4, r2 + " " + e3, n3, o3)) return true; } return sa(t4, e3, n3, o3); } function sa(t4, e3, n3, o3) { var r2 = oa(t4, e3, o3); return "multi" == r2 && (t4.state.keySeq = e3), "handled" == r2 && An(t4, "keyHandled", t4, e3, n3), "handled" != r2 && "multi" != r2 || (Ct(n3), Xo(t4)), !!r2; } function aa(t4, e3) { var n3 = $s(e3, true); return !!n3 && (e3.shiftKey && !t4.state.keySeq ? ia(t4, "Shift-" + n3, e3, function(e4) { return na(t4, e4, true); }) || ia(t4, n3, e3, function(e4) { if ("string" == typeof e4 ? /^go[A-Z]/.test(e4) : e4.motion) return na(t4, e4); }) : ia(t4, n3, e3, function(e4) { return na(t4, e4); })); } function la(t4, e3, n3) { return ia(t4, "'" + n3 + "'", e3, function(e4) { return na(t4, e4, true); }); } var ca = null; function ua(t4) { var e3 = this; if (!(t4.target && t4.target != e3.display.input.getField() || (e3.curOp.focus = L(), bt(e3, t4)))) { s && a < 11 && 27 == t4.keyCode && (t4.returnValue = false); var o3 = t4.keyCode; e3.display.shift = 16 == o3 || t4.shiftKey; var r2 = aa(e3, t4); d && (ca = r2 ? o3 : null, r2 || 88 != o3 || Ft || !(b ? t4.metaKey : t4.ctrlKey) || e3.replaceSelection("", null, "cut")), n2 && !b && !r2 && 46 == o3 && t4.shiftKey && !t4.ctrlKey && document.execCommand && document.execCommand("cut"), 18 != o3 || /\bCodeMirror-crosshair\b/.test(e3.display.lineDiv.className) || pa(e3); } } function pa(t4) { var e3 = t4.display.lineDiv; function n3(t5) { 18 != t5.keyCode && t5.altKey || (k(e3, "CodeMirror-crosshair"), yt(document, "keyup", n3), yt(document, "mouseover", n3)); } D(e3, "CodeMirror-crosshair"), gt(document, "keyup", n3), gt(document, "mouseover", n3); } function da(t4) { 16 == t4.keyCode && (this.doc.sel.shift = false), bt(this, t4); } function fa(t4) { var e3 = this; if (!(t4.target && t4.target != e3.display.input.getField() || $n(e3.display, t4) || bt(e3, t4) || t4.ctrlKey && !t4.altKey || b && t4.metaKey)) { var n3 = t4.keyCode, o3 = t4.charCode; if (d && n3 == ca) return ca = null, void Ct(t4); if (!d || t4.which && !(t4.which < 10) || !aa(e3, t4)) { var r2 = String.fromCharCode(null == o3 ? n3 : o3); "\b" != r2 && (la(e3, t4, r2) || e3.display.input.onKeyPress(t4)); } } } var ha, ga, va = 400, ya = function(t4, e3, n3) { this.time = t4, this.pos = e3, this.button = n3; }; function ma(t4, e3) { var n3 = +/* @__PURE__ */ new Date(); return ga && ga.compare(n3, t4, e3) ? (ha = ga = null, "triple") : ha && ha.compare(n3, t4, e3) ? (ga = new ya(n3, t4, e3), ha = null, "double") : (ha = new ya(n3, t4, e3), ga = null, "single"); } function ba(t4) { var e3 = this, n3 = e3.display; if (!(bt(e3, t4) || n3.activeTouch && n3.input.supportsTouch())) { if (n3.input.ensurePolled(), n3.shift = t4.shiftKey, $n(n3, t4)) l || (n3.scroller.draggable = false, setTimeout(function() { return n3.scroller.draggable = true; }, 100)); else if (!Pa(e3, t4)) { var o3 = Fo(e3, t4), r2 = Pt(t4), i2 = o3 ? ma(o3, r2) : "single"; window.focus(), 1 == r2 && e3.state.selectingText && e3.state.selectingText(t4), o3 && _a(e3, r2, o3, i2, t4) || (1 == r2 ? o3 ? xa(e3, o3, i2, t4) : kt(t4) == n3.scroller && Ct(t4) : 2 == r2 ? (o3 && Fi(e3.doc, o3), setTimeout(function() { return n3.input.focus(); }, 20)) : 3 == r2 && (S ? e3.display.input.onContextMenu(t4) : Zo(e3))); } } } function _a(t4, e3, n3, o3, r2) { var i2 = "Click"; return "double" == o3 ? i2 = "Double" + i2 : "triple" == o3 && (i2 = "Triple" + i2), ia(t4, Ws(i2 = (1 == e3 ? "Left" : 2 == e3 ? "Middle" : "Right") + i2, r2), r2, function(e4) { if ("string" == typeof e4 && (e4 = Zs[e4]), !e4) return false; var o4 = false; try { t4.isReadOnly() && (t4.state.suppressEdits = true), o4 = e4(t4, n3) != U; } finally { t4.state.suppressEdits = false; } return o4; }); } function wa(t4, e3, n3) { var o3 = t4.getOption("configureMouse"), r2 = o3 ? o3(t4, e3, n3) : {}; if (null == r2.unit) { var i2 = _ ? n3.shiftKey && n3.metaKey : n3.altKey; r2.unit = i2 ? "rectangle" : "single" == e3 ? "char" : "double" == e3 ? "word" : "line"; } return (null == r2.extend || t4.doc.extend) && (r2.extend = t4.doc.extend || n3.shiftKey), null == r2.addNew && (r2.addNew = b ? n3.metaKey : n3.ctrlKey), null == r2.moveOnDrag && (r2.moveOnDrag = !(b ? n3.altKey : n3.ctrlKey)), r2; } function xa(t4, e3, n3, o3) { s ? setTimeout(F(Jo, t4), 0) : t4.curOp.focus = L(); var r2, i2 = wa(t4, n3, o3), a2 = t4.doc.sel; t4.options.dragDrop && jt && !t4.isReadOnly() && "single" == n3 && (r2 = a2.contains(e3)) > -1 && (ae((r2 = a2.ranges[r2]).from(), e3) < 0 || e3.xRel > 0) && (ae(r2.to(), e3) > 0 || e3.xRel < 0) ? Ca(t4, o3, e3, i2) : Oa(t4, o3, e3, i2); } function Ca(t4, e3, n3, o3) { var r2 = t4.display, i2 = false, c2 = Dr(t4, function(e4) { l && (r2.scroller.draggable = false), t4.state.draggingText = false, t4.state.delayingBlurEvent && (t4.hasFocus() ? t4.state.delayingBlurEvent = false : Zo(t4)), yt(r2.wrapper.ownerDocument, "mouseup", c2), yt(r2.wrapper.ownerDocument, "mousemove", u2), yt(r2.scroller, "dragstart", p2), yt(r2.scroller, "drop", c2), i2 || (Ct(e4), o3.addNew || Fi(t4.doc, n3, null, null, o3.extend), l && !f || s && 9 == a ? setTimeout(function() { r2.wrapper.ownerDocument.body.focus({ preventScroll: true }), r2.input.focus(); }, 20) : r2.input.focus()); }), u2 = function(t5) { i2 = i2 || Math.abs(e3.clientX - t5.clientX) + Math.abs(e3.clientY - t5.clientY) >= 10; }, p2 = function() { return i2 = true; }; l && (r2.scroller.draggable = true), t4.state.draggingText = c2, c2.copy = !o3.moveOnDrag, gt(r2.wrapper.ownerDocument, "mouseup", c2), gt(r2.wrapper.ownerDocument, "mousemove", u2), gt(r2.scroller, "dragstart", p2), gt(r2.scroller, "drop", c2), t4.state.delayingBlurEvent = true, setTimeout(function() { return r2.input.focus(); }, 20), r2.scroller.dragDrop && r2.scroller.dragDrop(); } function Sa(t4, e3, n3) { if ("char" == n3) return new ai(e3, e3); if ("word" == n3) return t4.findWordAt(e3); if ("line" == n3) return new ai(se(e3.line, 0), fe(t4.doc, se(e3.line + 1, 0))); var o3 = n3(t4, e3); return new ai(o3.from, o3.to); } function Oa(t4, e3, n3, o3) { s && Zo(t4); var r2 = t4.display, i2 = t4.doc; Ct(e3); var a2, l2, c2 = i2.sel, u2 = c2.ranges; if (o3.addNew && !o3.extend ? (l2 = i2.sel.contains(n3), a2 = l2 > -1 ? u2[l2] : new ai(n3, n3)) : (a2 = i2.sel.primary(), l2 = i2.sel.primIndex), "rectangle" == o3.unit) o3.addNew || (a2 = new ai(n3, n3)), n3 = Fo(t4, e3, true, true), l2 = -1; else { var p2 = Sa(t4, n3, o3.unit); a2 = o3.extend ? Ii(a2, p2.anchor, p2.head, o3.extend) : p2; } o3.addNew ? -1 == l2 ? (l2 = u2.length, Ui(i2, li(t4, u2.concat([a2]), l2), { scroll: false, origin: "*mouse" })) : u2.length > 1 && u2[l2].empty() && "char" == o3.unit && !o3.extend ? (Ui(i2, li(t4, u2.slice(0, l2).concat(u2.slice(l2 + 1)), 0), { scroll: false, origin: "*mouse" }), c2 = i2.sel) : Ri(i2, l2, a2, $) : (l2 = 0, Ui(i2, new si([a2], 0), $), c2 = i2.sel); var d2 = n3; function f2(e4) { if (0 != ae(d2, e4)) if (d2 = e4, "rectangle" == o3.unit) { for (var r3 = [], s2 = t4.options.tabSize, u3 = R(Zt(i2, n3.line).text, n3.ch, s2), p3 = R(Zt(i2, e4.line).text, e4.ch, s2), f3 = Math.min(u3, p3), h3 = Math.max(u3, p3), g3 = Math.min(n3.line, e4.line), v3 = Math.min(t4.lastLine(), Math.max(n3.line, e4.line)); g3 <= v3; g3++) { var y3 = Zt(i2, g3).text, m3 = G(y3, f3, s2); f3 == h3 ? r3.push(new ai(se(g3, m3), se(g3, m3))) : y3.length > m3 && r3.push(new ai(se(g3, m3), se(g3, G(y3, h3, s2)))); } r3.length || r3.push(new ai(n3, n3)), Ui(i2, li(t4, c2.ranges.slice(0, l2).concat(r3), l2), { origin: "*mouse", scroll: false }), t4.scrollIntoView(e4); } else { var b3, _2 = a2, w2 = Sa(t4, e4, o3.unit), x2 = _2.anchor; ae(w2.anchor, x2) > 0 ? (b3 = w2.head, x2 = pe(_2.from(), w2.anchor)) : (b3 = w2.anchor, x2 = ue(_2.to(), w2.head)); var C2 = c2.ranges.slice(0); C2[l2] = Ta(t4, new ai(fe(i2, x2), b3)), Ui(i2, li(t4, C2, l2), $); } } var h2 = r2.wrapper.getBoundingClientRect(), g2 = 0; function v2(e4) { var n4 = ++g2, s2 = Fo(t4, e4, true, "rectangle" == o3.unit); if (s2) if (0 != ae(s2, d2)) { t4.curOp.focus = L(), f2(s2); var a3 = or(r2, i2); (s2.line >= a3.to || s2.line < a3.from) && setTimeout(Dr(t4, function() { g2 == n4 && v2(e4); }), 150); } else { var l3 = e4.clientY < h2.top ? -20 : e4.clientY > h2.bottom ? 20 : 0; l3 && setTimeout(Dr(t4, function() { g2 == n4 && (r2.scroller.scrollTop += l3, v2(e4)); }), 50); } } function y2(e4) { t4.state.selectingText = false, g2 = 1 / 0, e4 && (Ct(e4), r2.input.focus()), yt(r2.wrapper.ownerDocument, "mousemove", m2), yt(r2.wrapper.ownerDocument, "mouseup", b2), i2.history.lastSelOrigin = null; } var m2 = Dr(t4, function(t5) { 0 !== t5.buttons && Pt(t5) ? v2(t5) : y2(t5); }), b2 = Dr(t4, y2); t4.state.selectingText = b2, gt(r2.wrapper.ownerDocument, "mousemove", m2), gt(r2.wrapper.ownerDocument, "mouseup", b2); } function Ta(t4, e3) { var n3 = e3.anchor, o3 = e3.head, r2 = Zt(t4.doc, n3.line); if (0 == ae(n3, o3) && n3.sticky == o3.sticky) return e3; var i2 = ft(r2); if (!i2) return e3; var s2 = pt(i2, n3.ch, n3.sticky), a2 = i2[s2]; if (a2.from != n3.ch && a2.to != n3.ch) return e3; var l2, c2 = s2 + (a2.from == n3.ch == (1 != a2.level) ? 0 : 1); if (0 == c2 || c2 == i2.length) return e3; if (o3.line != n3.line) l2 = (o3.line - n3.line) * ("ltr" == t4.doc.direction ? 1 : -1) > 0; else { var u2 = pt(i2, o3.ch, o3.sticky), p2 = u2 - s2 || (o3.ch - n3.ch) * (1 == a2.level ? -1 : 1); l2 = u2 == c2 - 1 || u2 == c2 ? p2 < 0 : p2 > 0; } var d2 = i2[c2 + (l2 ? -1 : 0)], f2 = l2 == (1 == d2.level), h2 = f2 ? d2.from : d2.to, g2 = f2 ? "after" : "before"; return n3.ch == h2 && n3.sticky == g2 ? e3 : new ai(new se(n3.line, h2, g2), o3); } function ka(t4, e3, n3, o3) { var r2, i2; if (e3.touches) r2 = e3.touches[0].clientX, i2 = e3.touches[0].clientY; else try { r2 = e3.clientX, i2 = e3.clientY; } catch (t5) { return false; } if (r2 >= Math.floor(t4.display.gutters.getBoundingClientRect().right)) return false; o3 && Ct(e3); var s2 = t4.display, a2 = s2.lineDiv.getBoundingClientRect(); if (i2 > a2.bottom || !wt(t4, n3)) return Ot(e3); i2 -= a2.top - s2.viewOffset; for (var l2 = 0; l2 < t4.display.gutterSpecs.length; ++l2) { var c2 = s2.gutters.childNodes[l2]; if (c2 && c2.getBoundingClientRect().right >= r2) return mt(t4, n3, t4, oe(t4.doc, i2), t4.display.gutterSpecs[l2].className, e3), Ot(e3); } } function Pa(t4, e3) { return ka(t4, e3, "gutterClick", true); } function Ea(t4, e3) { $n(t4.display, e3) || Aa(t4, e3) || bt(t4, e3, "contextmenu") || S || t4.display.input.onContextMenu(e3); } function Aa(t4, e3) { return !!wt(t4, "gutterContextMenu") && ka(t4, e3, "gutterContextMenu", false); } function ja(t4) { t4.display.wrapper.className = t4.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + t4.options.theme.replace(/(^|\s)\s*/g, " cm-s-"), ho(t4); } ya.prototype.compare = function(t4, e3, n3) { return this.time + va > t4 && 0 == ae(e3, this.pos) && n3 == this.button; }; var Ma = { toString: function() { return "CodeMirror.Init"; } }, La = {}, Da = {}; function Na(t4) { var e3 = t4.optionHandlers; function n3(n4, o3, r2, i2) { t4.defaults[n4] = o3, r2 && (e3[n4] = i2 ? function(t5, e4, n5) { n5 != Ma && r2(t5, e4, n5); } : r2); } t4.defineOption = n3, t4.Init = Ma, n3("value", "", function(t5, e4) { return t5.setValue(e4); }, true), n3("mode", null, function(t5, e4) { t5.doc.modeOption = e4, gi(t5); }, true), n3("indentUnit", 2, gi, true), n3("indentWithTabs", false), n3("smartIndent", true), n3("tabSize", 4, function(t5) { vi(t5), ho(t5), Ro(t5); }, true), n3("lineSeparator", null, function(t5, e4) { if (t5.doc.lineSep = e4, e4) { var n4 = [], o3 = t5.doc.first; t5.doc.iter(function(t6) { for (var r3 = 0; ; ) { var i2 = t6.text.indexOf(e4, r3); if (-1 == i2) break; r3 = i2 + e4.length, n4.push(se(o3, i2)); } o3++; }); for (var r2 = n4.length - 1; r2 >= 0; r2--) is(t5.doc, e4, n4[r2], se(n4[r2].line, n4[r2].ch + e4.length)); } }), n3("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function(t5, e4, n4) { t5.state.specialChars = new RegExp(e4.source + (e4.test(" ") ? "" : "| "), "g"), n4 != Ma && t5.refresh(); }), n3("specialCharPlaceholder", yn, function(t5) { return t5.refresh(); }, true), n3("electricChars", true), n3("inputStyle", m ? "contenteditable" : "textarea", function() { throw new Error("inputStyle can not (yet) be changed in a running editor"); }, true), n3("spellcheck", false, function(t5, e4) { return t5.getInputField().spellcheck = e4; }, true), n3("autocorrect", false, function(t5, e4) { return t5.getInputField().autocorrect = e4; }, true), n3("autocapitalize", false, function(t5, e4) { return t5.getInputField().autocapitalize = e4; }, true), n3("rtlMoveVisually", !w), n3("wholeLineUpdateBefore", true), n3("theme", "default", function(t5) { ja(t5), Qr(t5); }, true), n3("keyMap", "default", function(t5, e4, n4) { var o3 = qs(e4), r2 = n4 != Ma && qs(n4); r2 && r2.detach && r2.detach(t5, o3), o3.attach && o3.attach(t5, r2 || null); }), n3("extraKeys", null), n3("configureMouse", null), n3("lineWrapping", false, Fa, true), n3("gutters", [], function(t5, e4) { t5.display.gutterSpecs = Jr(e4, t5.options.lineNumbers), Qr(t5); }, true), n3("fixedGutter", true, function(t5, e4) { t5.display.gutters.style.left = e4 ? Do(t5.display) + "px" : "0", t5.refresh(); }, true), n3("coverGutterNextToScrollbar", false, function(t5) { return _r(t5); }, true), n3("scrollbarStyle", "native", function(t5) { Cr(t5), _r(t5), t5.display.scrollbars.setScrollTop(t5.doc.scrollTop), t5.display.scrollbars.setScrollLeft(t5.doc.scrollLeft); }, true), n3("lineNumbers", false, function(t5, e4) { t5.display.gutterSpecs = Jr(t5.options.gutters, e4), Qr(t5); }, true), n3("firstLineNumber", 1, Qr, true), n3("lineNumberFormatter", function(t5) { return t5; }, Qr, true), n3("showCursorWhenSelecting", false, $o, true), n3("resetSelectionOnContextMenu", true), n3("lineWiseCopyCut", true), n3("pasteLinesPerSelection", true), n3("selectionsMayTouch", false), n3("readOnly", false, function(t5, e4) { "nocursor" == e4 && (tr(t5), t5.display.input.blur()), t5.display.input.readOnlyChanged(e4); }), n3("screenReaderLabel", null, function(t5, e4) { e4 = "" === e4 ? null : e4, t5.display.input.screenReaderLabelChanged(e4); }), n3("disableInput", false, function(t5, e4) { e4 || t5.display.input.reset(); }, true), n3("dragDrop", true, Ia), n3("allowDropFileTypes", null), n3("cursorBlinkRate", 530), n3("cursorScrollMargin", 0), n3("cursorHeight", 1, $o, true), n3("singleCursorHeightPerLine", true, $o, true), n3("workTime", 100), n3("workDelay", 100), n3("flattenSpans", true, vi, true), n3("addModeClass", false, vi, true), n3("pollInterval", 100), n3("undoDepth", 200, function(t5, e4) { return t5.doc.history.undoDepth = e4; }), n3("historyEventDelay", 1250), n3("viewportMargin", 10, function(t5) { return t5.refresh(); }, true), n3("maxHighlightLength", 1e4, vi, true), n3("moveInputWithCursor", true, function(t5, e4) { e4 || t5.display.input.resetPosition(); }), n3("tabindex", null, function(t5, e4) { return t5.display.input.getField().tabIndex = e4 || ""; }), n3("autofocus", null), n3("direction", "ltr", function(t5, e4) { return t5.doc.setDirection(e4); }, true), n3("phrases", null); } function Ia(t4, e3, n3) { if (!e3 != !(n3 && n3 != Ma)) { var o3 = t4.display.dragFunctions, r2 = e3 ? gt : yt; r2(t4.display.scroller, "dragstart", o3.start), r2(t4.display.scroller, "dragenter", o3.enter), r2(t4.display.scroller, "dragover", o3.over), r2(t4.display.scroller, "dragleave", o3.leave), r2(t4.display.scroller, "drop", o3.drop); } } function Fa(t4) { t4.options.lineWrapping ? (D(t4.display.wrapper, "CodeMirror-wrap"), t4.display.sizer.style.minWidth = "", t4.display.sizerWidth = null) : (k(t4.display.wrapper, "CodeMirror-wrap"), cn(t4)), Io(t4), Ro(t4), ho(t4), setTimeout(function() { return _r(t4); }, 100); } function Va(t4, e3) { var n3 = this; if (!(this instanceof Va)) return new Va(t4, e3); this.options = e3 = e3 ? V(e3) : {}, V(La, e3, false); var o3 = e3.value; "string" == typeof o3 ? o3 = new Ss(o3, e3.mode, null, e3.lineSeparator, e3.direction) : e3.mode && (o3.modeOption = e3.mode), this.doc = o3; var r2 = new Va.inputStyles[e3.inputStyle](this), i2 = this.display = new ti(t4, o3, r2, e3); for (var c2 in i2.wrapper.CodeMirror = this, ja(this), e3.lineWrapping && (this.display.wrapper.className += " CodeMirror-wrap"), Cr(this), this.state = { keyMaps: [], overlays: [], modeGen: 0, overwrite: false, delayingBlurEvent: false, focused: false, suppressEdits: false, pasteIncoming: -1, cutIncoming: -1, selectingText: false, draggingText: false, highlight: new H(), keySeq: null, specialChars: null }, e3.autofocus && !m && i2.input.focus(), s && a < 11 && setTimeout(function() { return n3.display.input.reset(true); }, 20), Ra(this), Ms(), Or(this), this.curOp.forceUpdate = true, _i(this, o3), e3.autofocus && !m || this.hasFocus() ? setTimeout(function() { n3.hasFocus() && !n3.state.focused && Qo(n3); }, 20) : tr(this), Da) Da.hasOwnProperty(c2) && Da[c2](this, e3[c2], Ma); Xr(this), e3.finishInit && e3.finishInit(this); for (var u2 = 0; u2 < Ha.length; ++u2) Ha[u2](this); Tr(this), l && e3.lineWrapping && "optimizelegibility" == getComputedStyle(i2.lineDiv).textRendering && (i2.lineDiv.style.textRendering = "auto"); } function Ra(t4) { var e3 = t4.display; gt(e3.scroller, "mousedown", Dr(t4, ba)), gt(e3.scroller, "dblclick", s && a < 11 ? Dr(t4, function(e4) { if (!bt(t4, e4)) { var n4 = Fo(t4, e4); if (n4 && !Pa(t4, e4) && !$n(t4.display, e4)) { Ct(e4); var o4 = t4.findWordAt(n4); Fi(t4.doc, o4.anchor, o4.head); } } }) : function(e4) { return bt(t4, e4) || Ct(e4); }), gt(e3.scroller, "contextmenu", function(e4) { return Ea(t4, e4); }), gt(e3.input.getField(), "contextmenu", function(n4) { e3.scroller.contains(n4.target) || Ea(t4, n4); }); var n3, o3 = { end: 0 }; function r2() { e3.activeTouch && (n3 = setTimeout(function() { return e3.activeTouch = null; }, 1e3), (o3 = e3.activeTouch).end = +/* @__PURE__ */ new Date()); } function i2(t5) { if (1 != t5.touches.length) return false; var e4 = t5.touches[0]; return e4.radiusX <= 1 && e4.radiusY <= 1; } function l2(t5, e4) { if (null == e4.left) return true; var n4 = e4.left - t5.left, o4 = e4.top - t5.top; return n4 * n4 + o4 * o4 > 20 * 20; } gt(e3.scroller, "touchstart", function(r3) { if (!bt(t4, r3) && !i2(r3) && !Pa(t4, r3)) { e3.input.ensurePolled(), clearTimeout(n3); var s2 = +/* @__PURE__ */ new Date(); e3.activeTouch = { start: s2, moved: false, prev: s2 - o3.end <= 300 ? o3 : null }, 1 == r3.touches.length && (e3.activeTouch.left = r3.touches[0].pageX, e3.activeTouch.top = r3.touches[0].pageY); } }), gt(e3.scroller, "touchmove", function() { e3.activeTouch && (e3.activeTouch.moved = true); }), gt(e3.scroller, "touchend", function(n4) { var o4 = e3.activeTouch; if (o4 && !$n(e3, n4) && null != o4.left && !o4.moved && /* @__PURE__ */ new Date() - o4.start < 300) { var i3, s2 = t4.coordsChar(e3.activeTouch, "page"); i3 = !o4.prev || l2(o4, o4.prev) ? new ai(s2, s2) : !o4.prev.prev || l2(o4, o4.prev.prev) ? t4.findWordAt(s2) : new ai(se(s2.line, 0), fe(t4.doc, se(s2.line + 1, 0))), t4.setSelection(i3.anchor, i3.head), t4.focus(), Ct(n4); } r2(); }), gt(e3.scroller, "touchcancel", r2), gt(e3.scroller, "scroll", function() { e3.scroller.clientHeight && (hr(t4, e3.scroller.scrollTop), vr(t4, e3.scroller.scrollLeft, true), mt(t4, "scroll", t4)); }), gt(e3.scroller, "mousewheel", function(e4) { return ii(t4, e4); }), gt(e3.scroller, "DOMMouseScroll", function(e4) { return ii(t4, e4); }), gt(e3.wrapper, "scroll", function() { return e3.wrapper.scrollTop = e3.wrapper.scrollLeft = 0; }), e3.dragFunctions = { enter: function(e4) { bt(t4, e4) || Tt(e4); }, over: function(e4) { bt(t4, e4) || (Ps(t4, e4), Tt(e4)); }, start: function(e4) { return ks(t4, e4); }, drop: Dr(t4, Ts), leave: function(e4) { bt(t4, e4) || Es(t4); } }; var c2 = e3.input.getField(); gt(c2, "keyup", function(e4) { return da.call(t4, e4); }), gt(c2, "keydown", Dr(t4, ua)), gt(c2, "keypress", Dr(t4, fa)), gt(c2, "focus", function(e4) { return Qo(t4, e4); }), gt(c2, "blur", function(e4) { return tr(t4, e4); }); } Va.defaults = La, Va.optionHandlers = Da; var Ha = []; function za(t4, e3, n3, o3) { var r2, i2 = t4.doc; null == n3 && (n3 = "add"), "smart" == n3 && (i2.mode.indent ? r2 = _e(t4, e3).state : n3 = "prev"); var s2 = t4.options.tabSize, a2 = Zt(i2, e3), l2 = R(a2.text, null, s2); a2.stateAfter && (a2.stateAfter = null); var c2, u2 = a2.text.match(/^\s*/)[0]; if (o3 || /\S/.test(a2.text)) { if ("smart" == n3 && ((c2 = i2.mode.indent(r2, a2.text.slice(u2.length), a2.text)) == U || c2 > 150)) { if (!o3) return; n3 = "prev"; } } else c2 = 0, n3 = "not"; "prev" == n3 ? c2 = e3 > i2.first ? R(Zt(i2, e3 - 1).text, null, s2) : 0 : "add" == n3 ? c2 = l2 + t4.options.indentUnit : "subtract" == n3 ? c2 = l2 - t4.options.indentUnit : "number" == typeof n3 && (c2 = l2 + n3), c2 = Math.max(0, c2); var p2 = "", d2 = 0; if (t4.options.indentWithTabs) for (var f2 = Math.floor(c2 / s2); f2; --f2) d2 += s2, p2 += " "; if (d2 < c2 && (p2 += Y(c2 - d2)), p2 != u2) return is(i2, p2, se(e3, 0), se(e3, u2.length), "+input"), a2.stateAfter = null, true; for (var h2 = 0; h2 < i2.sel.ranges.length; h2++) { var g2 = i2.sel.ranges[h2]; if (g2.head.line == e3 && g2.head.ch < u2.length) { var v2 = se(e3, u2.length); Ri(i2, h2, new ai(v2, v2)); break; } } } Va.defineInitHook = function(t4) { return Ha.push(t4); }; var Ba = null; function Ua(t4) { Ba = t4; } function Wa(t4, e3, n3, o3, r2) { var i2 = t4.doc; t4.display.shift = false, o3 || (o3 = i2.sel); var s2 = +/* @__PURE__ */ new Date() - 200, a2 = "paste" == r2 || t4.state.pasteIncoming > s2, l2 = Nt(e3), c2 = null; if (a2 && o3.ranges.length > 1) if (Ba && Ba.text.join("\n") == e3) { if (o3.ranges.length % Ba.text.length == 0) { c2 = []; for (var u2 = 0; u2 < Ba.text.length; u2++) c2.push(i2.splitLines(Ba.text[u2])); } } else l2.length == o3.ranges.length && t4.options.pasteLinesPerSelection && (c2 = J(l2, function(t5) { return [t5]; })); for (var p2 = t4.curOp.updateInput, d2 = o3.ranges.length - 1; d2 >= 0; d2--) { var f2 = o3.ranges[d2], h2 = f2.from(), g2 = f2.to(); f2.empty() && (n3 && n3 > 0 ? h2 = se(h2.line, h2.ch - n3) : t4.state.overwrite && !a2 ? g2 = se(g2.line, Math.min(Zt(i2, g2.line).text.length, g2.ch + X(l2).length)) : a2 && Ba && Ba.lineWise && Ba.text.join("\n") == l2.join("\n") && (h2 = g2 = se(h2.line, 0))); var v2 = { from: h2, to: g2, text: c2 ? c2[d2 % c2.length] : l2, origin: r2 || (a2 ? "paste" : t4.state.cutIncoming > s2 ? "cut" : "+input") }; Qi(t4.doc, v2), An(t4, "inputRead", t4, v2); } e3 && !a2 && qa(t4, e3), cr(t4), t4.curOp.updateInput < 2 && (t4.curOp.updateInput = p2), t4.curOp.typing = true, t4.state.pasteIncoming = t4.state.cutIncoming = -1; } function $a(t4, e3) { var n3 = t4.clipboardData && t4.clipboardData.getData("Text"); if (n3) return t4.preventDefault(), e3.isReadOnly() || e3.options.disableInput || !e3.hasFocus() || Lr(e3, function() { return Wa(e3, n3, 0, null, "paste"); }), true; } function qa(t4, e3) { if (t4.options.electricChars && t4.options.smartIndent) for (var n3 = t4.doc.sel, o3 = n3.ranges.length - 1; o3 >= 0; o3--) { var r2 = n3.ranges[o3]; if (!(r2.head.ch > 100 || o3 && n3.ranges[o3 - 1].head.line == r2.head.line)) { var i2 = t4.getModeAt(r2.head), s2 = false; if (i2.electricChars) { for (var a2 = 0; a2 < i2.electricChars.length; a2++) if (e3.indexOf(i2.electricChars.charAt(a2)) > -1) { s2 = za(t4, r2.head.line, "smart"); break; } } else i2.electricInput && i2.electricInput.test(Zt(t4.doc, r2.head.line).text.slice(0, r2.head.ch)) && (s2 = za(t4, r2.head.line, "smart")); s2 && An(t4, "electricInput", t4, r2.head.line); } } } function Ga(t4) { for (var e3 = [], n3 = [], o3 = 0; o3 < t4.doc.sel.ranges.length; o3++) { var r2 = t4.doc.sel.ranges[o3].head.line, i2 = { anchor: se(r2, 0), head: se(r2 + 1, 0) }; n3.push(i2), e3.push(t4.getRange(i2.anchor, i2.head)); } return { text: e3, ranges: n3 }; } function Ka(t4, e3, n3, o3) { t4.setAttribute("autocorrect", n3 ? "" : "off"), t4.setAttribute("autocapitalize", o3 ? "" : "off"), t4.setAttribute("spellcheck", !!e3); } function Ya() { var t4 = A("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"), e3 = A("div", [t4], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); return l ? t4.style.width = "1000px" : t4.setAttribute("wrap", "off"), v && (t4.style.border = "1px solid black"), Ka(t4), e3; } function Xa(t4) { var e3 = t4.optionHandlers, n3 = t4.helpers = {}; t4.prototype = { constructor: t4, focus: function() { window.focus(), this.display.input.focus(); }, setOption: function(t5, n4) { var o3 = this.options, r2 = o3[t5]; o3[t5] == n4 && "mode" != t5 || (o3[t5] = n4, e3.hasOwnProperty(t5) && Dr(this, e3[t5])(this, n4, r2), mt(this, "optionChange", this, t5)); }, getOption: function(t5) { return this.options[t5]; }, getDoc: function() { return this.doc; }, addKeyMap: function(t5, e4) { this.state.keyMaps[e4 ? "push" : "unshift"](qs(t5)); }, removeKeyMap: function(t5) { for (var e4 = this.state.keyMaps, n4 = 0; n4 < e4.length; ++n4) if (e4[n4] == t5 || e4[n4].name == t5) return e4.splice(n4, 1), true; }, addOverlay: Nr(function(e4, n4) { var o3 = e4.token ? e4 : t4.getMode(this.options, e4); if (o3.startState) throw new Error("Overlays may not be stateful."); Z(this.state.overlays, { mode: o3, modeSpec: e4, opaque: n4 && n4.opaque, priority: n4 && n4.priority || 0 }, function(t5) { return t5.priority; }), this.state.modeGen++, Ro(this); }), removeOverlay: Nr(function(t5) { for (var e4 = this.state.overlays, n4 = 0; n4 < e4.length; ++n4) { var o3 = e4[n4].modeSpec; if (o3 == t5 || "string" == typeof t5 && o3.name == t5) return e4.splice(n4, 1), this.state.modeGen++, void Ro(this); } }), indentLine: Nr(function(t5, e4, n4) { "string" != typeof e4 && "number" != typeof e4 && (e4 = null == e4 ? this.options.smartIndent ? "smart" : "prev" : e4 ? "add" : "subtract"), re(this.doc, t5) && za(this, t5, e4, n4); }), indentSelection: Nr(function(t5) { for (var e4 = this.doc.sel.ranges, n4 = -1, o3 = 0; o3 < e4.length; o3++) { var r2 = e4[o3]; if (r2.empty()) r2.head.line > n4 && (za(this, r2.head.line, t5, true), n4 = r2.head.line, o3 == this.doc.sel.primIndex && cr(this)); else { var i2 = r2.from(), s2 = r2.to(), a2 = Math.max(n4, i2.line); n4 = Math.min(this.lastLine(), s2.line - (s2.ch ? 0 : 1)) + 1; for (var l2 = a2; l2 < n4; ++l2) za(this, l2, t5); var c2 = this.doc.sel.ranges; 0 == i2.ch && e4.length == c2.length && c2[o3].from().ch > 0 && Ri(this.doc, o3, new ai(i2, c2[o3].to()), W); } } }), getTokenAt: function(t5, e4) { return Oe(this, t5, e4); }, getLineTokens: function(t5, e4) { return Oe(this, se(t5), e4, true); }, getTokenTypeAt: function(t5) { t5 = fe(this.doc, t5); var e4, n4 = be(this, Zt(this.doc, t5.line)), o3 = 0, r2 = (n4.length - 1) / 2, i2 = t5.ch; if (0 == i2) e4 = n4[2]; else for (; ; ) { var s2 = o3 + r2 >> 1; if ((s2 ? n4[2 * s2 - 1] : 0) >= i2) r2 = s2; else { if (!(n4[2 * s2 + 1] < i2)) { e4 = n4[2 * s2 + 2]; break; } o3 = s2 + 1; } } var a2 = e4 ? e4.indexOf("overlay ") : -1; return a2 < 0 ? e4 : 0 == a2 ? null : e4.slice(0, a2 - 1); }, getModeAt: function(e4) { var n4 = this.doc.mode; return n4.innerMode ? t4.innerMode(n4, this.getTokenAt(e4).state).mode : n4; }, getHelper: function(t5, e4) { return this.getHelpers(t5, e4)[0]; }, getHelpers: function(t5, e4) { var o3 = []; if (!n3.hasOwnProperty(e4)) return o3; var r2 = n3[e4], i2 = this.getModeAt(t5); if ("string" == typeof i2[e4]) r2[i2[e4]] && o3.push(r2[i2[e4]]); else if (i2[e4]) for (var s2 = 0; s2 < i2[e4].length; s2++) { var a2 = r2[i2[e4][s2]]; a2 && o3.push(a2); } else i2.helperType && r2[i2.helperType] ? o3.push(r2[i2.helperType]) : r2[i2.name] && o3.push(r2[i2.name]); for (var l2 = 0; l2 < r2._global.length; l2++) { var c2 = r2._global[l2]; c2.pred(i2, this) && -1 == z(o3, c2.val) && o3.push(c2.val); } return o3; }, getStateAfter: function(t5, e4) { var n4 = this.doc; return _e(this, (t5 = de(n4, null == t5 ? n4.first + n4.size - 1 : t5)) + 1, e4).state; }, cursorCoords: function(t5, e4) { var n4 = this.doc.sel.primary(); return wo(this, null == t5 ? n4.head : "object" == typeof t5 ? fe(this.doc, t5) : t5 ? n4.from() : n4.to(), e4 || "page"); }, charCoords: function(t5, e4) { return _o(this, fe(this.doc, t5), e4 || "page"); }, coordsChar: function(t5, e4) { return So(this, (t5 = bo(this, t5, e4 || "page")).left, t5.top); }, lineAtHeight: function(t5, e4) { return t5 = bo(this, { top: t5, left: 0 }, e4 || "page").top, oe(this.doc, t5 + this.display.viewOffset); }, heightAtLine: function(t5, e4, n4) { var o3, r2 = false; if ("number" == typeof t5) { var i2 = this.doc.first + this.doc.size - 1; t5 < this.doc.first ? t5 = this.doc.first : t5 > i2 && (t5 = i2, r2 = true), o3 = Zt(this.doc, t5); } else o3 = t5; return mo(this, o3, { top: 0, left: 0 }, e4 || "page", n4 || r2).top + (r2 ? this.doc.height - an(o3) : 0); }, defaultTextHeight: function() { return jo(this.display); }, defaultCharWidth: function() { return Mo(this.display); }, getViewport: function() { return { from: this.display.viewFrom, to: this.display.viewTo }; }, addWidget: function(t5, e4, n4, o3, r2) { var i2 = this.display, s2 = (t5 = wo(this, fe(this.doc, t5))).bottom, a2 = t5.left; if (e4.style.position = "absolute", e4.setAttribute("cm-ignore-events", "true"), this.display.input.setUneditable(e4), i2.sizer.appendChild(e4), "over" == o3) s2 = t5.top; else if ("above" == o3 || "near" == o3) { var l2 = Math.max(i2.wrapper.clientHeight, this.doc.height), c2 = Math.max(i2.sizer.clientWidth, i2.lineSpace.clientWidth); ("above" == o3 || t5.bottom + e4.offsetHeight > l2) && t5.top > e4.offsetHeight ? s2 = t5.top - e4.offsetHeight : t5.bottom + e4.offsetHeight <= l2 && (s2 = t5.bottom), a2 + e4.offsetWidth > c2 && (a2 = c2 - e4.offsetWidth); } e4.style.top = s2 + "px", e4.style.left = e4.style.right = "", "right" == r2 ? (a2 = i2.sizer.clientWidth - e4.offsetWidth, e4.style.right = "0px") : ("left" == r2 ? a2 = 0 : "middle" == r2 && (a2 = (i2.sizer.clientWidth - e4.offsetWidth) / 2), e4.style.left = a2 + "px"), n4 && sr(this, { left: a2, top: s2, right: a2 + e4.offsetWidth, bottom: s2 + e4.offsetHeight }); }, triggerOnKeyDown: Nr(ua), triggerOnKeyPress: Nr(fa), triggerOnKeyUp: da, triggerOnMouseDown: Nr(ba), execCommand: function(t5) { if (Zs.hasOwnProperty(t5)) return Zs[t5].call(null, this); }, triggerElectric: Nr(function(t5) { qa(this, t5); }), findPosH: function(t5, e4, n4, o3) { var r2 = 1; e4 < 0 && (r2 = -1, e4 = -e4); for (var i2 = fe(this.doc, t5), s2 = 0; s2 < e4 && !(i2 = Ja(this.doc, i2, r2, n4, o3)).hitSide; ++s2) ; return i2; }, moveH: Nr(function(t5, e4) { var n4 = this; this.extendSelectionsBy(function(o3) { return n4.display.shift || n4.doc.extend || o3.empty() ? Ja(n4.doc, o3.head, t5, e4, n4.options.rtlMoveVisually) : t5 < 0 ? o3.from() : o3.to(); }, q); }), deleteH: Nr(function(t5, e4) { var n4 = this.doc.sel, o3 = this.doc; n4.somethingSelected() ? o3.replaceSelection("", null, "+delete") : Gs(this, function(n5) { var r2 = Ja(o3, n5.head, t5, e4, false); return t5 < 0 ? { from: r2, to: n5.head } : { from: n5.head, to: r2 }; }); }), findPosV: function(t5, e4, n4, o3) { var r2 = 1, i2 = o3; e4 < 0 && (r2 = -1, e4 = -e4); for (var s2 = fe(this.doc, t5), a2 = 0; a2 < e4; ++a2) { var l2 = wo(this, s2, "div"); if (null == i2 ? i2 = l2.left : l2.left = i2, (s2 = Za(this, l2, r2, n4)).hitSide) break; } return s2; }, moveV: Nr(function(t5, e4) { var n4 = this, o3 = this.doc, r2 = [], i2 = !this.display.shift && !o3.extend && o3.sel.somethingSelected(); if (o3.extendSelectionsBy(function(s3) { if (i2) return t5 < 0 ? s3.from() : s3.to(); var a2 = wo(n4, s3.head, "div"); null != s3.goalColumn && (a2.left = s3.goalColumn), r2.push(a2.left); var l2 = Za(n4, a2, t5, e4); return "page" == e4 && s3 == o3.sel.primary() && lr(n4, _o(n4, l2, "div").top - a2.top), l2; }, q), r2.length) for (var s2 = 0; s2 < o3.sel.ranges.length; s2++) o3.sel.ranges[s2].goalColumn = r2[s2]; }), findWordAt: function(t5) { var e4 = Zt(this.doc, t5.line).text, n4 = t5.ch, o3 = t5.ch; if (e4) { var r2 = this.getHelper(t5, "wordChars"); "before" != t5.sticky && o3 != e4.length || !n4 ? ++o3 : --n4; for (var i2 = e4.charAt(n4), s2 = ot(i2, r2) ? function(t6) { return ot(t6, r2); } : /\s/.test(i2) ? function(t6) { return /\s/.test(t6); } : function(t6) { return !/\s/.test(t6) && !ot(t6); }; n4 > 0 && s2(e4.charAt(n4 - 1)); ) --n4; for (; o3 < e4.length && s2(e4.charAt(o3)); ) ++o3; } return new ai(se(t5.line, n4), se(t5.line, o3)); }, toggleOverwrite: function(t5) { null != t5 && t5 == this.state.overwrite || ((this.state.overwrite = !this.state.overwrite) ? D(this.display.cursorDiv, "CodeMirror-overwrite") : k(this.display.cursorDiv, "CodeMirror-overwrite"), mt(this, "overwriteToggle", this, this.state.overwrite)); }, hasFocus: function() { return this.display.input.getField() == L(); }, isReadOnly: function() { return !(!this.options.readOnly && !this.doc.cantEdit); }, scrollTo: Nr(function(t5, e4) { ur(this, t5, e4); }), getScrollInfo: function() { var t5 = this.display.scroller; return { left: t5.scrollLeft, top: t5.scrollTop, height: t5.scrollHeight - Yn(this) - this.display.barHeight, width: t5.scrollWidth - Yn(this) - this.display.barWidth, clientHeight: Jn(this), clientWidth: Xn(this) }; }, scrollIntoView: Nr(function(t5, e4) { null == t5 ? (t5 = { from: this.doc.sel.primary().head, to: null }, null == e4 && (e4 = this.options.cursorScrollMargin)) : "number" == typeof t5 ? t5 = { from: se(t5, 0), to: null } : null == t5.from && (t5 = { from: t5, to: null }), t5.to || (t5.to = t5.from), t5.margin = e4 || 0, null != t5.from.line ? pr(this, t5) : fr(this, t5.from, t5.to, t5.margin); }), setSize: Nr(function(t5, e4) { var n4 = this, o3 = function(t6) { return "number" == typeof t6 || /^\d+$/.test(String(t6)) ? t6 + "px" : t6; }; null != t5 && (this.display.wrapper.style.width = o3(t5)), null != e4 && (this.display.wrapper.style.height = o3(e4)), this.options.lineWrapping && fo(this); var r2 = this.display.viewFrom; this.doc.iter(r2, this.display.viewTo, function(t6) { if (t6.widgets) { for (var e5 = 0; e5 < t6.widgets.length; e5++) if (t6.widgets[e5].noHScroll) { Ho(n4, r2, "widget"); break; } } ++r2; }), this.curOp.forceUpdate = true, mt(this, "refresh", this); }), operation: function(t5) { return Lr(this, t5); }, startOperation: function() { return Or(this); }, endOperation: function() { return Tr(this); }, refresh: Nr(function() { var t5 = this.display.cachedTextHeight; Ro(this), this.curOp.forceUpdate = true, ho(this), ur(this, this.doc.scrollLeft, this.doc.scrollTop), Gr(this.display), (null == t5 || Math.abs(t5 - jo(this.display)) > 0.5 || this.options.lineWrapping) && Io(this), mt(this, "refresh", this); }), swapDoc: Nr(function(t5) { var e4 = this.doc; return e4.cm = null, this.state.selectingText && this.state.selectingText(), _i(this, t5), ho(this), this.display.input.reset(), ur(this, t5.scrollLeft, t5.scrollTop), this.curOp.forceScroll = true, An(this, "swapDoc", this, e4), e4; }), phrase: function(t5) { var e4 = this.options.phrases; return e4 && Object.prototype.hasOwnProperty.call(e4, t5) ? e4[t5] : t5; }, 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; } }, xt(t4), t4.registerHelper = function(e4, o3, r2) { n3.hasOwnProperty(e4) || (n3[e4] = t4[e4] = { _global: [] }), n3[e4][o3] = r2; }, t4.registerGlobalHelper = function(e4, o3, r2, i2) { t4.registerHelper(e4, o3, i2), n3[e4]._global.push({ pred: r2, val: i2 }); }; } function Ja(t4, e3, n3, o3, r2) { var i2 = e3, s2 = n3, a2 = Zt(t4, e3.line), l2 = r2 && "rtl" == t4.direction ? -n3 : n3; function c2() { var n4 = e3.line + l2; return !(n4 < t4.first || n4 >= t4.first + t4.size) && (e3 = new se(n4, e3.ch, e3.sticky), a2 = Zt(t4, n4)); } function u2(i3) { var s3; if ("codepoint" == o3) { var u3 = a2.text.charCodeAt(e3.ch + (n3 > 0 ? 0 : -1)); if (isNaN(u3)) s3 = null; else { var p3 = n3 > 0 ? u3 >= 55296 && u3 < 56320 : u3 >= 56320 && u3 < 57343; s3 = new se(e3.line, Math.max(0, Math.min(a2.text.length, e3.ch + n3 * (p3 ? 2 : 1))), -n3); } } else s3 = r2 ? Js(t4.cm, a2, e3, n3) : Ys(a2, e3, n3); if (null == s3) { if (i3 || !c2()) return false; e3 = Xs(r2, t4.cm, a2, e3.line, l2); } else e3 = s3; return true; } if ("char" == o3 || "codepoint" == o3) u2(); else if ("column" == o3) u2(true); else if ("word" == o3 || "group" == o3) for (var p2 = null, d2 = "group" == o3, f2 = t4.cm && t4.cm.getHelper(e3, "wordChars"), h2 = true; !(n3 < 0) || u2(!h2); h2 = false) { var g2 = a2.text.charAt(e3.ch) || "\n", v2 = ot(g2, f2) ? "w" : d2 && "\n" == g2 ? "n" : !d2 || /\s/.test(g2) ? null : "p"; if (!d2 || h2 || v2 || (v2 = "s"), p2 && p2 != v2) { n3 < 0 && (n3 = 1, u2(), e3.sticky = "after"); break; } if (v2 && (p2 = v2), n3 > 0 && !u2(!h2)) break; } var y2 = Yi(t4, e3, i2, s2, true); return le(i2, y2) && (y2.hitSide = true), y2; } function Za(t4, e3, n3, o3) { var r2, i2, s2 = t4.doc, a2 = e3.left; if ("page" == o3) { var l2 = Math.min(t4.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight), c2 = Math.max(l2 - 0.5 * jo(t4.display), 3); r2 = (n3 > 0 ? e3.bottom : e3.top) + n3 * c2; } else "line" == o3 && (r2 = n3 > 0 ? e3.bottom + 3 : e3.top - 3); for (; (i2 = So(t4, a2, r2)).outside; ) { if (n3 < 0 ? r2 <= 0 : r2 >= s2.height) { i2.hitSide = true; break; } r2 += 5 * n3; } return i2; } var Qa = function(t4) { this.cm = t4, this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null, this.polling = new H(), this.composing = null, this.gracePeriod = false, this.readDOMTimeout = null; }; function tl(t4, e3) { var n3 = no(t4, e3.line); if (!n3 || n3.hidden) return null; var o3 = Zt(t4.doc, e3.line), r2 = Qn(n3, o3, e3.line), i2 = ft(o3, t4.doc.direction), s2 = "left"; i2 && (s2 = pt(i2, e3.ch) % 2 ? "right" : "left"); var a2 = ao(r2.map, e3.ch, s2); return a2.offset = "right" == a2.collapse ? a2.end : a2.start, a2; } function el(t4) { for (var e3 = t4; e3; e3 = e3.parentNode) if (/CodeMirror-gutter-wrapper/.test(e3.className)) return true; return false; } function nl(t4, e3) { return e3 && (t4.bad = true), t4; } function ol(t4, e3, n3, o3, r2) { var i2 = "", s2 = false, a2 = t4.doc.lineSeparator(), l2 = false; function c2(t5) { return function(e4) { return e4.id == t5; }; } function u2() { s2 && (i2 += a2, l2 && (i2 += a2), s2 = l2 = false); } function p2(t5) { t5 && (u2(), i2 += t5); } function d2(e4) { if (1 == e4.nodeType) { var n4 = e4.getAttribute("cm-text"); if (n4) return void p2(n4); var i3, f2 = e4.getAttribute("cm-marker"); if (f2) { var h2 = t4.findMarks(se(o3, 0), se(r2 + 1, 0), c2(+f2)); return void (h2.length && (i3 = h2[0].find(0)) && p2(Qt(t4.doc, i3.from, i3.to).join(a2))); } if ("false" == e4.getAttribute("contenteditable")) return; var g2 = /^(pre|div|p|li|table|br)$/i.test(e4.nodeName); if (!/^br$/i.test(e4.nodeName) && 0 == e4.textContent.length) return; g2 && u2(); for (var v2 = 0; v2 < e4.childNodes.length; v2++) d2(e4.childNodes[v2]); /^(pre|p)$/i.test(e4.nodeName) && (l2 = true), g2 && (s2 = true); } else 3 == e4.nodeType && p2(e4.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); } for (; d2(e3), e3 != n3; ) e3 = e3.nextSibling, l2 = false; return i2; } function rl(t4, e3, n3) { var o3; if (e3 == t4.display.lineDiv) { if (!(o3 = t4.display.lineDiv.childNodes[n3])) return nl(t4.clipPos(se(t4.display.viewTo - 1)), true); e3 = null, n3 = 0; } else for (o3 = e3; ; o3 = o3.parentNode) { if (!o3 || o3 == t4.display.lineDiv) return null; if (o3.parentNode && o3.parentNode == t4.display.lineDiv) break; } for (var r2 = 0; r2 < t4.display.view.length; r2++) { var i2 = t4.display.view[r2]; if (i2.node == o3) return il(i2, e3, n3); } } function il(t4, e3, n3) { var o3 = t4.text.firstChild, r2 = false; if (!e3 || !M(o3, e3)) return nl(se(ne(t4.line), 0), true); if (e3 == o3 && (r2 = true, e3 = o3.childNodes[n3], n3 = 0, !e3)) { var i2 = t4.rest ? X(t4.rest) : t4.line; return nl(se(ne(i2), i2.text.length), r2); } var s2 = 3 == e3.nodeType ? e3 : null, a2 = e3; for (s2 || 1 != e3.childNodes.length || 3 != e3.firstChild.nodeType || (s2 = e3.firstChild, n3 && (n3 = s2.nodeValue.length)); a2.parentNode != o3; ) a2 = a2.parentNode; var l2 = t4.measure, c2 = l2.maps; function u2(e4, n4, o4) { for (var r3 = -1; r3 < (c2 ? c2.length : 0); r3++) for (var i3 = r3 < 0 ? l2.map : c2[r3], s3 = 0; s3 < i3.length; s3 += 3) { var a3 = i3[s3 + 2]; if (a3 == e4 || a3 == n4) { var u3 = ne(r3 < 0 ? t4.line : t4.rest[r3]), p3 = i3[s3] + o4; return (o4 < 0 || a3 != e4) && (p3 = i3[s3 + (o4 ? 1 : 0)]), se(u3, p3); } } } var p2 = u2(s2, a2, n3); if (p2) return nl(p2, r2); for (var d2 = a2.nextSibling, f2 = s2 ? s2.nodeValue.length - n3 : 0; d2; d2 = d2.nextSibling) { if (p2 = u2(d2, d2.firstChild, 0)) return nl(se(p2.line, p2.ch - f2), r2); f2 += d2.textContent.length; } for (var h2 = a2.previousSibling, g2 = n3; h2; h2 = h2.previousSibling) { if (p2 = u2(h2, h2.firstChild, -1)) return nl(se(p2.line, p2.ch + g2), r2); g2 += h2.textContent.length; } } Qa.prototype.init = function(t4) { var e3 = this, n3 = this, o3 = n3.cm, r2 = n3.div = t4.lineDiv; function i2(t5) { for (var e4 = t5.target; e4; e4 = e4.parentNode) { if (e4 == r2) return true; if (/\bCodeMirror-(?:line)?widget\b/.test(e4.className)) break; } return false; } function s2(t5) { if (i2(t5) && !bt(o3, t5)) { if (o3.somethingSelected()) Ua({ lineWise: false, text: o3.getSelections() }), "cut" == t5.type && o3.replaceSelection("", null, "cut"); else { if (!o3.options.lineWiseCopyCut) return; var e4 = Ga(o3); Ua({ lineWise: true, text: e4.text }), "cut" == t5.type && o3.operation(function() { o3.setSelections(e4.ranges, 0, W), o3.replaceSelection("", null, "cut"); }); } if (t5.clipboardData) { t5.clipboardData.clearData(); var s3 = Ba.text.join("\n"); if (t5.clipboardData.setData("Text", s3), t5.clipboardData.getData("Text") == s3) return void t5.preventDefault(); } var a2 = Ya(), l2 = a2.firstChild; o3.display.lineSpace.insertBefore(a2, o3.display.lineSpace.firstChild), l2.value = Ba.text.join("\n"); var c2 = L(); I(l2), setTimeout(function() { o3.display.lineSpace.removeChild(a2), c2.focus(), c2 == r2 && n3.showPrimarySelection(); }, 50); } } r2.contentEditable = true, Ka(r2, o3.options.spellcheck, o3.options.autocorrect, o3.options.autocapitalize), gt(r2, "paste", function(t5) { !i2(t5) || bt(o3, t5) || $a(t5, o3) || a <= 11 && setTimeout(Dr(o3, function() { return e3.updateFromDOM(); }), 20); }), gt(r2, "compositionstart", function(t5) { e3.composing = { data: t5.data, done: false }; }), gt(r2, "compositionupdate", function(t5) { e3.composing || (e3.composing = { data: t5.data, done: false }); }), gt(r2, "compositionend", function(t5) { e3.composing && (t5.data != e3.composing.data && e3.readFromDOMSoon(), e3.composing.done = true); }), gt(r2, "touchstart", function() { return n3.forceCompositionEnd(); }), gt(r2, "input", function() { e3.composing || e3.readFromDOMSoon(); }), gt(r2, "copy", s2), gt(r2, "cut", s2); }, Qa.prototype.screenReaderLabelChanged = function(t4) { t4 ? this.div.setAttribute("aria-label", t4) : this.div.removeAttribute("aria-label"); }, Qa.prototype.prepareSelection = function() { var t4 = qo(this.cm, false); return t4.focus = L() == this.div, t4; }, Qa.prototype.showSelection = function(t4, e3) { t4 && this.cm.display.view.length && ((t4.focus || e3) && this.showPrimarySelection(), this.showMultipleSelections(t4)); }, Qa.prototype.getSelection = function() { return this.cm.display.wrapper.ownerDocument.getSelection(); }, Qa.prototype.showPrimarySelection = function() { var t4 = this.getSelection(), e3 = this.cm, o3 = e3.doc.sel.primary(), r2 = o3.from(), i2 = o3.to(); if (e3.display.viewTo == e3.display.viewFrom || r2.line >= e3.display.viewTo || i2.line < e3.display.viewFrom) t4.removeAllRanges(); else { var s2 = rl(e3, t4.anchorNode, t4.anchorOffset), a2 = rl(e3, t4.focusNode, t4.focusOffset); if (!s2 || s2.bad || !a2 || a2.bad || 0 != ae(pe(s2, a2), r2) || 0 != ae(ue(s2, a2), i2)) { var l2 = e3.display.view, c2 = r2.line >= e3.display.viewFrom && tl(e3, r2) || { node: l2[0].measure.map[2], offset: 0 }, u2 = i2.line < e3.display.viewTo && tl(e3, i2); if (!u2) { var p2 = l2[l2.length - 1].measure, d2 = p2.maps ? p2.maps[p2.maps.length - 1] : p2.map; u2 = { node: d2[d2.length - 1], offset: d2[d2.length - 2] - d2[d2.length - 3] }; } if (c2 && u2) { var f2, h2 = t4.rangeCount && t4.getRangeAt(0); try { f2 = T(c2.node, c2.offset, u2.offset, u2.node); } catch (t5) { } f2 && (!n2 && e3.state.focused ? (t4.collapse(c2.node, c2.offset), f2.collapsed || (t4.removeAllRanges(), t4.addRange(f2))) : (t4.removeAllRanges(), t4.addRange(f2)), h2 && null == t4.anchorNode ? t4.addRange(h2) : n2 && this.startGracePeriod()), this.rememberSelection(); } else t4.removeAllRanges(); } } }, Qa.prototype.startGracePeriod = function() { var t4 = this; clearTimeout(this.gracePeriod), this.gracePeriod = setTimeout(function() { t4.gracePeriod = false, t4.selectionChanged() && t4.cm.operation(function() { return t4.cm.curOp.selectionChanged = true; }); }, 20); }, Qa.prototype.showMultipleSelections = function(t4) { E(this.cm.display.cursorDiv, t4.cursors), E(this.cm.display.selectionDiv, t4.selection); }, Qa.prototype.rememberSelection = function() { var t4 = this.getSelection(); this.lastAnchorNode = t4.anchorNode, this.lastAnchorOffset = t4.anchorOffset, this.lastFocusNode = t4.focusNode, this.lastFocusOffset = t4.focusOffset; }, Qa.prototype.selectionInEditor = function() { var t4 = this.getSelection(); if (!t4.rangeCount) return false; var e3 = t4.getRangeAt(0).commonAncestorContainer; return M(this.div, e3); }, Qa.prototype.focus = function() { "nocursor" != this.cm.options.readOnly && (this.selectionInEditor() && L() == this.div || this.showSelection(this.prepareSelection(), true), this.div.focus()); }, Qa.prototype.blur = function() { this.div.blur(); }, Qa.prototype.getField = function() { return this.div; }, Qa.prototype.supportsTouch = function() { return true; }, Qa.prototype.receivedFocus = function() { var t4 = this, e3 = this; function n3() { e3.cm.state.focused && (e3.pollSelection(), e3.polling.set(e3.cm.options.pollInterval, n3)); } this.selectionInEditor() ? setTimeout(function() { return t4.pollSelection(); }, 20) : Lr(this.cm, function() { return e3.cm.curOp.selectionChanged = true; }), this.polling.set(this.cm.options.pollInterval, n3); }, Qa.prototype.selectionChanged = function() { var t4 = this.getSelection(); return t4.anchorNode != this.lastAnchorNode || t4.anchorOffset != this.lastAnchorOffset || t4.focusNode != this.lastFocusNode || t4.focusOffset != this.lastFocusOffset; }, Qa.prototype.pollSelection = function() { if (null == this.readDOMTimeout && !this.gracePeriod && this.selectionChanged()) { var t4 = this.getSelection(), e3 = this.cm; if (y && u && this.cm.display.gutterSpecs.length && el(t4.anchorNode)) return this.cm.triggerOnKeyDown({ type: "keydown", keyCode: 8, preventDefault: Math.abs }), this.blur(), void this.focus(); if (!this.composing) { this.rememberSelection(); var n3 = rl(e3, t4.anchorNode, t4.anchorOffset), o3 = rl(e3, t4.focusNode, t4.focusOffset); n3 && o3 && Lr(e3, function() { Ui(e3.doc, ci(n3, o3), W), (n3.bad || o3.bad) && (e3.curOp.selectionChanged = true); }); } } }, Qa.prototype.pollContent = function() { null != this.readDOMTimeout && (clearTimeout(this.readDOMTimeout), this.readDOMTimeout = null); var t4, e3, n3, o3 = this.cm, r2 = o3.display, i2 = o3.doc.sel.primary(), s2 = i2.from(), a2 = i2.to(); if (0 == s2.ch && s2.line > o3.firstLine() && (s2 = se(s2.line - 1, Zt(o3.doc, s2.line - 1).length)), a2.ch == Zt(o3.doc, a2.line).text.length && a2.line < o3.lastLine() && (a2 = se(a2.line + 1, 0)), s2.line < r2.viewFrom || a2.line > r2.viewTo - 1) return false; s2.line == r2.viewFrom || 0 == (t4 = Vo(o3, s2.line)) ? (e3 = ne(r2.view[0].line), n3 = r2.view[0].node) : (e3 = ne(r2.view[t4].line), n3 = r2.view[t4 - 1].node.nextSibling); var l2, c2, u2 = Vo(o3, a2.line); if (u2 == r2.view.length - 1 ? (l2 = r2.viewTo - 1, c2 = r2.lineDiv.lastChild) : (l2 = ne(r2.view[u2 + 1].line) - 1, c2 = r2.view[u2 + 1].node.previousSibling), !n3) return false; for (var p2 = o3.doc.splitLines(ol(o3, n3, c2, e3, l2)), d2 = Qt(o3.doc, se(e3, 0), se(l2, Zt(o3.doc, l2).text.length)); p2.length > 1 && d2.length > 1; ) if (X(p2) == X(d2)) p2.pop(), d2.pop(), l2--; else { if (p2[0] != d2[0]) break; p2.shift(), d2.shift(), e3++; } for (var f2 = 0, h2 = 0, g2 = p2[0], v2 = d2[0], y2 = Math.min(g2.length, v2.length); f2 < y2 && g2.charCodeAt(f2) == v2.charCodeAt(f2); ) ++f2; for (var m2 = X(p2), b2 = X(d2), _2 = Math.min(m2.length - (1 == p2.length ? f2 : 0), b2.length - (1 == d2.length ? f2 : 0)); h2 < _2 && m2.charCodeAt(m2.length - h2 - 1) == b2.charCodeAt(b2.length - h2 - 1); ) ++h2; if (1 == p2.length && 1 == d2.length && e3 == s2.line) for (; f2 && f2 > s2.ch && m2.charCodeAt(m2.length - h2 - 1) == b2.charCodeAt(b2.length - h2 - 1); ) f2--, h2++; p2[p2.length - 1] = m2.slice(0, m2.length - h2).replace(/^\u200b+/, ""), p2[0] = p2[0].slice(f2).replace(/\u200b+$/, ""); var w2 = se(e3, f2), x2 = se(l2, d2.length ? X(d2).length - h2 : 0); return p2.length > 1 || p2[0] || ae(w2, x2) ? (is(o3.doc, p2, w2, x2, "+input"), true) : void 0; }, Qa.prototype.ensurePolled = function() { this.forceCompositionEnd(); }, Qa.prototype.reset = function() { this.forceCompositionEnd(); }, Qa.prototype.forceCompositionEnd = function() { this.composing && (clearTimeout(this.readDOMTimeout), this.composing = null, this.updateFromDOM(), this.div.blur(), this.div.focus()); }, Qa.prototype.readFromDOMSoon = function() { var t4 = this; null == this.readDOMTimeout && (this.readDOMTimeout = setTimeout(function() { if (t4.readDOMTimeout = null, t4.composing) { if (!t4.composing.done) return; t4.composing = null; } t4.updateFromDOM(); }, 80)); }, Qa.prototype.updateFromDOM = function() { var t4 = this; !this.cm.isReadOnly() && this.pollContent() || Lr(this.cm, function() { return Ro(t4.cm); }); }, Qa.prototype.setUneditable = function(t4) { t4.contentEditable = "false"; }, Qa.prototype.onKeyPress = function(t4) { 0 == t4.charCode || this.composing || (t4.preventDefault(), this.cm.isReadOnly() || Dr(this.cm, Wa)(this.cm, String.fromCharCode(null == t4.charCode ? t4.keyCode : t4.charCode), 0)); }, Qa.prototype.readOnlyChanged = function(t4) { this.div.contentEditable = String("nocursor" != t4); }, Qa.prototype.onContextMenu = function() { }, Qa.prototype.resetPosition = function() { }, Qa.prototype.needsContentAttribute = true; var sl = function(t4) { this.cm = t4, this.prevInput = "", this.pollingFast = false, this.polling = new H(), this.hasSelection = false, this.composing = null; }; function al(t4, e3) { if ((e3 = e3 ? V(e3) : {}).value = t4.value, !e3.tabindex && t4.tabIndex && (e3.tabindex = t4.tabIndex), !e3.placeholder && t4.placeholder && (e3.placeholder = t4.placeholder), null == e3.autofocus) { var n3 = L(); e3.autofocus = n3 == t4 || null != t4.getAttribute("autofocus") && n3 == document.body; } function o3() { t4.value = a2.getValue(); } var r2; if (t4.form && (gt(t4.form, "submit", o3), !e3.leaveSubmitMethodAlone)) { var i2 = t4.form; r2 = i2.submit; try { var s2 = i2.submit = function() { o3(), i2.submit = r2, i2.submit(), i2.submit = s2; }; } catch (t5) { } } e3.finishInit = function(n4) { n4.save = o3, n4.getTextArea = function() { return t4; }, n4.toTextArea = function() { n4.toTextArea = isNaN, o3(), t4.parentNode.removeChild(n4.getWrapperElement()), t4.style.display = "", t4.form && (yt(t4.form, "submit", o3), e3.leaveSubmitMethodAlone || "function" != typeof t4.form.submit || (t4.form.submit = r2)); }; }, t4.style.display = "none"; var a2 = Va(function(e4) { return t4.parentNode.insertBefore(e4, t4.nextSibling); }, e3); return a2; } function ll(t4) { t4.off = yt, t4.on = gt, t4.wheelEventPixels = ri, t4.Doc = Ss, t4.splitLines = Nt, t4.countColumn = R, t4.findColumn = G, t4.isWordChar = nt, t4.Pass = U, t4.signal = mt, t4.Line = un, t4.changeEnd = ui, t4.scrollbarModel = xr, t4.Pos = se, t4.cmpPos = ae, t4.modes = Ht, t4.mimeModes = zt, t4.resolveMode = Wt, t4.getMode = $t, t4.modeExtensions = qt, t4.extendMode = Gt, t4.copyState = Kt, t4.startState = Xt, t4.innerMode = Yt, t4.commands = Zs, t4.keyMap = Rs, t4.keyName = $s, t4.isModifierKey = Us, t4.lookupKey = Bs, t4.normalizeKeyMap = zs, t4.StringStream = Jt, t4.SharedTextMarker = ms, t4.TextMarker = vs, t4.LineWidget = ds, t4.e_preventDefault = Ct, t4.e_stopPropagation = St, t4.e_stop = Tt, t4.addClass = D, t4.contains = M, t4.rmClass = k, t4.keyNames = Ns; } sl.prototype.init = function(t4) { var e3 = this, n3 = this, o3 = this.cm; this.createField(t4); var r2 = this.textarea; function i2(t5) { if (!bt(o3, t5)) { if (o3.somethingSelected()) Ua({ lineWise: false, text: o3.getSelections() }); else { if (!o3.options.lineWiseCopyCut) return; var e4 = Ga(o3); Ua({ lineWise: true, text: e4.text }), "cut" == t5.type ? o3.setSelections(e4.ranges, null, W) : (n3.prevInput = "", r2.value = e4.text.join("\n"), I(r2)); } "cut" == t5.type && (o3.state.cutIncoming = +/* @__PURE__ */ new Date()); } } t4.wrapper.insertBefore(this.wrapper, t4.wrapper.firstChild), v && (r2.style.width = "0px"), gt(r2, "input", function() { s && a >= 9 && e3.hasSelection && (e3.hasSelection = null), n3.poll(); }), gt(r2, "paste", function(t5) { bt(o3, t5) || $a(t5, o3) || (o3.state.pasteIncoming = +/* @__PURE__ */ new Date(), n3.fastPoll()); }), gt(r2, "cut", i2), gt(r2, "copy", i2), gt(t4.scroller, "paste", function(e4) { if (!$n(t4, e4) && !bt(o3, e4)) { if (!r2.dispatchEvent) return o3.state.pasteIncoming = +/* @__PURE__ */ new Date(), void n3.focus(); var i3 = new Event("paste"); i3.clipboardData = e4.clipboardData, r2.dispatchEvent(i3); } }), gt(t4.lineSpace, "selectstart", function(e4) { $n(t4, e4) || Ct(e4); }), gt(r2, "compositionstart", function() { var t5 = o3.getCursor("from"); n3.composing && n3.composing.range.clear(), n3.composing = { start: t5, range: o3.markText(t5, o3.getCursor("to"), { className: "CodeMirror-composing" }) }; }), gt(r2, "compositionend", function() { n3.composing && (n3.poll(), n3.composing.range.clear(), n3.composing = null); }); }, sl.prototype.createField = function(t4) { this.wrapper = Ya(), this.textarea = this.wrapper.firstChild; }, sl.prototype.screenReaderLabelChanged = function(t4) { t4 ? this.textarea.setAttribute("aria-label", t4) : this.textarea.removeAttribute("aria-label"); }, sl.prototype.prepareSelection = function() { var t4 = this.cm, e3 = t4.display, n3 = t4.doc, o3 = qo(t4); if (t4.options.moveInputWithCursor) { var r2 = wo(t4, n3.sel.primary().head, "div"), i2 = e3.wrapper.getBoundingClientRect(), s2 = e3.lineDiv.getBoundingClientRect(); o3.teTop = Math.max(0, Math.min(e3.wrapper.clientHeight - 10, r2.top + s2.top - i2.top)), o3.teLeft = Math.max(0, Math.min(e3.wrapper.clientWidth - 10, r2.left + s2.left - i2.left)); } return o3; }, sl.prototype.showSelection = function(t4) { var e3 = this.cm.display; E(e3.cursorDiv, t4.cursors), E(e3.selectionDiv, t4.selection), null != t4.teTop && (this.wrapper.style.top = t4.teTop + "px", this.wrapper.style.left = t4.teLeft + "px"); }, sl.prototype.reset = function(t4) { if (!this.contextMenuPending && !this.composing) { var e3 = this.cm; if (e3.somethingSelected()) { this.prevInput = ""; var n3 = e3.getSelection(); this.textarea.value = n3, e3.state.focused && I(this.textarea), s && a >= 9 && (this.hasSelection = n3); } else t4 || (this.prevInput = this.textarea.value = "", s && a >= 9 && (this.hasSelection = null)); } }, sl.prototype.getField = function() { return this.textarea; }, sl.prototype.supportsTouch = function() { return false; }, sl.prototype.focus = function() { if ("nocursor" != this.cm.options.readOnly && (!m || L() != this.textarea)) try { this.textarea.focus(); } catch (t4) { } }, sl.prototype.blur = function() { this.textarea.blur(); }, sl.prototype.resetPosition = function() { this.wrapper.style.top = this.wrapper.style.left = 0; }, sl.prototype.receivedFocus = function() { this.slowPoll(); }, sl.prototype.slowPoll = function() { var t4 = this; this.pollingFast || this.polling.set(this.cm.options.pollInterval, function() { t4.poll(), t4.cm.state.focused && t4.slowPoll(); }); }, sl.prototype.fastPoll = function() { var t4 = false, e3 = this; function n3() { e3.poll() || t4 ? (e3.pollingFast = false, e3.slowPoll()) : (t4 = true, e3.polling.set(60, n3)); } e3.pollingFast = true, e3.polling.set(20, n3); }, sl.prototype.poll = function() { var t4 = this, e3 = this.cm, n3 = this.textarea, o3 = this.prevInput; if (this.contextMenuPending || !e3.state.focused || It(n3) && !o3 && !this.composing || e3.isReadOnly() || e3.options.disableInput || e3.state.keySeq) return false; var r2 = n3.value; if (r2 == o3 && !e3.somethingSelected()) return false; if (s && a >= 9 && this.hasSelection === r2 || b && /[\uf700-\uf7ff]/.test(r2)) return e3.display.input.reset(), false; if (e3.doc.sel == e3.display.selForContextMenu) { var i2 = r2.charCodeAt(0); if (8203 != i2 || o3 || (o3 = "​"), 8666 == i2) return this.reset(), this.cm.execCommand("undo"); } for (var l2 = 0, c2 = Math.min(o3.length, r2.length); l2 < c2 && o3.charCodeAt(l2) == r2.charCodeAt(l2); ) ++l2; return Lr(e3, function() { Wa(e3, r2.slice(l2), o3.length - l2, null, t4.composing ? "*compose" : null), r2.length > 1e3 || r2.indexOf("\n") > -1 ? n3.value = t4.prevInput = "" : t4.prevInput = r2, t4.composing && (t4.composing.range.clear(), t4.composing.range = e3.markText(t4.composing.start, e3.getCursor("to"), { className: "CodeMirror-composing" })); }), true; }, sl.prototype.ensurePolled = function() { this.pollingFast && this.poll() && (this.pollingFast = false); }, sl.prototype.onKeyPress = function() { s && a >= 9 && (this.hasSelection = null), this.fastPoll(); }, sl.prototype.onContextMenu = function(t4) { var e3 = this, n3 = e3.cm, o3 = n3.display, r2 = e3.textarea; e3.contextMenuPending && e3.contextMenuPending(); var i2 = Fo(n3, t4), c2 = o3.scroller.scrollTop; if (i2 && !d) { n3.options.resetSelectionOnContextMenu && -1 == n3.doc.sel.contains(i2) && Dr(n3, Ui)(n3.doc, ci(i2), W); var u2, p2 = r2.style.cssText, f2 = e3.wrapper.style.cssText, h2 = e3.wrapper.offsetParent.getBoundingClientRect(); if (e3.wrapper.style.cssText = "position: static", r2.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (t4.clientY - h2.top - 5) + "px; left: " + (t4.clientX - h2.left - 5) + "px;\n z-index: 1000; background: " + (s ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);", l && (u2 = window.scrollY), o3.input.focus(), l && window.scrollTo(null, u2), o3.input.reset(), n3.somethingSelected() || (r2.value = e3.prevInput = " "), e3.contextMenuPending = y2, o3.selForContextMenu = n3.doc.sel, clearTimeout(o3.detectingSelectAll), s && a >= 9 && v2(), S) { Tt(t4); var g2 = function() { yt(window, "mouseup", g2), setTimeout(y2, 20); }; gt(window, "mouseup", g2); } else setTimeout(y2, 50); } function v2() { if (null != r2.selectionStart) { var t5 = n3.somethingSelected(), i3 = "​" + (t5 ? r2.value : ""); r2.value = "⇚", r2.value = i3, e3.prevInput = t5 ? "" : "​", r2.selectionStart = 1, r2.selectionEnd = i3.length, o3.selForContextMenu = n3.doc.sel; } } function y2() { if (e3.contextMenuPending == y2 && (e3.contextMenuPending = false, e3.wrapper.style.cssText = f2, r2.style.cssText = p2, s && a < 9 && o3.scrollbars.setScrollTop(o3.scroller.scrollTop = c2), null != r2.selectionStart)) { (!s || s && a < 9) && v2(); var t5 = 0, i3 = function() { o3.selForContextMenu == n3.doc.sel && 0 == r2.selectionStart && r2.selectionEnd > 0 && "​" == e3.prevInput ? Dr(n3, Ji)(n3) : t5++ < 10 ? o3.detectingSelectAll = setTimeout(i3, 500) : (o3.selForContextMenu = null, o3.input.reset()); }; o3.detectingSelectAll = setTimeout(i3, 200); } } }, sl.prototype.readOnlyChanged = function(t4) { t4 || this.reset(), this.textarea.disabled = "nocursor" == t4, this.textarea.readOnly = !!t4; }, sl.prototype.setUneditable = function() { }, sl.prototype.needsContentAttribute = false, Na(Va), Xa(Va); var cl = "iter insert remove copy getEditor constructor".split(" "); for (var ul in Ss.prototype) Ss.prototype.hasOwnProperty(ul) && z(cl, ul) < 0 && (Va.prototype[ul] = function(t4) { return function() { return t4.apply(this.doc, arguments); }; }(Ss.prototype[ul])); return xt(Ss), Va.inputStyles = { textarea: sl, contenteditable: Qa }, Va.defineMode = function(t4) { Va.defaults.mode || "null" == t4 || (Va.defaults.mode = t4), Bt.apply(this, arguments); }, Va.defineMIME = Ut, Va.defineMode("null", function() { return { token: function(t4) { return t4.skipToEnd(); } }; }), Va.defineMIME("text/plain", "null"), Va.defineExtension = function(t4, e3) { Va.prototype[t4] = e3; }, Va.defineDocExtension = function(t4, e3) { Ss.prototype[t4] = e3; }, Va.fromTextArea = al, ll(Va), Va.version = "5.65.6", Va; }(); }, 629: (t2, e2, n2) => { (function(t3) { function e3(t4) { for (var e4 = {}, n4 = 0; n4 < t4.length; ++n4) e4[t4[n4].toLowerCase()] = true; return e4; } t3.defineMode("css", function(e4, n4) { var o3 = n4.inline; n4.propertyKeywords || (n4 = t3.resolveMode("text/css")); var r2, i2, s2 = e4.indentUnit, a2 = n4.tokenHooks, l2 = n4.documentTypes || {}, c2 = n4.mediaTypes || {}, u2 = n4.mediaFeatures || {}, p2 = n4.mediaValueKeywords || {}, d2 = n4.propertyKeywords || {}, f2 = n4.nonStandardPropertyKeywords || {}, h2 = n4.fontProperties || {}, g2 = n4.counterDescriptors || {}, v2 = n4.colorKeywords || {}, y2 = n4.valueKeywords || {}, m2 = n4.allowNested, b2 = n4.lineComment, _2 = true === n4.supportsAtComponent, w2 = false !== e4.highlightNonStandardPropertyKeywords; function x(t4, e5) { return r2 = e5, t4; } function C(t4, e5) { var n5 = t4.next(); if (a2[n5]) { var o4 = a2[n5](t4, e5); if (false !== o4) return o4; } return "@" == n5 ? (t4.eatWhile(/[\w\\\-]/), x("def", t4.current())) : "=" == n5 || ("~" == n5 || "|" == n5) && t4.eat("=") ? x(null, "compare") : '"' == n5 || "'" == n5 ? (e5.tokenize = S(n5), e5.tokenize(t4, e5)) : "#" == n5 ? (t4.eatWhile(/[\w\\\-]/), x("atom", "hash")) : "!" == n5 ? (t4.match(/^\s*\w*/), x("keyword", "important")) : /\d/.test(n5) || "." == n5 && t4.eat(/\d/) ? (t4.eatWhile(/[\w.%]/), x("number", "unit")) : "-" !== n5 ? /[,+>*\/]/.test(n5) ? x(null, "select-op") : "." == n5 && t4.match(/^-?[_a-z][_a-z0-9-]*/i) ? x("qualifier", "qualifier") : /[:;{}\[\]\(\)]/.test(n5) ? x(null, n5) : t4.match(/^[\w-.]+(?=\()/) ? (/^(url(-prefix)?|domain|regexp)$/i.test(t4.current()) && (e5.tokenize = O), x("variable callee", "variable")) : /[\w\\\-]/.test(n5) ? (t4.eatWhile(/[\w\\\-]/), x("property", "word")) : x(null, null) : /[\d.]/.test(t4.peek()) ? (t4.eatWhile(/[\w.%]/), x("number", "unit")) : t4.match(/^-[\w\\\-]*/) ? (t4.eatWhile(/[\w\\\-]/), t4.match(/^\s*:/, false) ? x("variable-2", "variable-definition") : x("variable-2", "variable")) : t4.match(/^\w+-/) ? x("meta", "meta") : void 0; } function S(t4) { return function(e5, n5) { for (var o4, r3 = false; null != (o4 = e5.next()); ) { if (o4 == t4 && !r3) { ")" == t4 && e5.backUp(1); break; } r3 = !r3 && "\\" == o4; } return (o4 == t4 || !r3 && ")" != t4) && (n5.tokenize = null), x("string", "string"); }; } function O(t4, e5) { return t4.next(), t4.match(/^\s*[\"\')]/, false) ? e5.tokenize = null : e5.tokenize = S(")"), x(null, "("); } function T(t4, e5, n5) { this.type = t4, this.indent = e5, this.prev = n5; } function k(t4, e5, n5, o4) { return t4.context = new T(n5, e5.indentation() + (false === o4 ? 0 : s2), t4.context), n5; } function P(t4) { return t4.context.prev && (t4.context = t4.context.prev), t4.context.type; } function E(t4, e5, n5) { return M[n5.context.type](t4, e5, n5); } function A(t4, e5, n5, o4) { for (var r3 = o4 || 1; r3 > 0; r3--) n5.context = n5.context.prev; return E(t4, e5, n5); } function j(t4) { var e5 = t4.current().toLowerCase(); i2 = y2.hasOwnProperty(e5) ? "atom" : v2.hasOwnProperty(e5) ? "keyword" : "variable"; } var M = { top: function(t4, e5, n5) { if ("{" == t4) return k(n5, e5, "block"); if ("}" == t4 && n5.context.prev) return P(n5); if (_2 && /@component/i.test(t4)) return k(n5, e5, "atComponentBlock"); if (/^@(-moz-)?document$/i.test(t4)) return k(n5, e5, "documentTypes"); if (/^@(media|supports|(-moz-)?document|import)$/i.test(t4)) return k(n5, e5, "atBlock"); if (/^@(font-face|counter-style)/i.test(t4)) return n5.stateArg = t4, "restricted_atBlock_before"; if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t4)) return "keyframes"; if (t4 && "@" == t4.charAt(0)) return k(n5, e5, "at"); if ("hash" == t4) i2 = "builtin"; else if ("word" == t4) i2 = "tag"; else { if ("variable-definition" == t4) return "maybeprop"; if ("interpolation" == t4) return k(n5, e5, "interpolation"); if (":" == t4) return "pseudo"; if (m2 && "(" == t4) return k(n5, e5, "parens"); } return n5.context.type; }, block: function(t4, e5, n5) { if ("word" == t4) { var o4 = e5.current().toLowerCase(); return d2.hasOwnProperty(o4) ? (i2 = "property", "maybeprop") : f2.hasOwnProperty(o4) ? (i2 = w2 ? "string-2" : "property", "maybeprop") : m2 ? (i2 = e5.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag", "block") : (i2 += " error", "maybeprop"); } return "meta" == t4 ? "block" : m2 || "hash" != t4 && "qualifier" != t4 ? M.top(t4, e5, n5) : (i2 = "error", "block"); }, maybeprop: function(t4, e5, n5) { return ":" == t4 ? k(n5, e5, "prop") : E(t4, e5, n5); }, prop: function(t4, e5, n5) { if (";" == t4) return P(n5); if ("{" == t4 && m2) return k(n5, e5, "propBlock"); if ("}" == t4 || "{" == t4) return A(t4, e5, n5); if ("(" == t4) return k(n5, e5, "parens"); if ("hash" != t4 || /^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e5.current())) { if ("word" == t4) j(e5); else if ("interpolation" == t4) return k(n5, e5, "interpolation"); } else i2 += " error"; return "prop"; }, propBlock: function(t4, e5, n5) { return "}" == t4 ? P(n5) : "word" == t4 ? (i2 = "property", "maybeprop") : n5.context.type; }, parens: function(t4, e5, n5) { return "{" == t4 || "}" == t4 ? A(t4, e5, n5) : ")" == t4 ? P(n5) : "(" == t4 ? k(n5, e5, "parens") : "interpolation" == t4 ? k(n5, e5, "interpolation") : ("word" == t4 && j(e5), "parens"); }, pseudo: function(t4, e5, n5) { return "meta" == t4 ? "pseudo" : "word" == t4 ? (i2 = "variable-3", n5.context.type) : E(t4, e5, n5); }, documentTypes: function(t4, e5, n5) { return "word" == t4 && l2.hasOwnProperty(e5.current()) ? (i2 = "tag", n5.context.type) : M.atBlock(t4, e5, n5); }, atBlock: function(t4, e5, n5) { if ("(" == t4) return k(n5, e5, "atBlock_parens"); if ("}" == t4 || ";" == t4) return A(t4, e5, n5); if ("{" == t4) return P(n5) && k(n5, e5, m2 ? "block" : "top"); if ("interpolation" == t4) return k(n5, e5, "interpolation"); if ("word" == t4) { var o4 = e5.current().toLowerCase(); i2 = "only" == o4 || "not" == o4 || "and" == o4 || "or" == o4 ? "keyword" : c2.hasOwnProperty(o4) ? "attribute" : u2.hasOwnProperty(o4) ? "property" : p2.hasOwnProperty(o4) ? "keyword" : d2.hasOwnProperty(o4) ? "property" : f2.hasOwnProperty(o4) ? w2 ? "string-2" : "property" : y2.hasOwnProperty(o4) ? "atom" : v2.hasOwnProperty(o4) ? "keyword" : "error"; } return n5.context.type; }, atComponentBlock: function(t4, e5, n5) { return "}" == t4 ? A(t4, e5, n5) : "{" == t4 ? P(n5) && k(n5, e5, m2 ? "block" : "top", false) : ("word" == t4 && (i2 = "error"), n5.context.type); }, atBlock_parens: function(t4, e5, n5) { return ")" == t4 ? P(n5) : "{" == t4 || "}" == t4 ? A(t4, e5, n5, 2) : M.atBlock(t4, e5, n5); }, restricted_atBlock_before: function(t4, e5, n5) { return "{" == t4 ? k(n5, e5, "restricted_atBlock") : "word" == t4 && "@counter-style" == n5.stateArg ? (i2 = "variable", "restricted_atBlock_before") : E(t4, e5, n5); }, restricted_atBlock: function(t4, e5, n5) { return "}" == t4 ? (n5.stateArg = null, P(n5)) : "word" == t4 ? (i2 = "@font-face" == n5.stateArg && !h2.hasOwnProperty(e5.current().toLowerCase()) || "@counter-style" == n5.stateArg && !g2.hasOwnProperty(e5.current().toLowerCase()) ? "error" : "property", "maybeprop") : "restricted_atBlock"; }, keyframes: function(t4, e5, n5) { return "word" == t4 ? (i2 = "variable", "keyframes") : "{" == t4 ? k(n5, e5, "top") : E(t4, e5, n5); }, at: function(t4, e5, n5) { return ";" == t4 ? P(n5) : "{" == t4 || "}" == t4 ? A(t4, e5, n5) : ("word" == t4 ? i2 = "tag" : "hash" == t4 && (i2 = "builtin"), "at"); }, interpolation: function(t4, e5, n5) { return "}" == t4 ? P(n5) : "{" == t4 || ";" == t4 ? A(t4, e5, n5) : ("word" == t4 ? i2 = "variable" : "variable" != t4 && "(" != t4 && ")" != t4 && (i2 = "error"), "interpolation"); } }; return { startState: function(t4) { return { tokenize: null, state: o3 ? "block" : "top", stateArg: null, context: new T(o3 ? "block" : "top", t4 || 0, null) }; }, token: function(t4, e5) { if (!e5.tokenize && t4.eatSpace()) return null; var n5 = (e5.tokenize || C)(t4, e5); return n5 && "object" == typeof n5 && (r2 = n5[1], n5 = n5[0]), i2 = n5, "comment" != r2 && (e5.state = M[e5.state](r2, t4, e5)), i2; }, indent: function(t4, e5) { var n5 = t4.context, o4 = e5 && e5.charAt(0), r3 = n5.indent; return "prop" != n5.type || "}" != o4 && ")" != o4 || (n5 = n5.prev), n5.prev && ("}" != o4 || "block" != n5.type && "top" != n5.type && "interpolation" != n5.type && "restricted_atBlock" != n5.type ? (")" != o4 || "parens" != n5.type && "atBlock_parens" != n5.type) && ("{" != o4 || "at" != n5.type && "atBlock" != n5.type) || (r3 = Math.max(0, n5.indent - s2)) : r3 = (n5 = n5.prev).indent), r3; }, electricChars: "}", blockCommentStart: "/*", blockCommentEnd: "*/", blockCommentContinue: " * ", lineComment: b2, fold: "brace" }; }); var n3 = ["domain", "regexp", "url", "url-prefix"], o2 = e3(n3), r = ["all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed"], i = e3(r), s = ["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"], a = e3(s), l = ["landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", "interlace", "progressive", "dark", "light", "standard", "high"], c = e3(l), u = ["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"], p = e3(u), d = ["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"], f = e3(d), h = e3(["font-display", "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", "font-stretch", "font-weight", "font-style"]), g = e3(["additive-symbols", "fallback", "negative", "pad", "prefix", "range", "speak-as", "suffix", "symbols", "system"]), v = ["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"], y = e3(v), m = ["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"], b = e3(m), _ = n3.concat(r).concat(s).concat(l).concat(u).concat(d).concat(v).concat(m); function w(t4, e4) { for (var n4, o3 = false; null != (n4 = t4.next()); ) { if (o3 && "/" == n4) { e4.tokenize = null; break; } o3 = "*" == n4; } return ["comment", "comment"]; } t3.registerHelper("hintWords", "css", _), t3.defineMIME("text/css", { documentTypes: o2, mediaTypes: i, mediaFeatures: a, mediaValueKeywords: c, propertyKeywords: p, nonStandardPropertyKeywords: f, fontProperties: h, counterDescriptors: g, colorKeywords: y, valueKeywords: b, tokenHooks: { "/": function(t4, e4) { return !!t4.eat("*") && (e4.tokenize = w, w(t4, e4)); } }, name: "css" }), t3.defineMIME("text/x-scss", { mediaTypes: i, mediaFeatures: a, mediaValueKeywords: c, propertyKeywords: p, nonStandardPropertyKeywords: f, colorKeywords: y, valueKeywords: b, fontProperties: h, allowNested: true, lineComment: "//", tokenHooks: { "/": function(t4, e4) { return t4.eat("/") ? (t4.skipToEnd(), ["comment", "comment"]) : t4.eat("*") ? (e4.tokenize = w, w(t4, e4)) : ["operator", "operator"]; }, ":": function(t4) { return !!t4.match(/^\s*\{/, false) && [null, null]; }, $: function(t4) { return t4.match(/^[\w-]+/), t4.match(/^\s*:/, false) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"]; }, "#": function(t4) { return !!t4.eat("{") && [null, "interpolation"]; } }, name: "css", helperType: "scss" }), t3.defineMIME("text/x-less", { mediaTypes: i, mediaFeatures: a, mediaValueKeywords: c, propertyKeywords: p, nonStandardPropertyKeywords: f, colorKeywords: y, valueKeywords: b, fontProperties: h, allowNested: true, lineComment: "//", tokenHooks: { "/": function(t4, e4) { return t4.eat("/") ? (t4.skipToEnd(), ["comment", "comment"]) : t4.eat("*") ? (e4.tokenize = w, w(t4, e4)) : ["operator", "operator"]; }, "@": function(t4) { return t4.eat("{") ? [null, "interpolation"] : !t4.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false) && (t4.eatWhile(/[\w\\\-]/), t4.match(/^\s*:/, false) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"]); }, "&": function() { return ["atom", "atom"]; } }, name: "css", helperType: "less" }), t3.defineMIME("text/x-gss", { documentTypes: o2, mediaTypes: i, mediaFeatures: a, propertyKeywords: p, nonStandardPropertyKeywords: f, fontProperties: h, counterDescriptors: g, colorKeywords: y, valueKeywords: b, supportsAtComponent: true, tokenHooks: { "/": function(t4, e4) { return !!t4.eat("*") && (e4.tokenize = w, w(t4, e4)); } }, name: "css", helperType: "gss" }); })(n2(631)); }, 531: (t2, e2, n2) => { (function(t3) { var e3 = { 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 n3(t4, e4, n4) { var o3 = t4.current(), r2 = o3.search(e4); return r2 > -1 ? t4.backUp(o3.length - r2) : o3.match(/<\/?$/) && (t4.backUp(o3.length), t4.match(e4, false) || t4.match(o3)), n4; } var o2 = {}; function r(t4) { var e4 = o2[t4]; return e4 || (o2[t4] = new RegExp("\\s+" + t4 + `\\s*=\\s*('|")?([^'"]+)('|")?\\s*`)); } function i(t4, e4) { var n4 = t4.match(r(e4)); return n4 ? /^\s*(.*?)\s*$/.exec(n4[2])[1] : ""; } function s(t4, e4) { return new RegExp((e4 ? "^" : "") + "", "i"); } function a(t4, e4) { for (var n4 in t4) for (var o3 = e4[n4] || (e4[n4] = []), r2 = t4[n4], i2 = r2.length - 1; i2 >= 0; i2--) o3.unshift(r2[i2]); } function l(t4, e4) { for (var n4 = 0; n4 < t4.length; n4++) { var o3 = t4[n4]; if (!o3[0] || o3[1].test(i(e4, o3[0]))) return o3[2]; } } t3.defineMode("htmlmixed", function(o3, r2) { var i2 = t3.getMode(o3, { name: "xml", htmlMode: true, multilineTagIndentFactor: r2.multilineTagIndentFactor, multilineTagIndentPastTag: r2.multilineTagIndentPastTag, allowMissingTagName: r2.allowMissingTagName }), c = {}, u = r2 && r2.tags, p = r2 && r2.scriptTypes; if (a(e3, c), u && a(u, c), p) for (var d = p.length - 1; d >= 0; d--) c.script.unshift(["type", p[d].matches, p[d].mode]); function f(e4, r3) { var a2, u2 = i2.token(e4, r3.htmlState), p2 = /\btag\b/.test(u2); if (p2 && !/[<>\s\/]/.test(e4.current()) && (a2 = r3.htmlState.tagName && r3.htmlState.tagName.toLowerCase()) && c.hasOwnProperty(a2)) r3.inTag = a2 + " "; else if (r3.inTag && p2 && />$/.test(e4.current())) { var d2 = /^([\S]+) (.*)/.exec(r3.inTag); r3.inTag = null; var h = ">" == e4.current() && l(c[d2[1]], d2[2]), g = t3.getMode(o3, h), v = s(d2[1], true), y = s(d2[1], false); r3.token = function(t4, e5) { return t4.match(v, false) ? (e5.token = f, e5.localState = e5.localMode = null, null) : n3(t4, y, e5.localMode.token(t4, e5.localState)); }, r3.localMode = g, r3.localState = t3.startState(g, i2.indent(r3.htmlState, "", "")); } else r3.inTag && (r3.inTag += e4.current(), e4.eol() && (r3.inTag += " ")); return u2; } return { startState: function() { return { token: f, inTag: null, localMode: null, localState: null, htmlState: t3.startState(i2) }; }, copyState: function(e4) { var n4; return e4.localState && (n4 = t3.copyState(e4.localMode, e4.localState)), { token: e4.token, inTag: e4.inTag, localMode: e4.localMode, localState: n4, htmlState: t3.copyState(i2, e4.htmlState) }; }, token: function(t4, e4) { return e4.token(t4, e4); }, indent: function(e4, n4, o4) { return !e4.localMode || /^\s*<\//.test(n4) ? i2.indent(e4.htmlState, n4, o4) : e4.localMode.indent ? e4.localMode.indent(e4.localState, n4, o4) : t3.Pass; }, innerMode: function(t4) { return { state: t4.localState || t4.htmlState, mode: t4.localMode || i2 }; } }; }, "xml", "javascript", "css"), t3.defineMIME("text/html", "htmlmixed"); })(n2(631), n2(589), n2(876), n2(629)); }, 876: (t2, e2, n2) => { (function(t3) { t3.defineMode("javascript", function(e3, n3) { var o2, r, i = e3.indentUnit, s = n3.statementIndent, a = n3.jsonld, l = n3.json || a, c = false !== n3.trackScope, u = n3.typescript, p = n3.wordCharacters || /[\w$\xa1-\uffff]/, d = function() { function t4(t5) { return { type: t5, style: "keyword" }; } var e4 = t4("keyword a"), n4 = t4("keyword b"), o3 = t4("keyword c"), r2 = t4("keyword d"), i2 = t4("operator"), s2 = { type: "atom", style: "atom" }; return { if: t4("if"), while: e4, with: e4, else: n4, do: n4, try: n4, finally: n4, return: r2, break: r2, continue: r2, new: t4("new"), delete: o3, void: o3, throw: o3, debugger: t4("debugger"), var: t4("var"), const: t4("var"), let: t4("var"), function: t4("function"), catch: t4("catch"), for: t4("for"), switch: t4("switch"), case: t4("case"), default: t4("default"), in: i2, typeof: i2, instanceof: i2, true: s2, false: s2, null: s2, undefined: s2, NaN: s2, Infinity: s2, this: t4("this"), class: t4("class"), super: t4("atom"), yield: o3, export: t4("export"), import: t4("import"), extends: o3, await: o3 }; }(), f = /[+\-*&%=<>!?|~^@]/, h = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; function g(t4) { for (var e4, n4 = false, o3 = false; null != (e4 = t4.next()); ) { if (!n4) { if ("/" == e4 && !o3) return; "[" == e4 ? o3 = true : o3 && "]" == e4 && (o3 = false); } n4 = !n4 && "\\" == e4; } } function v(t4, e4, n4) { return o2 = t4, r = n4, e4; } function y(t4, e4) { var n4 = t4.next(); if ('"' == n4 || "'" == n4) return e4.tokenize = m(n4), e4.tokenize(t4, e4); if ("." == n4 && t4.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) return v("number", "number"); if ("." == n4 && t4.match("..")) return v("spread", "meta"); if (/[\[\]{}\(\),;\:\.]/.test(n4)) return v(n4); if ("=" == n4 && t4.eat(">")) return v("=>", "operator"); if ("0" == n4 && t4.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) return v("number", "number"); if (/\d/.test(n4)) return t4.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/), v("number", "number"); if ("/" == n4) return t4.eat("*") ? (e4.tokenize = b, b(t4, e4)) : t4.eat("/") ? (t4.skipToEnd(), v("comment", "comment")) : re(t4, e4, 1) ? (g(t4), t4.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/), v("regexp", "string-2")) : (t4.eat("="), v("operator", "operator", t4.current())); if ("`" == n4) return e4.tokenize = _, _(t4, e4); if ("#" == n4 && "!" == t4.peek()) return t4.skipToEnd(), v("meta", "meta"); if ("#" == n4 && t4.eatWhile(p)) return v("variable", "property"); if ("<" == n4 && t4.match("!--") || "-" == n4 && t4.match("->") && !/\S/.test(t4.string.slice(0, t4.start))) return t4.skipToEnd(), v("comment", "comment"); if (f.test(n4)) return ">" == n4 && e4.lexical && ">" == e4.lexical.type || (t4.eat("=") ? "!" != n4 && "=" != n4 || t4.eat("=") : /[<>*+\-|&?]/.test(n4) && (t4.eat(n4), ">" == n4 && t4.eat(n4))), "?" == n4 && t4.eat(".") ? v(".") : v("operator", "operator", t4.current()); if (p.test(n4)) { t4.eatWhile(p); var o3 = t4.current(); if ("." != e4.lastType) { if (d.propertyIsEnumerable(o3)) { var r2 = d[o3]; return v(r2.type, r2.style, o3); } if ("async" == o3 && t4.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false)) return v("async", "keyword", o3); } return v("variable", "variable", o3); } } function m(t4) { return function(e4, n4) { var o3, r2 = false; if (a && "@" == e4.peek() && e4.match(h)) return n4.tokenize = y, v("jsonld-keyword", "meta"); for (; null != (o3 = e4.next()) && (o3 != t4 || r2); ) r2 = !r2 && "\\" == o3; return r2 || (n4.tokenize = y), v("string", "string"); }; } function b(t4, e4) { for (var n4, o3 = false; n4 = t4.next(); ) { if ("/" == n4 && o3) { e4.tokenize = y; break; } o3 = "*" == n4; } return v("comment", "comment"); } function _(t4, e4) { for (var n4, o3 = false; null != (n4 = t4.next()); ) { if (!o3 && ("`" == n4 || "$" == n4 && t4.eat("{"))) { e4.tokenize = y; break; } o3 = !o3 && "\\" == n4; } return v("quasi", "string-2", t4.current()); } var w = "([{}])"; function x(t4, e4) { e4.fatArrowAt && (e4.fatArrowAt = null); var n4 = t4.string.indexOf("=>", t4.start); if (!(n4 < 0)) { if (u) { var o3 = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t4.string.slice(t4.start, n4)); o3 && (n4 = o3.index); } for (var r2 = 0, i2 = false, s2 = n4 - 1; s2 >= 0; --s2) { var a2 = t4.string.charAt(s2), l2 = w.indexOf(a2); if (l2 >= 0 && l2 < 3) { if (!r2) { ++s2; break; } if (0 == --r2) { "(" == a2 && (i2 = true); break; } } else if (l2 >= 3 && l2 < 6) ++r2; else if (p.test(a2)) i2 = true; else if (/["'\/`]/.test(a2)) for (; ; --s2) { if (0 == s2) return; if (t4.string.charAt(s2 - 1) == a2 && "\\" != t4.string.charAt(s2 - 2)) { s2--; break; } } else if (i2 && !r2) { ++s2; break; } } i2 && !r2 && (e4.fatArrowAt = s2); } } var C = { atom: true, number: true, variable: true, string: true, regexp: true, this: true, import: true, "jsonld-keyword": true }; function S(t4, e4, n4, o3, r2, i2) { this.indented = t4, this.column = e4, this.type = n4, this.prev = r2, this.info = i2, null != o3 && (this.align = o3); } function O(t4, e4) { if (!c) return false; for (var n4 = t4.localVars; n4; n4 = n4.next) if (n4.name == e4) return true; for (var o3 = t4.context; o3; o3 = o3.prev) for (n4 = o3.vars; n4; n4 = n4.next) if (n4.name == e4) return true; } function T(t4, e4, n4, o3, r2) { var i2 = t4.cc; for (k.state = t4, k.stream = r2, k.marked = null, k.cc = i2, k.style = e4, t4.lexical.hasOwnProperty("align") || (t4.lexical.align = true); 1; ) if ((i2.length ? i2.pop() : l ? $ : U)(n4, o3)) { for (; i2.length && i2[i2.length - 1].lex; ) i2.pop()(); return k.marked ? k.marked : "variable" == n4 && O(t4, o3) ? "variable-2" : e4; } } var k = { state: null, column: null, marked: null, cc: null }; function P() { for (var t4 = arguments.length - 1; t4 >= 0; t4--) k.cc.push(arguments[t4]); } function E() { return P.apply(null, arguments), true; } function A(t4, e4) { for (var n4 = e4; n4; n4 = n4.next) if (n4.name == t4) return true; return false; } function j(t4) { var e4 = k.state; if (k.marked = "def", c) { if (e4.context) { if ("var" == e4.lexical.info && e4.context && e4.context.block) { var o3 = M(t4, e4.context); if (null != o3) return void (e4.context = o3); } else if (!A(t4, e4.localVars)) return void (e4.localVars = new N(t4, e4.localVars)); } n3.globalVars && !A(t4, e4.globalVars) && (e4.globalVars = new N(t4, e4.globalVars)); } } function M(t4, e4) { if (e4) { if (e4.block) { var n4 = M(t4, e4.prev); return n4 ? n4 == e4.prev ? e4 : new D(n4, e4.vars, true) : null; } return A(t4, e4.vars) ? e4 : new D(e4.prev, new N(t4, e4.vars), false); } return null; } function L(t4) { return "public" == t4 || "private" == t4 || "protected" == t4 || "abstract" == t4 || "readonly" == t4; } function D(t4, e4, n4) { this.prev = t4, this.vars = e4, this.block = n4; } function N(t4, e4) { this.name = t4, this.next = e4; } var I = new N("this", new N("arguments", null)); function F() { k.state.context = new D(k.state.context, k.state.localVars, false), k.state.localVars = I; } function V() { k.state.context = new D(k.state.context, k.state.localVars, true), k.state.localVars = null; } function R() { k.state.localVars = k.state.context.vars, k.state.context = k.state.context.prev; } function H(t4, e4) { var n4 = function() { var n5 = k.state, o3 = n5.indented; if ("stat" == n5.lexical.type) o3 = n5.lexical.indented; else for (var r2 = n5.lexical; r2 && ")" == r2.type && r2.align; r2 = r2.prev) o3 = r2.indented; n5.lexical = new S(o3, k.stream.column(), t4, null, n5.lexical, e4); }; return n4.lex = true, n4; } function z() { var t4 = k.state; t4.lexical.prev && (")" == t4.lexical.type && (t4.indented = t4.lexical.indented), t4.lexical = t4.lexical.prev); } function B(t4) { function e4(n4) { return n4 == t4 ? E() : ";" == t4 || "}" == n4 || ")" == n4 || "]" == n4 ? P() : E(e4); } return e4; } function U(t4, e4) { return "var" == t4 ? E(H("vardef", e4), Pt, B(";"), z) : "keyword a" == t4 ? E(H("form"), G, U, z) : "keyword b" == t4 ? E(H("form"), U, z) : "keyword d" == t4 ? k.stream.match(/^\s*$/, false) ? E() : E(H("stat"), Y, B(";"), z) : "debugger" == t4 ? E(B(";")) : "{" == t4 ? E(H("}"), V, dt, z, R) : ";" == t4 ? E() : "if" == t4 ? ("else" == k.state.lexical.info && k.state.cc[k.state.cc.length - 1] == z && k.state.cc.pop()(), E(H("form"), G, U, z, Dt)) : "function" == t4 ? E(Vt) : "for" == t4 ? E(H("form"), V, Nt, U, R, z) : "class" == t4 || u && "interface" == e4 ? (k.marked = "keyword", E(H("form", "class" == t4 ? t4 : e4), Ut, z)) : "variable" == t4 ? u && "declare" == e4 ? (k.marked = "keyword", E(U)) : u && ("module" == e4 || "enum" == e4 || "type" == e4) && k.stream.match(/^\s*\w/, false) ? (k.marked = "keyword", "enum" == e4 ? E(ee) : "type" == e4 ? E(Ht, B("operator"), yt, B(";")) : E(H("form"), Et, B("{"), H("}"), dt, z, z)) : u && "namespace" == e4 ? (k.marked = "keyword", E(H("form"), $, U, z)) : u && "abstract" == e4 ? (k.marked = "keyword", E(U)) : E(H("stat"), it) : "switch" == t4 ? E(H("form"), G, B("{"), H("}", "switch"), V, dt, z, z, R) : "case" == t4 ? E($, B(":")) : "default" == t4 ? E(B(":")) : "catch" == t4 ? E(H("form"), F, W, U, z, R) : "export" == t4 ? E(H("stat"), Gt, z) : "import" == t4 ? E(H("stat"), Yt, z) : "async" == t4 ? E(U) : "@" == e4 ? E($, U) : P(H("stat"), $, B(";"), z); } function W(t4) { if ("(" == t4) return E(zt, B(")")); } function $(t4, e4) { return K(t4, e4, false); } function q(t4, e4) { return K(t4, e4, true); } function G(t4) { return "(" != t4 ? P() : E(H(")"), Y, B(")"), z); } function K(t4, e4, n4) { if (k.state.fatArrowAt == k.stream.start) { var o3 = n4 ? et : tt; if ("(" == t4) return E(F, H(")"), ut(zt, ")"), z, B("=>"), o3, R); if ("variable" == t4) return P(F, Et, B("=>"), o3, R); } var r2 = n4 ? J : X; return C.hasOwnProperty(t4) ? E(r2) : "function" == t4 ? E(Vt, r2) : "class" == t4 || u && "interface" == e4 ? (k.marked = "keyword", E(H("form"), Bt, z)) : "keyword c" == t4 || "async" == t4 ? E(n4 ? q : $) : "(" == t4 ? E(H(")"), Y, B(")"), z, r2) : "operator" == t4 || "spread" == t4 ? E(n4 ? q : $) : "[" == t4 ? E(H("]"), te, z, r2) : "{" == t4 ? pt(at, "}", null, r2) : "quasi" == t4 ? P(Z, r2) : "new" == t4 ? E(nt(n4)) : E(); } function Y(t4) { return t4.match(/[;\}\)\],]/) ? P() : P($); } function X(t4, e4) { return "," == t4 ? E(Y) : J(t4, e4, false); } function J(t4, e4, n4) { var o3 = 0 == n4 ? X : J, r2 = 0 == n4 ? $ : q; return "=>" == t4 ? E(F, n4 ? et : tt, R) : "operator" == t4 ? /\+\+|--/.test(e4) || u && "!" == e4 ? E(o3) : u && "<" == e4 && k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false) ? E(H(">"), ut(yt, ">"), z, o3) : "?" == e4 ? E($, B(":"), r2) : E(r2) : "quasi" == t4 ? P(Z, o3) : ";" != t4 ? "(" == t4 ? pt(q, ")", "call", o3) : "." == t4 ? E(st, o3) : "[" == t4 ? E(H("]"), Y, B("]"), z, o3) : u && "as" == e4 ? (k.marked = "keyword", E(yt, o3)) : "regexp" == t4 ? (k.state.lastType = k.marked = "operator", k.stream.backUp(k.stream.pos - k.stream.start - 1), E(r2)) : void 0 : void 0; } function Z(t4, e4) { return "quasi" != t4 ? P() : "${" != e4.slice(e4.length - 2) ? E(Z) : E(Y, Q); } function Q(t4) { if ("}" == t4) return k.marked = "string-2", k.state.tokenize = _, E(Z); } function tt(t4) { return x(k.stream, k.state), P("{" == t4 ? U : $); } function et(t4) { return x(k.stream, k.state), P("{" == t4 ? U : q); } function nt(t4) { return function(e4) { return "." == e4 ? E(t4 ? rt : ot) : "variable" == e4 && u ? E(Ot, t4 ? J : X) : P(t4 ? q : $); }; } function ot(t4, e4) { if ("target" == e4) return k.marked = "keyword", E(X); } function rt(t4, e4) { if ("target" == e4) return k.marked = "keyword", E(J); } function it(t4) { return ":" == t4 ? E(z, U) : P(X, B(";"), z); } function st(t4) { if ("variable" == t4) return k.marked = "property", E(); } function at(t4, e4) { return "async" == t4 ? (k.marked = "property", E(at)) : "variable" == t4 || "keyword" == k.style ? (k.marked = "property", "get" == e4 || "set" == e4 ? E(lt) : (u && k.state.fatArrowAt == k.stream.start && (n4 = k.stream.match(/^\s*:\s*/, false)) && (k.state.fatArrowAt = k.stream.pos + n4[0].length), E(ct))) : "number" == t4 || "string" == t4 ? (k.marked = a ? "property" : k.style + " property", E(ct)) : "jsonld-keyword" == t4 ? E(ct) : u && L(e4) ? (k.marked = "keyword", E(at)) : "[" == t4 ? E($, ft, B("]"), ct) : "spread" == t4 ? E(q, ct) : "*" == e4 ? (k.marked = "keyword", E(at)) : ":" == t4 ? P(ct) : void 0; var n4; } function lt(t4) { return "variable" != t4 ? P(ct) : (k.marked = "property", E(Vt)); } function ct(t4) { return ":" == t4 ? E(q) : "(" == t4 ? P(Vt) : void 0; } function ut(t4, e4, n4) { function o3(r2, i2) { if (n4 ? n4.indexOf(r2) > -1 : "," == r2) { var s2 = k.state.lexical; return "call" == s2.info && (s2.pos = (s2.pos || 0) + 1), E(function(n5, o4) { return n5 == e4 || o4 == e4 ? P() : P(t4); }, o3); } return r2 == e4 || i2 == e4 ? E() : n4 && n4.indexOf(";") > -1 ? P(t4) : E(B(e4)); } return function(n5, r2) { return n5 == e4 || r2 == e4 ? E() : P(t4, o3); }; } function pt(t4, e4, n4) { for (var o3 = 3; o3 < arguments.length; o3++) k.cc.push(arguments[o3]); return E(H(e4, n4), ut(t4, e4), z); } function dt(t4) { return "}" == t4 ? E() : P(U, dt); } function ft(t4, e4) { if (u) { if (":" == t4) return E(yt); if ("?" == e4) return E(ft); } } function ht(t4, e4) { if (u && (":" == t4 || "in" == e4)) return E(yt); } function gt(t4) { if (u && ":" == t4) return k.stream.match(/^\s*\w+\s+is\b/, false) ? E($, vt, yt) : E(yt); } function vt(t4, e4) { if ("is" == e4) return k.marked = "keyword", E(); } function yt(t4, e4) { return "keyof" == e4 || "typeof" == e4 || "infer" == e4 || "readonly" == e4 ? (k.marked = "keyword", E("typeof" == e4 ? q : yt)) : "variable" == t4 || "void" == e4 ? (k.marked = "type", E(St)) : "|" == e4 || "&" == e4 ? E(yt) : "string" == t4 || "number" == t4 || "atom" == t4 ? E(St) : "[" == t4 ? E(H("]"), ut(yt, "]", ","), z, St) : "{" == t4 ? E(H("}"), bt, z, St) : "(" == t4 ? E(ut(Ct, ")"), mt, St) : "<" == t4 ? E(ut(yt, ">"), yt) : "quasi" == t4 ? P(wt, St) : void 0; } function mt(t4) { if ("=>" == t4) return E(yt); } function bt(t4) { return t4.match(/[\}\)\]]/) ? E() : "," == t4 || ";" == t4 ? E(bt) : P(_t, bt); } function _t(t4, e4) { return "variable" == t4 || "keyword" == k.style ? (k.marked = "property", E(_t)) : "?" == e4 || "number" == t4 || "string" == t4 ? E(_t) : ":" == t4 ? E(yt) : "[" == t4 ? E(B("variable"), ht, B("]"), _t) : "(" == t4 ? P(Rt, _t) : t4.match(/[;\}\)\],]/) ? void 0 : E(); } function wt(t4, e4) { return "quasi" != t4 ? P() : "${" != e4.slice(e4.length - 2) ? E(wt) : E(yt, xt); } function xt(t4) { if ("}" == t4) return k.marked = "string-2", k.state.tokenize = _, E(wt); } function Ct(t4, e4) { return "variable" == t4 && k.stream.match(/^\s*[?:]/, false) || "?" == e4 ? E(Ct) : ":" == t4 ? E(yt) : "spread" == t4 ? E(Ct) : P(yt); } function St(t4, e4) { return "<" == e4 ? E(H(">"), ut(yt, ">"), z, St) : "|" == e4 || "." == t4 || "&" == e4 ? E(yt) : "[" == t4 ? E(yt, B("]"), St) : "extends" == e4 || "implements" == e4 ? (k.marked = "keyword", E(yt)) : "?" == e4 ? E(yt, B(":"), yt) : void 0; } function Ot(t4, e4) { if ("<" == e4) return E(H(">"), ut(yt, ">"), z, St); } function Tt() { return P(yt, kt); } function kt(t4, e4) { if ("=" == e4) return E(yt); } function Pt(t4, e4) { return "enum" == e4 ? (k.marked = "keyword", E(ee)) : P(Et, ft, Mt, Lt); } function Et(t4, e4) { return u && L(e4) ? (k.marked = "keyword", E(Et)) : "variable" == t4 ? (j(e4), E()) : "spread" == t4 ? E(Et) : "[" == t4 ? pt(jt, "]") : "{" == t4 ? pt(At, "}") : void 0; } function At(t4, e4) { return "variable" != t4 || k.stream.match(/^\s*:/, false) ? ("variable" == t4 && (k.marked = "property"), "spread" == t4 ? E(Et) : "}" == t4 ? P() : "[" == t4 ? E($, B("]"), B(":"), At) : E(B(":"), Et, Mt)) : (j(e4), E(Mt)); } function jt() { return P(Et, Mt); } function Mt(t4, e4) { if ("=" == e4) return E(q); } function Lt(t4) { if ("," == t4) return E(Pt); } function Dt(t4, e4) { if ("keyword b" == t4 && "else" == e4) return E(H("form", "else"), U, z); } function Nt(t4, e4) { return "await" == e4 ? E(Nt) : "(" == t4 ? E(H(")"), It, z) : void 0; } function It(t4) { return "var" == t4 ? E(Pt, Ft) : "variable" == t4 ? E(Ft) : P(Ft); } function Ft(t4, e4) { return ")" == t4 ? E() : ";" == t4 ? E(Ft) : "in" == e4 || "of" == e4 ? (k.marked = "keyword", E($, Ft)) : P($, Ft); } function Vt(t4, e4) { return "*" == e4 ? (k.marked = "keyword", E(Vt)) : "variable" == t4 ? (j(e4), E(Vt)) : "(" == t4 ? E(F, H(")"), ut(zt, ")"), z, gt, U, R) : u && "<" == e4 ? E(H(">"), ut(Tt, ">"), z, Vt) : void 0; } function Rt(t4, e4) { return "*" == e4 ? (k.marked = "keyword", E(Rt)) : "variable" == t4 ? (j(e4), E(Rt)) : "(" == t4 ? E(F, H(")"), ut(zt, ")"), z, gt, R) : u && "<" == e4 ? E(H(">"), ut(Tt, ">"), z, Rt) : void 0; } function Ht(t4, e4) { return "keyword" == t4 || "variable" == t4 ? (k.marked = "type", E(Ht)) : "<" == e4 ? E(H(">"), ut(Tt, ">"), z) : void 0; } function zt(t4, e4) { return "@" == e4 && E($, zt), "spread" == t4 ? E(zt) : u && L(e4) ? (k.marked = "keyword", E(zt)) : u && "this" == t4 ? E(ft, Mt) : P(Et, ft, Mt); } function Bt(t4, e4) { return "variable" == t4 ? Ut(t4, e4) : Wt(t4, e4); } function Ut(t4, e4) { if ("variable" == t4) return j(e4), E(Wt); } function Wt(t4, e4) { return "<" == e4 ? E(H(">"), ut(Tt, ">"), z, Wt) : "extends" == e4 || "implements" == e4 || u && "," == t4 ? ("implements" == e4 && (k.marked = "keyword"), E(u ? yt : $, Wt)) : "{" == t4 ? E(H("}"), $t, z) : void 0; } function $t(t4, e4) { return "async" == t4 || "variable" == t4 && ("static" == e4 || "get" == e4 || "set" == e4 || u && L(e4)) && k.stream.match(/^\s+[\w$\xa1-\uffff]/, false) ? (k.marked = "keyword", E($t)) : "variable" == t4 || "keyword" == k.style ? (k.marked = "property", E(qt, $t)) : "number" == t4 || "string" == t4 ? E(qt, $t) : "[" == t4 ? E($, ft, B("]"), qt, $t) : "*" == e4 ? (k.marked = "keyword", E($t)) : u && "(" == t4 ? P(Rt, $t) : ";" == t4 || "," == t4 ? E($t) : "}" == t4 ? E() : "@" == e4 ? E($, $t) : void 0; } function qt(t4, e4) { if ("!" == e4) return E(qt); if ("?" == e4) return E(qt); if (":" == t4) return E(yt, Mt); if ("=" == e4) return E(q); var n4 = k.state.lexical.prev; return P(n4 && "interface" == n4.info ? Rt : Vt); } function Gt(t4, e4) { return "*" == e4 ? (k.marked = "keyword", E(Qt, B(";"))) : "default" == e4 ? (k.marked = "keyword", E($, B(";"))) : "{" == t4 ? E(ut(Kt, "}"), Qt, B(";")) : P(U); } function Kt(t4, e4) { return "as" == e4 ? (k.marked = "keyword", E(B("variable"))) : "variable" == t4 ? P(q, Kt) : void 0; } function Yt(t4) { return "string" == t4 ? E() : "(" == t4 ? P($) : "." == t4 ? P(X) : P(Xt, Jt, Qt); } function Xt(t4, e4) { return "{" == t4 ? pt(Xt, "}") : ("variable" == t4 && j(e4), "*" == e4 && (k.marked = "keyword"), E(Zt)); } function Jt(t4) { if ("," == t4) return E(Xt, Jt); } function Zt(t4, e4) { if ("as" == e4) return k.marked = "keyword", E(Xt); } function Qt(t4, e4) { if ("from" == e4) return k.marked = "keyword", E($); } function te(t4) { return "]" == t4 ? E() : P(ut(q, "]")); } function ee() { return P(H("form"), Et, B("{"), H("}"), ut(ne, "}"), z, z); } function ne() { return P(Et, Mt); } function oe(t4, e4) { return "operator" == t4.lastType || "," == t4.lastType || f.test(e4.charAt(0)) || /[,.]/.test(e4.charAt(0)); } function re(t4, e4, n4) { return e4.tokenize == y && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e4.lastType) || "quasi" == e4.lastType && /\{\s*$/.test(t4.string.slice(0, t4.pos - (n4 || 0))); } return F.lex = V.lex = true, R.lex = true, z.lex = true, { startState: function(t4) { var e4 = { tokenize: y, lastType: "sof", cc: [], lexical: new S((t4 || 0) - i, 0, "block", false), localVars: n3.localVars, context: n3.localVars && new D(null, null, false), indented: t4 || 0 }; return n3.globalVars && "object" == typeof n3.globalVars && (e4.globalVars = n3.globalVars), e4; }, token: function(t4, e4) { if (t4.sol() && (e4.lexical.hasOwnProperty("align") || (e4.lexical.align = false), e4.indented = t4.indentation(), x(t4, e4)), e4.tokenize != b && t4.eatSpace()) return null; var n4 = e4.tokenize(t4, e4); return "comment" == o2 ? n4 : (e4.lastType = "operator" != o2 || "++" != r && "--" != r ? o2 : "incdec", T(e4, n4, o2, r, t4)); }, indent: function(e4, o3) { if (e4.tokenize == b || e4.tokenize == _) return t3.Pass; if (e4.tokenize != y) return 0; var r2, a2 = o3 && o3.charAt(0), l2 = e4.lexical; if (!/^\s*else\b/.test(o3)) for (var c2 = e4.cc.length - 1; c2 >= 0; --c2) { var u2 = e4.cc[c2]; if (u2 == z) l2 = l2.prev; else if (u2 != Dt && u2 != R) break; } for (; ("stat" == l2.type || "form" == l2.type) && ("}" == a2 || (r2 = e4.cc[e4.cc.length - 1]) && (r2 == X || r2 == J) && !/^[,\.=+\-*:?[\(]/.test(o3)); ) l2 = l2.prev; s && ")" == l2.type && "stat" == l2.prev.type && (l2 = l2.prev); var p2 = l2.type, d2 = a2 == p2; return "vardef" == p2 ? l2.indented + ("operator" == e4.lastType || "," == e4.lastType ? l2.info.length + 1 : 0) : "form" == p2 && "{" == a2 ? l2.indented : "form" == p2 ? l2.indented + i : "stat" == p2 ? l2.indented + (oe(e4, o3) ? s || i : 0) : "switch" != l2.info || d2 || 0 == n3.doubleIndentSwitch ? l2.align ? l2.column + (d2 ? 0 : 1) : l2.indented + (d2 ? 0 : i) : l2.indented + (/^(?:case|default)\b/.test(o3) ? i : 2 * i); }, electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, blockCommentStart: l ? null : "/*", blockCommentEnd: l ? null : "*/", blockCommentContinue: l ? null : " * ", lineComment: l ? null : "//", fold: "brace", closeBrackets: "()[]{}''\"\"``", helperType: l ? "json" : "javascript", jsonldMode: a, jsonMode: l, expressionAllowed: re, skipExpression: function(e4) { T(e4, "atom", "atom", "true", new t3.StringStream("", 2, null)); } }; }), t3.registerHelper("wordChars", "javascript", /[\w$]/), t3.defineMIME("text/javascript", "javascript"), t3.defineMIME("text/ecmascript", "javascript"), t3.defineMIME("application/javascript", "javascript"), t3.defineMIME("application/x-javascript", "javascript"), t3.defineMIME("application/ecmascript", "javascript"), t3.defineMIME("application/json", { name: "javascript", json: true }), t3.defineMIME("application/x-json", { name: "javascript", json: true }), t3.defineMIME("application/manifest+json", { name: "javascript", json: true }), t3.defineMIME("application/ld+json", { name: "javascript", jsonld: true }), t3.defineMIME("text/typescript", { name: "javascript", typescript: true }), t3.defineMIME("application/typescript", { name: "javascript", typescript: true }); })(n2(631)); }, 589: (t2, e2, n2) => { (function(t3) { var e3 = { autoSelfClosers: { area: true, base: true, br: true, col: true, command: true, embed: true, frame: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true, menuitem: true }, implicitlyClosed: { dd: true, li: true, optgroup: true, option: true, p: true, rp: true, rt: true, tbody: true, td: true, tfoot: true, th: true, tr: true }, contextGrabbers: { dd: { dd: true, dt: true }, dt: { dd: true, dt: true }, li: { li: true }, option: { option: true, optgroup: true }, optgroup: { optgroup: true }, p: { address: true, article: true, aside: true, blockquote: true, dir: true, div: true, dl: true, fieldset: true, footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true, h6: true, header: true, hgroup: true, hr: true, menu: true, nav: true, ol: true, p: true, pre: true, section: true, table: true, ul: true }, rp: { rp: true, rt: true }, rt: { rp: true, rt: true }, tbody: { tbody: true, tfoot: true }, td: { td: true, th: true }, tfoot: { tbody: true }, th: { td: true, th: true }, thead: { tbody: true, tfoot: true }, tr: { tr: true } }, doNotIndent: { pre: true }, allowUnquoted: true, allowMissing: true, caseFold: true }, n3 = { autoSelfClosers: {}, implicitlyClosed: {}, contextGrabbers: {}, doNotIndent: {}, allowUnquoted: false, allowMissing: false, allowMissingTagName: false, caseFold: false }; t3.defineMode("xml", function(o2, r) { var i, s, a = o2.indentUnit, l = {}, c = r.htmlMode ? e3 : n3; for (var u in c) l[u] = c[u]; for (var u in r) l[u] = r[u]; function p(t4, e4) { function n4(n5) { return e4.tokenize = n5, n5(t4, e4); } var o3 = t4.next(); return "<" == o3 ? t4.eat("!") ? t4.eat("[") ? t4.match("CDATA[") ? n4(h("atom", "]]>")) : null : t4.match("--") ? n4(h("comment", "-->")) : t4.match("DOCTYPE", true, true) ? (t4.eatWhile(/[\w\._\-]/), n4(g(1))) : null : t4.eat("?") ? (t4.eatWhile(/[\w\._\-]/), e4.tokenize = h("meta", "?>"), "meta") : (i = t4.eat("/") ? "closeTag" : "openTag", e4.tokenize = d, "tag bracket") : "&" == o3 ? (t4.eat("#") ? t4.eat("x") ? t4.eatWhile(/[a-fA-F\d]/) && t4.eat(";") : t4.eatWhile(/[\d]/) && t4.eat(";") : t4.eatWhile(/[\w\.\-:]/) && t4.eat(";")) ? "atom" : "error" : (t4.eatWhile(/[^&<]/), null); } function d(t4, e4) { var n4 = t4.next(); if (">" == n4 || "/" == n4 && t4.eat(">")) return e4.tokenize = p, i = ">" == n4 ? "endTag" : "selfcloseTag", "tag bracket"; if ("=" == n4) return i = "equals", null; if ("<" == n4) { e4.tokenize = p, e4.state = _, e4.tagName = e4.tagStart = null; var o3 = e4.tokenize(t4, e4); return o3 ? o3 + " tag error" : "tag error"; } return /[\'\"]/.test(n4) ? (e4.tokenize = f(n4), e4.stringStartCol = t4.column(), e4.tokenize(t4, e4)) : (t4.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/), "word"); } function f(t4) { var e4 = function(e5, n4) { for (; !e5.eol(); ) if (e5.next() == t4) { n4.tokenize = d; break; } return "string"; }; return e4.isInAttribute = true, e4; } function h(t4, e4) { return function(n4, o3) { for (; !n4.eol(); ) { if (n4.match(e4)) { o3.tokenize = p; break; } n4.next(); } return t4; }; } function g(t4) { return function(e4, n4) { for (var o3; null != (o3 = e4.next()); ) { if ("<" == o3) return n4.tokenize = g(t4 + 1), n4.tokenize(e4, n4); if (">" == o3) { if (1 == t4) { n4.tokenize = p; break; } return n4.tokenize = g(t4 - 1), n4.tokenize(e4, n4); } } return "meta"; }; } function v(t4) { return t4 && t4.toLowerCase(); } function y(t4, e4, n4) { this.prev = t4.context, this.tagName = e4 || "", this.indent = t4.indented, this.startOfLine = n4, (l.doNotIndent.hasOwnProperty(e4) || t4.context && t4.context.noIndent) && (this.noIndent = true); } function m(t4) { t4.context && (t4.context = t4.context.prev); } function b(t4, e4) { for (var n4; 1; ) { if (!t4.context) return; if (n4 = t4.context.tagName, !l.contextGrabbers.hasOwnProperty(v(n4)) || !l.contextGrabbers[v(n4)].hasOwnProperty(v(e4))) return; m(t4); } } function _(t4, e4, n4) { return "openTag" == t4 ? (n4.tagStart = e4.column(), w) : "closeTag" == t4 ? x : _; } function w(t4, e4, n4) { return "word" == t4 ? (n4.tagName = e4.current(), s = "tag", O) : l.allowMissingTagName && "endTag" == t4 ? (s = "tag bracket", O(t4, e4, n4)) : (s = "error", w); } function x(t4, e4, n4) { if ("word" == t4) { var o3 = e4.current(); return n4.context && n4.context.tagName != o3 && l.implicitlyClosed.hasOwnProperty(v(n4.context.tagName)) && m(n4), n4.context && n4.context.tagName == o3 || false === l.matchClosing ? (s = "tag", C) : (s = "tag error", S); } return l.allowMissingTagName && "endTag" == t4 ? (s = "tag bracket", C(t4, e4, n4)) : (s = "error", S); } function C(t4, e4, n4) { return "endTag" != t4 ? (s = "error", C) : (m(n4), _); } function S(t4, e4, n4) { return s = "error", C(t4, e4, n4); } function O(t4, e4, n4) { if ("word" == t4) return s = "attribute", T; if ("endTag" == t4 || "selfcloseTag" == t4) { var o3 = n4.tagName, r2 = n4.tagStart; return n4.tagName = n4.tagStart = null, "selfcloseTag" == t4 || l.autoSelfClosers.hasOwnProperty(v(o3)) ? b(n4, o3) : (b(n4, o3), n4.context = new y(n4, o3, r2 == n4.indented)), _; } return s = "error", O; } function T(t4, e4, n4) { return "equals" == t4 ? k : (l.allowMissing || (s = "error"), O(t4, e4, n4)); } function k(t4, e4, n4) { return "string" == t4 ? P : "word" == t4 && l.allowUnquoted ? (s = "string", O) : (s = "error", O(t4, e4, n4)); } function P(t4, e4, n4) { return "string" == t4 ? P : O(t4, e4, n4); } return p.isInText = true, { startState: function(t4) { var e4 = { tokenize: p, state: _, indented: t4 || 0, tagName: null, tagStart: null, context: null }; return null != t4 && (e4.baseIndent = t4), e4; }, token: function(t4, e4) { if (!e4.tagName && t4.sol() && (e4.indented = t4.indentation()), t4.eatSpace()) return null; i = null; var n4 = e4.tokenize(t4, e4); return (n4 || i) && "comment" != n4 && (s = null, e4.state = e4.state(i || n4, t4, e4), s && (n4 = "error" == s ? n4 + " error" : s)), n4; }, indent: function(e4, n4, o3) { var r2 = e4.context; if (e4.tokenize.isInAttribute) return e4.tagStart == e4.indented ? e4.stringStartCol + 1 : e4.indented + a; if (r2 && r2.noIndent) return t3.Pass; if (e4.tokenize != d && e4.tokenize != p) return o3 ? o3.match(/^(\s*)/)[0].length : 0; if (e4.tagName) return false !== l.multilineTagIndentPastTag ? e4.tagStart + e4.tagName.length + 2 : e4.tagStart + a * (l.multilineTagIndentFactor || 1); if (l.alignCDATA && /$/, blockCommentStart: "", configuration: l.htmlMode ? "html" : "xml", helperType: l.htmlMode ? "html" : "xml", skipAttribute: function(t4) { t4.state == k && (t4.state = O); }, xmlCurrentTag: function(t4) { return t4.tagName ? { name: t4.tagName, close: "closeTag" == t4.type } : null; }, xmlCurrentContext: function(t4) { for (var e4 = [], n4 = t4.context; n4; n4 = n4.prev) e4.push(n4.tagName); return e4.reverse(); } }; }), t3.defineMIME("text/xml", "xml"), t3.defineMIME("application/xml", "xml"), t3.mimeModes.hasOwnProperty("text/html") || t3.defineMIME("text/html", { name: "xml", htmlMode: true }); })(n2(631)); }, 858: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => o2 }); const o2 = { run: function(t3) { t3.DomComponents.clear(), t3.CssComposer.clear(); } }; }, 884: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => s }); var o2 = n2(50), r = n2(163), i = n2(668); const s = { run: function(t3) { (0, o2.bindAll)(this, "onKeyUp", "enableDragger", "disableDragger"), this.editor = t3, this.canvasModel = this.canvas.getCanvasView().model, this.toggleMove(1); }, stop: function(t3) { this.toggleMove(), this.disableDragger(); }, onKeyUp: function(t3) { " " === (0, r.getKeyChar)(t3) && this.editor.stopCommand(this.id); }, enableDragger: function(t3) { this.toggleDragger(1, t3); }, disableDragger: function(t3) { this.toggleDragger(0, t3); }, toggleDragger: function(t3, e3) { var n3 = this.canvasModel, o3 = this.em, r2 = this.dragger, s2 = t3 ? "add" : "remove"; this.getCanvas().classList[s2]("".concat(this.ppfx, "is__grabbing")), r2 || (r2 = new i.Z({ getPosition: function() { return { x: n3.get("x"), y: n3.get("y") }; }, setPosition: function(t4) { var e4 = t4.x, o4 = t4.y; n3.set({ x: e4, y: o4 }); }, onStart: function(t4, e4) { o3.trigger("canvas:move:start", e4); }, onDrag: function(t4, e4) { o3.trigger("canvas:move", e4); }, onEnd: function(t4, e4) { o3.trigger("canvas:move:end", e4); } }), this.dragger = r2), t3 ? r2.start(e3) : r2.stop(); }, toggleMove: function(t3) { var e3 = this.ppfx, n3 = t3 ? "add" : "remove", o3 = t3 ? "on" : "off", i2 = { on: r.on, off: r.off }, s2 = this.getCanvas(), a = ["".concat(e3, "is__grab")]; !t3 && a.push("".concat(e3, "is__grabbing")), a.forEach(function(t4) { return s2.classList[n3](t4); }), i2[o3](document, "keyup", this.onKeyUp), i2[o3](s2, "mousedown", this.enableDragger), i2[o3](document, "mouseup", this.disableDragger); } }; }, 790: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => a, defineCommand: () => s }); var o2, r = n2(346), i = (o2 = function(t3, e3) { return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, o2(t3, e3); }, function(t3, e3) { if ("function" != typeof e3 && null !== e3) throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null"); function n3() { this.constructor = t3; } o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3()); }); function s(t3) { return t3; } const a = function(t3) { function e3(e4) { var n3 = t3.call(this, 0) || this; n3.config = e4 || {}, n3.em = n3.config.em || {}; var o3 = n3.config.stylePrefix; return n3.pfx = o3, n3.ppfx = n3.config.pStylePrefix, n3.hoverClass = "".concat(o3, "hover"), n3.badgeClass = "".concat(o3, "badge"), n3.plhClass = "".concat(o3, "placeholder"), n3.freezClass = "".concat(n3.ppfx, "freezed"), n3.canvas = n3.em.Canvas, n3.init(n3.config), n3; } return i(e3, t3), e3.prototype.onFrameScroll = function(t4) { }, e3.prototype.getCanvas = function() { return this.canvas.getElement(); }, e3.prototype.getCanvasBody = function() { return this.canvas.getBody(); }, e3.prototype.getCanvasTools = function() { return this.canvas.getToolsEl(); }, e3.prototype.offset = function(t4) { var e4 = t4.getBoundingClientRect(); return { top: e4.top + t4.ownerDocument.body.scrollTop, left: e4.left + t4.ownerDocument.body.scrollLeft }; }, e3.prototype.init = function(t4) { }, e3.prototype.callRun = function(t4, e4) { void 0 === e4 && (e4 = {}); var n3 = this.id; if (t4.trigger("run:".concat(n3, ":before"), e4), !e4 || !e4.abort) { var o3 = e4.sender || t4, r2 = this.run(t4, o3, e4); return t4.trigger("run:".concat(n3), r2, e4), t4.trigger("run", n3, r2, e4), r2; } t4.trigger("abort:".concat(n3), e4); }, e3.prototype.callStop = function(t4, e4) { void 0 === e4 && (e4 = {}); var n3 = this.id, o3 = e4.sender || t4; t4.trigger("stop:".concat(n3, ":before"), e4); var r2 = this.stop(t4, o3, e4); return t4.trigger("stop:".concat(n3), r2, e4), t4.trigger("stop", n3, r2, e4), r2; }, e3.prototype.stopCommand = function(t4) { this.em.Commands.stop(this.id, t4); }, e3.prototype.run = function(t4, e4, n3) { }, e3.prototype.stop = function(t4, e4, n3) { }, e3; }(r.Hn); }, 180: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => i }); var o2 = n2(50), r = function(t3, e3, n3) { if (n3 || 2 === arguments.length) for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]); return t3.concat(o3 || Array.prototype.slice.call(e3)); }; const i = { run: function(t3, e3, n3) { var i2 = this; void 0 === n3 && (n3 = {}); var s = [], a = n3.component || t3.getSelectedAll(); return (a = (0, o2.isArray)(a) ? r([], a, true) : [a]).filter(Boolean).forEach(function(t4) { if (!t4.get("removable")) return s.push(t4), i2.em.logWarning("The element is not removable", { component: t4 }); t4.remove(); }), t3.select(s), a; } }; }, 544: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => a }); var o2 = n2(50), r = n2(668), i = function() { return i = Object.assign || function(t3) { for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++) for (var r2 in e3 = arguments[n3]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, i.apply(this, arguments); }, s = "dmode"; const a = { run: function(t3, e3, n3) { var a2 = this; void 0 === n3 && (n3 = {}), (0, o2.bindAll)(this, "setPosition", "onStart", "onDrag", "onEnd", "getPosition", "getGuidesStatic", "renderGuide", "getGuidesTarget"); var l = n3.target, c = n3.event, u = n3.mode, p = n3.dragger, d = void 0 === p ? {} : p, f = l.getEl(), h = i({ doc: f.ownerDocument, onStart: this.onStart, onEnd: this.onEnd, onDrag: this.onDrag, getPosition: this.getPosition, setPosition: this.setPosition, guidesStatic: function() { return a2.guidesStatic; }, guidesTarget: function() { return a2.guidesTarget; } }, d); this.setupGuides(), this.opts = n3, this.editor = t3, this.em = t3.getModel(), this.target = l, this.isTran = "translate" == u, this.guidesContainer = this.getGuidesContainer(), this.guidesTarget = this.getGuidesTarget(), this.guidesStatic = this.getGuidesStatic(); var g = this.dragger; return g ? g.setOptions(h) : (g = new r.Z(h), this.dragger = g), c && g.start(c), this.toggleDrag(1), this.em.trigger("".concat(s, ":start"), this.getEventOpts()), g; }, 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(t3) { var e3 = t3.guide; e3 && e3.parentNode.removeChild(e3); }), this.guides = []; }, getGuidesContainer: function() { var t3 = this, e3 = this.guidesEl; if (!e3) { var n3 = this, r2 = n3.editor, i2 = n3.em, s2 = n3.opts, a2 = r2.getConfig().stylePrefix, l = document.createElement("div"), c = document.createElement("div"), u = '
\n
\n
'); (e3 = document.createElement("div")).className = "".concat(a2, "guides"), l.className = "".concat(a2, "guide-info ").concat(a2, "guide-info__x"), c.className = "".concat(a2, "guide-info ").concat(a2, "guide-info__y"), l.innerHTML = u, c.innerHTML = u, e3.appendChild(l), e3.appendChild(c), r2.Canvas.getGlobalToolsEl().appendChild(e3), this.guidesEl = e3, this.elGuideInfoX = l, this.elGuideInfoY = c, this.elGuideInfoContentX = l.querySelector(".".concat(a2, "guide-info__content")), this.elGuideInfoContentY = c.querySelector(".".concat(a2, "guide-info__content")), i2.on("canvas:update frame:scroll", (0, o2.debounce)(function() { var e4; t3.updateGuides(), s2.debug && (null === (e4 = t3.guides) || void 0 === e4 || e4.forEach(function(e5) { return t3.renderGuide(e5); })); }, 200)); } return e3; }, getGuidesStatic: function() { var t3 = this, e3 = [], n3 = this.target.getEl(), r2 = n3.parentNode, i2 = void 0 === r2 ? {} : r2; return (0, o2.each)(i2.children, function(o3) { return e3 = e3.concat(n3 !== o3 ? t3.getElementGuides(o3) : []); }), e3.concat(this.getElementGuides(i2)); }, getGuidesTarget: function() { return this.getElementGuides(this.target.getEl()); }, updateGuides: function(t3) { var e3, n3, r2 = this; (t3 || this.guides).forEach(function(t4) { var i2 = t4.origin, s2 = e3 === i2 ? n3 : r2.getElementPos(i2); e3 = i2, n3 = s2, (0, o2.each)(r2.getGuidePosUpdate(t4, s2), function(e4, n4) { return t4[n4] = e4; }), t4.originRect = s2; }); }, getGuidePosUpdate: function(t3, e3) { var n3 = {}, o3 = e3.top, r2 = e3.height, i2 = e3.left, s2 = e3.width; switch (t3.type) { case "t": n3.y = o3; break; case "b": n3.y = o3 + r2; break; case "l": n3.x = i2; break; case "r": n3.x = i2 + s2; break; case "x": n3.x = i2 + s2 / 2; break; case "y": n3.y = o3 + r2 / 2; } return n3; }, renderGuide: function(t3) { void 0 === t3 && (t3 = {}); var e3 = t3.guide || document.createElement("div"), n3 = "px", o3 = t3.active ? 2 : 1, r2 = e3.children[0]; return e3.style = "position: absolute; background-color: ".concat(t3.active ? "green" : "red", ";"), e3.children.length || ((r2 = document.createElement("div")).style = "position: absolute; color: red; padding: 5px; top: 0; left: 0;", e3.appendChild(r2)), t3.y ? (e3.style.width = "100%", e3.style.height = "".concat(o3).concat(n3), e3.style.top = "".concat(t3.y).concat(n3), e3.style.left = 0) : (e3.style.width = "".concat(o3).concat(n3), e3.style.height = "100%", e3.style.left = "".concat(t3.x).concat(n3), e3.style.top = "0".concat(n3)), !t3.guide && this.guidesContainer.appendChild(e3), e3; }, getElementPos: function(t3) { return this.editor.Canvas.getElementPos(t3, { noScroll: 1 }); }, getElementGuides: function(t3) { var e3 = this, n3 = this.opts, o3 = this.getElementPos(t3), r2 = o3.top, s2 = o3.height, a2 = o3.left, l = o3.width, c = [{ type: "t", y: r2 }, { type: "b", y: r2 + s2 }, { type: "l", x: a2 }, { type: "r", x: a2 + l }, { type: "x", x: a2 + l / 2 }, { type: "y", y: r2 + s2 / 2 }].map(function(r3) { return i(i({}, r3), { origin: t3, originRect: o3, guide: n3.debug && e3.renderGuide(r3) }); }); return c.forEach(function(t4) { var n4; return null === (n4 = e3.guides) || void 0 === n4 ? void 0 : n4.push(t4); }), c; }, getTranslate: function(t3, e3) { void 0 === e3 && (e3 = "x"); var n3 = 0; return (t3 || "").split(" ").forEach(function(t4) { var o3 = t4.trim(), r2 = "translate".concat(e3.toUpperCase(), "("); 0 === o3.indexOf(r2) && (n3 = parseFloat(o3.replace(r2, ""))); }), n3; }, setTranslate: function(t3, e3, n3) { var o3 = "translate".concat(e3.toUpperCase(), "("), r2 = "".concat(o3).concat(n3, ")"), i2 = (t3 || "").split(" ").map(function(t4) { return 0 === t4.trim().indexOf(o3) && (t4 = r2), t4; }).join(" "); return i2.indexOf(o3) < 0 && (i2 += " ".concat(r2)), i2; }, getPosition: function() { var t3 = this.target, e3 = this.isTran, n3 = t3.getStyle(), o3 = n3.left, r2 = n3.top, i2 = n3.transform, s2 = 0, a2 = 0; return e3 ? (s2 = this.getTranslate(i2), a2 = this.getTranslate(i2, "y")) : (s2 = parseFloat(o3 || 0), a2 = parseFloat(r2 || 0)), { x: s2, y: a2 }; }, setPosition: function(t3) { var e3 = t3.x, n3 = t3.y, r2 = t3.end, i2 = t3.position, s2 = t3.width, a2 = t3.height, l = this, c = l.target, u = l.isTran, p = l.em, d = "px", f = !r2, h = "".concat(parseInt(e3, 10)).concat(d), g = "".concat(parseInt(n3, 10)).concat(d), v = {}; if (u) { var y = c.getStyle()["transform"] || ""; y = this.setTranslate(y, "x", h), v = { transform: y = this.setTranslate(y, "y", g), __p: f }, c.addStyle(v, { avoidStore: !r2 }); } else { var m = { position: i2, width: s2, height: a2 }, b = { left: h, top: g, __p: f }; (0, o2.keys)(m).forEach(function(t4) { var e4 = m[t4]; e4 && (b[t4] = e4); }), v = b, c.addStyle(v, { avoidStore: !r2 }); } null == p || p.Styles.__emitCmpStyleUpdate(v, { components: p.getSelected() }); }, _getDragData: function() { var t3 = this.target; return { target: t3, parent: t3.parent(), index: t3.index() }; }, onStart: function(t3) { var e3 = this, n3 = e3.target, o3 = e3.editor, r2 = e3.isTran, i2 = e3.opts, s2 = i2.center, a2 = i2.onStart, l = o3.Canvas, c = n3.getStyle(), u = "absolute", p = [u, "relative"]; if (a2 && a2(this._getDragData()), !r2 && c.position !== u) { var d = l.offset(n3.getEl()), f = d.left, h = d.top, g = d.width, v = d.height, y = n3.parent(), m = void 0; do { var b = y.getStyle(); m = p.indexOf(b.position) >= 0 ? y : null, y = y.parent(); } while (y && !m); if (s2) { var _ = l.getMouseRelativeCanvas(t3); f = _.x, h = _.y; } else if (m) { var w = l.offset(m.getEl()); f -= w.left, h -= w.top; } this.setPosition({ x: f, y: h, width: "".concat(g, "px"), height: "".concat(v, "px"), position: u }); } }, onDrag: function() { for (var t3 = this, e3 = [], n3 = 0; n3 < arguments.length; n3++) e3[n3] = arguments[n3]; var o3 = this, r2 = o3.guidesTarget, i2 = o3.opts, s2 = i2.onDrag; this.updateGuides(r2), i2.debug && r2.forEach(function(e4) { return t3.renderGuide(e4); }), i2.guidesInfo && this.renderGuideInfo(r2.filter(function(t4) { return t4.active; })), s2 && s2(this._getDragData()); }, onEnd: function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this, r2 = o3.editor, a2 = o3.opts, l = o3.id, c = a2.onEnd; c && c(t3, n3, i(i({ event: t3 }, n3), this._getDragData())), r2.stopCommand(l), this.hideGuidesInfo(), this.em.trigger("".concat(s, ":end"), this.getEventOpts()); }, hideGuidesInfo: function() { var t3 = this; ["X", "Y"].forEach(function(e3) { var n3 = t3["elGuideInfo".concat(e3)]; n3 && (n3.style.display = "none"); }); }, renderGuideInfo: function(t3) { var e3 = this; void 0 === t3 && (t3 = []); var n3 = this.guidesStatic; this.hideGuidesInfo(), t3.forEach(function(t4) { var r2 = t4.origin, a2 = t4.x, l = e3.getElementPos(r2), c = (0, o2.isUndefined)(a2) ? "y" : "x", u = "y" === c, p = l[u ? "left" : "top"], d = l.rect[u ? "left" : "top"], f = u ? p + l.width : p + l.height, h = u ? d + l.rect.width : d + l.rect.height, g = e3["elGuideInfo".concat(c.toUpperCase())], v = e3["elGuideInfoContent".concat(c.toUpperCase())], y = g.style, m = null == n3 ? void 0 : n3.filter(function(e4) { return e4.type === t4.type; }).map(function(t5) { var e4 = t5.originRect, n4 = e4.left, o3 = e4.width, r3 = e4.top, i2 = e4.height, s2 = u ? n4 + o3 : r3 + i2; return { gap: s2 < p ? p - s2 : (u ? n4 : r3) - f, guide: t5 }; }).filter(function(t5) { return t5.gap > 0; }).sort(function(t5, e4) { return t5.gap - e4.gap; }).map(function(t5) { return t5.guide; })[0]; if (m) { var b = m.originRect, _ = b.left, w = b.width, x = b.top, C = b.height, S = b.rect, O = u ? _ < l.left : x < l.top, T = u ? _ : x, k = u ? S.left : S.top, P = u ? _ + w : x + C, E = u ? S.left + S.width : S.top + S.height, A = u ? t4.y : t4.x, j = O ? P : f, M = "".concat(A, "px"), L = O ? p - P : T - f, D = O ? d - E : k - h; y.display = "", y[u ? "top" : "left"] = M, y[u ? "left" : "top"] = "".concat(j, "px"), y[u ? "width" : "height"] = "".concat(L, "px"), v.innerHTML = "".concat(Math.round(D), "px"), e3.em.trigger("".concat(s, ":active"), i(i({}, e3.getEventOpts()), { guide: t4, guidesStatic: n3, matched: m, posFirst: A, posSecond: j, size: L, sizeRaw: D, elGuideInfo: g, elGuideInfoCnt: v })); } }); }, toggleDrag: function(t3) { var e3 = this.ppfx, n3 = this.editor, o3 = t3 ? "add" : "remove", r2 = ["".concat(e3, "is__grabbing")], i2 = n3.Canvas, s2 = i2.getBody(); r2.forEach(function(t4) { return s2.classList[o3](t4); }), i2[t3 ? "startAutoscroll" : "stopAutoscroll"](); } }; }, 236: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => o2 }); const o2 = { run: function(t3) { if (t3.Canvas.hasFocus()) { var e3 = []; t3.getSelectedAll().forEach(function(t4) { var n3 = t4.components(), o3 = n3 && n3.filter(function(t5) { return t5.get("selectable"); })[0]; o3 && e3.push(o3); }), e3.length && t3.select(e3); } } }; }, 368: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => o2 }); const o2 = { run: function(t3, e3, n3) { if (void 0 === n3 && (n3 = {}), t3.Canvas.hasFocus() || n3.force) { var o3 = []; t3.getSelectedAll().forEach(function(t4) { for (var e4 = t4.parent(); e4 && !e4.get("selectable"); ) e4 = e4.parent(); e4 && o3.push(e4); }), o3.length && t3.select(o3); } } }; }, 243: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => o2 }); const o2 = { run: function(t3) { if (t3.Canvas.hasFocus()) { var e3 = []; t3.getSelectedAll().forEach(function(t4) { var n3 = t4.parent(); if (n3) { var o3, r = n3.components().length, i = 0, s = 0; do { i++, o3 = (s = t4.index() + i) <= r ? n3.getChildAt(s) : null; } while (o3 && !o3.get("selectable")); e3.push(o3 || t4); } }), e3.length && t3.select(e3); } } }; }, 400: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => o2 }); const o2 = { run: function(t3) { if (t3.Canvas.hasFocus()) { var e3 = []; t3.getSelectedAll().forEach(function(t4) { var n3 = t4.parent(); if (n3) { var o3, r = 0, i = 0; do { r++, o3 = (i = t4.index() - r) >= 0 ? n3.getChildAt(i) : null; } while (o3 && !o3.get("selectable")); e3.push(o3 || t4); } }), e3.length && t3.select(e3); } } }; }, 910: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(50); const r = { run: function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var r2 = n3.target, i = []; if (!r2.get("styles")) return i; var s = r2.get("type"), a = t3.Pages.getAllWrappers(); if (!(0, o2.flatten)(a.map(function(t4) { return t4.findType(s); })).length) { var l = t3.CssComposer.getAll(); i = l.filter(function(t4) { return t4.get("group") === "cmp:".concat(s); }), l.remove(i); } return i; } }; }, 744: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = function(t3, e3, n3) { if (n3 || 2 === arguments.length) for (var o3, r2 = 0, i = e3.length; r2 < i; r2++) !o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]); return t3.concat(o3 || Array.prototype.slice.call(e3)); }; const r = { run: function(t3) { var e3 = t3.getModel(), n3 = o2([], t3.getSelectedAll(), true); n3.length && e3.set("clipboard", n3); } }; }, 517: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => s }); var o2 = n2(50), r = n2(895), i = n2(407); const s = (0, o2.extend)({}, i["default"], { init: function() { (0, o2.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(t3) { t3.stopPropagation(); var e3 = (0, r["default"])(t3.target); e3.data("model").get("removable") && (e3.addClass(this.hoverClass), this.attachBadge(e3.get(0))); }, stopDelete: function(t3) { t3.stopPropagation(), (0, r["default"])(t3.target).removeClass(this.hoverClass), this.badge && this.badge.css({ left: -1e3, top: -1e3 }); }, onDelete: function(t3) { t3.stopPropagation(); var e3 = (0, r["default"])(t3.target); e3.data("model").get("removable") && (e3.data("model").destroy(), this.removeBadge(), this.clean()); }, updateBadgeLabel: function(t3) { this.badge.html("Remove " + t3.getName()); } }); }, 457: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(895); const r = { run: function(t3, e3, n3) { var r2 = this; void 0 === n3 && (n3 = {}), e3 && e3.set && e3.set("active", 0); var i = t3.getConfig(), s = t3.Modal, a = i.stylePrefix; if (this.cm = t3.CodeManager || null, !this.$editors) { var l = this.buildEditor("htmlmixed", "hopscotch", "HTML"), c = this.buildEditor("css", "hopscotch", "CSS"); this.htmlEditor = l.el, this.cssEditor = c.el; var u = (0, o2["default"])('
')); u.append(l.$el).append(c.$el), this.$editors = u; } s.open({ title: i.textViewCode, content: this.$editors }).getModel().once("change:open", function() { return t3.stopCommand("".concat(r2.id)); }), this.htmlEditor.setContent(t3.getHtml(n3.optsHtml)), this.cssEditor.setContent(t3.getCss(n3.optsCss)); }, stop: function(t3) { var e3 = t3.Modal; e3 && e3.close(); }, buildEditor: function(t3, e3, n3) { var o3 = document.createElement("textarea"); !this.codeMirror && (this.codeMirror = this.cm.getViewer("CodeMirror")); var r2 = this.codeMirror.clone().set({ label: n3, codeName: t3, theme: e3, input: o3 }), i = new this.cm.EditorView({ model: r2, config: this.cm.getConfig() }).render().$el; return r2.init(o3), { el: r2, $el: i }; } }; }, 975: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(50); const r = { isEnabled: function() { var t3 = document; return !!(t3.fullscreenElement || t3.webkitFullscreenElement || t3.mozFullScreenElement); }, enable: function(t3) { var e3 = ""; return t3.requestFullscreen ? t3.requestFullscreen() : t3.webkitRequestFullscreen ? (e3 = "webkit", t3.webkitRequestFullscreen()) : t3.mozRequestFullScreen ? (e3 = "moz", t3.mozRequestFullScreen()) : t3.msRequestFullscreen && t3.msRequestFullscreen(), e3; }, disable: function() { var t3 = document; this.isEnabled() && (t3.exitFullscreen ? t3.exitFullscreen() : t3.webkitExitFullscreen ? t3.webkitExitFullscreen() : t3.mozCancelFullScreen ? t3.mozCancelFullScreen() : t3.msExitFullscreen && t3.msExitFullscreen()); }, fsChanged: function(t3) { this.isEnabled() || (this.stopCommand({ sender: this.sender }), document.removeEventListener("".concat(t3 || "", "fullscreenchange"), this.fsChanged)); }, run: function(t3, e3, n3) { void 0 === n3 && (n3 = {}), this.sender = e3; var r2 = n3.target, i = (0, o2.isElement)(r2) ? r2 : document.querySelector(r2), s = this.enable(i || t3.getContainer()); this.fsChanged = this.fsChanged.bind(this, s), document.addEventListener(s + "fullscreenchange", this.fsChanged), t3.trigger("change:canvasOffset"); }, stop: function(t3, e3) { e3 && e3.set && e3.set("active", false), this.disable(), t3 && t3.trigger("change:canvasOffset"); } }; }, 191: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => l }); var o2 = n2(50), r = n2(895), i = n2(163), s = n2(407), a = n2(189); const l = (0, o2.extend)({}, a["default"], s["default"], { init: function(t3) { s["default"].init.apply(this, arguments), (0, o2.bindAll)(this, "initSorter", "rollback", "onEndMove"), this.opt = t3, this.hoverClass = this.ppfx + "highlighter-warning", this.badgeClass = this.ppfx + "badge-warning", this.noSelClass = this.ppfx + "no-select"; }, enable: function() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; s["default"].enable.apply(this, t3), this.getBadgeEl().addClass(this.badgeClass), this.getHighlighterEl().addClass(this.hoverClass); var n3 = this.$wrapper; n3.css("cursor", "move"), n3.on("mousedown", this.initSorter), n3.addClass(this.noSelClass); }, toggleClipboard: function() { }, initSorter: function(t3) { var e3 = (0, r["default"])(t3.target).data("model").get("draggable"); e3 && (this.cacheEl = null, this.startSelectPosition(t3.target, this.frameEl.contentDocument), this.sorter.draggable = e3, this.sorter.onEndMove = this.onEndMove.bind(this), this.stopSelectComponent(), this.$wrapper.off("mousedown", this.initSorter), (0, i.on)(this.getContentWindow(), "keydown", this.rollback)); }, initSorterFromModel: function(t3) { var e3 = t3.get("draggable"); if (e3) { this.cacheEl = null; var n3 = t3.view.el; this.startSelectPosition(n3, this.frameEl.contentDocument), this.sorter.draggable = e3, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, i.on)(this.getContentWindow(), "keydown", this.rollback); } }, initSorterFromModels: function(t3) { this.cacheEl = null; var e3 = t3[t3.length - 1], n3 = (this.em.get("currentFrame") || {}).model, o3 = e3.getEl(n3), r2 = o3.ownerDocument; this.startSelectPosition(o3, r2, { onStart: this.onStart }), this.sorter.draggable = e3.get("draggable"), this.sorter.toMove = t3, this.sorter.onMoveClb = this.onDrag, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, i.on)(this.getContentWindow(), "keydown", this.rollback); }, onEndMoveFromModel: function() { (0, i.off)(this.getContentWindow(), "keydown", this.rollback); }, onEndMove: function() { this.enable(), (0, i.off)(this.getContentWindow(), "keydown", this.rollback); }, onSelect: function(t3, e3) { }, rollback: function(t3, e3) { (27 == (t3.which || t3.keyCode) || e3) && (this.sorter.moved = false, this.sorter.endMove()); }, getBadgeEl: function() { return this.$badge || (this.$badge = (0, r["default"])(this.getBadge())), this.$badge; }, getHighlighterEl: function() { return this.$hl || (this.$hl = (0, r["default"])(this.canvas.getHighlighter())), this.$hl; }, stop: function() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; s["default"].stop.apply(this, t3), this.getBadgeEl().removeClass(this.badgeClass), this.getHighlighterEl().removeClass(this.hoverClass); var n3 = this.$wrapper; n3.css("cursor", "").unbind().removeClass(this.noSelClass); } }); }, 912: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => i }); var o2 = n2(50), r = n2(491); const i = { open: function(t3) { var e3 = this, n3 = this, r2 = n3.editor, i2 = n3.title, s = n3.config, a = n3.am, l = s.custom; if ((0, o2.isFunction)(l.open)) return l.open(a.__customData()); r2.Modal.open({ title: i2, content: t3 }).onceClose(function() { return r2.stopCommand(e3.id); }); }, close: function() { var t3 = this.config.custom; if ((0, o2.isFunction)(t3.close)) return t3.close(this.am.__customData()); var e3 = this.editor.Modal; e3 && e3.close(); }, run: function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = t3.AssetManager, i2 = o3.getConfig(), s = n3.types, a = void 0 === s ? [] : s, l = n3.accept, c = n3.select; if (this.title = n3.modalTitle || t3.t("assetManager.modalTitle") || "", this.editor = t3, this.config = i2, this.am = o3, o3.setTarget(n3.target), o3.onClick(n3.onClick), o3.onDblClick(n3.onDblClick), o3.onSelect(n3.onSelect), o3.__behaviour({ select: c, types: a, options: n3 }), i2.custom) this.rendered = this.rendered || (0, r.ut)("div"), this.rendered.className = "".concat(i2.stylePrefix, "custom-wrp"), o3.__behaviour({ container: this.rendered }), o3.__trgCustom(); else { if (!this.rendered || a) { var u = o3.getAll().filter(function(t4) { return t4; }); a && a.length && (u = u.filter(function(t4) { return -1 !== a.indexOf(t4.get("type")); })), o3.render(u), this.rendered = o3.getContainer(); } if (l) { var p = this.rendered.querySelector("input#".concat(i2.stylePrefix, "uploadFile")); p && p.setAttribute("accept", l); } } return this.open(this.rendered), this; }, stop: function(t3) { this.editor = t3, this.close(this.rendered); } }; }, 117: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => i }); var o2 = n2(50), r = n2(491); const i = { open: function() { var t3 = this, e3 = t3.container, n3 = t3.editor, r2 = t3.bm, i2 = t3.config, s = i2.custom, a = i2.appendTo; if ((0, o2.isFunction)(s.open)) return s.open(r2.__customData()); if (this.firstRender && !a) { var l = "views-container", c = n3.Panels; (c.getPanel(l) || c.addPanel({ id: l })).set("appendContent", e3).trigger("change:appendContent"), s || e3.appendChild(r2.render()); } e3 && (e3.style.display = "block"); }, close: function() { var t3 = this.container, e3 = this.config.custom; if ((0, o2.isFunction)(e3.close)) return e3.close(this.bm.__customData()); t3 && (t3.style.display = "none"); }, run: function(t3) { var e3 = t3.Blocks; this.config = e3.getConfig(), this.firstRender = !this.container, this.container = this.container || (0, r.ut)("div"), this.editor = t3, this.bm = e3; var n3 = this.container; e3.__behaviour({ container: n3 }), this.config.custom && e3.__trgCustom(), this.open(); }, stop: function() { this.close(); } }; }, 614: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => o2 }); const o2 = { run: function(t3) { var e3 = t3.LayerManager, n3 = t3.Panels, o3 = e3.getConfig(); if (!o3.appendTo) { if (!this.layers) { var r = "views-container", i = document.createElement("div"), s = n3.getPanel(r) || n3.addPanel({ id: r }); o3.custom ? e3.__trgCustom({ container: i }) : i.appendChild(e3.render()), s.set("appendContent", i).trigger("change:appendContent"), this.layers = i; } this.layers.style.display = "block"; } }, stop: function() { var t3 = this.layers; t3 && (t3.style.display = "none"); } }; }, 801: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(895); const r = { run: function(t3, e3) { if (this.sender = e3, !this.$cn) { var n3 = t3.getConfig(), r2 = t3.Panels, i = "change:appendContent"; this.$cn = (0, o2["default"])("
"), this.$cn2 = (0, o2["default"])("
"), this.$cn.append(this.$cn2); var s = t3.DeviceManager; if (s && n3.showDevices) { var a = r2.addPanel({ id: "devices-c" }), l = s.render(); a.set("appendContent", l).trigger(i); } var c = t3.SelectorManager; this.slm = c; var u = c.getConfig(); u.custom ? c.__trgCustom({ container: this.$cn2.get(0) }) : u.appendTo || this.$cn2.append(c.render([])); var p = t3.StyleManager; this.sm = p; var d = p.getConfig(), f = d.stylePrefix; this.$header = (0, o2["default"])('
').concat(t3.t("styleManager.empty"), "
")), this.$cn.append(this.$header), d.custom ? p.__trgCustom({ container: this.$cn2.get(0) }) : d.appendTo || this.$cn2.append(p.render()); var h = "views-container"; this.panel = r2.getPanel(h), this.panel || (this.panel = r2.addPanel({ id: h })), this.panel.set("appendContent", this.$cn).trigger(i), this.em = t3.getModel(), this.listenTo(this.em, p.events.target, this.toggleSm); } this.toggleSm(); }, toggleSm: function() { var t3, e3, n3, o3, r2 = this.sender, i = this.sm; r2 && r2.get && !r2.get("active") || !i || (i.getSelected() ? (null === (t3 = this.$cn2) || void 0 === t3 || t3.show(), null === (e3 = this.$header) || void 0 === e3 || e3.hide()) : (null === (n3 = this.$cn2) || void 0 === n3 || n3.hide(), null === (o3 = this.$header) || void 0 === o3 || o3.show())); }, stop: function() { var t3, e3; null === (t3 = this.$cn2) || void 0 === t3 || t3.hide(), null === (e3 = this.$header) || void 0 === e3 || e3.hide(); } }; }, 395: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(895); const r = { run: function(t3, e3) { this.sender = e3; var n3, r2 = t3.getModel(), i = t3.Config.stylePrefix, s = t3.TraitManager, a = s.getConfig(); if (!a.appendTo) { if (!this.$cn) { this.$cn = (0, o2["default"])("
"), this.$cn2 = (0, o2["default"])("
"), this.$cn.append(this.$cn2), this.$header = (0, o2["default"])("
").append('
').concat(r2.t("traitManager.empty"), "
")), this.$cn.append(this.$header), this.$cn2.append('
').concat(r2.t("traitManager.label"), "
")), this.$cn2.append(s.render()); var l = t3.Panels; null == (n3 = l.getPanel("views-container") ? l.getPanel("views-container") : l.addPanel({ id: "views-container" })) || n3.set("appendContent", this.$cn.get(0)).trigger("change:appendContent"), this.target = t3.getModel(), this.listenTo(this.target, "component:toggled", this.toggleTm); } this.toggleTm(); } }, toggleTm: function() { var t3 = this.sender; t3 && t3.get && !t3.get("active") || (1 === this.target.getSelectedAll().length ? (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: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(50); const r = { run: function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var r2 = t3.getModel().get("clipboard"), i = t3.getSelected(); r2 && i && (t3.getSelectedAll().forEach(function(e4) { var i2 = e4.collection; if (i2) { var s, a = { at: e4.index() + 1, action: n3.action || "paste-component" }; if ((0, o2.contains)(r2, e4) && e4.get("copyable")) s = i2.add(e4.clone(), a); else { var l = r2.filter(function(t4) { return t4.get("copyable"); }).filter(function(n4) { return t3.Components.canMove(e4.parent(), n4).result; }); s = i2.add(l.map(function(t4) { return t4.clone(); }), a); } (s = (0, o2.isArray)(s) ? s : [s]).forEach(function(e5) { return t3.trigger("component:paste", e5); }); } }), i.emitUpdate()); } }; }, 129: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => s }); var o2 = n2(50), r = function(t3, e3, n3) { if (n3 || 2 === arguments.length) for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]); return t3.concat(o3 || Array.prototype.slice.call(e3)); }, i = "core:component-outline"; const s = { getPanels: function(t3) { return this.panels || (this.panels = t3.Panels.getPanels()), this.panels; }, preventDrag: function(t3) { t3.abort = 1; }, tglEffects: function(t3) { var e3 = this.em, n3 = t3 ? "on" : "off"; if (e3) { var r2 = e3.Canvas, i2 = r2.getBody(), s2 = r2.getToolbarEl(); s2 && (s2.style.display = t3 ? "none" : ""); var a = i2.querySelectorAll(".".concat(this.ppfx, "no-pointer")); (0, o2.each)(a, function(e4) { return e4.style.pointerEvents = t3 ? "all" : ""; }), e3[n3]("run:tlb-move:before", this.preventDrag); } }, run: function(t3, e3) { var n3 = this; this.sender = e3, this.selected = r([], t3.getSelectedAll(), true), t3.select(), this.shouldRunSwVisibility || (this.shouldRunSwVisibility = t3.Commands.isActive(i)), this.shouldRunSwVisibility && t3.stopCommand(i), t3.getModel().stopDefault(); var o3 = this.getPanels(t3), s2 = t3.Canvas.getElement(), a = t3.getEl(), l = t3.Config.stylePrefix; if (!this.helper) { var c = document.createElement("span"); c.className = "".concat(l, "off-prv fa fa-eye-slash"), a.appendChild(c), c.onclick = function() { return n3.stopCommand(); }, this.helper = c; } this.helper.style.display = "inline-block", o3.forEach(function(t4) { return t4.set("visible", false); }); var u = s2.style; u.width = "100%", u.height = "100%", u.top = "0", u.left = "0", u.padding = "0", u.margin = "0", t3.refresh(), this.tglEffects(1); }, stop: function(t3) { var e3 = this.sender, n3 = void 0 === e3 ? {} : e3, o3 = this.selected; n3.set && n3.set("active", 0); var r2 = this.getPanels(t3); this.shouldRunSwVisibility && (t3.runCommand(i), this.shouldRunSwVisibility = false), t3.getModel().runDefault(), r2.forEach(function(t4) { return t4.set("visible", true); }), t3.Canvas.getElement().setAttribute("style", ""), o3 && t3.select(o3), delete this.selected, this.helper && (this.helper.style.display = "none"), t3.refresh(), this.tglEffects(); } }; }, 116: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = function() { return o2 = Object.assign || function(t3) { for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++) for (var r2 in e3 = arguments[n3]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, o2.apply(this, arguments); }; const r = { run: function(t3, e3, n3) { var r2 = n3 || {}, i = t3.Canvas, s = i.getCanvasView(), a = o2({ appendTo: i.getResizerEl(), prefix: t3.getConfig().stylePrefix, posFetcher: s.getElementPos.bind(s), mousePosFetcher: i.getMouseRelativePos }, r2.options || {}), l = this.canvasResizer; return l && !r2.forceNew || (this.canvasResizer = new t3.Utils.Resizer(a), l = this.canvasResizer), l.setOptions(a, true), l.blur(), l.focus(r2.el), l; }, stop: function() { var t3; null === (t3 = this.canvasResizer) || void 0 === t3 || t3.blur(); } }; }, 407: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => C }); var o2, r = n2(50), i = n2(895), s = n2(346), a = (o2 = function(t3, e3) { return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, o2(t3, e3); }, function(t3, e3) { if ("function" != typeof e3 && null !== e3) throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null"); function n3() { this.constructor = t3; } o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3()); }); const l = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return a(e3, t3), e3.prototype.defaults = function() { return { command: "", attributes: {} }; }, e3; }(s.Hn); var c = function() { var t3 = function(e3, n3) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n4 in e4) Object.prototype.hasOwnProperty.call(e4, n4) && (t4[n4] = e4[n4]); }, t3(e3, n3); }; return function(e3, n3) { if ("function" != typeof n3 && null !== n3) throw new TypeError("Class extends value " + String(n3) + " is not a constructor or null"); function o3() { this.constructor = e3; } t3(e3, n3), e3.prototype = null === n3 ? Object.create(n3) : (o3.prototype = n3.prototype, new o3()); }; }(), u = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return c(e3, t3), e3; }(s.FE); const p = u; u.prototype.model = l; var d = n2(330), f = function() { var t3 = function(e3, n3) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n4 in e4) Object.prototype.hasOwnProperty.call(e4, n4) && (t4[n4] = e4[n4]); }, t3(e3, n3); }; return function(e3, n3) { if ("function" != typeof n3 && null !== n3) throw new TypeError("Class extends value " + String(n3) + " is not a constructor or null"); function o3() { this.constructor = e3; } t3(e3, n3), e3.prototype = null === n3 ? Object.create(n3) : (o3.prototype = n3.prototype, new o3()); }; }(), h = function() { return h = Object.assign || function(t3) { for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++) for (var r2 in e3 = arguments[n3]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, h.apply(this, arguments); }; const g = function(t3) { function e3(e4) { var n3 = t3.call(this, e4) || this; return n3.em = e4.config.em, n3; } return f(e3, t3), e3.prototype.events = function() { return this.model.get("events") || { mousedown: "handleClick" }; }, e3.prototype.attributes = function() { return this.model.get("attributes"); }, e3.prototype.handleClick = function(t4) { t4.preventDefault(), t4.stopPropagation(); var e4 = this.em, n3 = e4.Canvas.getFrameEl().getBoundingClientRect(), o3 = n3.left, r2 = n3.top, i2 = h(h({}, t4), { clientX: t4.clientX - o3, clientY: t4.clientY - r2 }); e4.trigger("toolbar:run:before", { event: i2 }), this.execCommand(i2); }, e3.prototype.execCommand = function(t4) { var e4 = this.em, n3 = { event: t4 }, o3 = this.model.get("command"), i2 = e4.Editor; (0, r.isFunction)(o3) && o3(i2, null, n3), (0, r.isString)(o3) && i2.runCommand(o3, n3); }, e3.prototype.render = function() { var t4 = this, e4 = t4.em, n3 = t4.$el, o3 = t4.model, r2 = o3.get("id"), i2 = o3.get("label"), s2 = e4.getConfig().stylePrefix; return n3.addClass("".concat(s2, "toolbar-item")), r2 && n3.addClass("".concat(s2, "toolbar-item__").concat(r2)), i2 && n3.append(i2), this; }, e3; }(s.G7); var v = function() { var t3 = function(e3, n3) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n4 in e4) Object.prototype.hasOwnProperty.call(e4, n4) && (t4[n4] = e4[n4]); }, t3(e3, n3); }; return function(e3, n3) { if ("function" != typeof n3 && null !== n3) throw new TypeError("Class extends value " + String(n3) + " is not a constructor or null"); function o3() { this.constructor = e3; } t3(e3, n3), e3.prototype = null === n3 ? Object.create(n3) : (o3.prototype = n3.prototype, new o3()); }; }(), y = function(t3) { function e3(e4) { var n3 = t3.call(this, e4) || this, o3 = e4.em; return n3.em = o3, n3.config = { em: o3 }, n3.listenTo(n3.collection, "reset", n3.render), n3; } return v(e3, t3), e3.prototype.onRender = function() { var t4 = this.em.config.stylePrefix; this.el.className = "".concat(t4, "toolbar-items"); }, e3; }(d.Z); const m = y; y.prototype.itemView = g; var b, _ = n2(491), w = n2(163), x = function() { return x = Object.assign || function(t3) { for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++) for (var r2 in e3 = arguments[n3]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, x.apply(this, arguments); }; const C = { init: function(t3) { (0, r.bindAll)(this, "onHover", "onOut", "onClick", "onFrameScroll", "onFrameUpdated", "onContainerChange"); }, enable: function() { this.frameOff = this.canvasOff = this.adjScroll = null, this.startSelectComponent(), b = true; }, startSelectComponent: function() { this.toggleSelectComponent(1), this.em.getSelected() && this.onSelect(); }, stopSelectComponent: function() { this.toggleSelectComponent(); }, toggleSelectComponent: function(t3) { var e3 = this, n3 = this.em, o3 = n3.getConfig().listenToEl, r2 = n3.getContainer().parentNode, i2 = t3 ? "on" : "off", s2 = { on: w.on, off: w.off }; !o3.length && r2 && o3.push(r2); s2[i2](window, "resize", this.onFrameUpdated), s2[i2](o3, "scroll", this.onContainerChange), n3[i2]("component:toggled component:update undo redo", this.onSelect, this), n3[i2]("change:componentHovered", this.onHovered, this), n3[i2]("component:resize styleable:change component:input", this.updateGlobalPos, this), n3[i2]("component:update:toolbar", this._upToolbar, this), n3[i2]("change:canvasOffset", this.updateAttached, this), n3[i2]("frame:updated", this.onFrameUpdated, this), n3[i2]("canvas:updateTools", this.onFrameUpdated, this), n3.Canvas.getFrames().forEach(function(t4) { var n4 = t4.view, o4 = null == n4 ? void 0 : n4.getWindow(); o4 && function(t5, n5) { s2[i2](n5, "mouseover", e3.onHover), s2[i2](n5, "mouseleave", e3.onOut), s2[i2](n5, "click", e3.onClick), s2[i2](t5, "scroll", e3.onFrameScroll, true); }(o4, null == n4 ? void 0 : n4.getBody()); }); }, onHover: function(t3) { t3.stopPropagation(); var e3 = this.em, n3 = t3.target, o3 = (0, w.getViewEl)(n3), r2 = o3 && o3._getFrame(), s2 = (0, i["default"])(n3), a2 = s2.data("model"); if (!a2) for (var l2 = s2.parent(); !a2 && l2.length && !(0, _.Mx)(l2[0]); ) a2 = l2.data("model"), l2 = l2.parent(); this.currentDoc = n3.ownerDocument, e3.setHovered(a2, { useValid: true }), r2 && e3.set("currentFrame", r2); }, onFrameUpdated: function() { this.updateLocalPos(), this.updateGlobalPos(); }, onHovered: function(t3, e3) { var n3, o3 = this, r2 = {}; e3 ? null === (n3 = e3.views) || void 0 === n3 || n3.forEach(function(t4) { var n4 = t4.el, i2 = o3.getElementPos(n4); r2 = { el: n4, pos: i2, component: e3, view: (0, w.getViewEl)(n4) }, o3.updateToolsLocal(r2), n4.ownerDocument === o3.currentDoc && (o3.elHovered = r2); }) : (this.currentDoc = null, this.elHovered = 0, this.updateToolsLocal(), this.canvas.getFrames().forEach(function(t4) { var e4 = t4.view, n4 = e4 && e4.getToolsEl(); n4 && o3.toggleToolsEl(0, 0, { el: n4 }); })); }, onSelect: (0, r.debounce)(function() { var t3 = this.em, e3 = t3.getSelected(), n3 = t3.get("currentFrame") || {}, o3 = e3 && e3.getView(n3.model), r2 = o3 && o3.el, i2 = {}; r2 && (0, _.pn)(r2) && (i2 = { el: r2, pos: this.getElementPos(r2), component: e3, view: (0, w.getViewEl)(r2) }); this.elSelected = i2, this.updateToolsGlobal(), this.updateLocalPos(i2), this.initResize(e3); }, 0), updateGlobalPos: function() { var t3 = this.getElSelected(); t3.el && (t3.pos = this.getElementPos(t3.el), this.updateToolsGlobal()); }, updateLocalPos: function(t3) { var e3 = this.getElHovered(); e3.el && (e3.pos = this.getElementPos(e3.el), this.updateToolsLocal(t3)); }, getElHovered: function() { return this.elHovered || {}; }, getElSelected: function() { return this.elSelected || {}; }, onOut: function() { this.em.setHovered(0); }, toggleToolsEl: function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = n3.el || this.canvas.getToolsEl(e3); return o3 && (o3.style.display = t3 ? "" : "none"), o3 || {}; }, showElementOffset: function(t3, e3, n3) { void 0 === n3 && (n3 = {}), b && this.editor.runCommand("show-offset", { el: t3, elPos: e3, view: n3.view, force: 1, top: 0, left: 0 }); }, hideElementOffset: function(t3) { this.editor.stopCommand("show-offset", { view: t3 }); }, showFixedElementOffset: function(t3, e3) { this.editor.runCommand("show-offset", { el: t3, elPos: e3, state: "Fixed" }); }, hideFixedElementOffset: function() { this.editor && this.editor.stopCommand("show-offset", { state: "Fixed" }); }, hideHighlighter: function(t3) { this.canvas.getHighlighter(t3).style.opacity = 0; }, onClick: function(t3) { t3.stopPropagation(), t3.preventDefault(); var e3 = this.em; if (e3.get("_cmpDrag")) return e3.set("_cmpDrag"); var n3 = (0, i["default"])(t3.target), o3 = n3.data("model"); if (!o3) for (var r2 = n3.parent(); !o3 && r2.length && !(0, _.Mx)(r2[0]); ) o3 = r2.data("model"), r2 = r2.parent(); if (o3) { if (e3.isEditing() && !o3.get("textable") && o3.isChildOf("text")) return; this.select(o3, t3); } }, select: function(t3, e3) { void 0 === e3 && (e3 = {}), t3 && (this.editor.select(t3, { event: e3, useValid: true }), this.initResize(t3)); }, updateBadge: function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.canvas, r2 = (0, i["default"])(t3).data("model"); if (r2 && r2.get("badgable")) { var s2 = this.getBadge(n3); if (!n3.posOnly) { var a2 = this.canvas.getConfig(), l2 = r2.getIcon(), c2 = a2.pStylePrefix || "", u2 = "".concat(c2, "badge"), p2 = a2.customBadgeLabel, d2 = "".concat(l2 ? '
').concat(l2, "
") : "", '\n
').concat(r2.getName(), "
"); s2.innerHTML = p2 ? p2(r2) : d2; } var f2 = "px", h2 = s2.style; h2.display = "block"; var g2 = o3.getTargetToElementFixed(t3, s2, { pos: e3 }).top, v2 = n3.leftOff < 0 ? -n3.leftOff : 0; h2.top = g2 + f2, h2.left = v2 + f2; } }, showHighlighter: function(t3) { this.canvas.getHighlighter(t3).style.opacity = ""; }, initResize: function(t3) { var e3, n3 = this.em, o3 = this.canvas, i2 = null == n3 ? void 0 : n3.Editor, s2 = (null == n3 ? void 0 : n3.config).stylePrefix || "", a2 = "".concat(s2, "resizing"), l2 = !(0, r.isElement)(t3) && (0, w.isTaggableNode)(t3) ? t3 : n3.getSelected(), c2 = l2 && l2.get("resizable"), u2 = {}, p2 = function(t4, e4, n4) { var o4 = n4.docs; o4 && o4.forEach(function(e5) { var n5 = e5.body, o5 = n5.className || ""; n5.className = ("add" == t4 ? "".concat(o5, " ").concat(a2) : o5.replace(a2, "")).trim(); }); }; if (i2 && c2) { var d2 = (0, r.isElement)(t3) ? t3 : l2.getEl(); u2 = { onStart: function(t4, r2) { void 0 === r2 && (r2 = {}); var i3 = r2.el, s3 = r2.config, a3 = r2.resizer, c3 = s3.keyHeight, u3 = s3.keyWidth, d3 = s3.currentUnit, f2 = s3.keepAutoHeight, h2 = s3.keepAutoWidth; p2("add", 0, r2), e3 = n3.Styles.getModelToStyle(l2), o3.toggleFramesEvents(false); var g2 = getComputedStyle(i3), v2 = e3.getStyle(), y2 = v2[u3]; s3.autoWidth = h2 && "auto" === y2, isNaN(parseFloat(y2)) && (y2 = g2[u3]); var m2 = v2[c3]; s3.autoHeight = f2 && "auto" === m2, isNaN(parseFloat(m2)) && (m2 = g2[c3]), a3.startDim.w = parseFloat(y2), a3.startDim.h = parseFloat(m2), b = false, d3 && (s3.unitHeight = (0, w.getUnitFromValue)(m2), s3.unitWidth = (0, w.getUnitFromValue)(y2)); }, onMove: function() { i2.trigger("component:resize"); }, onEnd: function(t4, e4) { p2("remove", 0, e4), i2.trigger("component:resize"), o3.toggleFramesEvents(true), b = true; }, updateTarget: function(t4, r2, i3) { if (void 0 === i3 && (i3 = {}), e3) { var s3 = i3.store, a3 = i3.selectedHandler, c3 = i3.config, u3 = c3.keyHeight, p3 = c3.keyWidth, d3 = c3.autoHeight, f2 = c3.autoWidth, h2 = c3.unitWidth, g2 = c3.unitHeight, v2 = ["tc", "bc"].indexOf(a3) >= 0, y2 = ["cl", "cr"].indexOf(a3) >= 0, m2 = {}; if (!v2) { var b2 = o3.getBody().offsetWidth, _2 = r2.w < b2 ? r2.w : b2; m2[p3] = f2 ? "auto" : "".concat(_2).concat(h2); } y2 || (m2[u3] = d3 ? "auto" : "".concat(r2.h).concat(g2)), n3.getDragMode(l2) && (m2.top = "".concat(r2.t).concat(g2), m2.left = "".concat(r2.l).concat(h2)); var w2 = x(x({}, m2), { __p: !s3 }); e3.addStyle(w2, { avoidStore: !s3 }), n3.Styles.__emitCmpStyleUpdate(w2, { components: n3.getSelected() }); } } }, "object" == typeof c2 && (u2 = x(x(x({}, u2), c2), { parent: u2 })), this.resizer = i2.runCommand("resize", { el: d2, options: u2, force: 1 }); } else i2.stopCommand("resize"), this.resizer = null; }, updateToolbar: function(t3) { var e3 = this.config.em, n3 = t3 == e3 ? e3.getSelected() : t3, o3 = this.canvas.getToolbarEl(), r2 = o3.style, i2 = n3.get("toolbar"), s2 = e3.config.showToolbar; if (n3 && s2 && i2 && i2.length) { if (r2.display = "", !this.toolbar) { o3.innerHTML = "", this.toolbar = new p(i2); var a2 = new m({ collection: this.toolbar, em: e3 }); o3.appendChild(a2.render().el); } this.toolbar.reset(i2), r2.top = "-100px", r2.left = "0"; } else r2.display = "none"; }, updateToolbarPos: function(t3) { var e3 = "px", n3 = this.canvas.getToolbarEl().style; n3.top = "".concat(t3.top).concat(e3), n3.left = "".concat(t3.left).concat(e3), n3.opacity = ""; }, getCanvasPosition: function() { return this.canvas.getCanvasView().getPosition(); }, getBadge: function(t3) { return void 0 === t3 && (t3 = {}), this.canvas.getBadgeEl(t3.view); }, onFrameScroll: function() { this.updateTools(); }, updateTools: function() { this.updateLocalPos(), this.updateGlobalPos(); }, isCompSelected: function(t3) { return t3 && "selected" === t3.get("status"); }, updateToolsLocal: function(t3) { var e3 = this.em.getConfig(), n3 = t3 || this.getElHovered(), o3 = n3.el, r2 = n3.pos, i2 = n3.view, s2 = n3.component; if (o3) { var a2 = s2.get("hoverable"), l2 = this.lastHovered !== o3, c2 = l2 ? {} : { posOnly: 1 }; l2 && a2 && (this.lastHovered = o3, this.showHighlighter(i2), this.showElementOffset(o3, r2, { view: i2 })), this.isCompSelected(s2) && (this.hideHighlighter(i2), !e3.showOffsetsSelected && this.hideElementOffset(i2)); var u2 = "px", p2 = this.toggleToolsEl(1, i2), d2 = p2.style, f2 = this.canvas.canvasRectOffset(o3, r2), h2 = f2.top, g2 = f2.left; this.updateBadge(o3, r2, x(x({}, c2), { view: i2, topOff: h2, leftOff: g2 })), d2.top = h2 + u2, d2.left = g2 + u2, d2.width = r2.width + u2, d2.height = r2.height + u2, this._trgToolUp("local", { component: s2, el: p2, top: h2, left: g2, width: r2.width, height: r2.height }); } else this.lastHovered = 0; }, _upToolbar: (0, r.debounce)(function() { this.updateToolsGlobal({ force: 1 }); }, 0), _trgToolUp: function(t3, e3) { void 0 === e3 && (e3 = {}), this.em.trigger("canvas:tools:update", x({ type: t3 }, e3)); }, updateToolsGlobal: function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.getElSelected(), n3 = e3.el, o3 = e3.pos, r2 = e3.component; if (!n3) return this.toggleToolsEl(), void (this.lastSelected = 0); var i2 = this.canvas; (this.lastSelected !== n3 || t3.force) && (this.lastSelected = n3, this.updateToolbar(r2)); var s2 = "px", a2 = this.toggleToolsEl(1), l2 = a2.style, c2 = i2.getTargetToElementFixed(n3, i2.getToolbarEl(), { pos: o3 }), u2 = c2.canvasOffsetTop, p2 = c2.canvasOffsetLeft; l2.top = u2 + s2, l2.left = p2 + s2, l2.width = o3.width + s2, l2.height = o3.height + s2, this.updateToolbarPos({ top: c2.top, left: c2.left }), this._trgToolUp("global", { component: r2, el: a2, top: u2, left: p2, width: o3.width, height: o3.height }); }, updateAttached: (0, r.debounce)(function() { this.updateGlobalPos(); }, 0), onContainerChange: (0, r.debounce)(function() { this.em.refreshCanvas(); }, 150), getElementPos: function(t3) { return this.canvas.getCanvasView().getElementPos(t3, { noScroll: true }); }, hideBadge: function() { this.getBadge().style.display = "none"; }, cleanPrevious: function(t3) { t3 && t3.set({ status: "", state: "" }); }, getContentWindow: function() { return this.canvas.getWindow(); }, run: function(t3) { (0, w.hasWin)() && (this.editor = t3 && t3.get("Editor"), this.enable()); }, stop: function(t3, e3, n3) { if (void 0 === n3 && (n3 = {}), (0, w.hasWin)()) { var o3 = this.em, r2 = this.editor; this.onHovered(), this.stopSelectComponent(), !n3.preserveSelected && o3.setSelected(), this.toggleToolsEl(), r2 && r2.stopCommand("resize"); } } }; }, 189: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(895); const r = { startSelectPosition: function(t3, e3, n3) { var o3 = this; void 0 === n3 && (n3 = {}), this.isPointed = false; var r2 = this.em.Utils, i = t3.ownerDocument.body; r2 && !this.sorter && (this.sorter = new r2.Sorter({ container: i, placer: this.canvas.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: this.ppfx, direction: "a", document: e3, wmargin: 1, nested: 1, em: this.em, canvasRelative: 1, scale: function() { return o3.em.getZoomDecimal(); } })), n3.onStart && (this.sorter.onStart = n3.onStart), t3 && this.sorter.startSort(t3, { container: i }); }, getOffsetDim: function() { var t3 = this.offset(this.canvas.getFrameEl()), e3 = this.offset(this.canvas.getElement()); return { top: t3.top - e3.top, left: t3.left - e3.left }; }, stopSelectPosition: function() { this.posTargetCollection = null, this.posIndex = "after" == this.posMethod && 0 !== this.cDim.length ? this.posIndex + 1 : this.posIndex, this.sorter && (this.sorter.moved = 0, this.sorter.endMove()), this.cDim && (this.posIsLastEl = 0 !== this.cDim.length && "after" == this.posMethod && this.posIndex == this.cDim.length, this.posTargetEl = 0 === this.cDim.length ? (0, o2["default"])(this.outsideElem) : !this.posIsLastEl && this.cDim[this.posIndex] ? (0, o2["default"])(this.cDim[this.posIndex][5]).parent() : (0, o2["default"])(this.outsideElem), this.posTargetModel = this.posTargetEl.data("model"), this.posTargetCollection = this.posTargetEl.data("model-comp")); }, enable: function() { this.startSelectPosition(); }, nearFloat: function(t3, e3, n3) { var o3 = t3 || 0, r2 = e3 || "before", i = n3.length, s = 0 !== i && "after" == r2 && o3 == i; return 0 !== i && (!s && !n3[o3][4] || n3[o3 - 1] && !n3[o3 - 1][4] || s && !n3[o3 - 1][4]) ? 1 : 0; }, run: function() { this.enable(); }, stop: function() { this.stopSelectPosition(), this.$wrapper.css("cursor", ""), this.$wrapper.unbind(); } }; }, 804: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => a }); var o2 = n2(50), r = n2(895), i = n2(163), s = function() { return s = Object.assign || function(t3) { for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++) for (var r2 in e3 = arguments[n3]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, s.apply(this, arguments); }; const a = { getOffsetMethod: function(t3) { return "get" + (t3 || "") + "OffsetViewerEl"; }, run: function(t3, e3, n3) { var a2 = n3 || {}, l = a2.state || "", c = t3.getConfig(), u = this.em.getZoomDecimal(), p = a2.el || ""; if (!c.showOffsets || (0, i.isTextNode)(p) || !c.showOffsetsSelected && "Fixed" == l) t3.stopCommand("".concat(this.id), n3); else { var d = t3.Canvas, f = s({}, a2.elPos || d.getElementPos(p)); (0, o2.isUndefined)(a2.top) || (f.top = a2.top), (0, o2.isUndefined)(a2.left) || (f.left = a2.left); var h = window.getComputedStyle(p), g = this.ppfx, v = l + "State", y = d[this.getOffsetMethod(l)](n3.view); y.style.opacity = ""; var m = this["marginT" + l], b = this["marginB" + l], _ = this["marginL" + l], w = this["marginR" + l], x = this["padT" + l], C = this["padB" + l], S = this["padL" + l], O = this["padR" + l]; if (y.childNodes.length && (this[v] = "1", m = y.querySelector("[data-offset-m-t]"), b = y.querySelector("[data-offset-m-b]"), _ = y.querySelector("[data-offset-m-l]"), w = y.querySelector("[data-offset-m-r]"), x = y.querySelector("[data-offset-p-t]"), C = y.querySelector("[data-offset-p-b]"), S = y.querySelector("[data-offset-p-l]"), O = y.querySelector("[data-offset-p-r]")), !this[v]) { var T = l.toLowerCase(), k = T + "margin-v", P = T + "padding-v", E = (0, r["default"])('
')).get(0), A = (0, r["default"])('
')).get(0), j = g + P + "-el", M = "".concat(g + k + "-el", " ").concat(g + k), L = "".concat(j, " ").concat(g + P); m = (0, r["default"])('
')).get(0), b = (0, r["default"])('
')).get(0), _ = (0, r["default"])('
')).get(0), w = (0, r["default"])('
')).get(0), x = (0, r["default"])('
')).get(0), C = (0, r["default"])('
')).get(0), S = (0, r["default"])('
')).get(0), O = (0, r["default"])('
')).get(0), this["marginT" + l] = m, this["marginB" + l] = b, this["marginL" + l] = _, this["marginR" + l] = w, this["padT" + l] = x, this["padB" + l] = C, this["padL" + l] = S, this["padR" + l] = O, E.appendChild(m), E.appendChild(b), E.appendChild(_), E.appendChild(w), A.appendChild(x), A.appendChild(C), A.appendChild(S), A.appendChild(O), y.appendChild(E), y.appendChild(A), this[v] = "1"; } var D = "px", N = parseFloat(h.marginLeft.replace(D, "")) * u, I = parseFloat(h.marginRight.replace(D, "")) * u, F = parseFloat(h.marginTop.replace(D, "")) * u, V = parseFloat(h.marginBottom.replace(D, "")) * u, R = m.style, H = b.style, z = _.style, B = w.style, U = x.style, W = C.style, $ = S.style, q = O.style, G = parseFloat(f.left), K = parseFloat(h.width) * u + D; R.height = F + D, R.width = K, R.top = f.top - F + D, R.left = G + D, H.height = V + D, H.width = K, H.top = f.top + f.height + D, H.left = G + D; var Y = f.height + F + V + D, X = f.top - F + D; z.height = Y, z.width = N + D, z.top = X, z.left = G - N + D, B.height = Y, B.width = I + D, B.top = X, B.left = G + f.width + D; var J = parseFloat(h.paddingTop) * u; U.height = J + D; var Z = parseFloat(h.paddingBottom) * u; W.height = Z + D; var Q = f.height - Z - J + D, tt = f.top + J + D; $.height = Q, $.width = parseFloat(h.paddingLeft) * u + D, $.top = tt; var et = parseFloat(h.paddingRight) * u; q.height = Q, q.width = et + D, q.top = tt; } }, stop: function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = (n3 || {}).state || "", r2 = this.getOffsetMethod(o3); t3.Canvas[r2](n3.view).style.opacity = 0; } }; }, 434: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => r }); var o2 = n2(50); const r = { init: function() { (0, o2.bindAll)(this, "_onFramesChange"); }, run: function(t3) { this.toggleVis(t3); }, stop: function(t3) { this.toggleVis(t3, 0); }, toggleVis: function(t3, e3) { var n3 = this; if (void 0 === e3 && (e3 = 1), !t3.Commands.isActive("preview")) { var o3 = t3.Canvas, r2 = e3 ? "on" : "off"; o3.getFrames().forEach(function(t4) { return n3._upFrame(t4, e3); }), o3.getModel()[r2]("change:frames", this._onFramesChange); } }, _onFramesChange: function(t3, e3) { var n3 = this; e3.forEach(function(t4) { return t4.once("loaded", function() { return n3._upFrame(t4, true); }); }); }, _upFrame: function(t3, e3) { var n3, o3 = e3 ? "add" : "remove"; null === (n3 = t3.view) || void 0 === n3 || n3.getBody().classList[o3]("".concat(this.ppfx, "dashed")); } }; }, 346: (t2, e2, n2) => { n2.d(e2, { FE: () => l, G7: () => c, Hn: () => a }); var o2, r = n2(316), i = n2.n(r), s = (o2 = function(t3, e3) { return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, o2(t3, e3); }, function(t3, e3) { if ("function" != typeof e3 && null !== e3) throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null"); function n3() { this.constructor = t3; } o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3()); }), a = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return s(e3, t3), e3; }(i().Model), l = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return s(e3, t3), e3; }(i().Collection), c = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return s(e3, t3), e3; }(i().View); }, 330: (t2, e2, n2) => { n2.d(e2, { Z: () => l }); var o2, r = n2(50), i = n2(346), s = (o2 = function(t3, e3) { return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, o2(t3, e3); }, function(t3, e3) { if ("function" != typeof e3 && null !== e3) throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null"); function n3() { this.constructor = t3; } o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3()); }), a = function(t3) { function e3(e4, n3, o3) { void 0 === e4 && (e4 = {}), void 0 === o3 && (o3 = false); var r2 = t3.call(this, e4) || this; return r2.itemsView = "", r2.itemType = "type", r2.reuseView = false, r2.config = n3 || e4.config || {}, o3 && r2.listenTo(r2.collection, "add", r2.addTo), r2.items = [], r2; } return s(e3, t3), e3.prototype.addTo = function(t4) { this.add(t4); }, e3.prototype.itemViewNotFound = function(t4) { var e4 = this.config, n3 = this.ns, o3 = e4.em, r2 = "".concat(n3 ? "[".concat(n3, "]: ") : "", "'").concat(t4, "' type not found"); o3 && o3.logWarning(r2); }, e3.prototype.add = function(t4, e4) { var n3, o3 = this, i2 = o3.config, s2 = o3.reuseView, a2 = o3.items, l2 = this.itemsView || {}, c = e4 || null, u = this.itemView, p = t4.get(this.itemType); l2[p] ? u = l2[p] : !p || l2[p] || (0, r.includes)(["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"], p) || this.itemViewNotFound(p), n3 = t4.view && s2 ? t4.view : new u({ model: t4, config: i2 }, i2), a2 && a2.push(n3); var d = n3.render().el; c ? c.appendChild(d) : this.$el.append(d); }, e3.prototype.render = function() { var t4 = document.createDocumentFragment(); return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each(function(e4) { this.add(e4, t4); }, this), this.$el.append(t4), this.onRender(), this; }, e3.prototype.onRender = function() { }, e3.prototype.onRemoveBefore = function(t4, e4) { }, e3.prototype.onRemove = function(t4, e4) { }, e3.prototype.remove = function(e4) { void 0 === e4 && (e4 = {}); var n3 = this.items; return this.onRemoveBefore(n3, e4), this.clearItems(), t3.prototype.remove.call(this), this.onRemove(n3, e4), this; }, e3.prototype.clearItems = function() { this.items; }, e3; }(i.G7); const l = a; a.prototype.itemView = ""; }, 668: (t2, e2, n2) => { n2.d(e2, { Z: () => a }); var o2 = n2(50), r = n2(163), i = function() { return i = Object.assign || function(t3) { for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++) for (var r2 in e3 = arguments[n3]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, i.apply(this, arguments); }, s = ["x", "y"]; const a = function() { function t3(t4) { return void 0 === t4 && (t4 = {}), this.opts = { snapOffset: 5, scale: 1 }, (0, o2.bindAll)(this, "drag", "stop", "keyHandle", "handleScroll"), this.setOptions(t4), 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 t3.prototype.setOptions = function(t4) { void 0 === t4 && (t4 = {}), this.opts = i(i({}, this.opts), t4); }, t3.prototype.toggleDrag = function(t4) { var e3 = this.getDocumentEl(), n3 = this.getContainerEl(), o3 = this.getWindowEl(), i2 = t4 ? "on" : "off", s2 = { on: r.on, off: r.off }; s2[i2](n3, "mousemove dragover", this.drag), s2[i2](e3, "mouseup dragend touchend", this.stop), s2[i2](e3, "keydown", this.keyHandle), s2[i2](o3, "scroll", this.handleScroll); }, t3.prototype.handleScroll = function() { var t4 = this.lastScroll, e3 = this.delta, n3 = this.getScrollInfo(), o3 = { x: n3.x - t4.x, y: n3.y - t4.y }; this.move(e3.x + o3.x, e3.y + o3.y), this.lastScrollDiff = o3; }, t3.prototype.start = function(t4) { var e3 = this.opts, n3 = e3.onStart; this.toggleDrag(true), this.startPointer = this.getPointerPos(t4), this.guidesStatic = (0, o2.result)(e3, "guidesStatic") || [], this.guidesTarget = (0, o2.result)(e3, "guidesTarget") || [], (0, o2.isFunction)(n3) && n3(t4, this), this.startPosition = this.getStartPosition(), this.lastScrollDiff = { x: 0, y: 0 }, this.globScrollDiff = { x: 0, y: 0 }, this.drag(t4); }, t3.prototype.drag = function(t4) { var e3 = this, n3 = this, r2 = n3.opts, a2 = n3.lastScrollDiff, l = n3.globScrollDiff, c = r2.onDrag, u = this.startPointer, p = this.getPointerPos(t4), d = { x: l.x + a2.x, y: l.y + a2.y }; this.globScrollDiff = d; var f = { x: p.x - u.x + d.x, y: p.y - u.y + d.y }; this.lastScrollDiff = { x: 0, y: 0 }; var h = this.lockedAxis; "x" === (h = t4.shiftKey ? !h && this.detectAxisLock(f.x, f.y) : null) ? f.x = u.x : "y" === h && (f.y = u.y); var g = function(n4) { s.forEach(function(t5) { return n4[t5] = n4[t5] * (0, o2.result)(r2, "scale"); }), e3.delta = n4, e3.move(n4.x, n4.y), (0, o2.isFunction)(c) && c(t4, e3); }, v = i({}, f); if (this.currentPointer = p, this.lockedAxis = h, this.lastScroll = this.getScrollInfo(), g(f), this.guidesTarget.length) { var y = this.snapGuides(v), m = y.newDelta, b = y.trgX, _ = y.trgY; (b || _) && g(m); } 0 === t4.which && this.stop(t4); }, t3.prototype.snapGuides = function(t4) { var e3 = this, n3 = t4, r2 = this.trgX, i2 = this.trgY; return this.guidesTarget.forEach(function(n4) { n4.x && e3.trgX || n4.y && e3.trgY || (n4.active = false, e3.guidesStatic.forEach(function(s2) { if (!(n4.y && s2.x || n4.x && s2.y)) { var a2 = n4.y && s2.y, l = a2 ? "y" : "x", c = n4[l], u = s2[l], p = t4[l], d = a2 ? i2 : r2; if (e3.isPointIn(c, u) && (0, o2.isUndefined)(d)) { var f = p - (c - u); e3.setGuideLock(n4, f); } } })); }), r2 = this.trgX, i2 = this.trgY, s.forEach(function(r3) { var i3 = r3.toUpperCase(), s2 = e3["trg".concat(i3)]; s2 && !e3.isPointIn(t4[r3], s2.lock) && (e3.setGuideLock(s2, null), s2 = null), s2 && !(0, o2.isUndefined)(s2.lock) && (n3[r3] = s2.lock); }), { newDelta: n3, trgX: this.trgX, trgY: this.trgY }; }, t3.prototype.isPointIn = function(t4, e3, n3) { var o3 = (void 0 === n3 ? {} : n3).offset || this.opts.snapOffset || 0; return t4 >= e3 && t4 <= e3 + o3 || t4 <= e3 && t4 >= e3 - o3; }, t3.prototype.setGuideLock = function(t4, e3) { var n3 = (0, o2.isUndefined)(t4.x) ? "Y" : "X", r2 = "trg".concat(n3); return null !== e3 ? (t4.active = true, t4.lock = e3, this[r2] = t4) : (delete t4.active, delete t4.lock, delete this[r2]), t4; }, t3.prototype.stop = function(t4, e3) { void 0 === e3 && (e3 = {}); var n3 = this.delta, r2 = !!e3.cancel, i2 = r2 ? 0 : n3.x, s2 = r2 ? 0 : n3.y; this.toggleDrag(), this.lockedAxis = null, this.move(i2, s2, true); var a2 = this.opts.onEnd; (0, o2.isFunction)(a2) && a2(t4, this, { cancelled: r2 }); }, t3.prototype.keyHandle = function(t4) { (0, r.isEscKey)(t4) && this.stop(t4, { cancel: true }); }, t3.prototype.move = function(t4, e3, n3) { var r2 = this.el, i2 = this.opts, s2 = this.startPosition; if (s2) { var a2 = i2.setPosition, l = s2.x + t4, c = s2.y + e3; this.position = { x: l, y: c, end: n3 }, (0, o2.isFunction)(a2) && a2(this.position), r2 && (r2.style.left = "".concat(l, "px"), r2.style.top = "".concat(c, "px")); } }, t3.prototype.getContainerEl = function() { var t4 = this.opts.container; return t4 ? [t4] : this.getDocumentEl(); }, t3.prototype.getWindowEl = function() { return this.getContainerEl().map(function(t4) { var e3 = t4.ownerDocument || t4; return e3.defaultView || e3.parentWindow; }); }, t3.prototype.getDocumentEl = function(t4) { var e3 = this.opts.doc; if (t4 = t4 || this.el, !this.docs.length) { var n3 = [document]; t4 && n3.push(t4.ownerDocument), e3 && n3.push(e3), this.docs = n3; } return this.docs; }, t3.prototype.getPointerPos = function(t4) { var e3 = this.opts.getPointerPosition, n3 = (0, r.getPointerEvent)(t4); return e3 ? e3(t4) : { x: n3.clientX, y: n3.clientY }; }, t3.prototype.getStartPosition = function() { var t4 = this.el, e3 = this.opts.getPosition, n3 = { x: 0, y: 0 }; return (0, o2.isFunction)(e3) ? n3 = e3() : t4 && (n3 = { x: parseFloat(t4.style.left), y: parseFloat(t4.style.top) }), n3; }, t3.prototype.getScrollInfo = function() { var t4 = this.opts.doc, e3 = t4 && t4.body; return { y: e3 ? e3.scrollTop : 0, x: e3 ? e3.scrollLeft : 0 }; }, t3.prototype.detectAxisLock = function(t4, e3) { var n3 = t4, o3 = e3, r2 = Math.abs(n3), i2 = Math.abs(o3); return o3 >= r2 || o3 <= -r2 ? "x" : n3 > i2 || n3 < -i2 ? "y" : void 0; }, t3; }(); }, 895: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { default: () => vt }); var o2 = "undefined" != typeof document ? document : null, r = "undefined" != typeof window ? window : null, i = Array.prototype, s = i.filter, a = i.indexOf, l = i.map, c = i.push, u = i.reverse, p = i.slice, d = i.splice, f = /^#[\w-]*$/, h = /^\.[\w-]*$/, g = /<.+>/, v = /^\w+$/; function y(t3, e3) { return void 0 === e3 && (e3 = o2), h.test(t3) ? e3.getElementsByClassName(t3.slice(1)) : v.test(t3) ? e3.getElementsByTagName(t3) : e3.querySelectorAll(t3); } function m(t3, e3) { if (void 0 === e3 && (e3 = o2), t3) { if (t3.__cash) return t3; var n3 = t3; if (P(t3)) { if (e3.__cash && (e3 = e3[0]), !(n3 = f.test(t3) ? e3.getElementById(t3.slice(1)) : g.test(t3) ? ft(t3) : y(t3, e3))) return; } else if (k(t3)) return this.ready(t3); (n3.nodeType || n3 === r) && (n3 = [n3]), this.length = n3.length; for (var i2 = 0, s2 = this.length; i2 < s2; i2++) this[i2] = n3[i2]; } } function b(t3, e3) { return new m(t3, e3); } var _ = b.fn = b.prototype = m.prototype = { constructor: b, __cash: true, length: 0, splice: d }; _.get = function(t3) { return void 0 === t3 ? p.call(this) : this[t3 < 0 ? t3 + this.length : t3]; }, _.eq = function(t3) { return b(this.get(t3)); }, _.first = function() { return this.eq(0); }, _.last = function() { return this.eq(-1); }, _.map = function(t3) { return b(l.call(this, function(e3, n3) { return t3.call(e3, n3, e3); })); }, _.slice = function() { return b(p.apply(this, arguments)); }; var w = /(?:^\w|[A-Z]|\b\w)/g, x = /[\s-_]+/g; function C(t3) { return t3.replace(w, function(t4, e3) { return t4[e3 ? "toUpperCase" : "toLowerCase"](); }).replace(x, ""); } function S(t3, e3) { for (var n3 = 0, o3 = t3.length; n3 < o3 && false !== e3.call(t3[n3], t3[n3], n3, t3); n3++) ; } b.camelCase = C, b.each = S, _.each = function(t3) { return S(this, function(e3, n3) { return t3.call(e3, n3, e3); }), this; }, _.removeProp = function(t3) { return this.each(function(e3, n3) { delete n3[t3]; }); }, b.extend = _.extend = function(t3) { void 0 === t3 && (t3 = this); for (var e3 = arguments, n3 = e3.length, o3 = n3 < 2 ? 0 : 1; o3 < n3; o3++) for (var r2 in e3[o3]) t3[r2] = e3[o3][r2]; return t3; }; var O = 1; function T(t3, e3) { var n3 = t3 && (t3.matches || t3.webkitMatchesSelector || t3.mozMatchesSelector || t3.msMatchesSelector || t3.oMatchesSelector); return !!n3 && n3.call(t3, e3); } function k(t3) { return "function" == typeof t3; } function P(t3) { return "string" == typeof t3; } function E(t3) { return !isNaN(parseFloat(t3)) && isFinite(t3); } b.guid = O, b.matches = T, b.isFunction = k, b.isString = P, b.isNumeric = E; var A = Array.isArray; function j(t3) { return P(t3) ? function(e3, n3) { return T(n3, t3); } : t3.__cash ? function(e3, n3) { return t3.is(n3); } : function(t4, e3, n3) { return e3 === n3; }; } b.isArray = A, _.prop = function(t3, e3) { if (t3) { if (P(t3)) return arguments.length < 2 ? this[0] && this[0][t3] : this.each(function(n4, o3) { o3[t3] = e3; }); for (var n3 in t3) this.prop(n3, t3[n3]); return this; } }, _.filter = function(t3) { if (!t3) return b(); var e3 = k(t3) ? t3 : j(t3); return b(s.call(this, function(n3, o3) { return e3.call(n3, o3, n3, t3); })); }; var M = /\S+/g; function L(t3) { return P(t3) && t3.match(M) || []; } function D(t3) { return t3.filter(function(t4, e3, n3) { return n3.indexOf(t4) === e3; }); } function N(t3, e3, n3) { if (1 === t3.nodeType) { var o3 = r.getComputedStyle(t3, null); return e3 ? n3 ? o3.getPropertyValue(e3) : o3[e3] : o3; } } function I(t3, e3) { return parseInt(N(t3, e3), 10) || 0; } _.hasClass = function(t3) { var e3 = L(t3), n3 = false; return e3.length && this.each(function(t4, o3) { return !(n3 = o3.classList.contains(e3[0])); }), n3; }, _.removeAttr = function(t3) { var e3 = L(t3); return e3.length ? this.each(function(t4, n3) { S(e3, function(t5) { n3.removeAttribute(t5); }); }) : this; }, _.attr = function(t3, e3) { if (t3) { if (P(t3)) { if (arguments.length < 2) { if (!this[0]) return; var n3 = this[0].getAttribute(t3); return null === n3 ? void 0 : n3; } return null === e3 ? this.removeAttr(t3) : this.each(function(n4, o4) { o4.setAttribute(t3, e3); }); } for (var o3 in t3) this.attr(o3, t3[o3]); return this; } }, _.toggleClass = function(t3, e3) { var n3 = L(t3), o3 = void 0 !== e3; return n3.length ? this.each(function(t4, r2) { S(n3, function(t5) { o3 ? e3 ? r2.classList.add(t5) : r2.classList.remove(t5) : r2.classList.toggle(t5); }); }) : this; }, _.addClass = function(t3) { return this.toggleClass(t3, true); }, _.removeClass = function(t3) { return arguments.length ? this.toggleClass(t3, false) : this.attr("class", ""); }, b.unique = D, _.add = function(t3, e3) { return b(D(this.get().concat(b(t3, e3).get()))); }; var F = /^--/; function V(t3) { return F.test(t3); } var R = {}, H = o2 && o2.createElement("div"), z = H ? H.style : {}, B = ["webkit", "moz", "ms", "o"]; function U(t3, e3) { if (void 0 === e3 && (e3 = V(t3)), e3) return t3; if (!R[t3]) { var n3 = C(t3), o3 = "" + n3.charAt(0).toUpperCase() + n3.slice(1); S((n3 + " " + B.join(o3 + " ") + o3).split(" "), function(e4) { if (e4 in z) return R[t3] = e4, false; }); } return R[t3]; } b.prefixedProp = U; var W = { animationIterationCount: true, columnCount: true, flexGrow: true, flexShrink: true, fontWeight: true, lineHeight: true, opacity: true, order: true, orphans: true, widows: true, zIndex: true }; function $(t3, e3, n3) { return void 0 === n3 && (n3 = V(t3)), n3 || W[t3] || !E(e3) ? e3 : e3 + "px"; } _.css = function(t3, e3) { if (P(t3)) { var n3 = V(t3); return t3 = U(t3, n3), arguments.length < 2 ? this[0] && N(this[0], t3, n3) : t3 ? (e3 = $(t3, e3, n3), this.each(function(o4, r2) { 1 === r2.nodeType && (n3 ? r2.style.setProperty(t3, e3) : r2.style[t3] = e3); })) : this; } for (var o3 in t3) this.css(o3, t3[o3]); return this; }; var q = "__cashData", G = /^data-(.*)/; function K(t3) { return t3[q] = t3[q] || {}; } function Y(t3, e3) { var n3 = K(t3); if (e3) { if (!(e3 in n3)) { var o3 = t3.dataset ? t3.dataset[e3] || t3.dataset[C(e3)] : b(t3).attr("data-" + e3); if (void 0 !== o3) { try { o3 = JSON.parse(o3); } catch (t4) { } n3[e3] = o3; } } return n3[e3]; } return n3; } function X(t3, e3) { return I(t3, "border" + (e3 ? "Left" : "Top") + "Width") + I(t3, "padding" + (e3 ? "Left" : "Top")) + I(t3, "padding" + (e3 ? "Right" : "Bottom")) + I(t3, "border" + (e3 ? "Right" : "Bottom") + "Width"); } function J(t3, e3) { for (var n3 = 0, o3 = e3.length; n3 < o3; n3++) if (t3.indexOf(e3[n3]) < 0) return false; return true; } function Z(t3, e3, n3) { S(t3[n3], function(t4) { t4[0]; var o3 = t4[1]; e3.removeEventListener(n3, o3); }), delete t3[n3]; } b.hasData = function(t3) { return q in t3; }, _.data = function(t3, e3) { var n3 = this; if (!t3) { if (!this[0]) return; return S(this[0].attributes, function(t4) { var e4 = t4.name.match(G); e4 && n3.data(e4[1]); }), Y(this[0]); } if (P(t3)) return void 0 === e3 ? this[0] && Y(this[0], t3) : this.each(function(n4, o4) { return function(t4, e4, n5) { K(t4)[e4] = n5; }(o4, t3, e3); }); for (var o3 in t3) this.data(o3, t3[o3]); return this; }, _.removeData = function(t3) { return this.each(function(e3, n3) { return function(t4, e4) { void 0 === e4 ? delete t4[q] : delete K(t4)[e4]; }(n3, t3); }); }, S(["Width", "Height"], function(t3) { _["inner" + t3] = function() { if (this[0]) return this[0] === r ? r["inner" + t3] : this[0]["client" + t3]; }; }), S(["width", "height"], function(t3, e3) { _[t3] = function(n3) { return this[0] ? arguments.length ? (n3 = parseInt(n3, 10), this.each(function(o3, r2) { if (1 === r2.nodeType) { var i2 = N(r2, "boxSizing"); r2.style[t3] = $(t3, n3 + ("border-box" === i2 ? X(r2, !e3) : 0)); } })) : this[0] === r ? this[0][C("outer-" + t3)] : this[0].getBoundingClientRect()[t3] - X(this[0], !e3) : void 0 === n3 ? void 0 : this; }; }), S(["Width", "Height"], function(t3, e3) { _["outer" + t3] = function(n3) { if (this[0]) return this[0] === r ? r["outer" + t3] : this[0]["offset" + t3] + (n3 ? I(this[0], "margin" + (e3 ? "Top" : "Left")) + I(this[0], "margin" + (e3 ? "Bottom" : "Right")) : 0); }; }); var Q = "__cashEvents", tt = "."; function et(t3) { return t3[Q] = t3[Q] || {}; } function nt(t3) { var e3 = t3.split(tt); return [e3[0], e3.slice(1).sort()]; } function ot(t3, e3, n3, o3) { var r2 = et(t3); if (e3) { var i2 = r2[e3]; if (!i2) return; o3 && (o3.guid = o3.guid || O++), r2[e3] = i2.filter(function(r3) { var i3 = r3[0], s2 = r3[1]; if (o3 && s2.guid !== o3.guid || !J(i3, n3)) return true; t3.removeEventListener(e3, s2); }); } else if (n3 && n3.length) for (e3 in r2) ot(t3, e3, n3, o3); else for (e3 in r2) Z(r2, t3, e3); } _.off = function(t3, e3) { var n3 = this; return void 0 === t3 ? this.each(function(t4, e4) { return ot(e4); }) : S(L(t3), function(t4) { var o3 = nt(t4), r2 = o3[0], i2 = o3[1]; n3.each(function(t5, n4) { return ot(n4, r2, i2, e3); }); }), this; }, _.on = function(t3, e3, n3, o3) { var r2 = this; if (!P(t3)) { for (var i2 in t3) this.on(i2, e3, t3[i2]); return this; } return k(e3) && (n3 = e3, e3 = false), S(L(t3), function(t4) { var i3 = nt(t4), s2 = i3[0], a2 = i3[1]; r2.each(function(t5, r3) { var i4 = function t6(i5) { if (!i5.namespace || J(a2, i5.namespace.split(tt))) { var l2 = r3; if (e3) { for (var c2 = i5.target; !T(c2, e3); ) { if (c2 === r3) return; if (!(c2 = c2.parentNode)) return; } l2 = c2; } i5.namespace = i5.namespace || ""; var u2 = n3.call(l2, i5, i5.data); o3 && ot(r3, s2, a2, t6), false === u2 && (i5.preventDefault(), i5.stopPropagation()); } }; i4.guid = n3.guid = n3.guid || O++, function(t6, e4, n4, o4) { o4.guid = o4.guid || O++; var r4 = et(t6); r4[e4] = r4[e4] || [], r4[e4].push([n4, o4]), t6.addEventListener(e4, o4); }(r3, s2, a2, i4); }); }), this; }, _.one = function(t3, e3, n3) { return this.on(t3, e3, n3, true); }, _.ready = function(t3) { var e3 = function() { return t3(b); }; return "loading" !== o2.readyState ? setTimeout(e3) : o2.addEventListener("DOMContentLoaded", e3), this; }, _.trigger = function(t3, e3) { var n3 = t3; if (P(t3)) { var r2 = nt(t3), i2 = r2[0], s2 = r2[1]; (n3 = o2.createEvent("HTMLEvents")).initEvent(i2, true, true), n3.namespace = s2.join(tt); } return n3.data = e3, this.each(function(t4, e4) { e4.dispatchEvent(n3); }); }; var rt = /select-one/i, it = /select-multiple/i; function st(t3) { var e3 = t3.type; return rt.test(e3) ? function(t4) { return t4.selectedIndex < 0 ? null : t4.options[t4.selectedIndex].value; }(t3) : it.test(e3) ? function(t4) { var e4 = []; return S(t4.options, function(t5) { !t5.selected || t5.disabled || t5.parentNode.disabled || e4.push(t5.value); }), e4; }(t3) : t3.value; } var at = /%20/g; var lt = /file|reset|submit|button|image/i, ct = /radio|checkbox/i; _.serialize = function() { var t3 = ""; return this.each(function(e3, n3) { S(n3.elements || [n3], function(e4) { if (!e4.disabled && e4.name && "FIELDSET" !== e4.tagName && !lt.test(e4.type) && (!ct.test(e4.type) || e4.checked)) { var n4 = st(e4); if (void 0 !== n4) S(A(n4) ? n4 : [n4], function(n5) { t3 += function(t4, e5) { return "&" + encodeURIComponent(t4) + "=" + encodeURIComponent(e5).replace(at, "+"); }(e4.name, n5); }); } }); }), t3.substr(1); }, _.val = function(t3) { return void 0 === t3 ? this[0] && st(this[0]) : this.each(function(e3, n3) { var o3 = it.test(n3.type), r2 = null === t3 ? o3 ? [] : "" : t3; o3 && A(r2) ? S(n3.options, function(t4) { t4.selected = r2.indexOf(t4.value) >= 0; }) : n3.value = r2; }); }, _.clone = function() { return this.map(function(t3, e3) { return e3.cloneNode(true); }); }, _.detach = function() { return this.each(function(t3, e3) { e3.parentNode && e3.parentNode.removeChild(e3); }); }; var ut, pt = /^\s*<(\w+)[^>]*>/, dt = /^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/; function ft(t3) { if (function() { if (!ut) { var t4 = o2.createElement("table"), e4 = o2.createElement("tr"); ut = { "*": o2.createElement("div"), tr: o2.createElement("tbody"), td: e4, th: e4, thead: t4, tbody: t4, tfoot: t4 }; } }(), !P(t3)) return []; if (dt.test(t3)) return [o2.createElement(RegExp.$1)]; var e3 = pt.test(t3) && RegExp.$1, n3 = ut[e3] || ut["*"]; return n3.innerHTML = t3, b(n3.childNodes).detach().get(); } function ht(t3, e3, n3) { if (void 0 !== e3) { var o3 = P(e3); !o3 && e3.length ? S(e3, function(e4) { return ht(t3, e4, n3); }) : S(t3, o3 ? function(t4) { t4.insertAdjacentHTML(n3 ? "afterbegin" : "beforeend", e3); } : function(t4, o4) { return function(t5, e4, n4) { n4 ? t5.insertBefore(e4, t5.childNodes[0]) : t5.appendChild(e4); }(t4, o4 ? e3.cloneNode(true) : e3, n3); }); } } b.parseHTML = ft, _.empty = function() { var t3 = this[0]; if (t3) for (; t3.firstChild; ) t3.removeChild(t3.firstChild); return this; }, _.append = function() { var t3 = this; return S(arguments, function(e3) { ht(t3, e3); }), this; }, _.appendTo = function(t3) { return ht(b(t3), this), this; }, _.html = function(t3) { if (void 0 === t3) return this[0] && this[0].innerHTML; var e3 = t3.nodeType ? t3[0].outerHTML : t3; return this.each(function(t4, n3) { n3.innerHTML = e3; }); }, _.insertAfter = function(t3) { var e3 = this; return b(t3).each(function(t4, n3) { var o3 = n3.parentNode; e3.each(function(e4, r2) { o3.insertBefore(t4 ? r2.cloneNode(true) : r2, n3.nextSibling); }); }), this; }, _.after = function() { var t3 = this; return S(u.apply(arguments), function(e3) { u.apply(b(e3).slice()).insertAfter(t3); }), this; }, _.insertBefore = function(t3) { var e3 = this; return b(t3).each(function(t4, n3) { var o3 = n3.parentNode; e3.each(function(e4, r2) { o3.insertBefore(t4 ? r2.cloneNode(true) : r2, n3); }); }), this; }, _.before = function() { var t3 = this; return S(arguments, function(e3) { b(e3).insertBefore(t3); }), this; }, _.prepend = function() { var t3 = this; return S(arguments, function(e3) { ht(t3, e3, true); }), this; }, _.prependTo = function(t3) { return ht(b(t3), u.apply(this.slice()), true), this; }, _.remove = function() { return this.detach().off(); }, _.replaceWith = function(t3) { var e3 = this; return this.each(function(n3, o3) { var r2 = o3.parentNode; if (r2) { var i2 = n3 ? b(t3).clone() : b(t3); if (!i2[0]) return e3.remove(), false; r2.replaceChild(i2[0], o3), b(i2[0]).after(i2.slice(1)); } }); }, _.replaceAll = function(t3) { return b(t3).replaceWith(this), this; }, _.text = function(t3) { return void 0 === t3 ? this[0] ? this[0].textContent : "" : this.each(function(e3, n3) { n3.textContent = t3; }); }; var gt = o2 && o2.documentElement; _.offset = function() { var t3 = this[0]; if (t3) { var e3 = t3.getBoundingClientRect(); return { top: e3.top + r.pageYOffset - gt.clientTop, left: e3.left + r.pageXOffset - gt.clientLeft }; } }, _.offsetParent = function() { return b(this[0] && this[0].offsetParent); }, _.position = function() { var t3 = this[0]; if (t3) return { left: t3.offsetLeft, top: t3.offsetTop }; }, _.children = function(t3) { var e3 = []; return this.each(function(t4, n3) { c.apply(e3, n3.children); }), e3 = b(D(e3)), t3 ? e3.filter(function(e4, n3) { return T(n3, t3); }) : e3; }, _.contents = function() { var t3 = []; return this.each(function(e3, n3) { c.apply(t3, "IFRAME" === n3.tagName ? [n3.contentDocument] : n3.childNodes); }), b(t3.length && D(t3)); }, _.find = function(t3) { for (var e3 = [], n3 = 0, o3 = this.length; n3 < o3; n3++) { var r2 = y(t3, this[n3]); r2.length && c.apply(e3, r2); } return b(e3.length && D(e3)); }, _.has = function(t3) { var e3 = P(t3) ? function(e4, n3) { return !!y(t3, n3).length; } : function(e4, n3) { return n3.contains(t3); }; return this.filter(e3); }, _.is = function(t3) { if (!t3 || !this[0]) return false; var e3 = j(t3), n3 = false; return this.each(function(o3, r2) { return !(n3 = e3(o3, r2, t3)); }), n3; }, _.next = function() { return b(this[0] && this[0].nextElementSibling); }, _.not = function(t3) { if (!t3 || !this[0]) return this; var e3 = j(t3); return this.filter(function(n3, o3) { return !e3(n3, o3, t3); }); }, _.parent = function() { var t3 = []; return this.each(function(e3, n3) { n3 && n3.parentNode && t3.push(n3.parentNode); }), b(D(t3)); }, _.index = function(t3) { var e3 = t3 ? b(t3)[0] : this[0], n3 = t3 ? this : b(e3).parent().children(); return a.call(n3, e3); }, _.closest = function(t3) { return t3 && this[0] ? this.is(t3) ? this.filter(t3) : this.parent().closest(t3) : b(); }, _.parents = function(t3) { var e3, n3 = []; return this.each(function(r2, i2) { for (e3 = i2; e3 && e3.parentNode && e3 !== o2.body.parentNode; ) e3 = e3.parentNode, (!t3 || t3 && T(e3, t3)) && n3.push(e3); }), b(D(n3)); }, _.prev = function() { return b(this[0] && this[0].previousElementSibling); }, _.siblings = function() { var t3 = this[0]; return this.parent().children().filter(function(e3, n3) { return n3 !== t3; }); }; const vt = b; }, 491: (t2, e2, n2) => { n2.d(e2, { $Q: () => g, FW: () => d, G1: () => a, GX: () => w, L_: () => c, Mx: () => l, R3: () => v, SJ: () => _, cx: () => u, dL: () => h, pn: () => f, rw: () => m, sE: () => p, t3: () => b, ut: () => y }); var o2 = n2(50), r = function(t3, e3, n3) { if (n3 || 2 === arguments.length) for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]); return t3.concat(o3 || Array.prototype.slice.call(e3)); }, i = "tag", s = "attributes", a = "transitionend oTransitionEnd transitionend webkitTransitionEnd", l = function(t3) { return t3 && 9 === t3.nodeType; }, c = function(t3) { var e3 = t3 && t3.parentNode; e3 && e3.removeChild(t3); }; function u() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; var n3 = Array.isArray(t3[0]) ? t3[0] : r([], t3, true); return n3.filter(Boolean).join(" "); } var p = function(t3, e3) { return t3.querySelectorAll(e3); }, d = function(t3, e3) { return void 0 === e3 && (e3 = {}), t3 && t3.setAttribute && (0, o2.each)(e3, function(e4, n3) { return t3.setAttribute(n3, e4); }); }, f = function(t3) { return t3 && !!(t3.offsetWidth || t3.offsetHeight || t3.getClientRects().length); }, h = function(t3, e3) { var n3; null === (n3 = t3.parentNode) || void 0 === n3 || n3.replaceChild(e3, t3); }, g = function(t3, e3, n3) { var r2 = t3.childNodes, i2 = r2.length, s2 = (0, o2.isUndefined)(n3) ? i2 : n3; (0, o2.isString)(e3) && (t3.insertAdjacentHTML("beforeEnd", e3), e3 = t3.lastChild, t3.removeChild(e3)), s2 >= i2 ? t3.appendChild(e3) : t3.insertBefore(e3, r2[s2]); }, v = function(t3, e3) { return g(t3, e3); }, y = function(t3, e3, n3) { void 0 === e3 && (e3 = {}); var r2 = document.createElement(t3); return e3 && (0, o2.each)(e3, function(t4, e4) { return r2.setAttribute(e4, t4); }), n3 && ((0, o2.isString)(n3) ? r2.innerHTML = n3 : r2.appendChild(n3)), r2; }, m = function(t3) { return document.createTextNode(t3); }, b = function(t3, e3) { var n3, o3 = t3.type; try { n3 = new window[e3](o3, t3); } catch (t4) { (n3 = document.createEvent(e3)).initEvent(o3, true, true); } return n3._parentEvent = t3, 0 === o3.indexOf("key") && (n3.keyCodeVal = t3.keyCode, ["keyCode", "which"].forEach(function(t4) { Object.defineProperty(n3, t4, { get: function() { return this.keyCodeVal; } }); })), n3; }, _ = function(t3, e3) { void 0 === e3 && (e3 = []), (Array.isArray(e3) ? e3 : [e3]).forEach(function(e4) { var n3 = e4[i] || "div", r2 = e4[s] || {}, a2 = document.createElement(n3); (0, o2.each)(r2, function(t4, e5) { a2.setAttribute(e5, t4); }), t3.appendChild(a2); }); }, w = function(t3) { var e3 = (null == t3 ? void 0 : t3.ownerDocument) || document, n3 = e3.documentElement, o3 = e3.defaultView || window; return { x: (o3.pageXOffset || n3.scrollLeft || 0) - (n3.clientLeft || 0), y: (o3.pageYOffset || n3.scrollTop || 0) - (n3.clientTop || 0) }; }; }, 163: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { appendStyles: () => f, buildBase64UrlFromSvg: () => $, camelCase: () => b, capitalize: () => R, createId: () => W, deepMerge: () => E, escape: () => k, escapeNodeContent: () => P, find: () => T, getElRect: () => j, getElement: () => x, getGlobal: () => l, getKeyChar: () => D, getKeyCode: () => L, getModel: () => A, getPointerEvent: () => M, getUiClass: () => d, getUnitFromValue: () => y, getViewEl: () => B, hasDnd: () => w, hasWin: () => a, isCommentNode: () => S, isComponent: () => H, isDef: () => s, isEmptyObj: () => V, isEnterKey: () => I, isEscKey: () => N, isObject: () => F, isRule: () => z, isTaggableNode: () => O, isTextNode: () => C, matches: () => p, normalizeFloat: () => _, off: () => v, on: () => g, setViewEl: () => U, shallowDiff: () => h, toLowerCase: () => c, upFirst: () => m }); var o2 = n2(50), r = function() { return r = Object.assign || function(t3) { for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++) for (var r2 in e3 = arguments[n3]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, r.apply(this, arguments); }, i = function(t3, e3, n3) { if (n3 || 2 === arguments.length) for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]); return t3.concat(o3 || Array.prototype.slice.call(e3)); }, s = function(t3) { return void 0 !== t3; }, a = function() { return "undefined" != typeof window; }, l = function() { return "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : n2.g; }, c = function(t3) { return (t3 || "").toLowerCase(); }, u = a() ? window.Element.prototype : {}, p = u.matches || u.webkitMatchesSelector || u.mozMatchesSelector || u.msMatchesSelector, d = function(t3, e3) { var n3 = t3.getConfig(), o3 = n3.stylePrefix; return [n3.customUI && "".concat(o3, "cui"), e3].filter(function(t4) { return t4; }).join(" "); }, f = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = (0, o2.isArray)(t3) ? i([], t3, true) : [t3]; if (n3.length) { var r2 = n3.shift(); if (r2 && (!e3.unique || !document.querySelector('link[href="'.concat(r2, '"]')))) { var s2 = document.head, a2 = document.createElement("link"); a2.href = r2, a2.rel = "stylesheet", e3.prepand ? s2.insertBefore(a2, s2.firstChild) : s2.appendChild(a2); } f(n3); } }, h = function(t3, e3) { var n3 = {}, r2 = (0, o2.keys)(e3); for (var i2 in t3) if (t3.hasOwnProperty(i2)) { var s2 = t3[i2], a2 = e3[i2]; r2.indexOf(i2) >= 0 ? s2 !== a2 && (n3[i2] = a2) : n3[i2] = null; } for (var i2 in e3) e3.hasOwnProperty(i2) && (0, o2.isUndefined)(t3[i2]) && (n3[i2] = e3[i2]); return n3; }, g = function(t3, e3, n3, o3) { var r2 = e3.split(/\s+/); t3 = t3 instanceof Array ? t3 : [t3]; for (var i2 = function(e4) { t3.forEach(function(t4) { return t4 && t4.addEventListener(r2[e4], n3, o3); }); }, s2 = 0; s2 < r2.length; ++s2) i2(s2); }, v = function(t3, e3, n3, o3) { var r2 = e3.split(/\s+/); t3 = t3 instanceof Array ? t3 : [t3]; for (var i2 = function(e4) { t3.forEach(function(t4) { return t4 && t4.removeEventListener(r2[e4], n3, o3); }); }, s2 = 0; s2 < r2.length; ++s2) i2(s2); }, y = function(t3) { return t3.replace(parseFloat(t3), ""); }, m = function(t3) { return t3[0].toUpperCase() + t3.toLowerCase().slice(1); }, b = function(t3) { return t3.replace(/-./g, function(t4) { return t4[1].toUpperCase(); }); }, _ = function(t3, e3, n3) { void 0 === e3 && (e3 = 1), void 0 === n3 && (n3 = 0); var o3 = 0; if (isNaN(t3)) return n3; if (t3 = parseFloat(t3), Math.floor(t3) !== t3) { var r2 = e3.toString().split(".")[1]; o3 = r2 ? r2.length : 0; } return o3 ? parseFloat(t3.toFixed(o3)) : t3; }, w = function(t3) { return "draggable" in document.createElement("i") && (!t3 || t3.config.nativeDnD); }, x = function(t3) { return (0, o2.isElement)(t3) || C(t3) ? t3 : t3 && t3.getEl ? t3.getEl() : void 0; }, C = function(t3) { return t3 && 3 === t3.nodeType; }, S = function(t3) { return t3 && 8 === t3.nodeType; }, O = function(t3) { return t3 && !C(t3) && !S(t3); }, T = function(t3, e3) { var n3 = null; return t3.some(function(o3, r2) { return e3(o3, r2, t3) ? (n3 = o3, 1) : 0; }), n3; }, k = function(t3) { return void 0 === t3 && (t3 = ""), "".concat(t3).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`"); }, P = function(t3) { return void 0 === t3 && (t3 = ""), "".concat(t3).replace(/&/g, "&").replace(//g, ">"); }, E = function() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; for (var n3 = r({}, t3[0]), o3 = 1; o3 < t3.length; o3++) { var i2 = r({}, t3[o3]); for (var s2 in i2) { var a2 = n3[s2], l2 = i2[s2]; F(a2) && F(l2) ? n3[s2] = E(a2, l2) : n3[s2] = l2; } } return n3; }, A = function(t3, e3) { var n3 = t3; return !e3 && t3 && t3.__cashData ? n3 = t3.__cashData.model : (0, o2.isElement)(t3) && (n3 = e3(t3).data("model")), n3; }, j = function(t3) { var e3, n3 = { top: 0, left: 0, width: 0, height: 0 }; if (!t3) return n3; if (C(t3)) { var o3 = document.createRange(); o3.selectNode(t3), e3 = o3.getBoundingClientRect(), o3.detach(); } return e3 || (t3.getBoundingClientRect ? t3.getBoundingClientRect() : n3); }, M = function(t3) { return t3.touches && t3.touches[0] ? t3.touches[0] : t3; }, L = function(t3) { return t3.which || t3.keyCode; }, D = function(t3) { return String.fromCharCode(L(t3)); }, N = function(t3) { return 27 === L(t3); }, I = function(t3) { return 13 === L(t3); }, F = function(t3) { return null !== t3 && !Array.isArray(t3) && "object" == typeof t3; }, V = function(t3) { return Object.keys(t3).length <= 0; }, R = function(t3) { return void 0 === t3 && (t3 = ""), t3 && t3.charAt(0).toUpperCase() + t3.substring(1); }, H = function(t3) { return t3 && t3.toHTML; }, z = function(t3) { return t3 && t3.toCSS; }, B = function(t3) { return t3.__gjsv; }, U = function(t3, e3) { t3.__gjsv = e3; }, W = function(t3) { void 0 === t3 && (t3 = 16); for (var e3 = "", n3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", o3 = n3.length, r2 = 0; r2 < t3; r2++) e3 += n3.charAt(Math.floor(Math.random() * o3)); return e3; }, $ = function(t3) { if (t3 && " { var o2 = { "./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 r(t3) { var e3 = i(t3); return n2(e3); } function i(t3) { if (!n2.o(o2, t3)) { var e3 = new Error("Cannot find module '" + t3 + "'"); throw e3.code = "MODULE_NOT_FOUND", e3; } return o2[t3]; } r.keys = function() { return Object.keys(o2); }, r.resolve = i, t2.exports = r, r.id = 828; }, 50: (t2, e2, n2) => { n2.r(e2), n2.d(e2, { VERSION: () => r, after: () => Ne, all: () => en, allKeys: () => vt, any: () => nn, assign: () => Nt, before: () => Ie, bind: () => Ce, bindAll: () => Te, chain: () => be, chunk: () => Rn, clone: () => Rt, collect: () => Ye, compact: () => Pn, compose: () => De, constant: () => Z, contains: () => on, countBy: () => mn, create: () => Vt, debounce: () => je, default: () => Wn, defaults: () => It, defer: () => Ee, delay: () => Pe, detect: () => qe, difference: () => An, drop: () => Tn, each: () => Ke, escape: () => ae, every: () => en, extend: () => Dt, extendOwn: () => Nt, filter: () => Qe, find: () => qe, findIndex: () => He, findKey: () => Ve, findLastIndex: () => ze, findWhere: () => Ge, first: () => On, flatten: () => En, foldl: () => Je, foldr: () => Ze, forEach: () => Ke, functions: () => Mt, get: () => Wt, groupBy: () => vn, has: () => $t, head: () => On, identity: () => qt, include: () => on, includes: () => on, indexBy: () => yn, indexOf: () => We, initial: () => Sn, inject: () => Je, intersection: () => Dn, invert: () => jt, invoke: () => rn, isArguments: () => Y, isArray: () => q, isArrayBuffer: () => F, isBoolean: () => P, isDataView: () => $, isDate: () => L, isElement: () => E, isEmpty: () => lt, isEqual: () => gt, isError: () => N, isFinite: () => X, isFunction: () => H, isMap: () => Ot, isMatch: () => ct, isNaN: () => J, isNull: () => T, isNumber: () => M, isObject: () => O, isRegExp: () => D, isSet: () => kt, isString: () => j, isSymbol: () => I, isTypedArray: () => rt, isUndefined: () => k, isWeakMap: () => Tt, isWeakSet: () => Pt, iteratee: () => Jt, keys: () => at, last: () => kn, lastIndexOf: () => $e, map: () => Ye, mapObject: () => Qt, matcher: () => Gt, matches: () => Gt, max: () => ln, memoize: () => ke, methods: () => Mt, min: () => cn, mixin: () => zn, negate: () => Le, noop: () => te, now: () => re, object: () => Fn, omit: () => Cn, once: () => Fe, pairs: () => At, partial: () => xe, partition: () => bn, pick: () => xn, pluck: () => sn, property: () => Kt, propertyOf: () => ee, random: () => oe, range: () => Vn, reduce: () => Je, reduceRight: () => Ze, reject: () => tn, rest: () => Tn, restArguments: () => S, result: () => ve, sample: () => dn, select: () => Qe, shuffle: () => fn, size: () => _n, some: () => nn, sortBy: () => hn, sortedIndex: () => Be, tail: () => Tn, take: () => On, tap: () => Ht, template: () => ge, templateSettings: () => ce, throttle: () => Ae, times: () => ne, toArray: () => pn, toPath: () => zt, transpose: () => Nn, unescape: () => le, union: () => Ln, uniq: () => Mn, unique: () => Mn, uniqueId: () => me, unzip: () => Nn, values: () => Et, where: () => an, without: () => jn, wrap: () => Me, zip: () => In }); var o2 = {}; n2.r(o2), n2.d(o2, { VERSION: () => r, after: () => Ne, all: () => en, allKeys: () => vt, any: () => nn, assign: () => Nt, before: () => Ie, bind: () => Ce, bindAll: () => Te, chain: () => be, chunk: () => Rn, clone: () => Rt, collect: () => Ye, compact: () => Pn, compose: () => De, constant: () => Z, contains: () => on, countBy: () => mn, create: () => Vt, debounce: () => je, default: () => Bn, defaults: () => It, defer: () => Ee, delay: () => Pe, detect: () => qe, difference: () => An, drop: () => Tn, each: () => Ke, escape: () => ae, every: () => en, extend: () => Dt, extendOwn: () => Nt, filter: () => Qe, find: () => qe, findIndex: () => He, findKey: () => Ve, findLastIndex: () => ze, findWhere: () => Ge, first: () => On, flatten: () => En, foldl: () => Je, foldr: () => Ze, forEach: () => Ke, functions: () => Mt, get: () => Wt, groupBy: () => vn, has: () => $t, head: () => On, identity: () => qt, include: () => on, includes: () => on, indexBy: () => yn, indexOf: () => We, initial: () => Sn, inject: () => Je, intersection: () => Dn, invert: () => jt, invoke: () => rn, isArguments: () => Y, isArray: () => q, isArrayBuffer: () => F, isBoolean: () => P, isDataView: () => $, isDate: () => L, isElement: () => E, isEmpty: () => lt, isEqual: () => gt, isError: () => N, isFinite: () => X, isFunction: () => H, isMap: () => Ot, isMatch: () => ct, isNaN: () => J, isNull: () => T, isNumber: () => M, isObject: () => O, isRegExp: () => D, isSet: () => kt, isString: () => j, isSymbol: () => I, isTypedArray: () => rt, isUndefined: () => k, isWeakMap: () => Tt, isWeakSet: () => Pt, iteratee: () => Jt, keys: () => at, last: () => kn, lastIndexOf: () => $e, map: () => Ye, mapObject: () => Qt, matcher: () => Gt, matches: () => Gt, max: () => ln, memoize: () => ke, methods: () => Mt, min: () => cn, mixin: () => zn, negate: () => Le, noop: () => te, now: () => re, object: () => Fn, omit: () => Cn, once: () => Fe, pairs: () => At, partial: () => xe, partition: () => bn, pick: () => xn, pluck: () => sn, property: () => Kt, propertyOf: () => ee, random: () => oe, range: () => Vn, reduce: () => Je, reduceRight: () => Ze, reject: () => tn, rest: () => Tn, restArguments: () => S, result: () => ve, sample: () => dn, select: () => Qe, shuffle: () => fn, size: () => _n, some: () => nn, sortBy: () => hn, sortedIndex: () => Be, tail: () => Tn, take: () => On, tap: () => Ht, template: () => ge, templateSettings: () => ce, throttle: () => Ae, times: () => ne, toArray: () => pn, toPath: () => zt, transpose: () => Nn, unescape: () => le, union: () => Ln, uniq: () => Mn, unique: () => Mn, uniqueId: () => me, unzip: () => Nn, values: () => Et, where: () => an, without: () => jn, wrap: () => Me, zip: () => In }); var r = "1.13.4", i = "object" == typeof self && self.self === self && self || "object" == typeof commonjsGlobal && commonjsGlobal.global === commonjsGlobal && commonjsGlobal || Function("return this")() || {}, s = Array.prototype, a = Object.prototype, l = "undefined" != typeof Symbol ? Symbol.prototype : null, c = s.push, u = s.slice, p = a.toString, d = a.hasOwnProperty, f = "undefined" != typeof ArrayBuffer, h = "undefined" != typeof DataView, g = Array.isArray, v = Object.keys, y = Object.create, m = f && ArrayBuffer.isView, b = isNaN, _ = isFinite, w = !{ toString: null }.propertyIsEnumerable("toString"), x = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"], C = Math.pow(2, 53) - 1; function S(t3, e3) { return e3 = null == e3 ? t3.length - 1 : +e3, function() { for (var n3 = Math.max(arguments.length - e3, 0), o3 = Array(n3), r2 = 0; r2 < n3; r2++) o3[r2] = arguments[r2 + e3]; switch (e3) { case 0: return t3.call(this, o3); case 1: return t3.call(this, arguments[0], o3); case 2: return t3.call(this, arguments[0], arguments[1], o3); } var i2 = Array(e3 + 1); for (r2 = 0; r2 < e3; r2++) i2[r2] = arguments[r2]; return i2[e3] = o3, t3.apply(this, i2); }; } function O(t3) { var e3 = typeof t3; return "function" === e3 || "object" === e3 && !!t3; } function T(t3) { return null === t3; } function k(t3) { return void 0 === t3; } function P(t3) { return true === t3 || false === t3 || "[object Boolean]" === p.call(t3); } function E(t3) { return !(!t3 || 1 !== t3.nodeType); } function A(t3) { var e3 = "[object " + t3 + "]"; return function(t4) { return p.call(t4) === e3; }; } const j = A("String"), M = A("Number"), L = A("Date"), D = A("RegExp"), N = A("Error"), I = A("Symbol"), F = A("ArrayBuffer"); var V = A("Function"), R = i.document && i.document.childNodes; "object" != typeof Int8Array && "function" != typeof R && (V = function(t3) { return "function" == typeof t3 || false; }); const H = V, z = A("Object"); var B = h && z(new DataView(new ArrayBuffer(8))), U = "undefined" != typeof Map && z(/* @__PURE__ */ new Map()), W = A("DataView"); const $ = B ? function(t3) { return null != t3 && H(t3.getInt8) && F(t3.buffer); } : W, q = g || A("Array"); function G(t3, e3) { return null != t3 && d.call(t3, e3); } var K = A("Arguments"); !function() { K(arguments) || (K = function(t3) { return G(t3, "callee"); }); }(); const Y = K; function X(t3) { return !I(t3) && _(t3) && !isNaN(parseFloat(t3)); } function J(t3) { return M(t3) && b(t3); } function Z(t3) { return function() { return t3; }; } function Q(t3) { return function(e3) { var n3 = t3(e3); return "number" == typeof n3 && n3 >= 0 && n3 <= C; }; } function tt(t3) { return function(e3) { return null == e3 ? void 0 : e3[t3]; }; } const et = tt("byteLength"), nt = Q(et); var ot = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; const rt = f ? function(t3) { return m ? m(t3) && !$(t3) : nt(t3) && ot.test(p.call(t3)); } : Z(false), it = tt("length"); function st(t3, e3) { e3 = function(t4) { for (var e4 = {}, n4 = t4.length, o4 = 0; o4 < n4; ++o4) e4[t4[o4]] = true; return { contains: function(t5) { return true === e4[t5]; }, push: function(n5) { return e4[n5] = true, t4.push(n5); } }; }(e3); var n3 = x.length, o3 = t3.constructor, r2 = H(o3) && o3.prototype || a, i2 = "constructor"; for (G(t3, i2) && !e3.contains(i2) && e3.push(i2); n3--; ) (i2 = x[n3]) in t3 && t3[i2] !== r2[i2] && !e3.contains(i2) && e3.push(i2); } function at(t3) { if (!O(t3)) return []; if (v) return v(t3); var e3 = []; for (var n3 in t3) G(t3, n3) && e3.push(n3); return w && st(t3, e3), e3; } function lt(t3) { if (null == t3) return true; var e3 = it(t3); return "number" == typeof e3 && (q(t3) || j(t3) || Y(t3)) ? 0 === e3 : 0 === it(at(t3)); } function ct(t3, e3) { var n3 = at(e3), o3 = n3.length; if (null == t3) return !o3; for (var r2 = Object(t3), i2 = 0; i2 < o3; i2++) { var s2 = n3[i2]; if (e3[s2] !== r2[s2] || !(s2 in r2)) return false; } return true; } function ut(t3) { return t3 instanceof ut ? t3 : this instanceof ut ? void (this._wrapped = t3) : new ut(t3); } function pt(t3) { return new Uint8Array(t3.buffer || t3, t3.byteOffset || 0, et(t3)); } ut.VERSION = r, ut.prototype.value = function() { return this._wrapped; }, ut.prototype.valueOf = ut.prototype.toJSON = ut.prototype.value, ut.prototype.toString = function() { return String(this._wrapped); }; var dt = "[object DataView]"; function ft(t3, e3, n3, o3) { if (t3 === e3) return 0 !== t3 || 1 / t3 == 1 / e3; if (null == t3 || null == e3) return false; if (t3 != t3) return e3 != e3; var r2 = typeof t3; return ("function" === r2 || "object" === r2 || "object" == typeof e3) && ht(t3, e3, n3, o3); } function ht(t3, e3, n3, o3) { t3 instanceof ut && (t3 = t3._wrapped), e3 instanceof ut && (e3 = e3._wrapped); var r2 = p.call(t3); if (r2 !== p.call(e3)) return false; if (B && "[object Object]" == r2 && $(t3)) { if (!$(e3)) return false; r2 = dt; } switch (r2) { case "[object RegExp]": case "[object String]": return "" + t3 == "" + e3; case "[object Number]": return +t3 != +t3 ? +e3 != +e3 : 0 == +t3 ? 1 / +t3 == 1 / e3 : +t3 == +e3; case "[object Date]": case "[object Boolean]": return +t3 == +e3; case "[object Symbol]": return l.valueOf.call(t3) === l.valueOf.call(e3); case "[object ArrayBuffer]": case dt: return ht(pt(t3), pt(e3), n3, o3); } var i2 = "[object Array]" === r2; if (!i2 && rt(t3)) { if (et(t3) !== et(e3)) return false; if (t3.buffer === e3.buffer && t3.byteOffset === e3.byteOffset) return true; i2 = true; } if (!i2) { if ("object" != typeof t3 || "object" != typeof e3) return false; var s2 = t3.constructor, a2 = e3.constructor; if (s2 !== a2 && !(H(s2) && s2 instanceof s2 && H(a2) && a2 instanceof a2) && "constructor" in t3 && "constructor" in e3) return false; } o3 = o3 || []; for (var c2 = (n3 = n3 || []).length; c2--; ) if (n3[c2] === t3) return o3[c2] === e3; if (n3.push(t3), o3.push(e3), i2) { if ((c2 = t3.length) !== e3.length) return false; for (; c2--; ) if (!ft(t3[c2], e3[c2], n3, o3)) return false; } else { var u2, d2 = at(t3); if (c2 = d2.length, at(e3).length !== c2) return false; for (; c2--; ) if (!G(e3, u2 = d2[c2]) || !ft(t3[u2], e3[u2], n3, o3)) return false; } return n3.pop(), o3.pop(), true; } function gt(t3, e3) { return ft(t3, e3); } function vt(t3) { if (!O(t3)) return []; var e3 = []; for (var n3 in t3) e3.push(n3); return w && st(t3, e3), e3; } function yt(t3) { var e3 = it(t3); return function(n3) { if (null == n3) return false; var o3 = vt(n3); if (it(o3)) return false; for (var r2 = 0; r2 < e3; r2++) if (!H(n3[t3[r2]])) return false; return t3 !== Ct || !H(n3[mt]); }; } var mt = "forEach", bt = "has", _t = ["clear", "delete"], wt = ["get", bt, "set"], xt = _t.concat(mt, wt), Ct = _t.concat(wt), St = ["add"].concat(_t, mt, bt); const Ot = U ? yt(xt) : A("Map"), Tt = U ? yt(Ct) : A("WeakMap"), kt = U ? yt(St) : A("Set"), Pt = A("WeakSet"); function Et(t3) { for (var e3 = at(t3), n3 = e3.length, o3 = Array(n3), r2 = 0; r2 < n3; r2++) o3[r2] = t3[e3[r2]]; return o3; } function At(t3) { for (var e3 = at(t3), n3 = e3.length, o3 = Array(n3), r2 = 0; r2 < n3; r2++) o3[r2] = [e3[r2], t3[e3[r2]]]; return o3; } function jt(t3) { for (var e3 = {}, n3 = at(t3), o3 = 0, r2 = n3.length; o3 < r2; o3++) e3[t3[n3[o3]]] = n3[o3]; return e3; } function Mt(t3) { var e3 = []; for (var n3 in t3) H(t3[n3]) && e3.push(n3); return e3.sort(); } function Lt(t3, e3) { return function(n3) { var o3 = arguments.length; if (e3 && (n3 = Object(n3)), o3 < 2 || null == n3) return n3; for (var r2 = 1; r2 < o3; r2++) for (var i2 = arguments[r2], s2 = t3(i2), a2 = s2.length, l2 = 0; l2 < a2; l2++) { var c2 = s2[l2]; e3 && void 0 !== n3[c2] || (n3[c2] = i2[c2]); } return n3; }; } const Dt = Lt(vt), Nt = Lt(at), It = Lt(vt, true); function Ft(t3) { if (!O(t3)) return {}; if (y) return y(t3); var e3 = function() { }; e3.prototype = t3; var n3 = new e3(); return e3.prototype = null, n3; } function Vt(t3, e3) { var n3 = Ft(t3); return e3 && Nt(n3, e3), n3; } function Rt(t3) { return O(t3) ? q(t3) ? t3.slice() : Dt({}, t3) : t3; } function Ht(t3, e3) { return e3(t3), t3; } function zt(t3) { return q(t3) ? t3 : [t3]; } function Bt(t3) { return ut.toPath(t3); } function Ut(t3, e3) { for (var n3 = e3.length, o3 = 0; o3 < n3; o3++) { if (null == t3) return; t3 = t3[e3[o3]]; } return n3 ? t3 : void 0; } function Wt(t3, e3, n3) { var o3 = Ut(t3, Bt(e3)); return k(o3) ? n3 : o3; } function $t(t3, e3) { for (var n3 = (e3 = Bt(e3)).length, o3 = 0; o3 < n3; o3++) { var r2 = e3[o3]; if (!G(t3, r2)) return false; t3 = t3[r2]; } return !!n3; } function qt(t3) { return t3; } function Gt(t3) { return t3 = Nt({}, t3), function(e3) { return ct(e3, t3); }; } function Kt(t3) { return t3 = Bt(t3), function(e3) { return Ut(e3, t3); }; } function Yt(t3, e3, n3) { if (void 0 === e3) return t3; switch (null == n3 ? 3 : n3) { case 1: return function(n4) { return t3.call(e3, n4); }; case 3: return function(n4, o3, r2) { return t3.call(e3, n4, o3, r2); }; case 4: return function(n4, o3, r2, i2) { return t3.call(e3, n4, o3, r2, i2); }; } return function() { return t3.apply(e3, arguments); }; } function Xt(t3, e3, n3) { return null == t3 ? qt : H(t3) ? Yt(t3, e3, n3) : O(t3) && !q(t3) ? Gt(t3) : Kt(t3); } function Jt(t3, e3) { return Xt(t3, e3, 1 / 0); } function Zt(t3, e3, n3) { return ut.iteratee !== Jt ? ut.iteratee(t3, e3) : Xt(t3, e3, n3); } function Qt(t3, e3, n3) { e3 = Zt(e3, n3); for (var o3 = at(t3), r2 = o3.length, i2 = {}, s2 = 0; s2 < r2; s2++) { var a2 = o3[s2]; i2[a2] = e3(t3[a2], a2, t3); } return i2; } function te() { } function ee(t3) { return null == t3 ? te : function(e3) { return Wt(t3, e3); }; } function ne(t3, e3, n3) { var o3 = Array(Math.max(0, t3)); e3 = Yt(e3, n3, 1); for (var r2 = 0; r2 < t3; r2++) o3[r2] = e3(r2); return o3; } function oe(t3, e3) { return null == e3 && (e3 = t3, t3 = 0), t3 + Math.floor(Math.random() * (e3 - t3 + 1)); } ut.toPath = zt, ut.iteratee = Jt; const re = Date.now || function() { return (/* @__PURE__ */ new Date()).getTime(); }; function ie(t3) { var e3 = function(e4) { return t3[e4]; }, n3 = "(?:" + at(t3).join("|") + ")", o3 = RegExp(n3), r2 = RegExp(n3, "g"); return function(t4) { return t4 = null == t4 ? "" : "" + t4, o3.test(t4) ? t4.replace(r2, e3) : t4; }; } const se = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }, ae = ie(se), le = ie(jt(se)), ce = ut.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; var ue = /(.)^/, pe = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029" }, de = /\\|'|\r|\n|\u2028|\u2029/g; function fe(t3) { return "\\" + pe[t3]; } var he = /^\s*(\w|\$)+\s*$/; function ge(t3, e3, n3) { !e3 && n3 && (e3 = n3), e3 = It({}, e3, ut.templateSettings); var o3 = RegExp([(e3.escape || ue).source, (e3.interpolate || ue).source, (e3.evaluate || ue).source].join("|") + "|$", "g"), r2 = 0, i2 = "__p+='"; t3.replace(o3, function(e4, n4, o4, s3, a3) { return i2 += t3.slice(r2, a3).replace(de, fe), r2 = a3 + e4.length, n4 ? i2 += "'+\n((__t=(" + n4 + "))==null?'':_.escape(__t))+\n'" : o4 ? i2 += "'+\n((__t=(" + o4 + "))==null?'':__t)+\n'" : s3 && (i2 += "';\n" + s3 + "\n__p+='"), e4; }), i2 += "';\n"; var s2, a2 = e3.variable; if (a2) { if (!he.test(a2)) throw new Error("variable is not a bare identifier: " + a2); } else i2 = "with(obj||{}){\n" + i2 + "}\n", a2 = "obj"; i2 = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + i2 + "return __p;\n"; try { s2 = new Function(a2, "_", i2); } catch (t4) { throw t4.source = i2, t4; } var l2 = function(t4) { return s2.call(this, t4, ut); }; return l2.source = "function(" + a2 + "){\n" + i2 + "}", l2; } function ve(t3, e3, n3) { var o3 = (e3 = Bt(e3)).length; if (!o3) return H(n3) ? n3.call(t3) : n3; for (var r2 = 0; r2 < o3; r2++) { var i2 = null == t3 ? void 0 : t3[e3[r2]]; void 0 === i2 && (i2 = n3, r2 = o3), t3 = H(i2) ? i2.call(t3) : i2; } return t3; } var ye = 0; function me(t3) { var e3 = ++ye + ""; return t3 ? t3 + e3 : e3; } function be(t3) { var e3 = ut(t3); return e3._chain = true, e3; } function _e(t3, e3, n3, o3, r2) { if (!(o3 instanceof e3)) return t3.apply(n3, r2); var i2 = Ft(t3.prototype), s2 = t3.apply(i2, r2); return O(s2) ? s2 : i2; } var we = S(function(t3, e3) { var n3 = we.placeholder, o3 = function() { for (var r2 = 0, i2 = e3.length, s2 = Array(i2), a2 = 0; a2 < i2; a2++) s2[a2] = e3[a2] === n3 ? arguments[r2++] : e3[a2]; for (; r2 < arguments.length; ) s2.push(arguments[r2++]); return _e(t3, o3, this, this, s2); }; return o3; }); we.placeholder = ut; const xe = we, Ce = S(function(t3, e3, n3) { if (!H(t3)) throw new TypeError("Bind must be called on a function"); var o3 = S(function(r2) { return _e(t3, o3, e3, this, n3.concat(r2)); }); return o3; }), Se = Q(it); function Oe(t3, e3, n3, o3) { if (o3 = o3 || [], e3 || 0 === e3) { if (e3 <= 0) return o3.concat(t3); } else e3 = 1 / 0; for (var r2 = o3.length, i2 = 0, s2 = it(t3); i2 < s2; i2++) { var a2 = t3[i2]; if (Se(a2) && (q(a2) || Y(a2))) if (e3 > 1) Oe(a2, e3 - 1, n3, o3), r2 = o3.length; else for (var l2 = 0, c2 = a2.length; l2 < c2; ) o3[r2++] = a2[l2++]; else n3 || (o3[r2++] = a2); } return o3; } const Te = S(function(t3, e3) { var n3 = (e3 = Oe(e3, false, false)).length; if (n3 < 1) throw new Error("bindAll must be passed function names"); for (; n3--; ) { var o3 = e3[n3]; t3[o3] = Ce(t3[o3], t3); } return t3; }); function ke(t3, e3) { var n3 = function(o3) { var r2 = n3.cache, i2 = "" + (e3 ? e3.apply(this, arguments) : o3); return G(r2, i2) || (r2[i2] = t3.apply(this, arguments)), r2[i2]; }; return n3.cache = {}, n3; } const Pe = S(function(t3, e3, n3) { return setTimeout(function() { return t3.apply(null, n3); }, e3); }), Ee = xe(Pe, ut, 1); function Ae(t3, e3, n3) { var o3, r2, i2, s2, a2 = 0; n3 || (n3 = {}); var l2 = function() { a2 = false === n3.leading ? 0 : re(), o3 = null, s2 = t3.apply(r2, i2), o3 || (r2 = i2 = null); }, c2 = function() { var c3 = re(); a2 || false !== n3.leading || (a2 = c3); var u2 = e3 - (c3 - a2); return r2 = this, i2 = arguments, u2 <= 0 || u2 > e3 ? (o3 && (clearTimeout(o3), o3 = null), a2 = c3, s2 = t3.apply(r2, i2), o3 || (r2 = i2 = null)) : o3 || false === n3.trailing || (o3 = setTimeout(l2, u2)), s2; }; return c2.cancel = function() { clearTimeout(o3), a2 = 0, o3 = r2 = i2 = null; }, c2; } function je(t3, e3, n3) { var o3, r2, i2, s2, a2, l2 = function() { var c3 = re() - r2; e3 > c3 ? o3 = setTimeout(l2, e3 - c3) : (o3 = null, n3 || (s2 = t3.apply(a2, i2)), o3 || (i2 = a2 = null)); }, c2 = S(function(c3) { return a2 = this, i2 = c3, r2 = re(), o3 || (o3 = setTimeout(l2, e3), n3 && (s2 = t3.apply(a2, i2))), s2; }); return c2.cancel = function() { clearTimeout(o3), o3 = i2 = a2 = null; }, c2; } function Me(t3, e3) { return xe(e3, t3); } function Le(t3) { return function() { return !t3.apply(this, arguments); }; } function De() { var t3 = arguments, e3 = t3.length - 1; return function() { for (var n3 = e3, o3 = t3[e3].apply(this, arguments); n3--; ) o3 = t3[n3].call(this, o3); return o3; }; } function Ne(t3, e3) { return function() { if (--t3 < 1) return e3.apply(this, arguments); }; } function Ie(t3, e3) { var n3; return function() { return --t3 > 0 && (n3 = e3.apply(this, arguments)), t3 <= 1 && (e3 = null), n3; }; } const Fe = xe(Ie, 2); function Ve(t3, e3, n3) { e3 = Zt(e3, n3); for (var o3, r2 = at(t3), i2 = 0, s2 = r2.length; i2 < s2; i2++) if (e3(t3[o3 = r2[i2]], o3, t3)) return o3; } function Re(t3) { return function(e3, n3, o3) { n3 = Zt(n3, o3); for (var r2 = it(e3), i2 = t3 > 0 ? 0 : r2 - 1; i2 >= 0 && i2 < r2; i2 += t3) if (n3(e3[i2], i2, e3)) return i2; return -1; }; } const He = Re(1), ze = Re(-1); function Be(t3, e3, n3, o3) { for (var r2 = (n3 = Zt(n3, o3, 1))(e3), i2 = 0, s2 = it(t3); i2 < s2; ) { var a2 = Math.floor((i2 + s2) / 2); n3(t3[a2]) < r2 ? i2 = a2 + 1 : s2 = a2; } return i2; } function Ue(t3, e3, n3) { return function(o3, r2, i2) { var s2 = 0, a2 = it(o3); if ("number" == typeof i2) t3 > 0 ? s2 = i2 >= 0 ? i2 : Math.max(i2 + a2, s2) : a2 = i2 >= 0 ? Math.min(i2 + 1, a2) : i2 + a2 + 1; else if (n3 && i2 && a2) return o3[i2 = n3(o3, r2)] === r2 ? i2 : -1; if (r2 != r2) return (i2 = e3(u.call(o3, s2, a2), J)) >= 0 ? i2 + s2 : -1; for (i2 = t3 > 0 ? s2 : a2 - 1; i2 >= 0 && i2 < a2; i2 += t3) if (o3[i2] === r2) return i2; return -1; }; } const We = Ue(1, He, Be), $e = Ue(-1, ze); function qe(t3, e3, n3) { var o3 = (Se(t3) ? He : Ve)(t3, e3, n3); if (void 0 !== o3 && -1 !== o3) return t3[o3]; } function Ge(t3, e3) { return qe(t3, Gt(e3)); } function Ke(t3, e3, n3) { var o3, r2; if (e3 = Yt(e3, n3), Se(t3)) for (o3 = 0, r2 = t3.length; o3 < r2; o3++) e3(t3[o3], o3, t3); else { var i2 = at(t3); for (o3 = 0, r2 = i2.length; o3 < r2; o3++) e3(t3[i2[o3]], i2[o3], t3); } return t3; } function Ye(t3, e3, n3) { e3 = Zt(e3, n3); for (var o3 = !Se(t3) && at(t3), r2 = (o3 || t3).length, i2 = Array(r2), s2 = 0; s2 < r2; s2++) { var a2 = o3 ? o3[s2] : s2; i2[s2] = e3(t3[a2], a2, t3); } return i2; } function Xe(t3) { var e3 = function(e4, n3, o3, r2) { var i2 = !Se(e4) && at(e4), s2 = (i2 || e4).length, a2 = t3 > 0 ? 0 : s2 - 1; for (r2 || (o3 = e4[i2 ? i2[a2] : a2], a2 += t3); a2 >= 0 && a2 < s2; a2 += t3) { var l2 = i2 ? i2[a2] : a2; o3 = n3(o3, e4[l2], l2, e4); } return o3; }; return function(t4, n3, o3, r2) { var i2 = arguments.length >= 3; return e3(t4, Yt(n3, r2, 4), o3, i2); }; } const Je = Xe(1), Ze = Xe(-1); function Qe(t3, e3, n3) { var o3 = []; return e3 = Zt(e3, n3), Ke(t3, function(t4, n4, r2) { e3(t4, n4, r2) && o3.push(t4); }), o3; } function tn(t3, e3, n3) { return Qe(t3, Le(Zt(e3)), n3); } function en(t3, e3, n3) { e3 = Zt(e3, n3); for (var o3 = !Se(t3) && at(t3), r2 = (o3 || t3).length, i2 = 0; i2 < r2; i2++) { var s2 = o3 ? o3[i2] : i2; if (!e3(t3[s2], s2, t3)) return false; } return true; } function nn(t3, e3, n3) { e3 = Zt(e3, n3); for (var o3 = !Se(t3) && at(t3), r2 = (o3 || t3).length, i2 = 0; i2 < r2; i2++) { var s2 = o3 ? o3[i2] : i2; if (e3(t3[s2], s2, t3)) return true; } return false; } function on(t3, e3, n3, o3) { return Se(t3) || (t3 = Et(t3)), ("number" != typeof n3 || o3) && (n3 = 0), We(t3, e3, n3) >= 0; } const rn = S(function(t3, e3, n3) { var o3, r2; return H(e3) ? r2 = e3 : (e3 = Bt(e3), o3 = e3.slice(0, -1), e3 = e3[e3.length - 1]), Ye(t3, function(t4) { var i2 = r2; if (!i2) { if (o3 && o3.length && (t4 = Ut(t4, o3)), null == t4) return; i2 = t4[e3]; } return null == i2 ? i2 : i2.apply(t4, n3); }); }); function sn(t3, e3) { return Ye(t3, Kt(e3)); } function an(t3, e3) { return Qe(t3, Gt(e3)); } function ln(t3, e3, n3) { var o3, r2, i2 = -1 / 0, s2 = -1 / 0; if (null == e3 || "number" == typeof e3 && "object" != typeof t3[0] && null != t3) for (var a2 = 0, l2 = (t3 = Se(t3) ? t3 : Et(t3)).length; a2 < l2; a2++) null != (o3 = t3[a2]) && o3 > i2 && (i2 = o3); else e3 = Zt(e3, n3), Ke(t3, function(t4, n4, o4) { ((r2 = e3(t4, n4, o4)) > s2 || r2 === -1 / 0 && i2 === -1 / 0) && (i2 = t4, s2 = r2); }); return i2; } function cn(t3, e3, n3) { var o3, r2, i2 = 1 / 0, s2 = 1 / 0; if (null == e3 || "number" == typeof e3 && "object" != typeof t3[0] && null != t3) for (var a2 = 0, l2 = (t3 = Se(t3) ? t3 : Et(t3)).length; a2 < l2; a2++) null != (o3 = t3[a2]) && o3 < i2 && (i2 = o3); else e3 = Zt(e3, n3), Ke(t3, function(t4, n4, o4) { ((r2 = e3(t4, n4, o4)) < s2 || r2 === 1 / 0 && i2 === 1 / 0) && (i2 = t4, s2 = r2); }); return i2; } var un = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; function pn(t3) { return t3 ? q(t3) ? u.call(t3) : j(t3) ? t3.match(un) : Se(t3) ? Ye(t3, qt) : Et(t3) : []; } function dn(t3, e3, n3) { if (null == e3 || n3) return Se(t3) || (t3 = Et(t3)), t3[oe(t3.length - 1)]; var o3 = pn(t3), r2 = it(o3); e3 = Math.max(Math.min(e3, r2), 0); for (var i2 = r2 - 1, s2 = 0; s2 < e3; s2++) { var a2 = oe(s2, i2), l2 = o3[s2]; o3[s2] = o3[a2], o3[a2] = l2; } return o3.slice(0, e3); } function fn(t3) { return dn(t3, 1 / 0); } function hn(t3, e3, n3) { var o3 = 0; return e3 = Zt(e3, n3), sn(Ye(t3, function(t4, n4, r2) { return { value: t4, index: o3++, criteria: e3(t4, n4, r2) }; }).sort(function(t4, e4) { var n4 = t4.criteria, o4 = e4.criteria; if (n4 !== o4) { if (n4 > o4 || void 0 === n4) return 1; if (n4 < o4 || void 0 === o4) return -1; } return t4.index - e4.index; }), "value"); } function gn(t3, e3) { return function(n3, o3, r2) { var i2 = e3 ? [[], []] : {}; return o3 = Zt(o3, r2), Ke(n3, function(e4, r3) { var s2 = o3(e4, r3, n3); t3(i2, e4, s2); }), i2; }; } const vn = gn(function(t3, e3, n3) { G(t3, n3) ? t3[n3].push(e3) : t3[n3] = [e3]; }), yn = gn(function(t3, e3, n3) { t3[n3] = e3; }), mn = gn(function(t3, e3, n3) { G(t3, n3) ? t3[n3]++ : t3[n3] = 1; }), bn = gn(function(t3, e3, n3) { t3[n3 ? 0 : 1].push(e3); }, true); function _n(t3) { return null == t3 ? 0 : Se(t3) ? t3.length : at(t3).length; } function wn(t3, e3, n3) { return e3 in n3; } const xn = S(function(t3, e3) { var n3 = {}, o3 = e3[0]; if (null == t3) return n3; H(o3) ? (e3.length > 1 && (o3 = Yt(o3, e3[1])), e3 = vt(t3)) : (o3 = wn, e3 = Oe(e3, false, false), t3 = Object(t3)); for (var r2 = 0, i2 = e3.length; r2 < i2; r2++) { var s2 = e3[r2], a2 = t3[s2]; o3(a2, s2, t3) && (n3[s2] = a2); } return n3; }), Cn = S(function(t3, e3) { var n3, o3 = e3[0]; return H(o3) ? (o3 = Le(o3), e3.length > 1 && (n3 = e3[1])) : (e3 = Ye(Oe(e3, false, false), String), o3 = function(t4, n4) { return !on(e3, n4); }), xn(t3, o3, n3); }); function Sn(t3, e3, n3) { return u.call(t3, 0, Math.max(0, t3.length - (null == e3 || n3 ? 1 : e3))); } function On(t3, e3, n3) { return null == t3 || t3.length < 1 ? null == e3 || n3 ? void 0 : [] : null == e3 || n3 ? t3[0] : Sn(t3, t3.length - e3); } function Tn(t3, e3, n3) { return u.call(t3, null == e3 || n3 ? 1 : e3); } function kn(t3, e3, n3) { return null == t3 || t3.length < 1 ? null == e3 || n3 ? void 0 : [] : null == e3 || n3 ? t3[t3.length - 1] : Tn(t3, Math.max(0, t3.length - e3)); } function Pn(t3) { return Qe(t3, Boolean); } function En(t3, e3) { return Oe(t3, e3, false); } const An = S(function(t3, e3) { return e3 = Oe(e3, true, true), Qe(t3, function(t4) { return !on(e3, t4); }); }), jn = S(function(t3, e3) { return An(t3, e3); }); function Mn(t3, e3, n3, o3) { P(e3) || (o3 = n3, n3 = e3, e3 = false), null != n3 && (n3 = Zt(n3, o3)); for (var r2 = [], i2 = [], s2 = 0, a2 = it(t3); s2 < a2; s2++) { var l2 = t3[s2], c2 = n3 ? n3(l2, s2, t3) : l2; e3 && !n3 ? (s2 && i2 === c2 || r2.push(l2), i2 = c2) : n3 ? on(i2, c2) || (i2.push(c2), r2.push(l2)) : on(r2, l2) || r2.push(l2); } return r2; } const Ln = S(function(t3) { return Mn(Oe(t3, true, true)); }); function Dn(t3) { for (var e3 = [], n3 = arguments.length, o3 = 0, r2 = it(t3); o3 < r2; o3++) { var i2 = t3[o3]; if (!on(e3, i2)) { var s2; for (s2 = 1; s2 < n3 && on(arguments[s2], i2); s2++) ; s2 === n3 && e3.push(i2); } } return e3; } function Nn(t3) { for (var e3 = t3 && ln(t3, it).length || 0, n3 = Array(e3), o3 = 0; o3 < e3; o3++) n3[o3] = sn(t3, o3); return n3; } const In = S(Nn); function Fn(t3, e3) { for (var n3 = {}, o3 = 0, r2 = it(t3); o3 < r2; o3++) e3 ? n3[t3[o3]] = e3[o3] : n3[t3[o3][0]] = t3[o3][1]; return n3; } function Vn(t3, e3, n3) { null == e3 && (e3 = t3 || 0, t3 = 0), n3 || (n3 = e3 < t3 ? -1 : 1); for (var o3 = Math.max(Math.ceil((e3 - t3) / n3), 0), r2 = Array(o3), i2 = 0; i2 < o3; i2++, t3 += n3) r2[i2] = t3; return r2; } function Rn(t3, e3) { if (null == e3 || e3 < 1) return []; for (var n3 = [], o3 = 0, r2 = t3.length; o3 < r2; ) n3.push(u.call(t3, o3, o3 += e3)); return n3; } function Hn(t3, e3) { return t3._chain ? ut(e3).chain() : e3; } function zn(t3) { return Ke(Mt(t3), function(e3) { var n3 = ut[e3] = t3[e3]; ut.prototype[e3] = function() { var t4 = [this._wrapped]; return c.apply(t4, arguments), Hn(this, n3.apply(ut, t4)); }; }), ut; } Ke(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(t3) { var e3 = s[t3]; ut.prototype[t3] = function() { var n3 = this._wrapped; return null != n3 && (e3.apply(n3, arguments), "shift" !== t3 && "splice" !== t3 || 0 !== n3.length || delete n3[0]), Hn(this, n3); }; }), Ke(["concat", "join", "slice"], function(t3) { var e3 = s[t3]; ut.prototype[t3] = function() { var t4 = this._wrapped; return null != t4 && (t4 = e3.apply(t4, arguments)), Hn(this, t4); }; }); const Bn = ut; var Un = zn(o2); Un._ = Un; const Wn = Un; } }, e = {}; function n(o2) { var r = e[o2]; if (void 0 !== r) return r.exports; var i = e[o2] = { exports: {} }; return t[o2].call(i.exports, i, i.exports, n), i.exports; } n.n = (t2) => { var e2 = t2 && t2.__esModule ? () => t2["default"] : () => t2; return n.d(e2, { a: e2 }), e2; }, n.d = (t2, e2) => { for (var o2 in e2) n.o(e2, o2) && !n.o(t2, o2) && Object.defineProperty(t2, o2, { enumerable: true, get: e2[o2] }); }, n.g = function() { if ("object" == typeof globalThis) return globalThis; try { return this || new Function("return this")(); } catch (t2) { if ("object" == typeof window) return window; } }(), n.o = (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), n.r = (t2) => { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true }); }; var o = {}; return (() => { n.d(o, { default: () => Ph }); var t2 = n(50), e2 = n(163); function r(t3) { for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2]; var r2 = t3.raw; return r2.reduce(function(t4, o3, i2) { var s2 = n2[i2 - 1], a2 = r2[i2 - 1]; return Array.isArray(s2) ? s2 = s2.join("") : a2 && "$" === a2.slice(-1) ? t4 = t4.slice(0, -1) : s2 = (0, e2.escape)(s2), t4 + s2 + o3; }); } const i = { stylePrefix: "gjs-", components: "", style: "", fromElement: false, projectData: void 0, noticeOnUnload: true, showOffsets: false, showOffsetsSelected: false, forceClass: true, height: "900px", width: "100%", log: ["warning", "error"], baseCss: "", protectedCss: "* { box-sizing: border-box; } body {margin: 0;}", canvasCss: "", defaultCommand: "select-comp", showToolbar: true, showDevices: true, devicePreviewMode: false, mediaCondition: "max-width", tagVarStart: "{[ ", tagVarEnd: " ]}", keepEmptyTextNodes: false, jsInHtml: true, nativeDnD: true, multipleSelection: true, optsHtml: {}, optsCss: {}, avoidInlineStyle: true, avoidDefaults: true, clearStyles: false, 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: false, multiFrames: false, customUI: false }; var s = n(316), a = n.n(s), l = n(895); var c, u = n(346), p = (c = function(t3, e3) { return c = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n2 in e4) Object.prototype.hasOwnProperty.call(e4, n2) && (t4[n2] = e4[n2]); }, c(t3, e3); }, function(t3, e3) { if ("function" != typeof e3 && null !== e3) throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null"); function n2() { this.constructor = t3; } c(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n2.prototype = e3.prototype, new n2()); }), d = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return p(e3, t3), e3; }(u.Hn); const f = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return p(n2, e3), n2.prototype.getByComponent = function(t3) { var e4 = this; return this.filter(function(n3) { return e4.getComponent(n3) === t3; })[0]; }, n2.prototype.addComponent = function(e4, n3) { var o2 = this, r2 = ((0, t2.isArray)(e4) ? e4 : [e4]).filter(function(t3) { return !o2.hasComponent(t3); }).map(function(t3) { return new d({ component: t3 }); })[0]; return this.push(r2, n3); }, n2.prototype.getComponent = function(t3) { return t3.get("component"); }, n2.prototype.hasComponent = function(t3) { var e4 = this.getByComponent(t3); return e4 && this.contains(e4); }, n2.prototype.lastComponent = function() { var t3 = this.last(); return t3 ? this.getComponent(t3) : void 0; }, n2.prototype.allComponents = function() { var t3 = this; return this.map(function(e4) { return t3.getComponent(e4); }).filter(function(t4) { return t4; }); }, n2.prototype.removeComponent = function(e4, n3) { var o2 = this, r2 = ((0, t2.isArray)(e4) ? e4 : [e4]).map(function(t3) { return o2.getByComponent(t3); }); return this.remove(r2, n3); }, n2; }(u.FE); var h = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), g = function() { return g = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, g.apply(this, arguments); }, v = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, y = function() { function n2(n3, o2, r2) { this.cls = [], this._em = n3, this._name = o2; var i2 = this.name.charAt(0).toLowerCase() + this.name.slice(1), s2 = (0, t2.isUndefined)(n3.config[i2]) ? n3.config[this.name] : n3.config[i2], a2 = true === s2 ? {} : s2 || {}; a2.pStylePrefix = n3.config.pStylePrefix || "", (0, t2.isUndefined)(s2) || s2 || (a2._disable = 1), a2.em = n3, this._config = (0, e2.deepMerge)(r2 || {}, a2); } return Object.defineProperty(n2.prototype, "em", { get: function() { return this._em; }, enumerable: false, configurable: true }), Object.defineProperty(n2.prototype, "config", { get: function() { return this._config; }, enumerable: false, configurable: true }), n2.prototype.render = function(t3) { }, n2.prototype.postLoad = function(t3) { }, Object.defineProperty(n2.prototype, "name", { get: function() { return this._name; }, enumerable: false, configurable: true }), n2.prototype.getConfig = function(t3) { return t3 ? this.config[t3] : this.config; }, n2.prototype.__logWarn = function(t3, e3) { void 0 === e3 && (e3 = {}), this.em.logWarning("[".concat(this.name, "]: ").concat(t3), e3); }, n2.prototype.__appendTo = function() { var e3 = this.getConfig().appendTo; if (e3) { var n3 = (0, t2.isElement)(e3) ? e3 : document.querySelector(e3); if (!n3) return this.__logWarn('"appendTo" element not found'); n3.appendChild(this.render()); } }, n2; }(); const m = y; var b = function(n2) { function o2(t3, e3, o3, r2, i2, s2) { void 0 === s2 && (s2 = {}); var a2 = n2.call(this, t3, e3, i2) || this; return a2.cls = [], a2.private = false, a2.all = o3, a2.events = r2, !s2.skipListen && a2.__initListen(), a2; } return h(o2, n2), o2.prototype.postLoad = function(t3) { }, o2.prototype.render = function(t3) { }, o2.prototype.getProjectData = function(t3) { var e3 = {}, n3 = this.storageKey; return n3 && (e3[n3] = t3 || this.getAll()), e3; }, o2.prototype.loadProjectData = function(t3, n3) { void 0 === t3 && (t3 = {}), void 0 === n3 && (n3 = {}); var o3 = n3.all, r2 = n3.onResult, i2 = n3.reset, s2 = this.storageKey, a2 = { action: "load" }, l2 = o3 || this.all, c2 = t3[s2]; if ("string" == typeof c2) try { c2 = JSON.parse(c2); } catch (t4) { this.__logWarn("Data parsing failed", { input: c2 }); } return i2 && c2 && l2.reset(void 0, a2), r2 ? c2 && r2(c2, a2) : c2 && (0, e2.isDef)(c2.length) && l2.reset(c2, a2), c2; }, o2.prototype.clear = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.all; return e3 && e3.reset(void 0, t3), this; }, o2.prototype.getAll = function() { return v([], this.all.models, true); }, o2.prototype.getAllMap = function() { return this.getAll().reduce(function(t3, e3) { return t3[e3.get(e3.idAttribute)] = e3, t3; }, {}); }, o2.prototype.__initListen = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this, n3 = e3.all, o3 = e3.em, r2 = e3.events; n3 && o3 && n3.on("add", function(t4, e4, n4) { return o3.trigger(r2.add, t4, n4); }).on("remove", function(t4, e4, n4) { return o3.trigger(r2.remove, t4, n4); }).on("change", function(t4, e4) { return o3.trigger(r2.update, t4, t4.changedAttributes(), e4); }).on("all", this.__catchAllEvent, this), this.cls = [n3].concat(t3.collections || []), (t3.propagate || []).forEach(function(t4) { var e4 = t4.entity, r3 = t4.event; e4.on("all", function(t5, e5, i2, s2) { var a2 = g({ event: t5 }, s2 || i2); [o3, n3].map(function(t6) { return t6.trigger(r3, e5, a2); }); }); }); }, o2.prototype.__remove = function(e3, n3) { var o3 = this; void 0 === n3 && (n3 = {}); var r2 = this.em, i2 = (0, t2.isString)(e3) ? this.get(e3) : e3, s2 = function() { return i2 && o3.all.remove(i2, n3), i2; }; return !n3.silent && (null == r2 || r2.trigger(this.events.removeBefore, i2, s2, n3)), !n3.abort && s2(); }, o2.prototype.__catchAllEvent = function(t3, e3, n3, o3) { var r2 = this.em, i2 = this.events, s2 = o3 || n3; r2 && i2.all && r2.trigger(i2.all, { event: t3, model: e3, options: s2 }), this.__onAllEvent(); }, o2.prototype.__appendTo = function(e3) { var n3 = this.config.appendTo; if (n3) { var o3 = (0, t2.isElement)(n3) ? n3 : document.querySelector(n3); if (!o3) return this.__logWarn('"appendTo" element not found'); o3.appendChild(this.render(e3)); } }, o2.prototype.__onAllEvent = function() { }, o2.prototype._createId = function(t3) { void 0 === t3 && (t3 = 16); var n3, o3 = this.getAll().length + t3, r2 = this.getAllMap(); do { n3 = (0, e2.createId)(o3); } while (r2[n3]); return n3; }, o2.prototype.__listenAdd = function(t3, e3) { var n3 = this; t3.on("add", function(t4, o3, r2) { return n3.em.trigger(e3, t4, r2); }); }, o2.prototype.__listenRemove = function(t3, e3) { var n3 = this; t3.on("remove", function(t4, o3, r2) { return n3.em.trigger(e3, t4, r2); }); }, o2.prototype.__listenUpdate = function(t3, e3) { var n3 = this; t3.on("change", function(t4, o3) { return n3.em.trigger(e3, t4, t4.changedAttributes(), o3); }); }, o2.prototype.__destroy = function() { var t3; this.cls.forEach(function(t4) { t4.stopListening(), t4.reset(); }), null === (t3 = this.view) || void 0 === t3 || t3.remove(), this.view = void 0; }, o2; }(y); const _ = { stylePrefix: "cv-", scripts: [], styles: [], customBadgeLabel: void 0, autoscrollLimit: 50, extHl: false, frameContent: "", frameStyle: "\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ", notTextable: ["button", "a", "input[type=checkbox]", "input[type=radio]"] }; var w = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const x = function(t3) { function e3(e4, n2, o2) { var r2 = t3.call(this, n2, o2) || this; return r2._module = e4, r2; } return w(e3, t3), Object.defineProperty(e3.prototype, "module", { get: function() { return this._module; }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "config", { get: function() { return this._module.config; }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "em", { get: function() { return this._module.em; }, enumerable: false, configurable: true }), e3; }(u.Hn); var C = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const S = function(e3) { function n2(t3, n3, o2) { return e3.call(this, n3, { module: t3, modelConstructor: o2 }) || this; } return C(n2, e3), n2.prototype.add = function(n3, o2) { var r2, i2 = this, s2 = (0, t2.isArray)(n3) ? n3 : (0, t2.isUndefined)(n3) ? void 0 : [n3]; return s2 = null !== (r2 = null == s2 ? void 0 : s2.map(function(t3) { return t3 instanceof i2.newModel ? t3 : new i2.newModel(i2.module, t3); })) && void 0 !== r2 ? r2 : [void 0], e3.prototype.add.call(this, (0, t2.isArray)(n3) ? s2 : s2[0], o2); }, n2.prototype.preinitialize = function(t3, e4) { this.newModel = e4.modelConstructor, this.module = e4.module; }, n2; }(u.FE); var O = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), T = function() { return T = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, T.apply(this, arguments); }, k = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, P = "__aw", E = "__ah", A = function(n2) { function o2(o3, r2) { var i2 = n2.call(this, o3, r2) || this, s2 = i2.em, a2 = i2.attributes, l2 = a2.styles, c2 = a2.component, u2 = s2.Components, p2 = u2.getConfig(), d2 = s2.Css.getAll(), f2 = {}, h2 = { em: s2, config: p2, frame: i2, idMap: f2 }; if (!(0, e2.isComponent)(c2)) { var g2 = (0, e2.isObject)(c2) ? c2 : { components: c2 }; !g2.type && (g2.type = "wrapper"); var v2 = u2.getType("wrapper").model; i2.set("component", new v2(g2, h2)); } if (l2) { if (!(0, e2.isObject)(l2)) { Object.keys(f2).length && Array.isArray(l2) && l2.forEach(function(e3) { var n3 = e3.selectors; if (n3 && 1 == n3.length) { var o4 = n3[0], r3 = o4.name && 2 === o4.type && o4; if (r3 && f2[r3.name]) r3.name = f2[r3.name]; else if ((0, t2.isString)(o4) && "#" === o4[0]) { var i3 = o4.substring(1); i3 && f2[i3] && (n3[0] = "#".concat(f2[i3])); } } }), d2.add(l2), i2.set("styles", d2); } } else i2.set("styles", d2); return !r2.width && i2.set(P, 1), !r2.height && i2.set(E, 1), i2; } return O(o2, n2), o2.prototype.defaults = function() { return { x: 0, y: 0, changesCount: 0, attributes: {}, width: null, height: null, head: [], component: "", styles: "", _undo: true, _undoexc: ["changesCount"] }; }, Object.defineProperty(o2.prototype, "head", { get: function() { return this.get("head"); }, enumerable: false, configurable: true }), o2.prototype.onRemove = function() { this.getComponent().remove({ root: 1 }); }, o2.prototype.changesUp = function(t3) { void 0 === t3 && (t3 = {}), t3.temporary || t3.noCount || t3.avoidStore || this.set("changesCount", this.get("changesCount") + 1); }, o2.prototype.getComponent = function() { return this.get("component"); }, o2.prototype.getStyles = function() { return this.get("styles"); }, o2.prototype.disable = function() { this.trigger("disable"); }, o2.prototype.remove = function() { this.view = void 0; var t3 = this.collection; return t3 && t3.remove(this); }, o2.prototype.getHead = function() { return k([], this.head, true); }, o2.prototype.setHead = function(t3) { return this.set("head", k([], t3, true)); }, o2.prototype.addHeadItem = function(t3) { this.head.push(t3); }, o2.prototype.getHeadByAttr = function(t3, e3, n3) { return this.head.filter(function(o3) { return o3.attributes && o3.attributes[t3] == e3 && (!n3 || n3 === o3.tag); })[0]; }, o2.prototype.removeHeadByAttr = function(t3, e3, n3) { var o3 = this.getHeadByAttr(t3, e3, n3), r2 = this.head.indexOf(o3); r2 >= 0 && this.head.splice(r2, 1); }, o2.prototype.addLink = function(t3) { var e3 = "link"; !this.getHeadByAttr("href", t3, e3) && this.addHeadItem({ tag: e3, attributes: { href: t3, rel: "stylesheet" } }); }, o2.prototype.removeLink = function(t3) { this.removeHeadByAttr("href", t3, "link"); }, o2.prototype.addScript = function(t3) { var e3 = "script"; !this.getHeadByAttr("src", t3, e3) && this.addHeadItem({ tag: e3, attributes: { src: t3 } }); }, o2.prototype.removeScript = function(t3) { this.removeHeadByAttr("src", t3, "script"); }, o2.prototype.getPage = function() { var t3; return null === (t3 = this.collection) || void 0 === t3 ? void 0 : t3.page; }, o2.prototype._emitUpdated = function(t3) { void 0 === t3 && (t3 = {}), this.em.trigger("frame:updated", T({ frame: this }, t3)); }, o2.prototype.toJSON = function(e3) { void 0 === e3 && (e3 = {}); var n3 = x.prototype.toJSON.call(this, e3), o3 = (0, t2.result)(this, "defaults"); return e3.fromUndo && delete n3.component, delete n3.styles, delete n3.changesCount, n3[P] && delete n3.width, n3[E] && delete n3.height, (0, t2.forEach)(n3, function(t3, e4) { 0 === e4.indexOf("_") && delete n3[e4]; }), (0, t2.forEach)(o3, function(t3, e4) { n3[e4] === t3 && delete n3[e4]; }), (0, t2.forEach)(["attributes", "head"], function(e4) { (0, t2.isEmpty)(n3[e4]) && delete n3[e4]; }), n3; }, o2; }(x); const j = A; var M = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const L = function(e3) { function n2(n3, o2) { void 0 === o2 && (o2 = []); var r2 = e3.call(this, n3, o2, j) || this; return r2.loadedItems = 0, r2.itemsToLoad = 0, (0, t2.bindAll)(r2, "itemLoaded"), r2.on("reset", r2.onReset), r2.on("remove", r2.onRemove), r2; } return M(n2, e3), n2.prototype.onReset = function(t3, e4) { var n3 = this; ((null == e4 ? void 0 : e4.previousModels) || []).map(function(t4) { return n3.onRemove(t4); }); }, n2.prototype.onRemove = function(t3) { null == t3 || t3.onRemove(); }, n2.prototype.itemLoaded = function() { this.loadedItems++, this.loadedItems >= this.itemsToLoad && (this.trigger("loaded:all"), this.listenToLoadItems(false)); }, n2.prototype.listenToLoad = function() { this.loadedItems = 0, this.itemsToLoad = this.length, this.listenToLoadItems(true); }, n2.prototype.listenToLoadItems = function(t3) { var e4 = this; this.forEach(function(n3) { return n3[t3 ? "on" : "off"]("loaded", e4.itemLoaded); }); }, n2; }(S); var D = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const N = function(e3) { function n2(t3, n3) { void 0 === n3 && (n3 = {}); var o2 = e3.call(this, t3, n3) || this, r2 = n3.em, i2 = {}; o2.em = r2, t3.frames || (i2.component = t3.component, i2.styles = t3.styles, ["component", "styles"].map(function(t4) { return o2.unset(t4); })); var s2 = t3.frames || [i2], a2 = new L(r2.Canvas, s2); a2.page = o2, o2.set("frames", a2), !o2.getId() && o2.set("id", null == r2 ? void 0 : r2.get("PageManager")._createId()); var l2 = null == r2 ? void 0 : r2.get("UndoManager"); return null == l2 || l2.add(a2), o2; } return D(n2, e3), n2.prototype.defaults = function() { return { frames: [], _undo: true }; }, n2.prototype.onRemove = function() { this.getFrames().reset(); }, n2.prototype.getFrames = function() { return this.get("frames"); }, n2.prototype.getId = function() { return this.id; }, n2.prototype.getName = function() { return this.get("name"); }, n2.prototype.setName = function(t3) { return this.set({ name: t3 }); }, n2.prototype.getAllFrames = function() { return this.getFrames().models || []; }, n2.prototype.getMainFrame = function() { return this.getFrames().at(0); }, n2.prototype.getMainComponent = function() { var t3 = this.getMainFrame(); return null == t3 ? void 0 : t3.getComponent(); }, n2.prototype.toJSON = function(e4) { void 0 === e4 && (e4 = {}); var n3 = u.Hn.prototype.toJSON.call(this, e4), o2 = (0, t2.result)(this, "defaults"); return (0, t2.forEach)(n3, function(t3, e5) { 0 === e5.indexOf("_") && delete n3[e5]; }), (0, t2.forEach)(o2, function(t3, e5) { n3[e5] === t3 && delete n3[e5]; }), n3; }, n2; }(u.Hn); var I = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), F = function() { return F = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, F.apply(this, arguments); }; const V = function(t3) { function e3(e4, n2) { var o2 = t3.call(this, e4) || this; return o2.on("reset", o2.onReset), o2.on("remove", o2.onRemove), o2.model = function(t4, e5) { return void 0 === e5 && (e5 = {}), new N(t4, F(F({}, e5), { em: n2 })); }, o2; } return I(e3, t3), e3.prototype.onReset = function(t4, e4) { var n2, o2 = this; null === (n2 = null == e4 ? void 0 : e4.previousModels) || void 0 === n2 || n2.map(function(t5) { return o2.onRemove(t5); }); }, e3.prototype.onRemove = function(t4) { null == t4 || t4.onRemove(); }, e3; }(u.FE); var R = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), H = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, z = "page", B = "".concat(z, ":"), U = "".concat(B, "select"), W = "".concat(U, ":before"), $ = "".concat(B, "update"), q = "".concat(B, "add"), G = "".concat(q, ":before"), K = "".concat(B, "remove"), Y = "".concat(K, ":before"), X = "change:selected", J = "main", Z = { all: z, select: U, selectBefore: W, update: $, add: q, addBefore: G, remove: K, removeBefore: Y }, Q = function(n2) { function o2(e3) { var o3 = n2.call(this, e3, "PageManager", new V([], e3), Z) || this; o3.storageKey = "pages", (0, t2.bindAll)(o3, "_onPageChange"); var r2 = new x({ _undo: true }); return o3.model = r2, o3.pages.on("reset", function(t3) { return t3.at(0) && o3.select(t3.at(0)); }), o3.pages.on("all", o3.__onChange, o3), r2.on(X, o3._onPageChange), o3; } return R(o2, n2), Object.defineProperty(o2.prototype, "pages", { get: function() { return this.all; }, enumerable: false, configurable: true }), o2.prototype.getAll = function() { return H([], this.all.models, true); }, o2.prototype.__onChange = function(t3, e3, n3, o3) { var r2 = o3 || n3; this.em.trigger(z, { event: t3, page: e3, options: r2 }); }, o2.prototype.onLoad = function() { var t3, e3 = this, n3 = this.pages, o3 = { silent: true }; n3.add((null === (t3 = this.config.pages) || void 0 === t3 ? void 0 : t3.map(function(t4) { return new N(t4, { em: e3.em, config: e3.config }); })) || [], o3); var r2 = n3.length ? this.getMain() : this.add({ type: J }, o3); r2 && this.select(r2, o3); }, o2.prototype._onPageChange = function(t3, e3, n3) { var o3 = this.em, r2 = o3.Layers, i2 = e3.getMainComponent(); r2 && i2 && r2.setRoot(i2), o3.trigger(U, e3, t3.previous("selected")), this.__onChange(X, e3, n3); }, o2.prototype.postLoad = function() { var t3 = this, e3 = t3.em, n3 = t3.model, o3 = t3.pages, r2 = e3.UndoManager; r2.add(n3), r2.add(o3), o3.on("add remove reset change", function(t4, n4, o4) { return e3.changesUp(o4 || n4); }); }, o2.prototype.add = function(t3, e3) { var n3 = this; void 0 === e3 && (e3 = {}); var o3 = this.em; t3.id = t3.id || this._createId(); var r2 = function() { var o4 = n3.pages.add(new N(t3, { em: n3.em, config: n3.config }), e3); return e3.select && n3.select(o4), o4; }; return !e3.silent && o3.trigger(G, t3, r2, e3), !e3.abort && r2(); }, o2.prototype.remove = function(e3, n3) { var o3 = this; void 0 === n3 && (n3 = {}); var r2 = this.em, i2 = (0, t2.isString)(e3) ? this.get(e3) : e3, s2 = function() { return i2 && o3.pages.remove(i2, n3), i2; }; return !n3.silent && r2.trigger(Y, i2, s2, n3), !n3.abort && s2(); }, o2.prototype.get = function(t3) { return this.pages.filter(function(e3) { return e3.get(e3.idAttribute) === t3; })[0]; }, o2.prototype.getMain = function() { var t3 = this.pages; return t3.filter(function(t4) { return t4.get("type") === J; })[0] || t3.at(0); }, o2.prototype.getAllWrappers = function() { var e3 = this.getAll(); return (0, t2.unique)((0, t2.flatten)(e3.map(function(t3) { return t3.getAllFrames().map(function(t4) { return t4.getComponent(); }); }))); }, o2.prototype.select = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = (0, t2.isString)(e3) ? this.get(e3) : e3; return o3 && (this.em.trigger(W, o3, n3), this.model.set("selected", o3, n3)), this; }, o2.prototype.getSelected = function() { return this.model.get("selected"); }, o2.prototype.destroy = function() { var t3 = this; this.pages.off().reset(), this.model.stopListening(), this.model.clear({ silent: true }), ["selected", "model"].map(function(e3) { return t3[e3] = 0; }); }, o2.prototype.store = function() { return this.getProjectData(); }, o2.prototype.load = function(t3) { return this.loadProjectData(t3, { all: this.pages, reset: true }); }, o2.prototype._createId = function() { var t3, n3 = this.getAll().length + 16, o3 = this.getAllMap(); do { t3 = (0, e2.createId)(n3); } while (o3[t3]); return t3; }, o2; }(b); const tt = Q; const et = { 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 nt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const ot = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return nt(e3, t3), e3.prototype.defaults = function() { return { name: "", width: null, height: "", widthMedia: null, priority: null }; }, e3.prototype.initialize = function() { var t4 = this; null === this.get("widthMedia") && this.set("widthMedia", this.get("width")), null === this.get("width") && this.set("width", this.get("widthMedia")), !this.get("priority") && this.set("priority", parseFloat(this.get("widthMedia")) || 0); ["width", "height", "widthMedia"].forEach(function(e4) { return t4.checkUnit(e4); }); }, e3.prototype.checkUnit = function(t4) { var e4 = this.get(t4) || ""; (parseFloat(e4) || 0).toString() === e4.toString() && this.set(t4, "".concat(e4, "px")); }, e3.prototype.getName = function() { return this.get("name") || this.get("id"); }, e3.prototype.getWidthMedia = function() { return this.get("widthMedia") || ""; }, e3; }(u.Hn); var rt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), it = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return rt(e3, t3), e3; }(u.FE); const st = it; it.prototype.model = ot; var at = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), lt = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }; const ct = function(t3) { function e3(e4) { var n2 = t3.call(this, e4) || this; return n2.config = e4.config || {}, n2.em = n2.config.em, n2.ppfx = n2.config.pStylePrefix || "", n2.listenTo(n2.em, "change:device", n2.updateSelect), n2; } return at(e3, t3), e3.prototype.template = function(t4) { var e4 = t4.ppfx, n2 = t4.label; return r(ut || (ut = lt(['\n
', '
\n
\n \n \n \n
\n
\n
\n
\n \n '], ['\n
', '
\n
\n \n \n \n
\n
\n
\n
\n \n '])), e4, n2, e4, e4, e4, e4, e4, e4, e4); }, e3.prototype.events = function() { return { change: "updateDevice", "click [data-add-trasp]": "startAdd" }; }, e3.prototype.startAdd = function() { }, e3.prototype.updateDevice = function() { var t4 = this.em; if (t4) { var e4 = this.devicesEl; t4.set("device", e4 ? e4.val() : ""); } }, e3.prototype.updateSelect = function() { var t4 = this.em, e4 = this.devicesEl; if (t4 && t4.getDeviceModel && e4) { var n2 = t4.getDeviceModel(); e4.val(n2 ? n2.get("id") : ""); } }, e3.prototype.getOptions = function() { var t4 = this.collection, e4 = this.em, n2 = ""; return t4.forEach(function(t5) { var o2 = t5.attributes, r2 = o2.name, i2 = o2.id, s2 = e4 && e4.t && e4.t("deviceManager.devices.".concat(i2)) || r2; n2 += '"); }), n2; }, e3.prototype.render = function() { var t4 = this, e4 = t4.em, n2 = t4.ppfx, o2 = t4.$el, r2 = t4.el, i2 = e4 && e4.t && e4.t("deviceManager.device"); return o2.html(this.template({ ppfx: n2, label: i2 })), this.devicesEl = o2.find(".".concat(n2, "devices")), this.devicesEl.append(this.getOptions()), this.devicesEl.val(e4.get("device")), r2.className = "".concat(n2, "devices-c"), this; }, e3; }(u.G7); var ut, pt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), dt = function() { return dt = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, dt.apply(this, arguments); }, ft = "device", ht = "".concat(ft, ":"), gt = "".concat(ht, "select"), vt = "".concat(ht, "update"), yt = "".concat(ht, "add"), mt = "".concat(ht, "remove"), bt = "".concat(mt, ":before"), _t = "change:device", wt = { all: ft, select: gt, update: vt, add: yt, remove: mt, removeBefore: bt }, xt = function(e3) { function n2(t3) { var n3, o2 = this; return (o2 = e3.call(this, t3, "DeviceManager", new st(), wt, et) || this).Device = ot, o2.Devices = st, o2.storageKey = "", o2.devices = o2.all, null === (n3 = o2.config.devices) || void 0 === n3 || n3.forEach(function(t4) { return o2.add(t4, { silent: true }); }), o2.select(o2.config.default || o2.devices.at(0)), t3.on(_t, o2._onSelect, o2), o2; } return pt(n2, e3), n2.prototype._onSelect = function(t3, e4, n3) { var o2 = this.em, r2 = this.events, i2 = t3.previous("device"), s2 = this.get(e4), a2 = r2.select; o2.trigger(a2, s2, this.get(i2)), this.__catchAllEvent(a2, s2, n3); }, n2.prototype.add = function(e4, n3) { var o2; void 0 === n3 && (n3 = {}); var r2 = n3; if ((0, t2.isString)(e4)) { var i2 = n3; o2 = dt(dt({}, r2 = arguments[2] || {}), { id: e4, name: r2.name || e4, width: i2 }); } else o2 = e4; return o2.id || (o2.id = o2.name || this._createId()), this.devices.add(o2, r2); }, n2.prototype.get = function(t3) { return this.getAll().filter(function(e4) { return e4.get("name") === t3; })[0] || this.devices.get(t3) || null; }, n2.prototype.remove = function(t3, e4) { return void 0 === e4 && (e4 = {}), this.__remove(t3, e4); }, n2.prototype.getDevices = function() { return this.devices.models; }, n2.prototype.select = function(e4, n3) { void 0 === n3 && (n3 = {}); var o2 = (0, t2.isString)(e4) ? this.get(e4) : e4; return o2 && this.em.set("device", o2.get("id"), n3), this; }, n2.prototype.getSelected = function() { return this.get(this.em.get("device")); }, n2.prototype.getAll = function() { return this.devices; }, n2.prototype.render = function() { var t3, e4 = this.em; return null === (t3 = this.view) || void 0 === t3 || t3.remove(), this.view = new ct({ collection: this.devices, config: dt({ em: e4 }, this.config) }), this.view.render().el; }, n2.prototype.destroy = function() { this.__destroy(); }, n2; }(b); const Ct = xt; var St = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ot = function(t3) { function e3(e4) { var n2 = this, o2 = e4.em, r2 = e4.config, i2 = r2.scripts, s2 = r2.styles; return (n2 = t3.call(this, e4, { scripts: i2, styles: s2 }) || this).set("frames", new L(e4)), n2.listenTo(n2, "change:zoom", n2.onZoomChange), n2.listenTo(o2, "change:device ".concat(vt), n2.updateDevice), n2.listenTo(o2, U, n2._pageUpdated), n2; } return St(e3, t3), e3.prototype.defaults = function() { return { frame: "", frames: [], rulers: false, zoom: 100, x: 0, y: 0, scripts: [], styles: [] }; }, Object.defineProperty(e3.prototype, "frames", { get: function() { return this.get("frames"); }, enumerable: false, configurable: true }), e3.prototype.init = function() { var t4 = this.em.Pages.getMain(); this.set("frames", t4.getFrames()), this.updateDevice({ frame: t4.getMainFrame() }); }, e3.prototype._pageUpdated = function(t4, e4) { var n2 = this.em; n2.setSelected(), n2.get("readyCanvas") && n2.stopDefault(), null == e4 || e4.getFrames().map(function(t5) { return t5.disable(); }), this.set("frames", t4.getFrames()), this.updateDevice({ frame: t4.getMainFrame() }); }, e3.prototype.updateDevice = function(t4) { void 0 === t4 && (t4 = {}); var e4 = this.em, n2 = e4.getDeviceModel(), o2 = t4.frame || e4.getCurrentFrameModel(); if (o2 && n2) { var r2 = n2.attributes, i2 = r2.width, s2 = r2.height; o2.set({ width: i2, height: s2 }, { noUndo: 1 }); } }, e3.prototype.onZoomChange = function() { this.get("zoom") < 1 && this.set("zoom", 1); }, e3; }(x); const Tt = Ot; var kt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Pt = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return kt(e3, t3), Object.defineProperty(e3.prototype, "pfx", { get: function() { return this.ppfx + this.config.stylePrefix || ""; }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "ppfx", { get: function() { return this.em.config.stylePrefix || ""; }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "module", { get: function() { var t4, e4; return null !== (e4 = null === (t4 = this.model) || void 0 === t4 ? void 0 : t4.module) && void 0 !== e4 ? e4 : this.collection.module; }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "em", { get: function() { return this.module.em; }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "config", { get: function() { return this.module.config; }, enumerable: false, configurable: true }), e3.prototype.preinitialize = function(t4) { this.className = ""; }, e3; }(u.G7); var Et = n(491), At = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const jt = function(t3) { function e3(e4, n2) { void 0 === e4 && (e4 = {}), void 0 === n2 && (n2 = false); var o2 = t3.call(this, e4) || this; return o2.itemsView = "", o2.itemType = "type", o2.reuseView = false, o2.viewCollection = [], n2 && o2.listenTo(o2.collection, "add", o2.addTo), o2; } return At(e3, t3), e3.prototype.addTo = function(t4) { this.add(t4); }, e3.prototype.itemViewNotFound = function(t4) { }, e3.prototype.add = function(t4, e4) { var n2, o2 = this, r2 = o2.reuseView, i2 = o2.viewCollection, s2 = (o2.itemsView, e4 || null), a2 = t4.get(this.itemType); n2 = t4.view && r2 ? t4.view : this.renderView(t4, a2), i2.push(n2); var l2 = n2.render().el; s2 ? s2.appendChild(l2) : this.$el.append(l2); }, e3.prototype.render = function() { var t4 = this, e4 = document.createDocumentFragment(); return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each(function(n2) { return t4.add(n2, e4); }), this.$el.append(e4), this.onRender(), this; }, e3.prototype.onRender = function() { }, e3.prototype.onRemoveBefore = function(t4, e4) { }, e3.prototype.onRemove = function(t4, e4) { }, e3.prototype.remove = function(t4) { void 0 === t4 && (t4 = {}); var e4 = this.viewCollection; return this.onRemoveBefore(e4, t4), this.clearItems(), u.G7.prototype.remove.apply(this, t4), this.onRemove(e4, t4), this; }, e3.prototype.clearItems = function() { this.viewCollection; }, e3; }(Pt); var Mt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Lt = function(t3) { function e3(e4) { void 0 === e4 && (e4 = {}); var n2 = t3.call(this, e4) || this; n2.config = e4.config || {}; var o2 = n2.model; return n2.listenTo(o2, "change", n2.render), n2.listenTo(o2, "destroy remove", n2.remove), n2.listenTo(o2.get("selectors"), "change", n2.render), n2; } return Mt(e3, t3), e3.prototype.tagName = function() { return "style"; }, e3.prototype.render = function() { var t4 = this.model, e4 = this.el, n2 = t4.get("important"); return e4.innerHTML = t4.toCSS({ important: n2 }), this; }, e3; }(u.G7); var Dt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Nt = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Dt(e3, t3), e3.prototype._createElement = function() { return document.createTextNode(""); }, e3.prototype.render = function() { var t4 = this.model, e4 = t4.get("important"); return this.el.textContent = t4.getDeclaration({ important: e4 }), this; }, e3; }(Lt); var It = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ft = function(t3, e3) { return "".concat(t3).concat(e3 ? "-".concat(parseFloat(e3)) : ""); }, Vt = function(e3) { function n2(n3) { var o2 = e3.call(this, n3) || this; (0, t2.bindAll)(o2, "sortRules"); var r2 = n3.config || {}; o2.atRules = {}, o2.config = r2, o2.em = r2.em, o2.pfx = r2.stylePrefix || "", o2.className = o2.pfx + "rules"; var i2 = o2.collection; return o2.listenTo(i2, "add", o2.addTo), o2.listenTo(i2, "reset", o2.render), o2; } return It(n2, e3), n2.prototype.addTo = function(t3) { this.addToCollection(t3); }, n2.prototype.addToCollection = function(t3, e4) { if (this.renderStarted) { var n3, o2, r2 = e4 || null, i2 = { model: t3, config: this.config }; if ("keyframes" === t3.get("atRuleType")) { var s2 = t3.getAtRule(), a2 = this.atRules[s2]; if (!a2) { var l2 = document.createElement("style"); a2 = document.createTextNode(""), l2.appendChild(document.createTextNode("".concat(s2, "{"))), l2.appendChild(a2), l2.appendChild(document.createTextNode("}")), this.atRules[s2] = a2, n3 = l2; } o2 = new Nt(i2), a2.appendData(o2.render().el.textContent); } else n3 = (o2 = new Lt(i2)).render().el; var c2 = this.className, u2 = t3.get("mediaText"), p2 = Ft(c2), d2 = p2; if (u2 && (d2 = Ft(c2, this.getMediaWidth(u2))), n3) { var f2 = r2 || this.el, h2 = void 0; try { h2 = f2.querySelector("#".concat(d2)); } catch (t4) { } h2 || (h2 = f2.querySelector("#".concat(p2))), null == h2 || h2.appendChild(n3); } return n3; } }, n2.prototype.getMediaWidth = function(t3) { return t3 && t3.replace("(".concat(this.em.getConfig().mediaCondition, ": "), "").replace(")", ""); }, n2.prototype.sortRules = function(t3, e4) { var n3 = -1 !== (this.em.getConfig().mediaCondition || "").indexOf("min-width"); return n3 ? (n3 ? t3 : e4) - (n3 ? e4 : t3) : 0; }, n2.prototype.render = function() { var t3 = this; this.renderStarted = true, this.atRules = {}; var e4 = this, n3 = e4.em, o2 = e4.$el, r2 = e4.collection, i2 = this.className, s2 = document.createDocumentFragment(); o2.empty(); var a2 = n3.Devices.getAll().pluck("priority").sort(this.sortRules); return a2.every(function(t4) { return t4; }) && a2.unshift(0), a2.forEach(function(t4) { return s2.appendChild((0, Et.ut)("div", { id: Ft(i2, t4) })); }), r2.each(function(e5) { return t3.addToCollection(e5, s2); }), o2.append(s2), o2.attr("class", i2), this; }, n2; }(u.G7); const Rt = Vt; var Ht = function() { return Ht = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ht.apply(this, arguments); }, zt = function() { function n2(e3, n3) { var o2 = this; this.em = e3, this.canvas = e3.Canvas; var r2 = n3 || this.canvas.getFrames().map(function(t3) { return t3.getComponent().getEl(); }), i2 = Array.isArray(r2) ? r2 : [r2]; this.el = i2[0], this.counter = 0, (0, t2.bindAll)(this, "handleDragEnter", "handleDragOver", "handleDrop", "handleDragLeave"), i2.forEach(function(t3) { return o2.toggleEffects(t3, true); }); } return n2.prototype.toggleEffects = function(t3, n3) { var o2 = { on: e2.on, off: e2.off }, r2 = n3 ? "on" : "off"; o2[r2](t3, "dragenter", this.handleDragEnter), o2[r2](t3, "dragover", this.handleDragOver), o2[r2](t3, "drop", this.handleDrop), o2[r2](t3, "dragleave", this.handleDragLeave); }, n2.prototype.__customTglEff = function(t3) { var n3, o2 = t3 ? e2.on : e2.off, r2 = this.el.ownerDocument, i2 = null === (n3 = r2.defaultView) || void 0 === n3 ? void 0 : n3.frameElement; this.sortOpts = t3 ? { onStart: function(t4) { var n4 = t4.sorter; (0, e2.on)(i2, "pointermove", n4.onMove); }, onEnd: function(t4) { var n4 = t4.sorter; (0, e2.off)(i2, "pointermove", n4.onMove); }, customTarget: function(t4) { var e3 = t4.event; return r2.elementFromPoint(e3.clientX, e3.clientY); } } : null, o2(i2, "pointerenter", this.handleDragEnter), o2(i2, "pointermove", this.handleDragOver), o2(document, "pointerup", this.handleDrop), o2(i2, "pointerout", this.handleDragLeave); }, n2.prototype.startCustom = function() { this.__customTglEff(true); }, n2.prototype.endCustom = function(t3) { this.over ? this.endDrop(t3) : this.__customTglEff(false); }, n2.prototype.endDrop = function(t3, e3) { var n3 = this.em, o2 = this.dragStop; this.counter = 0, o2 && o2(t3), this.__customTglEff(false), n3.trigger("canvas:dragend", e3); }, n2.prototype.handleDragLeave = function(t3) { this.updateCounter(-1, t3); }, n2.prototype.updateCounter = function(t3, e3) { this.counter += t3, 0 === this.counter && this.endDrop(true, e3); }, n2.prototype.handleDragEnter = function(t3) { var e3 = this, n3 = this.em, o2 = this.canvas, r2 = t3.dataTransfer; if (this.updateCounter(1, t3), !this.over) { this.over = true; var i2, s2, a2 = n3.Utils, l2 = n3.get("dragContent") || "
"; if (n3.stopDefault(), n3.inAbsoluteMode()) { var c2 = n3.Components.getWrapper(), u2 = c2.append({})[0], p2 = n3.Commands.run("core:component-drag", { event: t3, guidesInfo: 1, center: 1, target: u2, onEnd: function(t4, n4, i3) { var s3; if (!i3.cancelled) { s3 = c2.append(l2)[0]; var a3 = o2.getOffset(), p3 = u2.getStyle(), d3 = p3.top, f2 = p3.left, h2 = p3.position, g2 = (0, Et.GX)(t4.target), v2 = parseInt("".concat(parseFloat(f2) + g2.x - a3.left), 10), y2 = parseInt("".concat(parseFloat(d3) + g2.y - a3.top), 10); s3.addStyle({ left: v2 + "px", top: y2 + "px", position: h2 }); } e3.handleDragEnd(s3, r2), u2.remove(); } }); i2 = function(e4) { return p2.stop(t3, { cancel: e4 }); }, s2 = function(t4) { return l2 = t4; }; } else { var d2 = new a2.Sorter(Ht({ em: n3, wmargin: 1, nested: 1, canvasRelative: 1, direction: "a", container: this.el, placer: o2.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: "gjs-", onEndMove: function(t4) { return e3.handleDragEnd(t4, r2); }, document: this.el.ownerDocument }, this.sortOpts || {})); d2.setDropContent(l2), d2.startSort(), this.sorter = d2, i2 = function(t4) { t4 && (d2.moved = false), d2.endMove(); }, s2 = function(t4) { return d2.setDropContent(t4); }; } this.dragStop = i2, this.dragContent = s2, n3.trigger("canvas:dragenter", r2, l2); } }, n2.prototype.handleDragEnd = function(t3, e3) { var n3 = this.em; this.over = false, t3 && (n3.set("dragResult", t3), n3.trigger("canvas:drop", e3, t3)), n3.runDefault({ preserveSelected: 1 }); }, n2.prototype.handleDragOver = function(t3) { t3.preventDefault(), this.em.trigger("canvas:dragover", t3); }, n2.prototype.handleDrop = function(t3) { t3.preventDefault(); var e3 = this.dragContent, n3 = t3.dataTransfer, o2 = this.getContentByData(n3).content; t3.target.style.border = "", o2 && e3 && e3(o2), this.endDrop(!o2, t3); }, n2.prototype.getContentByData = function(e3) { var n3 = this.em, o2 = e3 && e3.types, r2 = e3 && e3.files || [], i2 = n3.get("dragContent"), s2 = e3 && e3.getData("text"); if (r2.length) { s2 = []; for (var a2 = 0; a2 < r2.length; a2++) { var l2 = r2[a2], c2 = l2.type.split("/")[0]; "image" == c2 && s2.push({ type: c2, file: l2, attributes: { alt: l2.name } }); } } else if (i2) s2 = i2; else if ((0, t2.indexOf)(o2, "text/html") >= 0) s2 = e3 && e3.getData("text/html").replace(/<\/?meta[^>]*>/g, ""); else if ((0, t2.indexOf)(o2, "text/uri-list") >= 0) s2 = { type: "link", attributes: { href: s2 }, content: s2 }; else if ((0, t2.indexOf)(o2, "text/json") >= 0) { var u2 = e3 && e3.getData("text/json"); u2 && (s2 = JSON.parse(u2)); } else 1 === o2.length && "text/plain" === o2[0] && (s2 = "
".concat(s2, "
")); var p2 = { content: s2 }; return n3.trigger("canvas:dragdata", e3, p2), p2; }, n2; }(); const Bt = zt; var Ut = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Wt = function() { return Wt = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Wt.apply(this, arguments); }, $t = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, qt = function(n2) { function o2(o3, r2) { var i2 = n2.call(this, { model: o3 }) || this; i2.dragging = false, i2.lastMaxHeight = 0, i2.tools = {}, (0, t2.bindAll)(i2, "updateClientY", "stopAutoscroll", "autoscroll", "_emitUpdate"); var s2 = i2, a2 = s2.el; s2.em; i2.module._config = Wt(Wt({}, i2.config || {}), { frameView: i2 }), i2.frameWrapView = r2, i2.showGlobalTools = (0, t2.debounce)(i2.showGlobalTools.bind(i2), 50); var l2 = i2.getCanvasModel(); return i2.listenTo(o3, "change:head", i2.updateHead), i2.listenTo(l2, "change:styles", i2.renderStyles), o3.view = i2, (0, e2.setViewEl)(a2, i2), i2; } return Ut(o2, n2), Object.defineProperty(o2.prototype, "tagName", { get: function() { return "iframe"; }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "attributes", { get: function() { return { allowfullscreen: "allowfullscreen" }; }, enumerable: false, configurable: true }), o2.prototype.updateHead = function() { var t3 = this.model, e3 = this.getHead(), n3 = [], o3 = [], r2 = t3.head, i2 = t3.previous("head"), s2 = function(t4) { return void 0 === t4 && (t4 = {}), Object.keys(t4).sort().map(function(e4) { return "[".concat(e4, '="').concat(t4[e4], '"]'); }).join(""); }, a2 = function(t4, e4, n4) { t4.forEach(function(t5) { var o4 = t5.tag, r3 = t5.attributes; !e4.some(function(t6) { return t6.tag === o4 && s2(t6.attributes) === s2(r3); }) && n4.push(t5); }); }; a2(r2, i2, o3), a2(i2, r2, n3), n3.forEach(function(t4) { var n4, o4 = e3.querySelector("".concat(t4.tag).concat(s2(t4.attributes))); null === (n4 = null == o4 ? void 0 : o4.parentNode) || void 0 === n4 || n4.removeChild(o4); }), (0, Et.SJ)(e3, o3); }, o2.prototype.getEl = function() { return this.el; }, o2.prototype.getCanvasModel = function() { return this.em.Canvas.getModel(); }, o2.prototype.getWindow = function() { return this.getEl().contentWindow; }, o2.prototype.getDoc = function() { return this.getEl().contentDocument; }, o2.prototype.getHead = function() { return this.getDoc().querySelector("head"); }, o2.prototype.getBody = function() { return this.getDoc().querySelector("body"); }, o2.prototype.getWrapper = function() { return this.getBody().querySelector("[data-gjs-type=wrapper]"); }, o2.prototype.getJsContainer = function() { return this.jsContainer || (this.jsContainer = (0, Et.ut)("div", { class: "".concat(this.ppfx, "js-cont") })), this.jsContainer; }, o2.prototype.getToolsEl = function() { var t3; return null === (t3 = this.frameWrapView) || void 0 === t3 ? void 0 : t3.elTools; }, o2.prototype.getGlobalToolsEl = function() { return this.em.Canvas.getGlobalToolsEl(); }, o2.prototype.getHighlighter = function() { return this._getTool("[data-hl]"); }, o2.prototype.getBadgeEl = function() { return this._getTool("[data-badge]"); }, o2.prototype.getOffsetViewerEl = function() { return this._getTool("[data-offset]"); }, o2.prototype.getRect = function() { return this.rect || (this.rect = this.el.getBoundingClientRect()), this.rect; }, o2.prototype.getOffsetRect = function() { var t3 = this.el, e3 = this.getBody(), n3 = e3.scrollTop, o3 = e3.scrollLeft, r2 = t3.offsetHeight, i2 = t3.offsetWidth; return { top: t3.offsetTop, left: t3.offsetLeft, height: r2, width: i2, scrollTop: n3, scrollLeft: o3, scrollBottom: n3 + r2, scrollRight: o3 + i2 }; }, o2.prototype._getTool = function(t3) { var e3 = this.tools, n3 = this.getToolsEl(); return e3[t3] || (e3[t3] = n3.querySelector(t3)), e3[t3]; }, o2.prototype.remove = function() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; var n3 = this.wrapper; return this._toggleEffects(false), this.tools = {}, n3 && n3.remove(), Pt.prototype.remove.apply(this, t3), this; }, o2.prototype.startAutoscroll = function() { var t3 = this; this.lastMaxHeight = this.getWrapper().offsetHeight - this.el.offsetHeight, setTimeout(function() { t3._toggleAutoscrollFx(true), requestAnimationFrame(t3.autoscroll); }, 0); }, o2.prototype.autoscroll = function() { if (this.dragging) { var e3 = this.lastClientY, n3 = this.em.Canvas, o3 = this.getWindow(), r2 = o3.pageYOffset, i2 = e3 || 0, s2 = n3.getConfig().autoscrollLimit, a2 = this.getRect().height - s2, l2 = r2; if (i2 < s2 && (l2 -= s2 - i2), i2 > a2 && (l2 += i2 - a2), !(0, t2.isUndefined)(e3) && l2 !== r2 && l2 > 0 && l2 < this.lastMaxHeight) this.getGlobalToolsEl().style.opacity = "0", this.showGlobalTools(), o3.scrollTo(0, l2); requestAnimationFrame(this.autoscroll); } }, o2.prototype.updateClientY = function(t3) { t3.preventDefault(), this.lastClientY = (0, e2.getPointerEvent)(t3).clientY * this.em.getZoomDecimal(); }, o2.prototype.showGlobalTools = function() { this.getGlobalToolsEl().style.opacity = ""; }, o2.prototype.stopAutoscroll = function() { this.dragging && this._toggleAutoscrollFx(false); }, o2.prototype._toggleAutoscrollFx = function(t3) { this.dragging = t3; var n3 = this.getWindow(), o3 = t3 ? "on" : "off", r2 = { on: e2.on, off: e2.off }; r2[o3](n3, "mousemove dragover", this.updateClientY), r2[o3](n3, "mouseup", this.stopAutoscroll); }, o2.prototype.render = function() { var t3 = this.$el, e3 = this.ppfx; return t3.attr({ class: "".concat(e3, "frame") }), this.renderScripts(), this; }, o2.prototype.renderScripts = function() { var e3 = this, n3 = this, o3 = n3.el, r2 = n3.model, i2 = n3.em, s2 = "frame:load", a2 = { el: o3, model: r2, view: this }, l2 = this.getCanvasModel(), c2 = function(n4) { var r3; if (n4.length > 0) { var l3 = n4.shift(), u2 = (0, Et.ut)("script", Wt({ type: "text/javascript" }, (0, t2.isString)(l3) ? { src: l3 } : l3)); u2.onerror = u2.onload = c2.bind(null, n4), null === (r3 = o3.contentDocument) || void 0 === r3 || r3.head.appendChild(u2); } else e3.renderBody(), i2 && i2.trigger(s2, a2); }; o3.onload = function() { var t3 = e3.config.frameContent; if (t3) { var n4 = e3.getDoc(); n4.open(), n4.write(t3), n4.close(); } i2 && i2.trigger("".concat(s2, ":before"), a2), c2($t([], l2.get("scripts"), true)); }; }, o2.prototype.renderStyles = function(e3) { void 0 === e3 && (e3 = {}); var n3 = this.getHead(), o3 = this.getCanvasModel(), r2 = function(e4) { return e4.map(function(e5) { return { tag: "link", attributes: Wt({ rel: "stylesheet" }, (0, t2.isString)(e5) ? { href: e5 } : e5) }; }); }, i2 = r2(e3.prev || o3.previous("styles")), s2 = r2(o3.get("styles")), a2 = [], l2 = [], c2 = function(t3, e4, n4) { t3.forEach(function(t4) { var o4 = t4.attributes.href; !e4.some(function(t5) { return t5.attributes.href === o4; }) && n4.push(t4); }); }; c2(s2, i2, l2), c2(i2, s2, a2), a2.forEach(function(t3) { var e4, o4 = n3.querySelector('link[href="'.concat(t3.attributes.href, '"]')); null === (e4 = null == o4 ? void 0 : o4.parentNode) || void 0 === e4 || e4.removeChild(o4); }), (0, Et.SJ)(n3, l2); }, o2.prototype.renderBody = function() { var t3, n3, o3 = this, r2 = this, i2 = r2.config, s2 = r2.em, a2 = r2.model, l2 = r2.ppfx, c2 = this.getDoc(), u2 = this.getBody(), p2 = this.getWindow(), d2 = s2.config; p2._isEditor = true, this.renderStyles({ prev: [] }); (0, Et.R3)(u2, "")); var f2 = a2.getComponent(), h2 = s2.Components.getType("wrapper").view; this.wrapper = new h2({ model: f2, config: Wt(Wt({}, f2.config), { em: s2, frameView: this }) }).render(), (0, Et.R3)(u2, null === (t3 = this.wrapper) || void 0 === t3 ? void 0 : t3.el), (0, Et.R3)(u2, new Rt({ collection: a2.getStyles(), config: Wt(Wt({}, s2.Css.getConfig()), { frameView: this }) }).render().el), (0, Et.R3)(u2, this.getJsContainer()), (0, e2.on)(u2, "click", function(t4) { var e3; return t4 && "A" == (null === (e3 = t4.target) || void 0 === e3 ? void 0 : e3.tagName) && t4.preventDefault(); }), (0, e2.on)(u2, "submit", function(t4) { return t4 && t4.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(t4) { return t4.event.split(" ").forEach(function(e3) { c2.addEventListener(e3, function(e4) { return o3.el.dispatchEvent((0, Et.t3)(e4, t4.class)); }); }); }), this._toggleEffects(true), (0, e2.hasDnd)(s2) && (this.droppable = new Bt(s2, null === (n3 = this.wrapper) || void 0 === n3 ? void 0 : n3.el)), a2.trigger("loaded"); }, o2.prototype._toggleEffects = function(t3) { var n3 = t3 ? e2.on : e2.off, o3 = this.getWindow(); o3 && n3(o3, "".concat(Et.G1, " resize"), this._emitUpdate); }, o2.prototype._emitUpdate = function() { this.model._emitUpdated(); }, o2; }(Pt); const Gt = qt; var Kt = n(668), Yt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Xt = function() { return Xt = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Xt.apply(this, arguments); }; const Jt = function(e3) { function n2(n3, o2) { var r2 = e3.call(this, { model: n3 }) || this; (0, t2.bindAll)(r2, "onScroll", "frameLoaded", "updateOffset", "remove", "startDrag"); Xt(Xt({}, n3.config), { frameWrapView: r2 }); return r2.cv = o2, r2.frame = new Gt(n3, r2), r2.classAnim = "".concat(r2.ppfx, "frame-wrapper--anim"), r2.updateOffset = (0, t2.debounce)(r2.updateOffset.bind(r2), 0), r2.updateSize = (0, t2.debounce)(r2.updateSize.bind(r2), 0), r2.listenTo(n3, "loaded", r2.frameLoaded), r2.listenTo(n3, "change:x change:y", r2.updatePos), r2.listenTo(n3, "change:width change:height", r2.updateSize), r2.listenTo(n3, "destroy remove", r2.remove), r2.updatePos(), r2.setupDragger(), r2; } return Yt(n2, e3), n2.prototype.events = function() { return { "click [data-action-remove]": "remove", "mousedown [data-action-move]": "startDrag" }; }, n2.prototype.setupDragger = function() { var t3, e4, n3, o2 = this, r2 = this.module, i2 = this.model, s2 = function(t4) { r2.toggleFramesEvents(t4); }; this.dragger = new Kt.Z({ onStart: function() { var r3 = i2.attributes, a2 = r3.x, l2 = r3.y; n3 = o2.em.getZoomMultiplier(), t3 = a2, e4 = l2, s2(false); }, onEnd: function() { return s2(true); }, setPosition: function(o3) { i2.set({ x: t3 + o3.x * n3, y: e4 + o3.y * n3 }); } }); }, n2.prototype.startDrag = function(t3) { var e4; t3 && (null === (e4 = this.dragger) || void 0 === e4 || e4.start(t3)); }, n2.prototype.__clear = function(t3) { var e4 = this.frame; e4 && e4.remove(t3), (0, Et.L_)(this.elTools); }, n2.prototype.remove = function(t3) { var e4 = this; return this.__clear(t3), Pt.prototype.remove.apply(this, t3), ["frame", "dragger", "cv", "elTools"].forEach(function(t4) { return e4[t4] = 0; }), this; }, n2.prototype.updateOffset = function() { var t3, e4 = this, n3 = e4.em, o2 = e4.$el, r2 = e4.frame; n3 && !n3.destroyed && (n3.runDefault({ preserveSelected: 1 }), o2.removeClass(this.classAnim), null === (t3 = null == r2 ? void 0 : r2.model) || void 0 === t3 || t3._emitUpdated()); }, n2.prototype.updatePos = function(t3) { var e4 = this.model, n3 = this.el, o2 = e4.attributes, r2 = o2.x, i2 = o2.y, s2 = n3.style; this.frame.rect = void 0, s2.left = isNaN(r2) ? r2 : "".concat(r2, "px"), s2.top = isNaN(i2) ? i2 : "".concat(i2, "px"), t3 && this.updateOffset(); }, n2.prototype.updateSize = function() { this.updateDim(); }, n2.prototype.updateDim = function() { var e4 = this, n3 = e4.em, o2 = e4.el, r2 = e4.$el, i2 = e4.model, s2 = e4.classAnim, a2 = e4.frame; if (a2) { a2.rect = void 0, r2.addClass(s2); var l2 = this.__handleSize(), c2 = l2.noChanges, u2 = l2.width, p2 = l2.height; ((0, t2.isNull)(u2) || (0, t2.isNull)(p2)) && i2.set(Xt(Xt({}, u2 ? {} : { width: o2.offsetWidth }), p2 ? {} : { height: o2.offsetHeight }), { silent: 1 }), n3.stopDefault({ preserveSelected: 1 }), c2 ? this.updateOffset() : setTimeout(this.updateOffset, 350); } }, n2.prototype.onScroll = function() { var t3 = this.frame; this.em.trigger("frame:scroll", { frame: t3, body: t3.getBody(), target: t3.getWindow() }); }, n2.prototype.frameLoaded = function() { this.frame.getWindow().onscroll = this.onScroll, this.updateDim(); }, n2.prototype.__handleSize = function() { var e4 = "px", n3 = this.model, o2 = this.el.style, r2 = n3.attributes, i2 = r2.width, s2 = r2.height, a2 = o2.width || "", l2 = o2.height || "", c2 = i2 || "", u2 = s2 || "", p2 = a2 == c2 && l2 == u2; return o2.width = (0, t2.isNumber)(c2) ? "".concat(c2).concat(e4) : c2, o2.height = (0, t2.isNumber)(u2) ? "".concat(u2).concat(e4) : u2, { noChanges: p2, width: i2, height: s2, newW: c2, newH: u2 }; }, n2.prototype.render = function() { var t3 = this, e4 = t3.frame, n3 = t3.$el, o2 = t3.ppfx, r2 = t3.cv, i2 = t3.model, s2 = t3.el, a2 = i2.attributes.onRender; this.__clear(), this.__handleSize(), e4.render(), n3.empty().attr({ class: "".concat(o2, "frame-wrapper") }).append('\n
\n
\n ').concat(i2.get("name") || "", '\n
\n
\n \n
\n
\n
\n
\n
\n ')).append(e4.el); var l2 = (0, Et.ut)("div", { class: "".concat(o2, "tools"), style: "pointer-events:none; display: none" }, '\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ')); this.elTools = l2; var c2 = null == r2 ? void 0 : r2.toolsWrapper; return c2 && c2.appendChild(l2), a2 && a2({ el: s2, elTop: s2.querySelector("[data-frame-top]"), elRight: s2.querySelector("[data-frame-right]"), elBottom: s2.querySelector("[data-frame-bottom]"), elLeft: s2.querySelector("[data-frame-left]"), frame: i2, frameWrapperView: this, remove: this.remove, startDrag: this.startDrag }), this; }, n2; }(Pt); var Zt = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Qt = function(t3) { function e3(e4, n2) { void 0 === e4 && (e4 = {}); var o2 = t3.call(this, e4, true) || this; return o2.listenTo(o2.collection, "reset", o2.render), o2.canvasView = n2.canvasView, o2._module = n2.module, o2; } return Zt(e3, t3), e3.prototype.onRemoveBefore = function(t4, e4) { void 0 === e4 && (e4 = {}), t4.forEach(function(t5) { return t5.remove(e4); }); }, e3.prototype.onRender = function() { var t4 = this.$el, e4 = this.ppfx; t4.attr({ class: "".concat(e4, "frames") }); }, e3.prototype.renderView = function(t4, e4) { return new Jt(t4, this.canvasView); }, e3; }(jt); const te = Qt; var ee = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ne = function() { return ne = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, ne.apply(this, arguments); }, oe = function(n2) { function o2(e3) { var o3 = n2.call(this, { model: e3 }) || this; o3.ready = false, (0, t2.bindAll)(o3, "clearOff", "onKeyPress", "onCanvasMove"), o3.className = o3.pfx + "canvas"; var r2 = o3.em; return o3._initFrames(), o3.listenTo(r2, "change:canvasOffset", o3.clearOff), o3.listenTo(r2, "component:selected", o3.checkSelected), o3.listenTo(e3, "change:zoom change:x change:y", o3.updateFrames), o3.listenTo(e3, "change:frames", o3._onFramesUpdate), o3.toggleListeners(true), o3; } return ee(o2, n2), o2.prototype.events = function() { return { wheel: "onWheel" }; }, o2.prototype.template = function() { var t3 = this.pfx; return '\n
\n
\n '); }, o2.prototype._onFramesUpdate = function() { this._initFrames(), this._renderFrames(); }, o2.prototype._initFrames = function() { var t3 = this, e3 = t3.frames, n3 = t3.model, o3 = t3.config, r2 = t3.em, i2 = n3.frames; r2.set("readyCanvas", 0), i2.once("loaded:all", function() { return r2.set("readyCanvas", 1); }), null == e3 || e3.remove(), this.frames = new te({ collection: i2 }, ne(ne({}, o3), { canvasView: this })); }, o2.prototype.checkSelected = function(t3, e3) { var n3; void 0 === e3 && (e3 = {}); var o3 = e3.scroll, r2 = this.em.get("currentFrame"); o3 && (null === (n3 = t3.views) || void 0 === n3 || n3.forEach(function(t4) { t4._getFrame() === r2 && t4.scrollIntoView(o3); })); }, o2.prototype.remove = function() { for (var t3, e3 = [], n3 = 0; n3 < arguments.length; n3++) e3[n3] = arguments[n3]; return null === (t3 = this.frames) || void 0 === t3 || t3.remove(), this.frames = void 0, Pt.prototype.remove.apply(this, e3), this.toggleListeners(false), this; }, o2.prototype.preventDefault = function(t3) { var e3; t3 && (t3.preventDefault(), null === (e3 = t3._parentEvent) || void 0 === e3 || e3.preventDefault()); }, o2.prototype.onCanvasMove = function(t3) { }, o2.prototype.toggleListeners = function(t3) { this.el; var n3 = t3 ? e2.on : e2.off; n3(document, "keypress", this.onKeyPress), n3(window, "scroll resize", this.clearOff); }, o2.prototype.onKeyPress = function(t3) { var n3 = this.em; " " !== (0, e2.getKeyChar)(t3) || 1 === n3.getZoomDecimal() || n3.Canvas.isInputFocused() || (this.preventDefault(t3), n3.Editor.runCommand("core:canvas-move")); }, o2.prototype.onWheel = function(t3) { if ((t3.ctrlKey || t3.metaKey) && this.em.getConfig().multiFrames) { this.preventDefault(t3); var e3 = this.model, n3 = Math.max(-1, Math.min(1, t3.wheelDelta || -t3.detail)), o3 = e3.get("zoom"); e3.set("zoom", o3 + 2 * n3); } }, o2.prototype.updateFrames = function(t3) { var e3 = this.em, n3 = this.model.attributes, o3 = n3.x, r2 = n3.y, i2 = this.getZoom(), s2 = { preserveSelected: 1 }, a2 = i2 ? 1 / i2 : 1; this.framesArea.style.transform = "scale(".concat(i2, ") translate(").concat(o3 * a2, "px, ").concat(r2 * a2, "px)"), this.clearOff(), e3.stopDefault(s2), e3.trigger("canvas:update", t3), this.timerZoom && clearTimeout(this.timerZoom), this.timerZoom = setTimeout(function() { return e3.runDefault(s2); }, 300); }, o2.prototype.getZoom = function() { return this.em.getZoomDecimal(); }, o2.prototype.isElInViewport = function(t3) { var n3 = (0, e2.getElement)(t3), o3 = (0, e2.getElRect)(n3), r2 = this.getFrameOffset(n3), i2 = o3.top, s2 = o3.left; return i2 >= 0 && s2 >= 0 && i2 <= r2.height && s2 <= r2.width; }, o2.prototype.offset = function(t3, n3) { void 0 === n3 && (n3 = {}); var o3 = n3.noScroll, r2 = (0, e2.getElRect)(t3), i2 = o3 ? { x: 0, y: 0 } : (0, Et.GX)(t3); return { top: r2.top + i2.y, left: r2.left + i2.x, width: r2.width, height: r2.height }; }, o2.prototype.clearOff = function() { this.frmOff = void 0, this.cvsOff = void 0; }, o2.prototype.getFrameOffset = function(t3) { var e3; if (!this.frmOff || t3) { var n3 = null === (e3 = this.frame) || void 0 === e3 ? void 0 : e3.el, o3 = null == t3 ? void 0 : t3.ownerDocument.defaultView, r2 = o3 ? o3.frameElement : n3; this.frmOff = this.offset(r2 || n3); } return this.frmOff; }, o2.prototype.getCanvasOffset = function() { return this.cvsOff || (this.cvsOff = this.offset(this.el)), this.cvsOff; }, o2.prototype.getElementPos = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.getZoom(), o3 = this.getFrameOffset(t3), r2 = this.el, i2 = this.getCanvasOffset(), s2 = this.offset(t3, e3), a2 = e3.avoidFrameOffset ? 0 : o3.top, l2 = e3.avoidFrameOffset ? 0 : o3.left, c2 = e3.avoidFrameZoom ? s2.top : s2.top * n3, u2 = e3.avoidFrameZoom ? s2.left : s2.left * n3; return { top: e3.avoidFrameOffset ? c2 : c2 + a2 - i2.top + r2.scrollTop, left: e3.avoidFrameOffset ? u2 : u2 + l2 - i2.left + r2.scrollLeft, height: e3.avoidFrameZoom ? s2.height : s2.height * n3, width: e3.avoidFrameZoom ? s2.width : s2.width * n3, zoom: n3, rect: s2 }; }, o2.prototype.getElementOffsets = function(t3) { var n3 = this; if (!t3 || (0, e2.isTextNode)(t3)) return {}; var o3 = {}, r2 = window.getComputedStyle(t3); return ["marginTop", "marginRight", "marginBottom", "marginLeft", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"].forEach(function(t4) { o3[t4] = parseFloat(r2[t4]) * n3.getZoom(); }), o3; }, o2.prototype.getPosition = function(t3) { var e3; void 0 === t3 && (t3 = {}); var n3 = null === (e3 = this.frame) || void 0 === e3 ? void 0 : e3.el.contentDocument; if (!n3) return { top: 0, left: 0, width: 0, height: 0 }; var o3 = n3.body, r2 = this.getZoom(), i2 = this.getFrameOffset(), s2 = this.getCanvasOffset(), a2 = t3.noScroll; return { top: i2.top + (a2 ? 0 : o3.scrollTop) * r2 - s2.top, left: i2.left + (a2 ? 0 : o3.scrollLeft) * r2 - s2.left, width: s2.width, height: s2.height }; }, o2.prototype.updateScript = function(t3) { var e3 = t3.model, n3 = e3.getId(); t3.scriptContainer || (t3.scriptContainer = (0, Et.ut)("div", { "data-id": n3 }), this.getJsContainer().appendChild(t3.scriptContainer)), t3.el.id = n3, t3.scriptContainer.innerHTML = ""; var o3 = document.createElement("script"), r2 = e3.getScriptString(), i2 = e3.get("script-props") ? r2 : "function(){\n".concat(r2, "\n;}"), s2 = JSON.stringify(e3.__getScriptProps()); o3.innerHTML = "\n setTimeout(function() {\n var item = document.getElementById('".concat(n3, "');\n if (!item) return;\n (").concat(i2, ".bind(item))(").concat(s2, ")\n }, 1);"), setTimeout(function() { var e4 = t3.scriptContainer; null == e4 || e4.appendChild(o3); }, 0); }, o2.prototype.getJsContainer = function(t3) { var e3 = this.getFrameView(t3); return e3 && e3.getJsContainer(); }, o2.prototype.getFrameView = function(t3) { return (null == t3 ? void 0 : t3._getFrame()) || this.em.get("currentFrame"); }, o2.prototype._renderFrames = function() { if (this.ready) { var t3 = this, e3 = t3.model, n3 = t3.frames, o3 = t3.em, r2 = t3.framesArea, i2 = e3.frames; i2.listenToLoad(), n3.render(); var s2 = i2.at(0), a2 = null == s2 ? void 0 : s2.view; o3.setCurrentFrame(a2), null == r2 || r2.appendChild(n3.el), this.frame = a2; } }, o2.prototype.render = function() { var t3 = this, n3 = t3.el, o3 = t3.$el, r2 = t3.ppfx, i2 = t3.config, s2 = t3.em; o3.html(this.template()); var a2 = o3.find("[data-frames]"); this.framesArea = a2.get(0); var l2 = o3.find("[data-tools]"); return this.toolsWrapper = l2.get(0), l2.append('\n
\n
\n
\n
\n
\n
\n ').concat(i2.extHl ? '
') : "", '\n
\n
\n
\n
\n
\n
\n
\n ')), this.toolsEl = n3.querySelector("#".concat(r2, "tools")), this.hlEl = n3.querySelector(".".concat(r2, "highlighter")), this.badgeEl = n3.querySelector(".".concat(r2, "badge")), this.placerEl = n3.querySelector(".".concat(r2, "placeholder")), this.ghostEl = n3.querySelector(".".concat(r2, "ghost")), this.toolbarEl = n3.querySelector(".".concat(r2, "toolbar")), this.resizerEl = n3.querySelector(".".concat(r2, "resizer")), this.offsetEl = n3.querySelector(".".concat(r2, "offset-v")), this.fixedOffsetEl = n3.querySelector(".".concat(r2, "offset-fixed-v")), this.toolsGlobEl = n3.querySelector(".".concat(r2, "tools-gl")), this.el.className = (0, e2.getUiClass)(s2, this.className), this.ready = true, this._renderFrames(), this; }, o2; }(Pt); const re = oe; var ie = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), se = function() { return se = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, se.apply(this, arguments); }, ae = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, le = function(n2) { function o2(t3) { var e3 = n2.call(this, t3, "Canvas", _) || this; return e3.canvas = new Tt(e3), e3.model = e3.canvas, e3.startAutoscroll = e3.startAutoscroll.bind(e3), e3.stopAutoscroll = e3.stopAutoscroll.bind(e3), e3; } return ie(o2, n2), o2.prototype.getCanvasView = function() { return this.canvasView; }, o2.prototype.onLoad = function() { this.model.init(); }, o2.prototype.getModel = function() { return this.canvas; }, o2.prototype.getElement = function() { return this.getCanvasView().el; }, o2.prototype.getFrame = function(t3) { return this.getFrames()[t3 || 0]; }, o2.prototype.getFrameEl = function() { var t3 = (this.canvasView || {}).frame; return null == t3 ? void 0 : t3.el; }, o2.prototype.getFramesEl = function() { var t3; return null === (t3 = this.canvasView) || void 0 === t3 ? void 0 : t3.framesArea; }, o2.prototype.getWindow = function() { var t3 = (this.canvasView || {}).frame; return null == t3 ? void 0 : t3.getWindow(); }, o2.prototype.getDocument = function() { var t3 = this.getFrameEl(); return null == t3 ? void 0 : t3.contentDocument; }, o2.prototype.getBody = function() { var t3 = this.getDocument(); return null == t3 ? void 0 : t3.body; }, o2.prototype._getLocalEl = function(t3, e3, n3) { var o3 = t3, r2 = null == e3 ? void 0 : e3._getFrame(); return o3 = r2 ? r2[n3]() : o3; }, o2.prototype.getGlobalToolsEl = function() { var t3; return null === (t3 = this.canvasView) || void 0 === t3 ? void 0 : t3.toolsGlobEl; }, o2.prototype.getToolsEl = function(t3) { return this._getLocalEl(this.getCanvasView().toolsEl, t3, "getToolsEl"); }, o2.prototype.getHighlighter = function(t3) { return this._getLocalEl(this.getCanvasView().hlEl, t3, "getHighlighter"); }, o2.prototype.getBadgeEl = function(t3) { return this._getLocalEl(this.getCanvasView().badgeEl, t3, "getBadgeEl"); }, o2.prototype.getPlacerEl = function() { return this.getCanvasView().placerEl; }, o2.prototype.getGhostEl = function() { return this.getCanvasView().ghostEl; }, o2.prototype.getToolbarEl = function() { return this.getCanvasView().toolbarEl; }, o2.prototype.getResizerEl = function() { return this.getCanvasView().resizerEl; }, o2.prototype.getOffsetViewerEl = function(t3) { return this._getLocalEl(this.getCanvasView().offsetEl, t3, "getOffsetViewerEl"); }, o2.prototype.getFixedOffsetViewerEl = function() { return this.getCanvasView().fixedOffsetEl; }, o2.prototype.render = function() { var t3; return null === (t3 = this.canvasView) || void 0 === t3 || t3.remove(), this.canvasView = new re(this.canvas), this.canvasView.render().el; }, o2.prototype.getOffset = function() { var t3 = this.offset(this.getFrameEl()), e3 = this.offset(this.getElement()); return { top: t3.top - e3.top, left: t3.left - e3.left }; }, o2.prototype.offset = function(t3) { return this.getCanvasView().offset(t3); }, o2.prototype.setCustomBadgeLabel = function(t3) { this.config.customBadgeLabel = t3; }, o2.prototype.getElementPos = function(t3, e3) { return this.getCanvasView().getElementPos(t3, e3); }, o2.prototype.getElementOffsets = function(t3) { return this.getCanvasView().getElementOffsets(t3); }, o2.prototype.getRect = function() { var t3, e3 = null !== (t3 = this.getCanvasView().getPosition()) && void 0 !== t3 ? t3 : {}, n3 = e3.top, o3 = void 0 === n3 ? 0 : n3, r2 = e3.left, i2 = void 0 === r2 ? 0 : r2; return se(se({}, this.getCanvasView().getCanvasOffset()), { topScroll: o3, leftScroll: i2 }); }, o2.prototype.getTargetToElementDim = function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = n3 || {}, r2 = this.getCanvasView().getPosition(); if (r2) { var i2 = o3.elPos || this.getCanvasView().getElementPos(e3), s2 = n3.toRight || 0, a2 = o3.targetHeight || t3.offsetHeight, l2 = o3.targetWidth || t3.offsetWidth, c2 = o3.event || null, u2 = i2.top - a2, p2 = i2.left; p2 += s2 ? i2.width : 0; var d2 = (p2 = s2 ? p2 - l2 : p2) < r2.left ? r2.left : p2, f2 = u2 < r2.top ? r2.top : u2, h2 = { top: f2 = f2 > i2.top + i2.height ? i2.top + i2.height : f2, left: d2, elementTop: i2.top, elementLeft: i2.left, elementWidth: i2.width, elementHeight: i2.height, targetWidth: t3.offsetWidth, targetHeight: t3.offsetHeight, canvasTop: r2.top, canvasLeft: r2.left, canvasWidth: r2.width, canvasHeight: r2.height }; return c2 && this.em && this.em.trigger(c2, h2), h2; } }, o2.prototype.canvasRectOffset = function(t3, e3, n3) { var o3 = this; void 0 === n3 && (n3 = {}); var r2 = function(t4, e4, r3) { void 0 === e4 && (e4 = 1); var i2 = o3.em.getZoomDecimal(), s2 = e4 ? "top" : "left", a2 = t4.ownerDocument, l2 = n3.offset ? function(t5) { var e5 = t5.defaultView; return null == e5 ? void 0 : e5.frameElement; }(a2) : {}, c2 = l2.offsetTop, u2 = void 0 === c2 ? 0 : c2, p2 = l2.offsetLeft, d2 = void 0 === p2 ? 0 : p2, f2 = a2.body || {}, h2 = f2.scrollTop, g2 = void 0 === h2 ? 0 : h2, v2 = f2.scrollLeft, y2 = e4 ? g2 : void 0 === v2 ? 0 : v2, m2 = e4 ? u2 : d2; return r3[s2] - (y2 - m2) * i2; }; return { top: r2(t3, 1, e3), left: r2(t3, 0, e3) }; }, o2.prototype.getTargetToElementFixed = function(e3, n3, o3) { void 0 === o3 && (o3 = {}); var r2 = o3.pos || this.getElementPos(e3, { noScroll: true }), i2 = o3.canvasOff || this.canvasRectOffset(e3, r2), s2 = n3.offsetHeight || 0, a2 = n3.offsetWidth || 0, l2 = r2.left + r2.width, c2 = this.getCanvasView(), u2 = c2.getPosition(), p2 = c2.getFrameOffset(e3), d2 = o3.event, f2 = -s2, h2 = (0, t2.isUndefined)(o3.left) ? r2.width - a2 : o3.left; if (h2 = r2.left < -h2 ? -r2.left : h2, h2 = l2 > u2.width ? h2 - (l2 - u2.width) : h2, i2.top < s2) { var g2 = r2.height + s2; g2 < p2.height ? f2 += g2 : f2 = -i2.top < r2.height ? -i2.top : r2.height; } var v2 = { top: f2, left: h2, canvasOffsetTop: i2.top, canvasOffsetLeft: i2.left, elRect: r2, canvasOffset: i2, canvasRect: u2, targetWidth: a2, targetHeight: s2 }; return d2 && this.em.trigger(d2, v2), v2; }, o2.prototype.getMouseRelativePos = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = 0, o3 = 0, r2 = e3.subWinOffset, i2 = t3.target.ownerDocument, s2 = i2.defaultView || i2.parentWindow, a2 = s2.frameElement, l2 = r2 ? s2.pageYOffset : 0, c2 = r2 ? s2.pageXOffset : 0; if (a2) { var u2 = a2.getBoundingClientRect(); n3 = u2.top || 0, o3 = u2.left || 0; } return { y: t3.clientY + n3 - l2, x: t3.clientX + o3 - c2 }; }, o2.prototype.getMouseRelativeCanvas = function(t3, e3) { var n3, o3 = this.getZoomDecimal(), r2 = null !== (n3 = this.getCanvasView().getPosition(e3)) && void 0 !== n3 ? n3 : {}, i2 = r2.top, s2 = void 0 === i2 ? 0 : i2, a2 = r2.left, l2 = void 0 === a2 ? 0 : a2; return { y: t3.clientY * o3 + s2, x: t3.clientX * o3 + l2 }; }, o2.prototype.hasFocus = function() { return this.getDocument().hasFocus(); }, o2.prototype.isInputFocused = function() { var t3 = this.getDocument(), e3 = this.getFrameEl(), n3 = ae(["body"], this.config.notTextable, true), o3 = e3 && document.activeElement === e3 ? t3 && t3.activeElement : document.activeElement; return o3 && !n3.some(function(t4) { return o3.matches(t4); }); }, o2.prototype.scrollTo = function(t3, n3) { void 0 === n3 && (n3 = {}); var o3 = (0, e2.getElement)(t3), r2 = o3 && (0, e2.getViewEl)(o3); r2 && r2.scrollIntoView(n3); }, o2.prototype.startAutoscroll = function(t3) { var e3 = t3 && t3.view || this.em.getCurrentFrame(); e3 && e3.startAutoscroll(); }, o2.prototype.stopAutoscroll = function(t3) { var e3 = t3 && t3.view || this.em.getCurrentFrame(); e3 && e3.stopAutoscroll(); }, o2.prototype.setZoom = function(t3) { return this.canvas.set("zoom", "string" == typeof t3 ? parseFloat(t3) : t3), this; }, o2.prototype.getZoom = function() { return parseFloat(this.canvas.get("zoom")); }, o2.prototype.setCoords = function(t3, e3) { return this.canvas.set({ x: parseFloat(t3), y: parseFloat(e3) }), this; }, o2.prototype.getCoords = function() { var t3 = this.canvas.attributes; return { x: t3.x, y: t3.y }; }, o2.prototype.getZoomDecimal = function() { return this.getZoom() / 100; }, o2.prototype.getZoomMultiplier = function() { var t3 = this.getZoomDecimal(); return t3 ? 1 / t3 : 1; }, o2.prototype.toggleFramesEvents = function(t3) { this.getFramesEl().style.pointerEvents = t3 ? "" : "none"; }, o2.prototype.getFrames = function() { return this.canvas.frames.map(function(t3) { return t3; }); }, o2.prototype.addFrame = function(t3, e3) { return void 0 === t3 && (t3 = {}), void 0 === e3 && (e3 = {}), this.canvas.frames.add(new j(this, se({}, t3)), e3); }, o2.prototype.destroy = function() { var t3, e3 = this; this.canvas.stopListening(), null === (t3 = this.canvasView) || void 0 === t3 || t3.remove(), ["model", "droppable"].forEach(function(t4) { return e3[t4] = {}; }); }, o2; }(m); const ce = le, ue = { stylePrefix: "comp-", components: [], draggableComponents: true, disableTextInnerChilds: false, processor: void 0, voidElements: ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"] }; var pe = "text/html", de = pe; var fe = function() { return fe = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, fe.apply(this, arguments); }, he = "data-gjs-", ge = "parse:html"; const ve = function(e3, n2) { return void 0 === n2 && (n2 = {}), { compTypes: "", modelAttrStart: he, getPropAttribute: function(t3, e4) { var n3 = t3.replace(this.modelAttrStart, ""), o2 = (null == e4 ? void 0 : e4.length) || 0, r2 = null == e4 ? void 0 : e4.substring(0, 1), i2 = null == e4 ? void 0 : e4.substring(o2 - 1), s2 = "true" === e4 || "false" !== e4 && e4; try { s2 = "{" == r2 && "}" == i2 || "[" == r2 && "]" == i2 ? JSON.parse(s2) : s2; } catch (t4) { } return { name: n3, value: s2 }; }, splitPropsFromAttr: function(e4) { var n3 = this; void 0 === e4 && (e4 = {}); var o2 = {}, r2 = {}; return (0, t2.each)(e4, function(t3, e5) { if (0 === e5.indexOf(n3.modelAttrStart)) { var i2 = n3.getPropAttribute(e5, t3); o2[i2.name] = i2.value; } else r2[e5] = t3; }), { props: o2, attrs: r2 }; }, parseStyle: function(t3) { for (var e4 = {}, n3 = t3.split(";"), o2 = 0, r2 = n3.length; o2 < r2; o2++) { var i2 = n3[o2].trim(); if (i2) { var s2 = i2.split(":"); e4[s2[0].trim()] = s2.slice(1).join(":").trim(); } } return e4; }, parseClass: function(t3) { for (var e4 = [], n3 = t3.split(" "), o2 = 0, r2 = n3.length; o2 < r2; o2++) { var i2 = n3[o2].trim(); i2 && e4.push(i2); } return e4; }, parseNode: function(t3, e4) { void 0 === e4 && (e4 = {}); for (var o2 = [], r2 = t3.childNodes, i2 = 0, s2 = r2.length; i2 < s2; i2++) { var a2 = r2[i2], l2 = a2.attributes || [], c2 = l2.length, u2 = o2[o2.length - 1], p2 = a2.childNodes.length, d2 = this.compTypes, f2 = {}; if (d2) { var h2 = "", g2 = a2.getAttribute && a2.getAttribute("".concat(this.modelAttrStart, "type")); if (g2) f2 = { type: g2 }; else { for (var v2 = 0; v2 < d2.length; v2++) { var y2 = d2[v2]; if (h2 = y2.model.isComponent(a2, e4)) { "object" != typeof h2 && (h2 = { type: y2.id }); break; } } f2 = h2; } } if (!f2.tagName) { var m2 = a2.tagName || "", b2 = a2.namespaceURI || ""; f2.tagName = m2 && "http://www.w3.org/1999/xhtml" === b2 ? m2.toLowerCase() : m2; } c2 && (f2.attributes = {}); for (var _2 = 0; _2 < c2; _2++) { var w2 = l2[_2].nodeName, x2 = l2[_2].nodeValue; if ("style" == w2) f2.style = this.parseStyle(x2); else if ("class" == w2) f2.classes = this.parseClass(x2); else { if ("contenteditable" == w2) continue; if (0 === w2.indexOf(this.modelAttrStart)) { var C2 = this.getPropAttribute(w2, x2); f2[C2.name] = C2.value; } else "" === x2 && true === a2[w2] && (x2 = true), f2.attributes[w2] = x2; } } if (p2 && !f2.components) { var S2 = a2.childNodes[0]; 1 === p2 && 3 === S2.nodeType ? (!f2.type && (f2.type = "text"), f2.components = { type: "textnode", content: S2.nodeValue }) : f2.components = this.parseNode(a2, fe(fe({}, e4), { inSvg: e4.inSvg || "svg" === f2.type })); } if ("textnode" == f2.type) { if (u2 && "textnode" == u2.type) { u2.content += f2.content; continue; } if (!e4.keepEmptyTextNodes) { var O2 = a2.nodeValue; if (" " != O2 && !O2.trim()) continue; } } p2 || "/>" !== "".concat(a2.outerHTML).slice(-2) || (f2.void = true); var T2 = f2.components; if (!f2.type && T2) { for (var k2 = 1, P2 = 0, E2 = 0; E2 < T2.length; E2++) { var A2 = T2[E2], j2 = A2.type; if (["text", "textnode"].indexOf(j2) < 0 && n2.textTags.indexOf(A2.tagName) < 0) { k2 = 0; break; } "textnode" == j2 && (P2 = 1); } k2 && P2 && (f2.type = "text"); } (f2.tagName || "textnode" == f2.type) && o2.push(f2); } return o2; }, parse: function(o2, r2, i2) { var s2; void 0 === i2 && (i2 = {}); var a2 = (null == e3 ? void 0 : e3.get("Config")) || {}, l2 = {}, c2 = fe(fe({}, n2), i2), u2 = fe(fe(fe({}, n2.optionsHtml), { htmlType: (null === (s2 = n2.optionsHtml) || void 0 === s2 ? void 0 : s2.htmlType) || n2.htmlType }), i2), p2 = (0, t2.isFunction)(c2.parserHtml) ? c2.parserHtml(o2, u2) : function(e4, n3) { void 0 === n3 && (n3 = {}); var o3, r3 = new DOMParser(), i3 = n3.htmlType || de, s3 = i3 === pe, a3 = s3 ? e4 : "
".concat(e4, "
"), l3 = r3.parseFromString(a3, i3); if (s3) { var c3 = l3.head, u3 = l3.body, p3 = c3.querySelectorAll("script"); (0, t2.each)(p3, function(t3) { return u3.appendChild(t3); }); var d3 = []; (0, t2.each)(c3.children, function(t3) { return d3.push(t3); }), (0, t2.each)(d3, function(t3, e5) { return u3.insertBefore(t3, u3.children[e5]); }), o3 = u3; } else o3 = l3.firstChild; return o3; }(o2, u2), d2 = p2.querySelectorAll("script"), f2 = d2.length; if (!((0, t2.isUndefined)(a2.allowScripts) ? u2.allowScripts : a2.allowScripts)) for (; f2--; ) d2[f2].parentNode.removeChild(d2[f2]); if (u2.allowUnsafeAttr || this.__clearUnsafeAttr(p2), r2) { for (var h2 = p2.querySelectorAll("style"), g2 = h2.length, v2 = ""; g2--; ) v2 = h2[g2].innerHTML + v2, h2[g2].parentNode.removeChild(h2[g2]); v2 && (l2.css = r2.parse(v2)); } e3 && e3.trigger("".concat(ge, ":root"), { input: o2, root: p2 }); var y2 = this.parseNode(p2, c2), m2 = 1 !== y2.length || c2.returnArray ? y2 : y2[0]; return l2.html = m2, e3 && e3.trigger(ge, { input: o2, output: l2 }), l2; }, __clearUnsafeAttr: function(e4) { var n3 = this, o2 = e4.attributes || [], r2 = e4.childNodes || [], i2 = []; (0, t2.each)(o2, function(t3) { var e5 = t3.nodeName || ""; 0 === e5.indexOf("on") && i2.push(e5); }), i2.map(function(t3) { return e4.removeAttribute(t3); }), (0, t2.each)(r2, function(t3) { return n3.__clearUnsafeAttr(t3); }); } }; }; var ye = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), me = function() { return me = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, me.apply(this, arguments); }, be = ve(); const _e = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return ye(o2, n2), o2.prototype.parseStyle = function(t3) { return be.parseStyle(t3); }, o2.prototype.extendStyle = function(t3) { return me(me({}, this.getStyle()), t3); }, o2.prototype.getStyle = function(e3) { var n3 = this.get("style") || {}, o3 = me({}, n3); return e3 && (0, t2.isString)(e3) ? o3[e3] : o3; }, o2.prototype.setStyle = function(n3, o3) { var r2 = this; void 0 === n3 && (n3 = {}), void 0 === o3 && (o3 = {}), (0, t2.isString)(n3) && (n3 = this.parseStyle(n3)); var i2 = this.getStyle(o3), s2 = me({}, n3), a2 = me({}, s2); (0, t2.keys)(a2).forEach(function(t3) { "" === a2[t3] && delete a2[t3]; }), this.set("style", a2, o3); var l2 = (0, e2.shallowDiff)(i2, s2); return delete l2.__p, (0, t2.keys)(l2).forEach(function(t3) { var e3 = r2.em; o3.noEvent || (r2.trigger("change:style:".concat(t3)), e3 && (e3.trigger("styleable:change", r2, t3, o3), e3.trigger("styleable:change:".concat(t3), r2, t3, o3))); }), s2; }, o2.prototype.addStyle = function(t3, e3, n3) { var o3; void 0 === e3 && (e3 = ""), void 0 === n3 && (n3 = {}), "string" == typeof t3 ? ((o3 = {})[t3] = e3, t3 = o3) : n3 = e3 || {}, t3 = this.extendStyle(t3), this.setStyle(t3, n3); }, o2.prototype.removeStyle = function(t3) { var e3 = this.getStyle(); delete e3[t3], this.setStyle(e3); }, o2.prototype.styleToString = function(e3) { void 0 === e3 && (e3 = {}); var n3 = [], o3 = this.getStyle(e3); for (var r2 in o3) { var i2 = e3.important, s2 = (0, t2.isArray)(i2) ? i2.indexOf(r2) >= 0 : i2, a2 = "".concat(o3[r2]).concat(s2 ? " !important" : ""), l2 = "__" == r2.substr(0, 2); a2 && !l2 && n3.push("".concat(r2, ":").concat(a2, ";")); } return n3.join(""); }, o2.prototype.getSelectors = function() { return this.get("selectors") || this.get("classes"); }, o2.prototype.getSelectorsString = function(t3) { return this.selectorsToString ? this.selectorsToString(t3) : this.getSelectors().getFullString(); }, o2; }(u.Hn); var we = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), xe = function() { return xe = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, xe.apply(this, arguments); }, Ce = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, Se = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Oe = function(e3, n2) { return void 0 === n2 && (n2 = []), e3 ? (((0, t2.isArray)(e3) || (0, t2.isFunction)(e3.map) ? e3 : [e3]).map(function(t3) { n2.push(t3.getId()), Oe(t3.components().models, n2); }), n2) : []; }, Te = function(e3, n2, o2) { void 0 === n2 && (n2 = {}), void 0 === o2 && (o2 = {}), o2.visitedCmps = o2.visitedCmps || {}; var r2 = o2.visitedCmps; return ((0, t2.isArray)(e3) ? e3 : [e3]).map(function(e4) { var i2 = e4.attributes, s2 = void 0 === i2 ? {} : i2, a2 = e4.components, l2 = e4.tagName, c2 = s2.id, u2 = (s2.draggable, Ce(s2, ["id", "draggable"])), p2 = e4; if (c2 && (r2[c2] ? (r2[c2].push(p2), c2 = en.getNewId(n2), p2.attributes.id = c2) : (r2[c2] = [], n2[c2] && (p2 = n2[c2], l2 && p2.set({ tagName: l2 }, xe(xe({}, o2), { silent: true })), (0, t2.keys)(u2).length && p2.addAttributes(u2, xe({}, o2))))), a2) { var d2 = Te(a2, n2); if ((0, t2.isFunction)(p2.components)) { var f2 = p2.components(); f2.length > 0 && f2.reset(d2, o2); } else p2.components = d2; } return p2; }); }, ke = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return we(n2, e3), n2.prototype.initialize = function(t3, e4) { void 0 === e4 && (e4 = {}), this.opt = e4, this.listenTo(this, "add", this.onAdd), this.listenTo(this, "remove", this.removeChildren), this.listenTo(this, "reset", this.resetChildren); var n3 = e4.em, o2 = e4.config; this.config = o2, this.em = n3, this.domc = e4.domc || (null == n3 ? void 0 : n3.Components); }, n2.prototype.resetChildren = function(t3, e4) { var n3 = this; void 0 === e4 && (e4 = {}); var o2 = this, r2 = e4.previousModels || [], i2 = r2.filter(function(e5) { return !t3.get(e5.cid); }), s2 = Oe(t3), a2 = Oe(r2).filter(function(t4) { return s2.indexOf(t4) >= 0; }); e4.keepIds = (e4.keepIds || []).concat(a2), i2.forEach(function(t4) { return n3.removeChildren(t4, o2, e4); }), t3.each(function(t4) { return n3.onAdd(t4); }); }, n2.prototype.resetFromString = function(t3, e4) { var n3, o2; void 0 === t3 && (t3 = ""), void 0 === e4 && (e4 = {}), e4.keepIds = Oe(this); var r2 = this, i2 = r2.domc, s2 = r2.em, a2 = r2.parent, l2 = null == s2 ? void 0 : s2.Css, c2 = (null == i2 ? void 0 : i2.allById()) || {}, u2 = this.parseString(t3, e4), p2 = Te(u2, c2, e4), d2 = e4.visitedCmps, f2 = void 0 === d2 ? {} : d2; Object.keys(f2).forEach(function(t4) { var e5 = f2[t4]; if (e5.length) { var n4 = (null == l2 ? void 0 : l2.getRules("#".concat(t4))) || []; n4.length && e5.forEach(function(t5) { n4.forEach(function(e6) { var n5 = e6.clone(); n5.set("selectors", ["#".concat(t5.attributes.id)]), l2.getAll().add(n5); }); }); } }), this.reset(p2, e4), null == s2 || s2.trigger("component:content", a2, e4, t3), null === (o2 = (n3 = a2).__checkInnerChilds) || void 0 === o2 || o2.call(n3); }, n2.prototype.removeChildren = function(t3, e4, n3) { var o2 = this; if (void 0 === n3 && (n3 = {}), t3) { var r2 = this.domc, i2 = this.em, s2 = n3.temporary || n3.fromUndo; if (t3.prevColl = this, !s2) { var a2 = t3.getId(), l2 = i2.Selectors.getAll(), c2 = i2.Css.getAll(), u2 = (n3.keepIds || []).indexOf(a2) < 0; delete (r2 ? r2.allById() : {})[a2]; var p2 = u2 ? c2.remove(c2.filter(function(t4) { return t4.getSelectors().getFullString() === "#".concat(a2); }), n3) : []; l2.remove(p2.map(function(t4) { return t4.getSelectors().at(0); })), t3.opt.temporary || (i2.Commands.run("core:component-style-clear", { target: t3 }), t3.removed(), t3.trigger("removed"), i2.trigger("component:remove", t3)), t3.components().forEach(function(t4) { return o2.removeChildren(t4, e4, n3); }); } var d2 = t3.components(); i2.stopListening(d2), i2.stopListening(t3), i2.stopListening(t3.get("classes")), t3.__postRemove(); } }, n2.prototype.model = function(t3, e4) { var n3, o2 = e4.collection.opt, r2 = o2.em, i2 = r2.Components.componentTypes; e4.em = r2, e4.config = o2.config, e4.componentTypes = i2, e4.domc = o2.domc; for (var s2 = 0; s2 < i2.length; s2++) { if (i2[s2].id == t3.type) { n3 = i2[s2].model; break; } } return n3 || (n3 = i2[i2.length - 1].model, r2 && t3.type && r2.logWarning("Component type '".concat(t3.type, "' not found"), { attrs: t3, options: e4 })), new n3(t3, e4); }, n2.prototype.parseString = function(t3, e4) { void 0 === e4 && (e4 = {}); var n3 = this.em, o2 = this.domc, r2 = n3.Css, i2 = n3.Parser.parseHtml(t3); if (en.checkId(i2.html, i2.css, o2.componentsById, e4), i2.css && r2 && !e4.temporary) { e4.at; var s2 = Ce(e4, ["at"]); r2.addCollection(i2.css, xe(xe({}, s2), { extend: 1 })); } return i2.html; }, n2.prototype.add = function(e4, n3) { var o2 = this; void 0 === n3 && (n3 = {}), n3.keepIds = Se(Se([], n3.keepIds || [], true), Oe(n3.previousModels), true), (0, t2.isString)(e4) ? e4 = this.parseString(e4, n3) : (0, t2.isArray)(e4) && (e4 = Se([], e4, true)).forEach(function(r3, i3) { if ((0, t2.isString)(r3)) { var s2 = o2.parseString(r3, n3); e4[i3] = (0, t2.isArray)(s2) && !s2.length ? null : s2; } }); var r2 = (0, t2.isArray)(e4); e4 = (r2 ? e4 : [e4]).filter(Boolean).map(function(t3) { return o2.processDef(t3); }), e4 = r2 ? (0, t2.flatten)(e4, 1) : e4[0]; var i2 = u.FE.prototype.add.apply(this, [e4, n3]); return this.__firstAdd = i2, i2; }, n2.prototype.processDef = function(e4) { if (e4.cid && e4.ccid) return e4; var n3 = this.em, o2 = this.config, r2 = (void 0 === o2 ? {} : o2).processor, i2 = e4; if (r2) { var s2 = r2(i2 = xe({}, i2)); s2 && ((0, t2.each)(i2, function(t3, e5) { return delete i2[e5]; }), (0, t2.extend)(i2, s2)); } if (i2.$$typeof && "object" == typeof i2.props) { (i2 = xe({}, i2)).props = xe({}, i2.props); var a2 = n3.Components, l2 = n3.Parser.parserHtml; (0, t2.each)(i2, function(e5, n4) { (0, t2.includes)(["props", "type"], n4) || delete i2[n4]; }); var c2 = i2.props, u2 = c2.children; delete c2.children, delete i2.props; var p2 = l2.splitPropsFromAttr(c2); i2.attributes = p2.attrs, u2 && (i2.components = u2), i2.type ? a2.getType(i2.type) || (i2.tagName = i2.type, delete i2.type) : i2.type = "textnode", (0, t2.extend)(i2, p2.props); } return i2; }, n2.prototype.onAdd = function(e4, n3, o2) { void 0 === o2 && (o2 = {}); var r2 = this.domc, i2 = this.em, s2 = e4.getStyle(), a2 = i2 && i2.getConfig().avoidInlineStyle; if (r2 && r2.Component.ensureInList(e4), !(0, t2.isEmpty)(s2) && !a2 && i2 && i2.get && i2.getConfig().forceClass && !o2.temporary) { var l2 = e4.cid; i2.Css.setClassRule(l2, s2), e4.setStyle({}), e4.addClass(l2); } e4.__postAdd({ recursive: true }); }, n2; }(u.FE); const Pe = ke; var Ee = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ae = 1, je = 2, Me = function(e3) { function n2(t3, o2) { void 0 === o2 && (o2 = {}); var r2 = e3.call(this, t3, o2) || this, i2 = o2.config, s2 = void 0 === i2 ? {} : i2, a2 = r2.get("name"), l2 = r2.get("label"); a2 ? l2 || r2.set("label", a2) : r2.set("name", l2); var c2 = r2.get("name"), u2 = s2.escapeName, p2 = u2 ? u2(c2) : n2.escapeName(c2); return r2.set("name", p2), r2.em = o2.em, r2; } return Ee(n2, e3), n2.prototype.defaults = function() { return { name: "", label: "", type: Ae, active: true, private: false, protected: false, _undo: true }; }, n2.prototype.isId = function() { return this.get("type") === je; }, n2.prototype.isClass = function() { return this.get("type") === Ae; }, n2.prototype.getFullName = function(t3) { void 0 === t3 && (t3 = {}); var e4 = t3.escape, n3 = this.get("name"), o2 = ""; switch (this.get("type")) { case Ae: o2 = "."; break; case je: o2 = "#"; } return o2 + (e4 ? e4(n3) : n3); }, n2.prototype.toString = function() { return this.getFullName(); }, n2.prototype.getLabel = function() { return this.get("label"); }, n2.prototype.setLabel = function(t3) { return this.set("label", t3); }, n2.prototype.getActive = function() { return this.get("active"); }, n2.prototype.setActive = function(t3) { return this.set("active", t3); }, n2.prototype.toJSON = function(e4) { void 0 === e4 && (e4 = {}); var n3 = this.em, o2 = u.Hn.prototype.toJSON.call(this, [e4]), r2 = (0, t2.result)(this, "defaults"); if (n3 && n3.getConfig().avoidDefaults) { (0, t2.forEach)(r2, function(t3, e5) { o2[e5] === t3 && delete o2[e5]; }), o2.label === o2.name && delete o2.label; var i2 = (0, t2.keys)(o2).length; 1 === i2 && o2.name && (o2 = o2.name), 2 === i2 && o2.name && o2.type && (o2 = this.getFullName()); } return o2; }, n2.escapeName = function(t3) { return "".concat(t3).trim().replace(/([^a-z0-9\w-\:@]+)/gi, "-"); }, n2.TYPE_CLASS = Ae, n2.TYPE_ID = je, n2; }(u.Hn); const Le = Me; Me.prototype.idAttribute = "name"; var De = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ne = function(t3, e3) { return t3.reduce(function(n2, o2, r2) { return n2.concat(Ne(t3.slice(r2 + 1), "".concat(e3).concat(o2))); }, [e3]); }, Ie = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return De(n2, e3), n2.prototype.modelId = function(t3) { return "".concat(t3.name, "_").concat(t3.type || Le.TYPE_CLASS); }, n2.prototype.getStyleable = function() { return (0, t2.filter)(this.models, function(t3) { return t3.get("active") && !t3.get("private"); }); }, n2.prototype.getValid = function(e4) { var n3 = (void 0 === e4 ? {} : e4).noDisabled; return (0, t2.filter)(this.models, function(t3) { return !t3.get("private"); }).filter(function(t3) { return n3 ? t3.get("active") : 1; }); }, n2.prototype.getFullString = function(t3, e4) { void 0 === e4 && (e4 = {}); var n3 = []; return (t3 || this).forEach(function(t4) { return n3.push(t4.getFullName(e4)); }), e4.sort && n3.sort(), n3.join("").trim(); }, n2.prototype.getFullName = function(t3) { void 0 === t3 && (t3 = {}); var e4 = t3.combination, n3 = t3.array, o2 = [], r2 = this.map(function(e5) { return e5.getFullName(t3); }).sort(); return e4 ? r2.forEach(function(t4, e5) { o2 = o2.concat(Ne(r2.slice(e5 + 1), t4)); }) : o2 = r2, n3 ? o2 : e4 ? o2.join(",") : o2.join(""); }, n2; }(u.FE); const Fe = Ie; Ie.prototype.model = Le; var Ve = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Re = function() { return Re = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Re.apply(this, arguments); }; const He = function(e3) { function n2(n3) { var o2 = e3.call(this, n3) || this, r2 = o2.attributes, i2 = r2.target, s2 = r2.name, a2 = r2.changeProp, l2 = r2.value; if (!o2.get("id") && o2.set("id", s2), i2) { o2.target = i2, o2.unset("target"); var c2 = a2 ? "change:".concat(s2) : "change:attributes:".concat(s2); o2.listenTo(i2, c2, o2.targetUpdated); var u2 = l2 || o2.getValue(); !(0, t2.isUndefined)(u2) && o2.set({ value: u2 }, { silent: true }); } return o2; } return Ve(n2, e3), n2.prototype.defaults = function() { return { type: "text", label: "", name: "", unit: "", step: 1, value: "", default: "", placeholder: "", changeProp: false, options: [] }; }, n2.prototype.getId = function() { return this.get("id"); }, n2.prototype.getType = function() { return this.get("type"); }, n2.prototype.getName = function() { return this.get("name"); }, n2.prototype.getLabel = function(t3) { var e4; void 0 === t3 && (t3 = {}); var n3 = t3.locale, o2 = void 0 === n3 || n3, r2 = this.getId(), i2 = this.get("label") || this.getName(); return o2 && (null === (e4 = this.em) || void 0 === e4 ? void 0 : e4.t("traitManager.traits.labels.".concat(r2))) || i2; }, n2.prototype.getValue = function() { return this.getTargetValue(); }, n2.prototype.setValue = function(t3, e4) { var n3; void 0 === e4 && (e4 = {}); var o2 = {}, r2 = this.get("setValue"); r2 ? r2({ value: t3, editor: null === (n3 = this.em) || void 0 === n3 ? void 0 : n3.getEditor(), trait: this, component: this.target, partial: !!e4.partial }) : (e4.partial && (o2.avoidStore = true), this.setTargetValue(t3, o2), false === e4.partial && (this.setTargetValue(""), this.setTargetValue(t3))); }, n2.prototype.props = function() { return this.attributes; }, n2.prototype.targetUpdated = function() { var t3, e4 = this.getTargetValue(); this.set({ value: e4 }, { fromTarget: 1 }), null === (t3 = this.em) || void 0 === t3 || t3.trigger("trait:update", { trait: this, component: this.target }); }, n2.prototype.getTargetValue = function() { var e4, n3, o2 = this.getName(), r2 = this.target, i2 = this.get("getValue"); return n3 = i2 ? i2({ editor: null === (e4 = this.em) || void 0 === e4 ? void 0 : e4.getEditor(), trait: this, component: r2 }) : this.get("changeProp") ? r2.get(o2) : r2.getAttributes()[o2], (0, t2.isUndefined)(n3) ? "" : n3; }, n2.prototype.setTargetValue = function(e4, n3) { var o2; void 0 === n3 && (n3 = {}); var r2 = this.target, i2 = this.attributes, s2 = this.getName(); if (!(0, t2.isUndefined)(e4)) { var a2 = e4; if ("false" === e4 ? a2 = false : "true" === e4 && (a2 = true), "checkbox" === this.getType()) { var l2 = i2.valueTrue, c2 = i2.valueFalse; a2 && !(0, t2.isUndefined)(l2) && (a2 = l2), a2 || (0, t2.isUndefined)(c2) || (a2 = c2); } this.get("changeProp") ? r2.set(s2, a2, n3) : r2.addAttributes(((o2 = {})[s2] = a2, o2), n3); } }, n2.prototype.setValueFromInput = function(t3, e4, n3) { void 0 === e4 && (e4 = true), void 0 === n3 && (n3 = {}); var o2 = { value: t3 }; this.set(o2, Re(Re({}, n3), { avoidStore: 1 })), e4 && (this.set("value", "", n3), this.set(o2, n3)); }, n2.prototype.getInitValue = function() { var t3, e4 = this.target, n3 = this.getName(); if (e4) { var o2 = e4.get("attributes"); t3 = this.get("changeProp") ? e4.get(n3) : o2[n3]; } return t3 || this.get("value") || this.get("default"); }, n2; }(u.Hn); var ze = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Be = function(e3) { function n2(t3, n3) { var o2 = e3.call(this, t3) || this; return o2.em = n3.em, o2.listenTo(o2, "add", o2.handleAdd), o2.listenTo(o2, "reset", o2.handleReset), o2; } return ze(n2, e3), n2.prototype.handleReset = function(t3, e4) { var n3 = (void 0 === e4 ? {} : e4).previousModels; (void 0 === n3 ? [] : n3).forEach(function(t4) { return t4.trigger("remove"); }); }, n2.prototype.handleAdd = function(t3) { t3.em = this.em; var e4 = this.target; e4 && (t3.target = e4); }, n2.prototype.setTarget = function(t3) { this.target = t3; }, n2.prototype.add = function(e4, n3) { var o2 = this.em; if ((0, t2.isString)(e4) || (0, t2.isArray)(e4)) { var r2 = o2 && o2.get && o2.Traits, i2 = function(t3) { return void 0 === t3 && (t3 = {}), { build: function(e5) { var n4 = []; "string" == typeof e5 && (e5 = [e5]); for (var o3 = 0; o3 < e5.length; o3++) { var r3 = e5[o3], i3 = { name: r3, type: "text" }; "target" === r3 && (i3.type = "select", i3.default = false, i3.options = t3.optionsTarget), n4.push(i3); } return n4; } }; }(r2 && r2.getConfig()); (0, t2.isString)(e4) && (e4 = [e4]); for (var s2 = 0, a2 = e4.length; s2 < a2; s2++) { var l2 = e4[s2], c2 = (0, t2.isString)(l2) ? i2.build(l2)[0] : l2; c2.target = this.target, e4[s2] = c2; } } return u.FE.prototype.add.apply(this, [e4, n3]); }, n2; }(u.FE); const Ue = Be; Be.prototype.model = He; var We = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), $e = function() { return $e = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, $e.apply(this, arguments); }, qe = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Ge = function(t3) { return t3.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); }, Ke = "component:drag", Ye = "__symbols", Xe = "__symbol", Je = "__symbol_ovrd", Ze = "component:update", Qe = "".concat(Ze, "-inside"), tn = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return We(o2, n2), Object.defineProperty(o2.prototype, "defaults", { get: function() { var t3; return (t3 = { tagName: "div", type: "", name: "", removable: true, draggable: true, droppable: true, badgable: true, stylable: true, "stylable-require": "", "style-signature": "", unstylable: "", highlightable: true, copyable: true, resizable: false, editable: false, layerable: true, selectable: true, hoverable: true, locked: false, void: false, state: "", status: "", content: "", icon: "", style: "", styles: "", classes: "", script: "", "script-props": "", "script-export": "", attributes: {}, traits: ["id", "title"], propagate: "", dmode: "", toolbar: null })[Xe] = 0, t3[Ye] = 0, t3[Je] = 0, t3._undo = true, t3._undoexc = ["status", "open"], t3; }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "classes", { get: function() { return this.get("classes"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "traits", { get: function() { return this.get("traits"); }, enumerable: false, configurable: true }), o2.prototype.init = function() { }, o2.prototype.updated = function(t3, e3, n3) { }, o2.prototype.removed = function() { }, o2.prototype.initialize = function(e3, n3) { var r2 = this; void 0 === e3 && (e3 = {}), void 0 === n3 && (n3 = {}), (0, t2.bindAll)(this, "__upSymbProps", "__upSymbCls", "__upSymbComps"); var i2 = n3.em, s2 = this.parent(), a2 = null == s2 ? void 0 : s2.attributes, l2 = this.get("propagate"); if (l2 && this.set("propagate", (0, t2.isArray)(l2) ? l2 : [l2]), a2 && a2.propagate && !l2) { var c2 = {}, u2 = a2.propagate; u2.forEach(function(t3) { return c2[t3] = s2.get(t3); }), c2.propagate = u2, this.set($e($e({}, c2), e3)); } if (n3 && n3.config && n3.config.voidElements.indexOf(this.get("tagName")) >= 0 && this.set("void", true), n3.em = i2, this.opt = n3, this.em = i2, this.frame = n3.frame, this.config = n3.config || {}, this.set("attributes", $e($e({}, (0, t2.result)(this, "defaults").attributes || {}), this.get("attributes") || {})), this.ccid = o2.createId(this, n3), 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(Qe, this.__propToParent), this.set("status", ""), this.views = [], ["classes", "traits", "components"].forEach(function(t3) { var e4 = "add remove ".concat("components" !== t3 ? "change" : ""); r2.listenTo(r2.get(t3), e4.trim(), function() { for (var e5 = [], n4 = 0; n4 < arguments.length; n4++) e5[n4] = arguments[n4]; return r2.emitUpdate.apply(r2, qe([t3], e5, false)); }); }), !n3.temporary) { var p2 = i2 && i2.Css, d2 = this.attributes, f2 = d2.styles, h2 = d2.type; f2 && p2 && p2.addCollection(f2, { avoidUpdateStyle: true }, { group: "cmp:".concat(h2) }), this.__postAdd(), this.init(), this.__isSymbolOrInst() && this.__initSymb(), i2 && i2.trigger("component:create", this); } }, o2.prototype.__postAdd = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.em, n3 = null == e3 ? void 0 : e3.UndoManager, o3 = this.components(); n3 && !this.__hasUm && (n3.add(o3), n3.add(this.getSelectors()), this.__hasUm = true), t3.recursive && o3.map(function(e4) { return e4.__postAdd(t3); }); }, o2.prototype.__postRemove = function() { var t3 = this.em, e3 = null == t3 ? void 0 : t3.get("UndoManager"); e3 && (e3.remove(this.components()), e3.remove(this.getSelectors()), delete this.__hasUm); }, o2.prototype.__onChange = function(n3, o3) { var r2 = this, i2 = this.changedAttributes() || {}; (0, t2.keys)(i2).forEach(function(t3) { return r2.emitUpdate(t3); }), ["status", "open", "toolbar", "traits"].forEach(function(t3) { return delete i2[t3]; }), (0, e2.isEmptyObj)(i2) || (this.__changesUp(o3), this.__propSelfToParent({ component: this, changed: i2, options: o3 })); }, o2.prototype.__changesUp = function(t3) { var e3 = this.em; [this.frame, e3].forEach(function(e4) { return e4 && e4.changesUp(t3); }); }, o2.prototype.__propSelfToParent = function(t3) { this.trigger(Ze, t3), this.__propToParent(t3); }, o2.prototype.__propToParent = function(t3) { var e3 = this.parent(); e3 && e3.trigger(Qe, t3); }, o2.prototype.__emitUpdateTlb = function() { this.emitUpdate("toolbar"); }, o2.prototype.is = function(t3) { return !(this.get("type") != t3); }, o2.prototype.props = function() { return this.attributes; }, o2.prototype.index = function() { var t3 = this.collection; return t3 ? t3.indexOf(this) : 0; }, o2.prototype.setDragMode = function(t3) { return this.set("dmode", t3); }, o2.prototype.getDragMode = function() { return this.get("dmode") || ""; }, o2.prototype.find = function(t3) { var e3, n3 = [], o3 = null === (e3 = this.view) || void 0 === e3 ? void 0 : e3.$el.find(t3); return null == o3 || o3.each(function(t4) { var e4 = o3.eq(t4).data("model"); e4 && n3.push(e4); }), n3; }, o2.prototype.findType = function(t3) { var e3 = [], n3 = function(o3) { return o3.forEach(function(o4) { o4.is(t3) && e3.push(o4), n3(o4.components()); }); }; return n3(this.components()), e3; }, o2.prototype.closest = function(t3) { var e3, n3 = null === (e3 = this.view) || void 0 === e3 ? void 0 : e3.$el.closest(t3); return (null == n3 ? void 0 : n3.length) ? n3.data("model") : void 0; }, o2.prototype.closestType = function(t3) { for (var e3 = this.parent(); e3 && !e3.is(t3); ) e3 = e3.parent(); return e3; }, o2.prototype.contains = function(t3) { var e3 = false; if (!t3) return e3; var n3 = function(o3) { !e3 && o3.forEach(function(o4) { o4 === t3 && (e3 = true), !e3 && n3(o4.components()); }); }; return n3(this.components()), e3; }, o2.prototype.tagUpdated = function() { this.trigger("rerender"); }, o2.prototype.replaceWith = function(t3) { var e3 = this.collection, n3 = e3.indexOf(this); return e3.remove(this), e3.add(t3, { at: n3 }); }, o2.prototype.attrUpdated = function(n3, o3, r2) { var i2 = this; void 0 === r2 && (r2 = {}); var s2 = this.get("attributes"), a2 = s2.class; a2 && this.setClass(a2), delete s2.class; var l2 = s2.style; l2 && this.setStyle(l2), delete s2.style; var c2 = $e({}, this.previous("attributes")), u2 = (0, e2.shallowDiff)(c2, this.get("attributes")); (0, t2.keys)(u2).forEach(function(t3) { return i2.trigger("change:attributes:".concat(t3), i2, u2[t3], r2); }); }, o2.prototype.setAttributes = function(t3, e3) { return void 0 === e3 && (e3 = {}), this.set("attributes", $e({}, t3), e3), this; }, o2.prototype.addAttributes = function(t3, e3) { return void 0 === e3 && (e3 = {}), this.setAttributes($e($e({}, this.getAttributes({ noClass: true })), t3), e3); }, o2.prototype.removeAttributes = function(t3, e3) { void 0 === t3 && (t3 = []), void 0 === e3 && (e3 = {}); var n3 = Array.isArray(t3) ? t3 : [t3], o3 = this.getAttributes(); return n3.map(function(t4) { return delete o3[t4]; }), this.setAttributes(o3, e3); }, o2.prototype.getStyle = function(e3, o3) { void 0 === e3 && (e3 = {}), void 0 === o3 && (o3 = {}); var r2 = this.em, i2 = (0, t2.isString)(e3) ? e3 : "", s2 = i2 ? o3 : e3; if (r2 && r2.getConfig().avoidInlineStyle && !s2.inline) { var a2 = r2.get("state"), l2 = r2.Css.getIdRule(this.getId(), $e({ state: a2 }, s2)); if (this.rule = l2, l2) return l2.getStyle(i2); } return n2.prototype.getStyle.call(this, i2); }, o2.prototype.setStyle = function(o3, r2) { var i2 = this; void 0 === o3 && (o3 = {}), void 0 === r2 && (r2 = {}); var s2 = this, a2 = s2.opt, l2 = s2.em; if (l2 && l2.getConfig().avoidInlineStyle && !a2.temporary && !r2.inline) { var c2 = this.get("style") || {}; o3 = (0, t2.isString)(o3) ? this.parseStyle(o3) : o3, o3 = $e($e({}, o3), c2); var u2 = l2.get("state"), p2 = l2.Css, d2 = this.getStyle(r2); this.rule = p2.setIdRule(this.getId(), o3, $e($e({}, r2), { state: u2 })); var f2 = (0, e2.shallowDiff)(d2, o3); this.set("style", "", { silent: true }), (0, t2.keys)(f2).forEach(function(t3) { return i2.trigger("change:style:".concat(t3)); }); } else o3 = n2.prototype.setStyle.apply(this, arguments); return o3; }, o2.prototype.getAttributes = function(n3) { void 0 === n3 && (n3 = {}); var o3 = this.em, r2 = [], i2 = $e({}, this.get("attributes")), s2 = null == o3 ? void 0 : o3.Selectors, a2 = this.getId(); if (n3.noClass ? delete i2.class : (this.classes.forEach(function(e3) { return r2.push((0, t2.isString)(e3) ? e3 : e3.get("name")); }), r2.length && (i2.class = r2.join(" "))), !n3.noStyle) { var l2 = this.get("style"); (0, e2.isObject)(l2) && !(0, e2.isEmptyObj)(l2) && (i2.style = this.styleToString({ inline: 1 })); } if (!(0, t2.has)(i2, "id")) { var c2 = void 0; !function(t3) { return t3 && t3.getConfig().avoidInlineStyle; }(o3) ? (0, t2.isEmpty)(this.getStyle()) || (c2 = 1) : c2 = s2 && s2.get(a2, s2.Selector.TYPE_ID), (this.__getSymbol() || this.__getSymbols()) && (c2 = 1), c2 && (i2.id = a2); } return i2; }, o2.prototype.addClass = function(t3) { var e3 = this.em.Selectors.addClass(t3); return this.classes.add(e3); }, o2.prototype.setClass = function(t3) { return this.classes.reset(), this.addClass(t3); }, o2.prototype.removeClass = function(e3) { var n3 = []; e3 = (0, t2.isArray)(e3) ? e3 : [e3]; var o3 = this.classes, r2 = Le.TYPE_CLASS; return e3.forEach(function(t3) { t3.split(" ").forEach(function(t4) { var e4 = o3.where({ name: t4, type: r2 })[0]; e4 && n3.push(o3.remove(e4)); }); }), n3; }, o2.prototype.getClasses = function() { var t3 = this.getAttributes().class; return t3 ? t3.split(" ") : []; }, o2.prototype.__logSymbol = function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.__getSymbol(), r2 = this.__getSymbols(); (o3 || r2) && this.em.log(t3, { model: this, toUp: e3, context: "symbols", opts: n3 }); }, o2.prototype.__initSymb = function() { this.__symbReady || (this.on("change", this.__upSymbProps), this.__symbReady = true); }, o2.prototype.__isSymbol = function() { return (0, t2.isArray)(this.get(Ye)); }, o2.prototype.__isSymbolOrInst = function() { return !(!this.__isSymbol() && !this.get(Xe)); }, o2.prototype.__isSymbolTop = function() { var t3 = this.parent(); return this.__isSymbolOrInst() && (!t3 || t3 && !t3.__isSymbol() && !t3.__getSymbol()); }, o2.prototype.__isSymbolNested = function() { if (!this.__isSymbolOrInst() || this.__isSymbolTop()) return false; var t3 = (this.__isSymbol() ? this : this.__getSymbol()).__getSymbTop(), e3 = this.__getSymbTop(); return (e3.__isSymbol() ? e3 : e3.__getSymbol()) !== t3; }, o2.prototype.__getAllById = function() { var t3 = this.em; return t3 ? t3.Components.allById() : {}; }, o2.prototype.__getSymbol = function() { var e3 = this.get(Xe); if (e3 && (0, t2.isString)(e3)) { var n3 = this.__getAllById()[e3]; n3 ? (e3 = n3, this.set(Xe, n3)) : e3 = 0; } return e3; }, o2.prototype.__getSymbols = function() { var e3 = this, n3 = this.get(Ye); return n3 && (0, t2.isArray)(n3) && (n3.forEach(function(o3, r2) { o3 && (0, t2.isString)(o3) && (n3[r2] = e3.__getAllById()[o3]); }), n3 = n3.filter(function(e4) { return e4 && !(0, t2.isString)(e4); })), n3; }, o2.prototype.__isSymbOvrd = function(e3) { void 0 === e3 && (e3 = ""); var n3 = this.get(Je), o3 = e3.split(":")[0], r2 = e3 !== o3 ? [e3, o3] : [e3]; return true === n3 || (0, t2.isArray)(n3) && r2.some(function(t3) { return n3.indexOf(t3) >= 0; }); }, o2.prototype.__getSymbToUp = function(t3) { var e3 = this; void 0 === t3 && (t3 = {}); var n3 = [], o3 = t3.changed; if (t3.fromInstance || t3.noPropagate || t3.fromUndo || o3 && this.__isSymbOvrd(o3)) return n3; var r2 = this.__getSymbols() || [], i2 = this.__getSymbol(); return n3 = (i2 ? qe([i2], i2.__getSymbols() || [], true) : r2).filter(function(t4) { return t4 !== e3; }).filter(function(t4) { return !(o3 && t4.__isSymbOvrd(o3)); }); }, o2.prototype.__getSymbTop = function(t3) { for (var e3 = this, n3 = this.parent(t3); n3 && (n3.__isSymbol() || n3.__getSymbol()); ) e3 = n3, n3 = n3.parent(t3); return e3; }, o2.prototype.__upSymbProps = function(n3, o3) { var r2 = this; void 0 === o3 && (o3 = {}); var i2 = this.changedAttributes() || {}, s2 = i2.attributes || {}; if (delete i2.status, delete i2.open, delete i2[Ye], delete i2[Xe], delete i2[Je], delete i2.attributes, delete s2.id, (0, e2.isEmptyObj)(s2) || (i2.attributes = s2), !(0, e2.isEmptyObj)(i2)) { var a2 = this.__getSymbToUp(o3); (0, t2.keys)(i2).map(function(t3) { r2.__isSymbOvrd(t3) && delete i2[t3]; }), this.__logSymbol("props", a2, { opts: o3, changed: i2 }), a2.forEach(function(e3) { var n4 = $e({}, i2); (0, t2.keys)(n4).map(function(t3) { e3.__isSymbOvrd(t3) && delete n4[t3]; }), e3.set(n4, $e({ fromInstance: r2 }, o3)); }); } }, o2.prototype.__upSymbCls = function(t3, e3, n3) { var o3 = this; void 0 === n3 && (n3 = {}); var r2 = this.__getSymbToUp(n3); this.__logSymbol("classes", r2, { opts: n3 }), r2.forEach(function(t4) { t4.set("classes", o3.get("classes"), { fromInstance: o3 }); }), this.__changesUp(n3); }, o2.prototype.__upSymbComps = function(t3, e3, n3) { var o3 = this, r2 = n3 || e3 || {}, i2 = { fromInstance: r2.fromInstance, fromUndo: r2.fromUndo }, s2 = t3.opt.temporary; if (n3) if (n3.add) { var a2 = [], l2 = !!this.__getSymbols(); if ((y2 = this.__getSymbToUp($e($e({}, i2), { changed: "components:add" }))).length) { var c2 = t3.__getSymbol(); a2 = (c2 ? c2.__getSymbols() : t3.__getSymbols()) || [], (a2 = qe([], a2, true)).push(c2 || t3); } !s2 && this.__logSymbol("add", y2, { opts: n3, addedInstances: a2.map(function(t4) { return t4.cid; }), added: t3.cid }), y2.forEach(function(e4) { var r3 = e4.__getSymbTop(), i3 = a2.filter(function(t4) { var e5 = t4.__getSymbTop({ prev: 1 }); return r3 && e5 && e5 === r3; })[0] || t3.clone({ symbol: true, symbolInv: l2 }); e4.append(i3, $e({ fromInstance: o3 }, n3)); }); } else { var u2 = t3.__getSymbol(); if (u2 && !n3.temporary && u2.set(Ye, u2.__getSymbols().filter(function(e4) { return e4 !== t3; })), !t3.__isSymbolTop()) { var p2 = "components:remove", d2 = n3.index, f2 = t3.parent(), h2 = $e({ fromInstance: t3 }, n3), g2 = t3.__isSymbolNested(), v2 = function(t4) { var e4 = t4.parent(); e4 && !e4.__isSymbOvrd(p2) && t4.remove(h2); }; y2 = (null == f2 ? void 0 : f2.__isSymbOvrd(p2)) ? [] : t3.__getSymbToUp(i2); g2 && (y2 = null == f2 ? void 0 : f2.__getSymbToUp($e($e({}, i2), { changed: p2 })), v2 = function(t4) { var e4 = t4.components().at(d2); e4 && e4.remove($e({ fromInstance: f2 }, h2)); }), !s2 && this.__logSymbol("remove", y2, { opts: n3, removed: t3.cid, isSymbNested: g2 }), y2.forEach(v2); } } else { var y2 = this.__getSymbToUp($e($e({}, i2), { changed: "components:reset" })), m2 = t3.models; this.__logSymbol("reset", y2, { components: m2 }), y2.forEach(function(t4) { var n4 = m2.map(function(t5) { return t5.clone({ symbol: true }); }); t4.components().reset(n4, $e({ fromInstance: o3 }, e3)); }); } this.__changesUp(r2); }, o2.prototype.initClasses = function(e3, n3, o3) { void 0 === o3 && (o3 = {}); var r2 = this.get("attributes").class || [], i2 = [this, "change:classes", this.initClasses], s2 = this.get("classes") || r2, a2 = (0, t2.isString)(s2) ? s2.split(" ") : s2; this.stopListening.apply(this, i2); var l2 = this.normalizeClasses(a2), c2 = new Fe([]); return this.set("classes", c2, o3), c2.add(l2), c2.on("add remove reset", this.__upSymbCls), this.listenTo.apply(this, i2), this; }, o2.prototype.initComponents = function() { var e3 = [this, "change:components", this.initComponents]; this.stopListening.apply(this, e3); var n3 = new Pe([], this.opt); n3.parent = this; var o3 = this.get("components"), r2 = !this.opt.avoidChildren; return this.set("components", n3), r2 && o3 && n3.add((0, t2.isFunction)(o3) ? o3(this) : o3, this.opt), n3.on("add remove reset", this.__upSymbComps), this.listenTo.apply(this, e3), this; }, o2.prototype.initTraits = function(t3) { var e3 = this.em, n3 = "change:traits"; this.off(n3, this.initTraits), this.__loadTraits(); var o3 = $e({}, this.get("attributes")), r2 = this.traits; return r2.each(function(t4) { if (!t4.get("changeProp")) { var e4 = t4.get("name"), n4 = t4.getInitValue(); e4 && n4 && (o3[e4] = n4); } }), r2.length && this.set("attributes", o3), this.on(n3, this.initTraits), t3 && e3 && e3.trigger("component:toggled"), this; }, o2.prototype.initScriptProps = function() { if (!this.opt.temporary) { var t3 = "script-props", e3 = ["change:".concat(t3), this.initScriptProps]; this.off.apply(this, e3); var n3 = this.previous(t3) || [], o3 = this.get(t3) || [], r2 = n3.map(function(t4) { return "change:".concat(t4); }).join(" "), i2 = o3.map(function(t4) { return "change:".concat(t4); }).join(" "); r2 && this.off(r2, this.__scriptPropsChange), i2 && this.on(i2, this.__scriptPropsChange), this.on.apply(this, e3); } }, o2.prototype.__scriptPropsChange = function(t3, e3, n3) { void 0 === n3 && (n3 = {}), n3.avoidStore || this.trigger("rerender"); }, o2.prototype.append = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = ((0, t2.isArray)(e3) ? qe([], e3, true) : [e3]).map(function(e4) { return (0, t2.isString)(e4) || e4.collection && e4.collection.remove(e4, { temporary: true }), e4; }), r2 = this.components().add(o3, n3); return (0, t2.isArray)(r2) ? r2 : [r2]; }, o2.prototype.components = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.get("components"); return (0, t2.isUndefined)(e3) ? o3 : (o3.reset(void 0, n3), e3 ? this.append(e3, n3) : []); }, o2.prototype.getChildAt = function(t3) { return this.components().at(t3 || 0) || void 0; }, o2.prototype.getLastChild = function() { var t3 = this.components(); return t3.at(t3.length - 1) || null; }, o2.prototype.empty = function(t3) { return void 0 === t3 && (t3 = {}), this.components().reset(void 0, t3), this; }, o2.prototype.parent = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.collection || t3.prev && this.prevColl; return e3 ? e3.parent : void 0; }, o2.prototype.parents = function() { var t3 = this.parent(); return t3 ? [t3].concat(t3.parents()) : []; }, o2.prototype.scriptUpdated = function() { this.set("scriptUpdated", 1); }, o2.prototype.initToolbar = function() { var t3 = this.em, e3 = this, n3 = t3 && t3.getConfig().stylePrefix || ""; if (!e3.get("toolbar") && t3) { var o3 = []; e3.collection && o3.push({ label: t3.getIcon("arrowUp"), command: function(t4) { return t4.runCommand("core:component-exit", { force: 1 }); } }), e3.get("draggable") && o3.push({ attributes: { class: "".concat(n3, "no-touch-actions"), draggable: true }, label: t3.getIcon("move"), command: "tlb-move" }), e3.get("copyable") && o3.push({ label: t3.getIcon("copy"), command: "tlb-clone" }), e3.get("removable") && o3.push({ label: t3.getIcon("delete"), command: "tlb-delete" }), e3.set("toolbar", o3); } }, o2.prototype.__loadTraits = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = e3 || this.traits; if (!(o3 instanceof Ue)) { o3 = (0, t2.isFunction)(o3) ? o3(this) : o3; var r2 = new Ue([], this.opt); r2.setTarget(this), o3.length && (o3.forEach(function(t3) { return t3.attributes && delete t3.attributes.value; }), r2.add(o3)), this.set({ traits: r2 }, n3); } return this; }, o2.prototype.getTraits = function() { return this.__loadTraits(), qe([], this.traits.models, true); }, o2.prototype.setTraits = function(e3) { var n3 = (0, t2.isArray)(e3) ? e3 : [e3]; return this.set({ traits: n3 }), this.getTraits(); }, o2.prototype.getTrait = function(t3) { return this.getTraits().filter(function(e3) { return e3.get("id") === t3 || e3.get("name") === t3; })[0] || null; }, o2.prototype.updateTrait = function(t3, e3) { var n3, o3 = this.getTrait(t3); return o3 && o3.set(e3), null === (n3 = this.em) || void 0 === n3 || n3.trigger("component:toggled"), this; }, o2.prototype.getTraitIndex = function(t3) { var e3 = this.getTrait(t3); return e3 ? this.traits.indexOf(e3) : -1; }, o2.prototype.removeTrait = function(e3) { var n3, o3 = this, r2 = ((0, t2.isArray)(e3) ? e3 : [e3]).map(function(t3) { return o3.getTrait(t3); }), i2 = this.traits, s2 = r2.length ? i2.remove(r2) : []; return null === (n3 = this.em) || void 0 === n3 || n3.trigger("component:toggled"), (0, t2.isArray)(s2) ? s2 : [s2]; }, o2.prototype.addTrait = function(e3, n3) { var o3; void 0 === n3 && (n3 = {}), this.__loadTraits(); var r2 = this.traits.add(e3, n3); return null === (o3 = this.em) || void 0 === o3 || o3.trigger("component:toggled"), (0, t2.isArray)(r2) ? r2 : [r2]; }, o2.prototype.normalizeClasses = function(t3) { var e3 = [], n3 = this.em, o3 = null == n3 ? void 0 : n3.Selectors; return o3 ? t3.models ? qe([], t3.models, true) : (t3.forEach(function(t4) { return e3.push(o3.add(t4)); }), e3) : []; }, o2.prototype.clone = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.em, n3 = $e({}, this.attributes), o3 = $e({}, this.opt), r2 = this.getId(), i2 = null == e3 ? void 0 : e3.Css; n3.attributes = $e({}, n3.attributes), delete n3.attributes.id, n3.components = [], n3.classes = [], n3.traits = [], this.__isSymbolTop() && (t3.symbol = true), this.get("components").each(function(e4, o4) { n3.components[o4] = e4.clone($e($e({}, t3), { _inner: 1 })); }), this.get("traits").each(function(t4, e4) { n3.traits[e4] = t4.clone(); }), this.get("classes").each(function(t4, e4) { n3.classes[e4] = t4.get("name"); }), n3.status = "", o3.collection = null; var s2 = new this.constructor(n3, o3), a2 = "#".concat(s2.getId()); (i2 ? i2.getRules("#".concat(r2)) : []).forEach(function(t4) { var e4 = t4.clone(); e4.set("selectors", [a2]), i2.getAll().add(e4); }), s2.set(Ye, 0); var l2 = this.__getSymbol(), c2 = this.__getSymbols(); t3.symbol || !l2 && !c2 ? l2 ? (l2.set(Ye, qe(qe([], l2.__getSymbols(), true), [s2], false)), s2.__initSymb()) : t3.symbol && (this.__isSymbol() ? (this.set(Ye, qe(qe([], c2, true), [s2], false)), s2.set(Xe, this), s2.__initSymb()) : t3.symbolInv ? (this.set(Ye, [s2]), s2.set(Xe, this), [this, s2].map(function(t4) { return t4.__initSymb(); })) : (s2.set(Ye, [this]), [this, s2].map(function(t4) { return t4.__initSymb(); }), this.set(Xe, s2))) : (s2.set(Xe, 0), s2.set(Ye, 0)); var u2 = "component:clone"; return e3 && e3.trigger(u2, s2), this.trigger(u2, s2), s2; }, o2.prototype.getName = function(t3) { void 0 === t3 && (t3 = {}); var n3 = this.em, o3 = this.attributes, r2 = o3.type, i2 = o3.tagName, s2 = o3.name, a2 = r2 || i2, l2 = r2 ? "" : i2, c2 = "domComponents.names.", u2 = s2 && (null == n3 ? void 0 : n3.t("".concat(c2).concat(s2))), p2 = l2 && (null == n3 ? void 0 : n3.t("".concat(c2).concat(l2))), d2 = n3 && (n3.t("".concat(c2).concat(r2)) || n3.t("".concat(c2).concat(i2))), f2 = this.get("custom-name"); return (t3.noCustom ? "" : f2) || u2 || s2 || p2 || (0, e2.capitalize)(l2) || d2 || (0, e2.capitalize)(a2); }, o2.prototype.getIcon = function() { var t3 = this.get("icon"); return t3 ? t3 + " " : ""; }, o2.prototype.toHTML = function(n3) { void 0 === n3 && (n3 = {}); var o3 = this, r2 = [], i2 = n3.tag || o3.get("tagName"), s2 = o3.get("void"), a2 = n3.attributes, l2 = this.getAttrToHTML(); if (delete n3.tag, a2 && ((0, t2.isFunction)(a2) ? l2 = a2(o3, l2) || {} : (0, e2.isObject)(a2) && (l2 = a2)), n3.withProps) { var c2 = this.toJSON(); (0, t2.forEach)(c2, function(n4, o4) { "_" !== o4[0] && ["classes", "attributes", "components"].indexOf(o4) < 0 && (l2["data-gjs-".concat(o4)] = (0, t2.isArray)(n4) || (0, e2.isObject)(n4) ? JSON.stringify(n4) : n4); }); } for (var u2 in l2) { var p2 = l2[u2]; if (!(0, t2.isUndefined)(p2) && null !== p2) if ((0, t2.isBoolean)(p2)) p2 && r2.push(u2); else { var d2 = ""; if (n3.altQuoteAttr && (0, t2.isString)(p2) && p2.indexOf('"') >= 0) d2 = "'".concat(p2.replace(/'/g, "'"), "'"); else { var f2 = (0, t2.isString)(p2) ? p2.replace(/"/g, """) : p2; d2 = '"'.concat(f2, '"'); } r2.push("".concat(u2, "=").concat(d2)); } } var h2 = r2.length ? " ".concat(r2.join(" ")) : "", g2 = o3.getInnerHTML(n3), v2 = "<".concat(i2).concat(h2).concat(s2 ? "/" : "", ">").concat(g2); return !s2 && (v2 += "")), v2; }, o2.prototype.getInnerHTML = function(t3) { return this.__innerHTML(t3); }, o2.prototype.__innerHTML = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.components(); return e3.length ? e3.map(function(e4) { return e4.toHTML(t3); }).join("") : this.get("content"); }, o2.prototype.getAttrToHTML = function() { var t3 = this.getAttributes(); return delete t3.style, t3; }, o2.prototype.toJSON = function(e3) { void 0 === e3 && (e3 = {}); var n3 = s.Model.prototype.toJSON.call(this, e3); if (n3.attributes = this.getAttributes(), delete n3.attributes.class, delete n3.toolbar, delete n3.traits, delete n3.status, delete n3.open, delete n3._undoexc, !e3.fromUndo) { var o3 = n3[Xe], r2 = n3[Ye]; r2 && (0, t2.isArray)(r2) && (n3[Ye] = r2.filter(function(t3) { return t3; }).map(function(t3) { return t3.getId ? t3.getId() : t3; })), o3 && !(0, t2.isString)(o3) && (n3[Xe] = o3.getId()); } return this.em.getConfig().avoidDefaults && this.getChangedProps(n3), n3; }, o2.prototype.getChangedProps = function(e3) { var n3 = e3 || s.Model.prototype.toJSON.apply(this), o3 = (0, t2.result)(this, "defaults"); return (0, t2.forEach)(o3, function(t3, e4) { -1 === ["type"].indexOf(e4) && n3[e4] === t3 && delete n3[e4]; }), (0, t2.isEmpty)(n3.type) && delete n3.type, (0, t2.forEach)(["attributes", "style"], function(e4) { (0, t2.isEmpty)(o3[e4]) && (0, t2.isEmpty)(n3[e4]) && delete n3[e4]; }), (0, t2.forEach)(["classes", "components"], function(e4) { (!n3[e4] || (0, t2.isEmpty)(o3[e4]) && !n3[e4].length) && delete n3[e4]; }), n3; }, o2.prototype.getId = function() { return (this.get("attributes") || {}).id || this.ccid || this.cid; }, o2.prototype.setId = function(t3, e3) { var n3 = $e({}, this.get("attributes")); return n3.id = t3, this.set("attributes", n3, e3), this; }, o2.prototype.getEl = function(t3) { void 0 === t3 && (t3 = void 0); var e3 = this.getView(t3); return e3 && e3.el; }, o2.prototype.getView = function(t3) { var e3 = this.view, n3 = this.views; return t3 && (e3 = n3.filter(function(e4) { return e4._getFrame() === t3.view; })[0]), e3; }, o2.prototype.getCurrentView = function() { var t3 = (this.em.get("currentFrame") || {}).model; return this.getView(t3); }, o2.prototype.__getScriptProps = function() { var t3 = this.props(); return (this.get("script-props") || []).reduce(function(e3, n3) { return e3[n3] = t3[n3], e3; }, {}); }, o2.prototype.getScriptString = function(e3) { var n3 = this, o3 = e3 || this.get("script") || ""; if (!o3) return o3; if (this.get("script-props")) o3 = o3.toString().trim(); else { if ("function" == typeof o3) { var r2 = o3.toString().trim(); o3 = (r2 = r2.replace(/^function[\s\w]*\(\)\s?\{/, "").replace(/\}$/, "")).trim(); } var i2 = this.em.getConfig(), s2 = Ge(i2.tagVarStart || "{[ "), a2 = Ge(i2.tagVarEnd || " ]}"), l2 = new RegExp("".concat(s2, "([\\w\\d-]*)").concat(a2), "g"); o3 = o3.replace(l2, function(e4, o4) { n3.scriptUpdated(); var r3 = n3.attributes[o4] || ""; return (0, t2.isArray)(r3) || "object" == typeof r3 ? JSON.stringify(r3) : r3; }); } return o3; }, o2.prototype.emitUpdate = function(t3) { for (var e3, n3 = [], o3 = 1; o3 < arguments.length; o3++) n3[o3 - 1] = arguments[o3]; var r2 = this.em, i2 = Ze + (t3 ? ":".concat(t3) : ""), s2 = t3 && this.get(t3); t3 && this.updated.apply(this, qe([t3, s2, t3 && this.previous(t3)], n3, false)), this.trigger.apply(this, qe([i2], n3, false)), r2 && r2.trigger.apply(r2, qe([i2, this], n3, false)), ["components", "classes"].indexOf(t3) >= 0 && this.__propSelfToParent({ component: this, changed: (e3 = {}, e3[t3] = s2, e3), options: n3[2] || n3[1] || {} }); }, o2.prototype.onAll = function(e3) { return (0, t2.isFunction)(e3) && (e3(this), this.components().forEach(function(t3) { return t3.onAll(e3); })), this; }, o2.prototype.forEachChild = function(e3) { (0, t2.isFunction)(e3) && this.components().forEach(function(t3) { e3(t3), t3.forEachChild(e3); }); }, o2.prototype.remove = function(t3) { var e3 = this; void 0 === t3 && (t3 = {}); var n3 = this.em, o3 = this.collection, r2 = function() { o3 && o3.remove(e3, $e($e({}, t3), { action: "remove-component" })), o3 || (e3.components("", t3), e3.components().removeChildren(e3, void 0, t3)); }, i2 = $e({}, t3); return [this, n3].map(function(t4) { return t4.trigger("component:remove:before", e3, r2, i2); }), !i2.abort && r2(), this; }, o2.prototype.move = function(t3, e3) { if (void 0 === e3 && (e3 = {}), t3) { var n3 = e3.at, o3 = this.index(), r2 = t3 === this.parent(); r2 && (o3 === n3 || o3 === n3 - 1) || (r2 && n3 && n3 > o3 && (e3.at = n3 - 1), this.remove({ temporary: 1 }), t3.append(this, e3), this.emitUpdate()); } return this; }, o2.prototype.isInstanceOf = function(t3) { var e3, n3, o3 = null === (n3 = null === (e3 = this.em) || void 0 === e3 ? void 0 : e3.Components.getType(t3)) || void 0 === n3 ? void 0 : n3.model; return !!o3 && this instanceof o3; }, o2.prototype.isChildOf = function(e3) { for (var n3 = (0, t2.isString)(e3), o3 = this.parent(); o3; ) { if (n3) { if (o3.isInstanceOf(e3)) return true; } else if (o3 === e3) return true; o3 = o3.parent(); } return false; }, o2.prototype.resetId = function(t3) { var e3 = this.em, n3 = this.getId(); if (!n3) return this; var r2 = o2.createId(this); this.setId(r2); var i2 = null == e3 ? void 0 : e3.Css.getIdRule(n3), s2 = null == i2 ? void 0 : i2.get("selectors").at(0); return null == s2 || s2.set("name", r2), this; }, o2.prototype._getStyleRule = function(t3) { var e3 = (void 0 === t3 ? {} : t3).id, n3 = this.em, o3 = e3 || this.getId(); return null == n3 ? void 0 : n3.Css.getIdRule(o3); }, o2.prototype._getStyleSelector = function(t3) { var e3 = this._getStyleRule(t3); return null == e3 ? void 0 : e3.get("selectors").at(0); }, o2.prototype._idUpdated = function(t3, e3, n3) { if (void 0 === n3 && (n3 = {}), !n3.idUpdate) { var r2 = this.ccid, i2 = (this.get("attributes") || {}).id, s2 = (this.previous("attributes") || {}).id || r2, a2 = o2.getList(this); if (a2[i2] || !i2 && s2) return this.setId(s2, { idUpdate: true }); delete a2[s2], a2[i2] = this, this.ccid = i2; var l2 = this._getStyleSelector({ id: s2 }); l2 && l2.set({ name: i2, label: i2 }); } }, o2.getDefaults = function() { return (0, t2.result)(this.prototype, "defaults"); }, o2.isComponent = function(t3) { return { tagName: (0, e2.toLowerCase)(t3.tagName) }; }, o2.ensureInList = function(t3) { var e3 = o2.getList(t3), n3 = t3.getId(), r2 = e3[n3]; if (r2) { if (r2 !== t3) { var i2 = o2.getIncrementId(n3, e3); t3.setId(i2), e3[i2] = t3; } } else e3[n3] = t3; t3.components().forEach(function(t4) { return o2.ensureInList(t4); }); }, o2.createId = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3, r2 = o2.getList(t3), i2 = e3.idMap, s2 = void 0 === i2 ? {} : i2, a2 = t3.get("attributes").id; return a2 ? (n3 = o2.getIncrementId(a2, r2, e3), t3.setId(n3), a2 !== n3 && (s2[a2] = n3)) : n3 = o2.getNewId(r2), r2[n3] = t3, n3; }, o2.getNewId = function(t3) { for (var e3 = Object.keys(t3).length.toString().length + 2, n3 = (Math.random() + 1.1).toString(36).slice(-e3), r2 = "i".concat(n3); t3[r2]; ) r2 = o2.getNewId(t3); return r2; }, o2.getIncrementId = function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = n3.keepIds, r2 = 1, i2 = t3; if ((void 0 === o3 ? [] : o3).indexOf(t3) < 0) for (; e3[i2]; ) r2++, i2 = "".concat(t3, "-").concat(r2); return i2; }, o2.getList = function(t3) { var e3 = t3.opt, n3 = void 0 === e3 ? {} : e3, o3 = n3.domc, r2 = n3.em, i2 = o3 || (null == r2 ? void 0 : r2.Components); return i2 ? i2.componentsById : {}; }, o2.checkId = function(e3, n3, r2, i2) { void 0 === n3 && (n3 = []), void 0 === r2 && (r2 = {}), void 0 === i2 && (i2 = {}); var s2 = (0, t2.isArray)(e3) ? e3 : [e3], a2 = i2.keepIds, l2 = void 0 === a2 ? [] : a2; s2.forEach(function(e4) { e4.attributes; var s3 = e4.attributes, a3 = void 0 === s3 ? {} : s3, c2 = e4.components, u2 = a3.id; if (u2 && r2[u2] && l2.indexOf(u2) < 0) { var p2 = o2.getIncrementId(u2, r2); a3.id = p2, (0, t2.isArray)(n3) && n3.forEach(function(t3) { var e5 = t3.selectors; e5.forEach(function(t4, n4) { t4 === "#".concat(u2) && (e5[n4] = "#".concat(p2)); }); }); } c2 && o2.checkId(c2, n3, r2, i2); }); }, o2; }(_e); const en = tn; var nn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), on = function(e3) { function n2() { var t3 = null !== e3 && e3.apply(this, arguments) || this; return t3.compView = cn, t3; } return nn(n2, e3), n2.prototype.initialize = function(t3) { this.opts = t3 || {}, this.config = t3.config || {}, this.em = this.config.em; var e4 = this.collection; this.listenTo(e4, "add", this.addTo), this.listenTo(e4, "reset", this.resetChildren), this.listenTo(e4, "remove", this.removeChildren); }, n2.prototype.removeChildren = function(t3, e4, n3) { var o2 = this; void 0 === n3 && (n3 = {}), t3.views.forEach(function(t4) { if (t4) { var e5 = t4.childrenView, n4 = t4.scriptContainer; e5 && e5.stopListening(), (0, Et.L_)(n4), t4.remove.apply(t4); } }), t3.components().forEach(function(t4) { return o2.removeChildren(t4, e4, n3); }); }, n2.prototype.addTo = function(t3, e4, n3) { void 0 === n3 && (n3 = {}); var o2 = this.em, r2 = this.collection.indexOf(t3); if (this.addToCollection(t3, null, r2), o2 && !n3.temporary) { var i2 = function(t4) { o2.trigger("component:add", t4), t4.components().forEach(function(t5) { return i2(t5); }); }; i2(t3); } }, n2.prototype.addToCollection = function(e4, n3, o2) { for (var r2 = this, i2 = r2.config, s2 = r2.opts, a2 = r2.em, l2 = n3 || null, c2 = i2.frameView, u2 = (null == c2 ? void 0 : c2.model) && e4.getView(c2.model), p2 = s2.componentTypes || (null == a2 ? void 0 : a2.Components.getTypes()), d2 = e4.get("type") || "default", f2 = this.compView, h2 = 0; h2 < p2.length; h2++) if (p2[h2].id == d2) { f2 = p2[h2].view; break; } var g2, v2 = u2 || new f2({ model: e4, config: i2, componentTypes: p2 }); try { g2 = v2.render().el; } catch (t3) { g2 = document.createTextNode(""), a2.logError(t3); } if (l2) l2.appendChild(g2); else { var y2 = this.parentEl, m2 = y2.childNodes; if ((0, t2.isUndefined)(o2)) y2.appendChild(g2); else { var b2 = m2.length == o2; b2 && o2--, b2 || !m2.length ? y2.appendChild(g2) : y2.insertBefore(g2, m2[o2]); } } return e4.opt.temporary || null == a2 || a2.trigger("component:mount", e4), g2; }, n2.prototype.resetChildren = function(t3, e4) { var n3 = this, o2 = (void 0 === e4 ? {} : e4).previousModels, r2 = void 0 === o2 ? [] : o2; this.parentEl.innerHTML = "", r2.forEach(function(t4) { return n3.removeChildren(t4, n3.collection); }), t3.each(function(t4) { return n3.addToCollection(t4); }); }, n2.prototype.render = function(t3) { var e4 = this, n3 = this.el, o2 = document.createDocumentFragment(); return this.parentEl = t3 || this.el, this.collection.each(function(t4) { return e4.addToCollection(t4, o2); }), n3.innerHTML = "", n3.appendChild(o2), this; }, n2; }(u.G7); const rn = on; var sn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), an = function() { return an = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, an.apply(this, arguments); }, ln = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return sn(o2, n2), o2.prototype.className = function() { return this.getClasses(); }, o2.prototype.tagName = function() { return this.model.get("tagName"); }, o2.prototype.initialize = function(t3) { void 0 === t3 && (t3 = {}); var n3 = this.model, o3 = t3.config || {}, r2 = o3.em, i2 = n3.opt || {}, s2 = this.$el, a2 = this.el; this.opts = t3, this.modelOpt = i2, this.config = o3, this.em = r2, this.pfx = o3.stylePrefix || "", this.ppfx = o3.pStylePrefix || "", this.attr = n3.get("attributes"), this.classe = this.attr.class || [], this.listenTo(n3, "change:style", this.updateStyle), this.listenTo(n3, "change:attributes", this.renderAttributes), this.listenTo(n3, "change:highlightable", this.updateHighlight), this.listenTo(n3, "change:status change:locked", this.updateStatus), this.listenTo(n3, "change:script rerender", this.reset), this.listenTo(n3, "change:content", this.updateContent), this.listenTo(n3, "change", this.handleChange), this.listenTo(n3, "active", this.onActive), this.listenTo(n3, "disable", this.onDisable), s2.data("model", n3), (0, e2.setViewEl)(a2, this), n3.view = this, this._getFrame() && n3.views.push(this), this.initClasses(), this.initComponents({ avoidRender: true }), this.events = an(an({}, this.constructor.getEvents()), { dragstart: "handleDragStart" }), this.delegateEvents(), !i2.temporary && this.init(this._clbObj()); }, o2.prototype.__isDraggable = function() { var t3 = this.model, e3 = this.config, n3 = t3.attributes.draggable; return e3.draggableComponents && n3; }, o2.prototype._clbObj = function() { var t3 = this, e3 = t3.em, n3 = t3.model, o3 = t3.el; return { editor: null == e3 ? void 0 : e3.getEditor(), model: n3, el: o3 }; }, o2.prototype.init = function(t3) { }, o2.prototype.removed = function(t3) { }, o2.prototype.onRender = function(t3) { }, o2.prototype.onActive = function(t3) { }, o2.prototype.onDisable = function() { }, o2.prototype.remove = function() { var t3; n2.prototype.remove.call(this); var e3 = this.model, o3 = this.$el, r2 = e3.views, i2 = this._getFrame() || {}; return e3.components().forEach(function(t4) { var e4 = t4.getView(i2.model); null == e4 || e4.remove(); }), null === (t3 = this.childrenView) || void 0 === t3 || t3.remove(), r2.splice(r2.indexOf(this), 1), this.removed(this._clbObj()), o3.data({ model: "", collection: "", view: "" }), this; }, o2.prototype.handleDragStart = function(t3) { if (!this.__isDraggable()) return false; t3.stopPropagation(), t3.preventDefault(), this.em.Commands.run("tlb-move", { target: this.model, event: t3 }); }, o2.prototype.initClasses = function() { var t3 = this.model, e3 = "change:classes", n3 = t3.get("classes"); n3 instanceof Fe && (this.stopListening(t3, e3, this.initClasses), this.listenTo(t3, e3, this.initClasses), this.listenTo(n3, "add remove change", this.updateClasses), n3.length && this.importClasses()); }, o2.prototype.initComponents = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this, n3 = e3.model, o3 = e3.$el, r2 = e3.childrenView, i2 = n3.get("components"), s2 = [n3, "change:components", this.initComponents]; i2 instanceof Pe && (o3.data("collection", i2), r2 && r2.remove(), this.stopListening.apply(this, s2), !t3.avoidRender && this.renderChildren(), this.listenTo.apply(this, s2)); }, o2.prototype.handleChange = function() { var e3 = this.model, n3 = (0, t2.keys)(e3.changed); if (1 !== n3.length || "status" !== n3[0]) for (var o3 in e3.emitUpdate(), e3.changed) e3.emitUpdate(o3); }, o2.prototype.importClasses = function() { var t3 = this.em.Selectors; t3 && this.model.classes.each(function(e3) { t3.add(e3.get("name")); }); }, o2.prototype.updateStatus = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this, n3 = e3.em, o3 = e3.el, r2 = e3.ppfx, i2 = e3.model, s2 = null == n3 ? void 0 : n3.Canvas.getConfig().extHl, a2 = i2.get("status"), l2 = "".concat(r2, "selected"), c2 = "".concat(l2, "-parent"), u2 = "".concat(r2, "freezed"), p2 = "".concat(r2, "hovered"), d2 = "".concat(r2, "no-pointer"), f2 = [l2, c2, u2, p2, d2], h2 = s2 && !t3.noExtHl ? "" : l2; this.$el.removeClass(f2.join(" ")); var g2 = [o3.getAttribute("class") || ""]; switch (a2) { case "selected": g2.push(h2); break; case "selected-parent": g2.push(c2); break; case "freezed": g2.push(u2); break; case "freezed-selected": g2.push(u2, h2); break; case "hovered": !t3.avoidHover && g2.push(p2); } i2.get("locked") && g2.push(d2); var v2 = g2.filter(Boolean).join(" "); v2 && o3.setAttribute("class", v2); }, o2.prototype.updateHighlight = function() { var t3 = this.model, e3 = t3.get("textable"), n3 = t3.get("highlightable") && (e3 || !t3.isChildOf("text")); this.setAttribute("data-gjs-highlightable", !!n3 || ""); }, o2.prototype.updateStyle = function(e3, n3, o3) { void 0 === o3 && (o3 = {}); var r2 = this.model, i2 = this.em; if (i2 && i2.getConfig().avoidInlineStyle && !o3.inline) { var s2 = r2.getStyle(); !(0, t2.isEmpty)(s2) && r2.setStyle(s2); } else this.setAttribute("style", r2.styleToString(o3)); }, o2.prototype.updateClasses = function() { var t3 = this.model.classes.pluck("name").join(" "); this.setAttribute("class", t3), this.updateStatus(), this.onAttrUpdate(); }, o2.prototype.setAttribute = function(t3, e3) { var n3 = this.$el; e3 ? n3.attr(t3, e3) : n3.removeAttr(t3); }, o2.prototype.getClasses = function() { return this.model.getClasses().join(" "); }, o2.prototype.updateAttributes = function() { var e3 = [], n3 = this, o3 = n3.model, r2 = n3.$el, i2 = n3.el, s2 = o3.attributes, a2 = s2.textable, l2 = s2.type, c2 = an(an({ id: o3.getId(), "data-gjs-type": l2 || "default" }, this.__isDraggable() && { draggable: true }), a2 && { contenteditable: "false" }); (0, t2.each)(i2.attributes, function(t3) { return e3.push(t3.nodeName); }), e3.forEach(function(t3) { return r2.removeAttr(t3); }), this.updateStyle(), this.updateHighlight(); var u2 = an(an({}, c2), o3.getAttributes()); (0, t2.keys)(u2).forEach(function(t3) { return false === u2[t3] && delete u2[t3]; }), r2.attr(u2); }, o2.prototype.updateContent = function() { var t3 = this.model.get("content"), e3 = this.model.components().length; this.getChildrenContainer().innerHTML = e3 ? "" : t3; }, o2.prototype.prevDef = function(t3) { t3.preventDefault(); }, o2.prototype.updateScript = function() { var t3 = this.model, e3 = this.em; t3.get("script") && (null == e3 || e3.Canvas.getCanvasView().updateScript(this)); }, o2.prototype.getChildrenContainer = function() { var t3 = this.el; return "function" == typeof this.getChildrenSelector ? t3 = this.el.querySelector(this.getChildrenSelector()) : this.getTemplate, t3; }, o2.prototype.getOffsetRect = function() { var t3 = {}, e3 = this.el, n3 = 0, o3 = 0, r2 = function(i2) { var s2 = i2.offsetParent; s2 ? (n3 += s2.offsetTop, o3 += s2.offsetLeft, r2(s2)) : (t3.top = e3.offsetTop + n3, t3.left = e3.offsetLeft + o3, t3.bottom = t3.top + e3.offsetHeight, t3.right = t3.left + e3.offsetWidth); }; return r2(e3), t3; }, o2.prototype.isInViewport = function(t3) { var e3, n3 = (void 0 === t3 ? {} : t3).rect, o3 = this.el.ownerDocument, r2 = o3.body, i2 = null === (e3 = o3.defaultView) || void 0 === e3 ? void 0 : e3.frameElement, s2 = n3 || this.getOffsetRect(), a2 = s2.top, l2 = s2.left, c2 = this._getFrame().getOffsetRect(); return a2 >= c2.scrollTop && l2 >= c2.scrollLeft && a2 <= c2.scrollBottom && l2 <= (null == i2 ? void 0 : i2.offsetWidth) + r2.scrollLeft; }, o2.prototype.scrollIntoView = function(t3) { var e3; void 0 === t3 && (t3 = {}); var n3 = this.getOffsetRect(); if (!this.isInViewport({ rect: n3 }) || t3.force) { var o3 = this.el; "smooth" !== t3.behavior ? null === (e3 = o3.ownerDocument.defaultView) || void 0 === e3 || e3.scrollTo(0, n3.top) : o3.scrollIntoView(an({ behavior: "smooth", block: "nearest" }, t3)); } }, o2.prototype.reset = function() { var t3 = this.el; this.el = "", this._ensureElement(), this._setData(), (0, Et.dL)(t3, this.el), this.render(); }, o2.prototype._setData = function() { var t3 = this.model, e3 = t3.components(); this.$el.data({ model: t3, collection: e3, view: this }); }, o2.prototype._getFrame = function() { var t3; return null === (t3 = this.em) || void 0 === t3 ? void 0 : t3.get("Canvas").config.frameView; }, o2.prototype.renderChildren = function() { this.updateContent(); var t3 = this.getChildrenContainer(), e3 = this.childrenView || new rn({ collection: this.model.get("components"), config: this.config, componentTypes: this.opts.componentTypes }); e3.render(t3), this.childrenView = e3; for (var n3 = Array.prototype.slice.call(e3.el.childNodes), o3 = 0, r2 = n3.length; o3 < r2; o3++) t3.appendChild(n3.shift()); }, o2.prototype.renderAttributes = function() { this.updateAttributes(), this.updateClasses(); }, o2.prototype.onAttrUpdate = function() { }, o2.prototype.render = function() { return this.renderAttributes(), this.modelOpt.temporary || (this.renderChildren(), this.updateScript(), (0, e2.setViewEl)(this.el, this), this.postRender()), this; }, o2.prototype.postRender = function() { this.modelOpt.temporary || this.onRender(this._clbObj()); }, o2.getEvents = function() { return (0, t2.result)(this.prototype, "events"); }, o2; }(u.G7); const cn = ln; var un = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const pn = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return un(e3, t3), e3.prototype.tagName = function() { return "div"; }, e3; }(cn); var dn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), fn = function() { return fn = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, fn.apply(this, arguments); }; const hn = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return dn(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return fn(fn({}, t3.prototype.defaults), { type: "cell", tagName: "td", draggable: ["tr"] }); }, enumerable: false, configurable: true }), n2.isComponent = function(t4) { return ["td", "th"].indexOf((0, e2.toLowerCase)(t4.tagName)) >= 0; }, n2; }(en); var gn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const vn = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return gn(e3, t3), e3; }(cn); var yn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), mn = function() { return mn = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, mn.apply(this, arguments); }, bn = "tr"; const _n = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return yn(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return mn(mn({}, t3.prototype.defaults), { tagName: bn, draggable: ["thead", "tbody", "tfoot"], droppable: ["th", "td"] }); }, enumerable: false, configurable: true }), n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === bn; }, n2; }(en); var wn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const xn = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return wn(e3, t3), e3; }(cn); var Cn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Sn = function() { return Sn = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Sn.apply(this, arguments); }, On = "table"; const Tn = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return Cn(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return Sn(Sn({}, t3.prototype.defaults), { type: On, tagName: On, droppable: ["tbody", "thead", "tfoot"] }); }, enumerable: false, configurable: true }), n2.prototype.initialize = function(e3, n3) { t3.prototype.initialize.call(this, e3, n3); var o2 = this.get("components"); !o2.length && o2.add({ type: "tbody" }); }, n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === On; }, n2; }(en), kn = cn.extend({ events: {} }); var Pn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), En = function() { return En = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, En.apply(this, arguments); }, An = "tbody"; const jn = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return Pn(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return En(En({}, t3.prototype.defaults), { type: An, tagName: An, draggable: ["table"], droppable: ["tr"], columns: 1, rows: 1 }); }, enumerable: false, configurable: true }), n2.prototype.initialize = function(e3, n3) { t3.prototype.initialize.call(this, e3, n3); var o2 = this.get("components"), r2 = this.get("columns"), i2 = this.get("rows"); if (!o2.length) { for (var s2 = []; i2--; ) { for (var a2 = [], l2 = r2; l2--; ) a2.push({ type: "cell", classes: ["cell"] }); s2.push({ type: "row", classes: ["row"], components: a2 }); } o2.add(s2); } }, n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === An; }, n2; }(en); var Mn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ln = function() { return Ln = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ln.apply(this, arguments); }, Dn = "thead"; const Nn = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return Mn(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return Ln(Ln({}, t3.prototype.defaults), { type: Dn, tagName: Dn }); }, enumerable: false, configurable: true }), n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === Dn; }, n2; }(jn); var In = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Fn = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return In(e3, t3), e3; }(cn); var Vn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Rn = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Vn(e3, t3), e3; }(cn); var Hn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), zn = function() { return zn = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, zn.apply(this, arguments); }, Bn = "tfoot"; const Un = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return Hn(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return zn(zn({}, t3.prototype.defaults), { type: Bn, tagName: Bn }); }, enumerable: false, configurable: true }), n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === Bn; }, n2; }(jn); var Wn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const $n = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Wn(e3, t3), e3; }(cn); var qn = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Gn = function() { return Gn = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Gn.apply(this, arguments); }, Kn = '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)"', Yn = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return qn(o2, n2), Object.defineProperty(o2.prototype, "defaults", { get: function() { return Gn(Gn({}, n2.prototype.defaults), { type: "image", tagName: "img", void: true, droppable: 0, editable: 1, highlightable: 0, resizable: { ratioDefault: 1 }, traits: ["alt"], src: "\n \n '), fallback: "\n \n '), file: "" }); }, enumerable: false, configurable: true }), o2.prototype.initialize = function(o3, r2) { n2.prototype.initialize.call(this, o3, r2); var i2 = this.get("attributes").src; i2 && (0, e2.buildBase64UrlFromSvg)((0, t2.result)(this, "defaults").src) !== i2 && this.set("src", i2, { silent: true }); }, o2.prototype.initToolbar = function() { n2.prototype.initToolbar.call(this); var t3 = this.em; if (t3) { var e3 = "image-editor"; if (t3.Commands.has(e3)) { for (var o3 = false, r2 = this.get("toolbar"), i2 = 0; i2 < r2.length; i2++) if ("image-editor" === r2[i2].command) { o3 = true; break; } o3 || (r2.push({ attributes: { class: "fa fa-pencil" }, command: e3 }), this.set("toolbar", r2)); } } }, o2.prototype.getAttrToHTML = function() { var t3 = n2.prototype.getAttrToHTML.call(this), e3 = this.getSrcResult(); return e3 && (t3.src = e3), t3; }, o2.prototype.getSrcResult = function(t3) { void 0 === t3 && (t3 = {}); var n3 = this.get(t3.fallback ? "fallback" : "src") || "", o3 = n3; return n3 && "= 0) && delete r2.editable; }); } return r2; }, o2; }(lo); const ho = fo; var go = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), vo = function() { return vo = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, vo.apply(this, arguments); }, yo = function(t3, e3, n2, o2) { return new (n2 || (n2 = Promise))(function(r2, i2) { function s2(t4) { try { l2(o2.next(t4)); } catch (t5) { i2(t5); } } function a2(t4) { try { l2(o2["throw"](t4)); } catch (t5) { i2(t5); } } function l2(t4) { var e4; t4.done ? r2(t4.value) : (e4 = t4.value, e4 instanceof n2 ? e4 : new n2(function(t5) { t5(e4); })).then(s2, a2); } l2((o2 = o2.apply(t3, e3 || [])).next()); }); }, mo = function(t3, e3) { var n2, o2, r2, i2, s2 = { label: 0, sent: function() { if (1 & r2[0]) throw r2[1]; return r2[1]; }, trys: [], ops: [] }; return i2 = { next: a2(0), throw: a2(1), return: a2(2) }, "function" == typeof Symbol && (i2[Symbol.iterator] = function() { return this; }), i2; function a2(a3) { return function(l2) { return function(a4) { if (n2) throw new TypeError("Generator is already executing."); for (; i2 && (i2 = 0, a4[0] && (s2 = 0)), s2; ) try { if (n2 = 1, o2 && (r2 = 2 & a4[0] ? o2["return"] : a4[0] ? o2["throw"] || ((r2 = o2["return"]) && r2.call(o2), 0) : o2.next) && !(r2 = r2.call(o2, a4[1])).done) return r2; switch (o2 = 0, r2 && (a4 = [2 & a4[0], r2.value]), a4[0]) { case 0: case 1: r2 = a4; break; case 4: return s2.label++, { value: a4[1], done: false }; case 5: s2.label++, o2 = a4[1], a4 = [0]; continue; case 7: a4 = s2.ops.pop(), s2.trys.pop(); continue; default: if (!(r2 = s2.trys, (r2 = r2.length > 0 && r2[r2.length - 1]) || 6 !== a4[0] && 2 !== a4[0])) { s2 = 0; continue; } if (3 === a4[0] && (!r2 || a4[1] > r2[0] && a4[1] < r2[3])) { s2.label = a4[1]; break; } if (6 === a4[0] && s2.label < r2[1]) { s2.label = r2[1], r2 = a4; break; } if (r2 && s2.label < r2[2]) { s2.label = r2[2], s2.ops.push(a4); break; } r2[2] && s2.ops.pop(), s2.trys.pop(); continue; } a4 = e3.call(t3, s2); } catch (t4) { a4 = [6, t4], o2 = 0; } finally { n2 = r2 = 0; } if (5 & a4[0]) throw a4[1]; return { value: a4[0] ? a4[1] : void 0, done: true }; }([a3, l2]); }; } }, bo = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return go(o2, n2), o2.prototype.events = function() { return { dblclick: "onActive", input: "onInput" }; }, o2.prototype.initialize = function(e3) { n2.prototype.initialize.call(this, e3), (0, t2.bindAll)(this, "disableEditing", "onDisable"); var o3 = this.model, r2 = this.em; this.listenTo(o3, "focus", this.onActive), this.listenTo(o3, "change:content", this.updateContentText), this.listenTo(o3, "sync:content", this.syncContent), this.rte = null == r2 ? void 0 : r2.RichTextEditor; }, o2.prototype.updateContentText = function(t3, e3, n3) { void 0 === n3 && (n3 = {}), !n3.fromDisable && this.disableEditing(); }, o2.prototype.canActivate = function() { var t3, e3 = this, n3 = e3.model, o3 = e3.rteEnabled, r2 = e3.em, i2 = (null == r2 ? void 0 : r2.getEditing()) === n3, s2 = true, a2 = false; if ((o3 || !n3.get("editable") || i2 || (a2 = n3.isChildOf("text"))) && (s2 = false, a2 && !n3.get("textable"))) { for (var l2 = n3.parent(); l2 && !l2.isInstanceOf("text"); ) l2 = l2.parent(); l2 && l2.get("editable") ? t3 = l2 : s2 = true; } return { result: s2, delegate: t3 }; }, o2.prototype.onActive = function(t3) { var e3, n3; return yo(this, void 0, void 0, function() { var o3, r2, i2, s2, a2, l2, c2, u2, p2; return mo(this, function(d2) { switch (d2.label) { case 0: return r2 = (o3 = this).rte, i2 = o3.em, s2 = this.canActivate(), a2 = s2.result, l2 = s2.delegate, a2 ? (null === (n3 = null == t3 ? void 0 : t3.stopPropagation) || void 0 === n3 || n3.call(t3), c2 = this, [4, this.getContent()]) : (l2 && (null === (e3 = null == t3 ? void 0 : t3.stopPropagation) || void 0 === e3 || e3.call(t3), i2.setSelected(l2), l2.trigger("active", t3)), [2]); case 1: if (c2.lastContent = d2.sent(), !r2) return [3, 5]; d2.label = 2; case 2: return d2.trys.push([2, 4, , 5]), u2 = this, [4, r2.enable(this, this.activeRte, { event: t3 })]; case 3: return u2.activeRte = d2.sent(), [3, 5]; case 4: return p2 = d2.sent(), i2.logError(p2), [3, 5]; case 5: return this.toggleEvents(true), [2]; } }); }); }, o2.prototype.onDisable = function() { this.disableEditing(); }, o2.prototype.disableEditing = function(t3) { return void 0 === t3 && (t3 = {}), yo(this, void 0, void 0, function() { var e3, n3, o3, r2, i2, s2, a2, l2; return mo(this, function(c2) { switch (c2.label) { case 0: if (n3 = (e3 = this).model, o3 = e3.rte, r2 = e3.activeRte, i2 = e3.em, s2 = n3 && n3.get("editable"), !o3) return [3, 8]; c2.label = 1; case 1: return c2.trys.push([1, 3, , 4]), [4, o3.disable(this, r2)]; case 2: return c2.sent(), [3, 4]; case 3: return a2 = c2.sent(), i2.logError(a2), [3, 4]; case 4: return (l2 = s2) ? [4, this.getContent()] : [3, 6]; case 5: l2 = c2.sent() !== this.lastContent, c2.label = 6; case 6: return l2 ? [4, this.syncContent(t3)] : [3, 8]; case 7: c2.sent(), this.lastContent = "", c2.label = 8; case 8: return this.toggleEvents(), [2]; } }); }); }, o2.prototype.getContent = function() { return yo(this, void 0, void 0, function() { var t3, e3, n3, o3; return mo(this, function(r2) { switch (r2.label) { case 0: return e3 = (t3 = this).rte, n3 = t3.activeRte, o3 = "", e3 ? [4, e3.getContent(this, n3)] : [3, 2]; case 1: o3 = r2.sent(), r2.label = 2; case 2: return [2, o3]; } }); }); }, o2.prototype.syncContent = function(t3) { return void 0 === t3 && (t3 = {}), yo(this, void 0, void 0, function() { var e3, n3, o3, r2, i2, s2; return mo(this, function(a2) { switch (a2.label) { case 0: return n3 = (e3 = this).model, o3 = e3.rte, e3.rteEnabled || t3.force ? [4, this.getContent()] : [2]; case 1: return r2 = a2.sent(), i2 = n3.components(), s2 = vo({ fromDisable: 1 }, t3), n3.set("content", "", s2), (null == o3 ? void 0 : o3.customRte) && !o3.customRte.parseContent ? (i2.length && i2.reset(void 0, vo(vo({}, t3), { keepIds: Oe(i2) })), n3.set("content", r2, s2)) : i2.resetFromString(r2, t3), [2]; } }); }); }, o2.prototype.insertComponent = function(t3, n3) { var o3; void 0 === n3 && (n3 = {}); var r2 = this.model, i2 = this.el.ownerDocument.getSelection(); if (null == i2 ? void 0 : i2.rangeCount) { var s2 = i2.getRangeAt(0), a2 = s2.startContainer, l2 = s2.startOffset, c2 = (0, e2.getModel)(a2), u2 = []; if (c2 && (null === (o3 = c2.is) || void 0 === o3 ? void 0 : o3.call(c2, "textnode"))) { var p2 = c2.collection; p2.forEach(function(e3) { if (e3 === c2) { var n4 = "textnode", o4 = e3.get("content") || ""; u2.push({ type: n4, content: o4.slice(0, l2) }), u2.push(t3), u2.push({ type: n4, content: o4.slice(l2) }); } else u2.push(e3); }); var d2 = u2.filter(Boolean), f2 = d2.indexOf(t3); return p2.reset(d2, n3), p2.at(f2); } } return r2.append(t3, n3); }, o2.prototype.onInput = function() { var t3 = this.em, e3 = "component", n3 = ["".concat(e3, ":update"), "".concat(e3, ":input")].join(" "); t3 && t3.trigger(n3, this.model); }, o2.prototype.disablePropagation = function(t3) { t3.stopPropagation(); }, o2.prototype.toggleEvents = function(t3) { var n3 = this, o3 = n3.em, r2 = n3.model, i2 = n3.$el, s2 = { on: e2.on, off: e2.off }, a2 = t3 ? "on" : "off"; o3.setEditing(!!t3 && this), this.rteEnabled = !!t3; var l2 = [this.el.ownerDocument, document]; if (s2.off(l2, "mousedown", this.onDisable), s2[a2](l2, "mousedown", this.onDisable), o3[a2]("toolbar:run:before", this.onDisable), r2 && (r2[a2]("removed", this.onDisable), r2.trigger("rte:".concat(t3 ? "enable" : "disable"))), null == i2 || i2.off("mousedown", this.disablePropagation), i2 && i2[a2]("mousedown", this.disablePropagation), this.config.draggableComponents) for (var c2 = this.el; c2; ) c2.draggable = !t3, (c2 = c2.parentNode) && "BODY" == c2.tagName && (c2 = 0); }, o2; }(cn); const _o = bo; var wo = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const xo = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return wo(e3, t3), e3.prototype.render = function() { return t3.prototype.render.call(this), this.el.addEventListener("click", this.prevDef, true), this; }, e3; }(_o); var Co = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), So = function() { return So = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, So.apply(this, arguments); }, Oo = "label"; const To = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return Co(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return So(So({}, t3.prototype.defaults), { type: Oo, tagName: Oo, traits: ["id", "title", "for"] }); }, enumerable: false, configurable: true }), n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === Oo; }, n2; }(lo); var ko = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Po = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return ko(e3, t3), e3; }(xo); var Eo = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ao = function() { return Ao = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ao.apply(this, arguments); }, jo = "video", Mo = "yt", Lo = "vi", Do = "ytnc", No = function(t3) { return t3 && "0" !== t3; }, Io = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return Eo(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return Ao(Ao({}, t3.prototype.defaults), { type: jo, tagName: jo, videoId: "", void: false, 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: false, configurable: true }), n2.prototype.initialize = function(e3, n3) { this.em = n3.em, this.get("src") && this.parseFromSrc(), this.updateTraits(), this.listenTo(this, "change:provider", this.updateTraits), this.listenTo(this, "change:videoId change:provider", this.updateSrc), t3.prototype.initialize.call(this, e3, n3); }, n2.prototype.updateTraits = function() { var t4, e3 = this.em, n3 = "iframe"; switch (this.get("provider")) { case Mo: case Do: t4 = this.getYoutubeTraits(); break; case Lo: t4 = this.getVimeoTraits(); break; default: n3 = "video", t4 = this.getSourceTraits(); } this.set({ tagName: n3 }, { silent: true }), this.set({ traits: t4 }), e3.get("ready") && e3.trigger("component:toggled"); }, n2.prototype.parseFromSrc = function() { var t4 = this.get("provider"), e3 = this.parseUri(this.get("src")), n3 = e3.query; switch (t4) { case Mo: case Do: case Lo: this.set("videoId", e3.pathname.split("/").pop()), n3.list && this.set("list", n3.list), No(n3.autoplay) && this.set("autoplay", 1), No(n3.loop) && this.set("loop", 1), 0 === parseInt(n3.controls) && this.set("controls", 0), No(n3.color) && this.set("color", n3.color), "0" === n3.rel && this.set("rel", 0), "1" === n3.modestbranding && this.set("modestbranding", 1); } }, n2.prototype.updateSrc = function() { var t4 = ""; switch (this.get("provider")) { case Mo: t4 = this.getYoutubeSrc(); break; case Do: t4 = this.getYoutubeNoCookieSrc(); break; case Lo: t4 = this.getVimeoSrc(); } this.set({ src: t4 }); }, n2.prototype.getAttrToHTML = function() { var e3 = t3.prototype.getAttrToHTML.call(this); switch (this.get("provider")) { case Mo: case Do: case Lo: break; default: this.get("loop") && (e3.loop = "loop"), this.get("autoplay") && (e3.autoplay = "autoplay"), this.get("controls") && (e3.controls = "controls"); } return e3; }, n2.prototype.getProviderTrait = function() { return { type: "select", label: "Provider", name: "provider", changeProp: true, options: [{ value: "so", name: "HTML5 Source" }, { value: Mo, name: "Youtube" }, { value: Do, name: "Youtube (no cookie)" }, { value: Lo, name: "Vimeo" }] }; }, n2.prototype.getSourceTraits = function() { return [this.getProviderTrait(), { label: "Source", name: "src", placeholder: "eg. ./media/video.mp4", changeProp: true }, { label: "Poster", name: "poster", placeholder: "eg. ./media/image.jpg" }, this.getAutoplayTrait(), this.getLoopTrait(), this.getControlsTrait()]; }, n2.prototype.getYoutubeTraits = function() { return [this.getProviderTrait(), { label: "Video ID", name: "videoId", placeholder: "eg. jNQXAC9IVRw", changeProp: true }, this.getAutoplayTrait(), this.getLoopTrait(), this.getControlsTrait(), { type: "checkbox", label: "Related", name: "rel", changeProp: true }, { type: "checkbox", label: "Modest", name: "modestbranding", changeProp: true }]; }, n2.prototype.getVimeoTraits = function() { return [this.getProviderTrait(), { label: "Video ID", name: "videoId", placeholder: "eg. 123456789", changeProp: true }, { label: "Color", name: "color", placeholder: "eg. FF0000", changeProp: true }, this.getAutoplayTrait(), this.getLoopTrait()]; }, n2.prototype.getAutoplayTrait = function() { return { type: "checkbox", label: "Autoplay", name: "autoplay", changeProp: true }; }, n2.prototype.getLoopTrait = function() { return { type: "checkbox", label: "Loop", name: "loop", changeProp: true }; }, n2.prototype.getControlsTrait = function() { return { type: "checkbox", label: "Controls", name: "controls", changeProp: true }; }, n2.prototype.getYoutubeSrc = function() { var t4 = this.get("videoId"), e3 = this.get("ytUrl"), n3 = this.get("list"); return e3 += t4 + (t4.indexOf("?") < 0 ? "?" : ""), e3 += n3 ? "&list=".concat(n3) : "", e3 += this.get("autoplay") ? "&autoplay=1" : "", e3 += this.get("controls") ? "" : "&controls=0&showinfo=0", e3 += this.get("loop") ? "&loop=1&playlist=".concat(t4) : "", e3 += this.get("rel") ? "" : "&rel=0", e3 += this.get("modestbranding") ? "&modestbranding=1" : ""; }, n2.prototype.getYoutubeNoCookieSrc = function() { var t4 = this.getYoutubeSrc(); return t4 = t4.replace(this.get("ytUrl"), this.get("ytncUrl")); }, n2.prototype.getVimeoSrc = function() { var t4 = this.get("viUrl"); return t4 += this.get("videoId") + "?", t4 += this.get("autoplay") ? "&autoplay=1" : "", t4 += this.get("loop") ? "&loop=1" : "", t4 += this.get("controls") ? "" : "&title=0&portrait=0&badge=0", t4 += this.get("color") ? "&color=" + this.get("color") : ""; }, n2.isComponent = function(t4) { var n3 = t4.tagName, o2 = t4.src, r2 = /youtube\.com\/embed/.test(o2), i2 = /youtube-nocookie\.com\/embed/.test(o2), s2 = /player\.vimeo\.com\/video/.test(o2), a2 = r2 || i2 || s2; if ((0, e2.toLowerCase)(n3) == jo || "iframe" == (0, e2.toLowerCase)(n3) && a2) { var l2 = { type: "video" }; return o2 && (l2.src = o2), a2 && (r2 ? l2.provider = Mo : i2 ? l2.provider = Do : s2 && (l2.provider = Lo)), l2; } }, n2; }(Xn); const Fo = Io; var Vo = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ro = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Vo(e3, t3), e3.prototype.tagName = function() { return "div"; }, e3.prototype.events = function() { return {}; }, e3.prototype.initialize = function() { cn.prototype.initialize.apply(this, arguments); var t4 = this.model, e4 = ["loop", "autoplay", "controls", "color", "rel", "modestbranding", "poster"], n2 = e4.map(function(t5) { return "change:".concat(t5); }).join(" "); this.listenTo(t4, "change:provider", this.updateProvider), this.listenTo(t4, "change:src", this.updateSrc), this.listenTo(t4, n2, this.updateVideo); }, e3.prototype.updateProvider = function() { var t4 = this.model.get("provider"); this.el.innerHTML = "", this.el.appendChild(this.renderByProvider(t4)); }, e3.prototype.updateSrc = function() { var t4 = this.model, e4 = this.videoEl; if (e4) { var n2 = t4.get("provider"), o2 = t4.get("src"); switch (n2) { case "yt": o2 = t4.getYoutubeSrc(); break; case "ytnc": o2 = t4.getYoutubeNoCookieSrc(); break; case "vi": o2 = t4.getVimeoSrc(); } e4.src = o2; } }, e3.prototype.updateVideo = function() { var t4 = this.model, e4 = this.videoEl; switch (t4.get("provider")) { case "yt": case "ytnc": case "vi": t4.trigger("change:videoId"); break; default: if (e4) { var n2 = e4; n2.loop = t4.get("loop"), n2.autoplay = t4.get("autoplay"), n2.controls = t4.get("controls"), n2.poster = t4.get("poster"); } } }, e3.prototype.renderByProvider = function(t4) { var e4; switch (t4) { case "yt": e4 = this.renderYoutube(); break; case "ytnc": e4 = this.renderYoutubeNoCookie(); break; case "vi": e4 = this.renderVimeo(); break; default: e4 = this.renderSource(); } return this.videoEl = e4, e4; }, e3.prototype.renderSource = function() { var t4 = document.createElement("video"); return t4.src = this.model.get("src"), this.initVideoEl(t4), t4; }, e3.prototype.renderYoutube = function() { var t4 = document.createElement("iframe"); return t4.src = this.model.getYoutubeSrc(), t4.frameBorder = "0", t4.setAttribute("allowfullscreen", "true"), this.initVideoEl(t4), t4; }, e3.prototype.renderYoutubeNoCookie = function() { var t4 = document.createElement("iframe"); return t4.src = this.model.getYoutubeNoCookieSrc(), t4.frameBorder = "0", t4.setAttribute("allowfullscreen", "true"), this.initVideoEl(t4), t4; }, e3.prototype.renderVimeo = function() { var t4 = document.createElement("iframe"); return t4.src = this.model.getVimeoSrc(), t4.frameBorder = "0", t4.setAttribute("allowfullscreen", "true"), this.initVideoEl(t4), t4; }, e3.prototype.initVideoEl = function(t4) { t4.className = this.ppfx + "no-pointer", t4.style.height = "100%", t4.style.width = "100%"; }, e3.prototype.render = function() { cn.prototype.render.apply(this), this.updateClasses(); var t4 = this.model.get("provider"); return this.el.appendChild(this.renderByProvider(t4)), this.updateVideo(), this; }, e3; }(oo); const Ho = Ro; var zo = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Bo = function() { return Bo = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Bo.apply(this, arguments); }, Uo = "script"; const Wo = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return zo(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return Bo(Bo({}, t3.prototype.defaults), { type: Uo, tagName: Uo, droppable: false, draggable: false, layerable: false }); }, enumerable: false, configurable: true }), n2.isComponent = function(t4) { if ((0, e2.toLowerCase)(t4.tagName) == Uo) { var n3 = { type: Uo }; return t4.src && (n3.src = t4.src, n3.onload = t4.onload), n3; } }, n2; }(en); var $o = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), qo = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return $o(e3, t3), e3.prototype.tagName = function() { return "script"; }, e3.prototype.events = function() { return {}; }, e3.prototype.render = function() { var t4 = this.model, e4 = this.em, n2 = t4.get("src"), o2 = e4 && e4.get("scriptCount"), r2 = o2 || 0, i2 = ""; if (n2) { var s2 = t4.get("onload"), a2 = "script".concat(r2), l2 = "script".concat(r2 + 1), c2 = "".concat(a2, "Start"), u2 = "".concat(l2, "Start"); i2 = "\n var ".concat(a2, " = document.createElement('script');\n ").concat(a2, ".onload = function() {\n ").concat(s2 ? "".concat(s2, "();\n") : "", "\n typeof ").concat(u2, " == 'function' && ").concat(u2, "();\n };\n ").concat(a2, ".src = '").concat(n2, "';\n function ").concat(c2, "() { document.body.appendChild(").concat(a2, "); };\n ").concat(r2 ? "" : "".concat(c2, "();"), "\n "), e4 && e4.set("scriptCount", r2 + 1); } else i2 = t4.__innerHTML(); return this.el.innerHTML = i2, this.postRender(), this; }, e3; }(oo); const Go = qo; var Ko = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Yo = function() { return Yo = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Yo.apply(this, arguments); }, Xo = "svg"; const Jo = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return Ko(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return Yo(Yo({}, t3.prototype.defaults), { type: Xo, tagName: Xo, highlightable: false, resizable: { ratioDefault: true } }); }, enumerable: false, configurable: true }), n2.prototype.getName = function() { var t4 = this.get("tagName"), e3 = this.get("custom-name"); return t4 = t4.charAt(0).toUpperCase() + t4.slice(1), e3 || t4; }, n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === Xo; }, n2; }(en); var Zo = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Qo = function() { return Qo = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Qo.apply(this, arguments); }; const tr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Zo(e3, t3), Object.defineProperty(e3.prototype, "defaults", { get: function() { return Qo(Qo({}, t3.prototype.defaults), { selectable: false, hoverable: false, layerable: false }); }, enumerable: false, configurable: true }), e3.isComponent = function(t4, e4) { return void 0 === e4 && (e4 = {}), !!e4.inSvg; }, e3; }(Jo); var er = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), nr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return er(e3, t3), e3.prototype._createElement = function(t4) { return document.createElementNS("http://www.w3.org/2000/svg", t4); }, e3; }(cn); const or = nr; var rr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ir = function() { return ir = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, ir.apply(this, arguments); }; const sr = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return rr(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return ir(ir({}, t3.prototype.defaults), { tagName: "", droppable: false, layerable: false, selectable: false, editable: true }); }, enumerable: false, configurable: true }), n2.prototype.toHTML = function() { var t4 = this.parent(), e3 = this.get("content"); return (null == t4 ? void 0 : t4.is("script")) ? e3 : this.__escapeContent(e3); }, n2.prototype.__escapeContent = function(t4) { return (0, e2.escapeNodeContent)(t4); }, n2.isComponent = function(t4) { if (3 === t4.nodeType) return { type: "textnode", content: t4.textContent }; }, n2; }(en); var ar = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), lr = function() { return lr = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, lr.apply(this, arguments); }; const cr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return ar(e3, t3), Object.defineProperty(e3.prototype, "defaults", { get: function() { return lr({}, t3.prototype.defaults); }, enumerable: false, configurable: true }), e3.prototype.toHTML = function() { return ""); }, e3.isComponent = function(t4) { if (8 == t4.nodeType) return { tagName: "NULL", type: "comment", content: t4.textContent }; }, e3; }(sr); var ur = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const pr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return ur(e3, t3), e3.prototype._setAttributes = function() { }, e3.prototype.renderAttributes = function() { }, e3.prototype.updateStatus = function() { }, e3.prototype.updateClasses = function() { }, e3.prototype.setAttribute = function() { }, e3.prototype.updateAttributes = function() { }, e3.prototype.initClasses = function() { }, e3.prototype.initComponents = function() { }, e3.prototype.delegateEvents = function() { return this; }, e3.prototype._createElement = function() { return document.createTextNode(""); }, e3.prototype.render = function() { var t4 = this.model, e4 = this.el; return t4.opt.temporary || (e4.textContent = t4.get("content")), this; }, e3; }(cn); var dr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const fr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return dr(e3, t3), e3.prototype._createElement = function() { return document.createComment(this.model.get("content")); }, e3; }(pr); var hr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), gr = function() { return gr = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, gr.apply(this, arguments); }; const vr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return hr(e3, t3), Object.defineProperty(e3.prototype, "defaults", { get: function() { return gr(gr({}, t3.prototype.defaults), { tagName: "body", removable: false, copyable: false, draggable: false, components: [], traits: [], stylable: ["background", "background-color", "background-image", "background-repeat", "background-attachment", "background-position", "background-size"] }); }, enumerable: false, configurable: true }), e3.prototype.__postAdd = function() { var e4, n2 = null === (e4 = this.em) || void 0 === e4 ? void 0 : e4.UndoManager; return !this.__hasUm && (null == n2 || n2.add(this)), t3.prototype.__postAdd.call(this); }, e3.prototype.__postRemove = function() { var e4, n2 = null === (e4 = this.em) || void 0 === e4 ? void 0 : e4.UndoManager; return null == n2 || n2.remove(this), t3.prototype.__postRemove.call(this); }, e3.isComponent = function() { return false; }, e3; }(en); var yr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), mr = function() { return mr = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, mr.apply(this, arguments); }, br = "iframe"; const _r = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return yr(n2, t3), Object.defineProperty(n2.prototype, "defaults", { get: function() { return mr(mr({}, t3.prototype.defaults), { type: br, tagName: br, droppable: false, resizable: true, traits: ["id", "title", "src"], attributes: { frameborder: "0" } }); }, enumerable: false, configurable: true }), n2.isComponent = function(t4) { return (0, e2.toLowerCase)(t4.tagName) === br; }, n2; }(en); var wr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const xr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return wr(e3, t3), e3.prototype.tagName = function() { return "div"; }, e3.prototype.initialize = function(e4) { t3.prototype.initialize.call(this, e4), this.listenTo(this.model, "change:attributes:src", this.updateSrc); }, e3.prototype.updateSrc = function() { var t4 = (0, Et.sE)(this.el, "iframe")[0]; t4 && (0, Et.FW)(t4, { src: this.__getSrc() }); }, e3.prototype.render = function() { t3.prototype.render.call(this); var e4 = (0, Et.ut)("iframe", { class: "".concat(this.ppfx, "no-pointer"), style: "width: 100%; height: 100%; border: none", src: this.__getSrc() }); return this.el.appendChild(e4), this; }, e3.prototype.__getSrc = function() { return this.model.getAttributes().src || ""; }, e3; }(cn); var Cr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Sr = function() { return Sr = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Sr.apply(this, arguments); }, Or = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, Tr = function(e3) { function n2(t3) { var n3 = e3.call(this, t3, "DomComponents", new Pe(void 0, { em: t3 })) || this; for (var o2 in n3.componentTypes = [{ id: "cell", model: hn, view: vn }, { id: "row", model: _n, view: xn }, { id: "table", model: Tn, view: kn }, { id: "thead", model: Nn, view: Fn }, { id: "tbody", model: jn, view: Rn }, { id: "tfoot", model: Un, view: $n }, { id: "map", model: to, view: io }, { id: "link", model: ho, view: xo }, { id: "label", model: To, view: Po }, { id: "video", model: Fo, view: Ho }, { id: "image", model: Xn, view: oo }, { id: "script", model: Wo, view: Go }, { id: "svg-in", model: tr, view: or }, { id: "svg", model: Jo, view: or }, { id: "iframe", model: _r, view: xr }, { id: "comment", model: cr, view: fr }, { id: "textnode", model: sr, view: pr }, { id: "text", model: lo, view: _o }, { id: "wrapper", model: vr, view: pn }, { id: "default", model: en, view: cn }], n3.componentsById = {}, n3.Component = en, n3.Components = Pe, n3.ComponentsView = rn, n3.storageKey = "components", t3 && (n3.config.components = t3.config.components || n3.config.components), ue) o2 in n3.config || (n3.config[o2] = ue[o2]); var r2 = n3.config.pStylePrefix; if (r2 && (n3.config.stylePrefix = r2 + n3.config.stylePrefix), t3) { t3.get("Parser").compTypes = n3.componentTypes, t3.on("change:componentHovered", n3.componentHovered, n3); var i2 = t3.get("selected"); t3.listenTo(i2, "add", function(t4, e4, o3) { return n3.selectAdd(i2.getComponent(t4), o3); }), t3.listenTo(i2, "remove", function(t4, e4, o3) { return n3.selectRemove(i2.getComponent(t4), o3); }); } return n3; } return Cr(n2, e3), n2.prototype.load = function(e4) { var n3 = this; return this.loadProjectData(e4, { onResult: function(e5) { var o2 = n3.getWrapper(); if (o2 || (n3.em.Pages.add({}, { select: true }), o2 = n3.getWrapper()), (0, t2.isArray)(e5)) e5.length && o2.components(e5); else { var r2 = e5.components, i2 = void 0 === r2 ? [] : r2, s2 = Or(e5, ["components"]); o2.set(s2), o2.components(i2); } } }); }, n2.prototype.store = function() { return {}; }, n2.prototype.getComponent = function() { var t3 = this.em.Pages.getSelected(), e4 = null == t3 ? void 0 : t3.getMainFrame(); return null == e4 ? void 0 : e4.getComponent(); }, n2.prototype.getWrapper = function() { return this.getComponent(); }, n2.prototype.getComponents = function() { var t3 = this.getWrapper(); return null == t3 ? void 0 : t3.get("components"); }, n2.prototype.addComponent = function(t3, e4) { return void 0 === e4 && (e4 = {}), this.getComponents().add(t3, e4); }, n2.prototype.render = function() { var t3; return null === (t3 = this.componentView) || void 0 === t3 ? void 0 : t3.render().el; }, n2.prototype.clear = function(t3) { void 0 === t3 && (t3 = {}); var e4 = this.getComponents(); return null == e4 || e4.filter(Boolean).forEach(function(e5) { return e5.remove(t3); }), this; }, n2.prototype.setComponents = function(t3, e4) { void 0 === e4 && (e4 = {}), this.clear(e4).addComponent(t3, e4); }, n2.prototype.addType = function(e4, n3) { var o2 = this.em, r2 = n3.model, i2 = void 0 === r2 ? {} : r2, s2 = n3.view, a2 = void 0 === s2 ? {} : s2, l2 = n3.isComponent, c2 = n3.extend, u2 = n3.extendView, p2 = n3.extendFn, d2 = void 0 === p2 ? [] : p2, f2 = n3.extendFnView, h2 = void 0 === f2 ? [] : f2, g2 = this.getType(e4), v2 = this.getType(c2), y2 = this.getType(u2), m2 = v2 || (g2 || this.getType("default")), b2 = m2.model, _2 = y2 ? y2.view : m2.view, w2 = function(t3, e5, n4) { return t3.reduce(function(t4, o3) { var r3 = e5[o3], i3 = n4.prototype[o3]; return r3 && i3 && (t4[o3] = function() { for (var t5 = [], e6 = 0; e6 < arguments.length; e6++) t5[e6] = arguments[e6]; i3.bind(this).apply(void 0, t5), r3.bind(this).apply(void 0, t5); }), t4; }, {}); }; if ("object" == typeof i2) { var x2 = (0, t2.result)(i2, "defaults"); delete i2.defaults, n3.model = b2.extend(Sr(Sr({}, i2), w2(d2, i2, b2)), { isComponent: !g2 || v2 || l2 ? l2 || function() { return 0; } : b2.isComponent }), Object.defineProperty(n3.model.prototype, "defaults", { value: Sr(Sr({}, (0, t2.result)(b2.prototype, "defaults") || {}), x2 || {}) }); } "object" == typeof a2 && (n3.view = _2.extend(Sr(Sr({}, a2), w2(h2, a2, _2)))), g2 ? (g2.model = n3.model, g2.view = n3.view) : (n3.id = e4, this.componentTypes.unshift(n3)); var C2 = "component:type:".concat(g2 ? "update" : "add"); return null == o2 || o2.trigger(C2, g2 || n3), this; }, n2.prototype.getType = function(t3) { for (var e4 = this.componentTypes, n3 = 0; n3 < e4.length; n3++) { if (e4[n3].id == t3) return e4[n3]; } }, n2.prototype.removeType = function(t3) { var e4 = this.componentTypes, n3 = this.getType(t3); if (n3) { var o2 = e4.indexOf(n3); return e4.splice(o2, 1), n3; } }, n2.prototype.getTypes = function() { return this.componentTypes; }, n2.prototype.selectAdd = function(t3, e4) { var n3 = this; void 0 === e4 && (e4 = {}), t3 && (t3.set({ status: "selected" }), ["component:selected", "component:toggled"].forEach(function(o2) { return n3.em.trigger(o2, t3, e4); })); }, n2.prototype.selectRemove = function(t3, e4) { var n3 = this; if (void 0 === e4 && (e4 = {}), t3) { this.em; t3.set({ status: "", state: "" }), ["component:deselected", "component:toggled"].forEach(function(o2) { return n3.em.trigger(o2, t3, e4); }); } }, n2.prototype.componentHovered = function() { var e4 = this.em, n3 = e4.get("componentHovered"), o2 = e4.previous("componentHovered"), r2 = "hovered"; o2 && o2.get("status") == r2 && o2.set({ status: "", state: "" }), n3 && (0, t2.isEmpty)(n3.get("status")) && n3.set("status", r2); }, n2.prototype.getShallowWrapper = function() { var e4 = this.shallow, n3 = this.em; if (!e4 && n3) { var o2 = n3.shallow; if (!o2) return; var r2 = o2.Components; if (r2.componentTypes = this.componentTypes, e4 = r2.getWrapper()) { var i2 = [Ze, Qe].join(" "); e4.on(i2, (0, t2.debounce)(function() { return null == e4 ? void 0 : e4.components(""); }, 100)); } this.shallow = e4; } return e4; }, n2.prototype.canMove = function(e4, n3, o2) { var r2 = o2 || 0 === o2 ? o2 : null, i2 = { result: false, reason: 0, target: e4, source: null }; if (!n3 || !e4) return i2; var s2 = n3.toHTML ? n3 : null; if (!s2) { var a2 = this.getShallowWrapper(); s2 = (null == a2 ? void 0 : a2.append(n3)[0]) || null; } if (i2.source = s2, !s2) return i2; var l2 = s2.get("draggable"); if ((0, t2.isFunction)(l2)) l2 = !!l2(s2, e4, r2); else { var c2 = e4.getEl(); l2 = (0, t2.isArray)(l2) ? l2.join(",") : l2, l2 = (0, t2.isString)(l2) ? null == c2 ? void 0 : c2.matches(l2) : l2; } if (!l2) return Sr(Sr({}, i2), { reason: 1 }); var u2 = e4.get("droppable"); if ((0, t2.isFunction)(u2)) u2 = !!u2(s2, e4, r2); else if (false === u2 && e4.isInstanceOf("text") && s2.get("textable")) u2 = true; else { c2 = s2.getEl(); u2 = (0, t2.isArray)(u2) ? u2.join(",") : u2, u2 = (0, t2.isString)(u2) ? null == c2 ? void 0 : c2.matches(u2) : u2; } var p2 = [e4].concat(e4.parents()).indexOf(s2) > -1; return Sr(Sr({}, i2), !u2 || p2 ? { reason: 2 } : { result: true }); }, n2.prototype.allById = function() { return this.componentsById; }, n2.prototype.getById = function(t3) { return this.componentsById[t3] || null; }, n2.prototype.destroy = function() { var t3, e4 = this.allById(); Object.keys(e4).forEach(function(t4) { return e4[t4] && e4[t4].remove(); }), null === (t3 = this.componentView) || void 0 === t3 || t3.remove(), [this.em, this.componentsById, this.componentView].forEach(function(t4) { return {}; }); }, n2; }(b); const kr = Tr; const Pr = { stylePrefix: "css-", rules: [] }; var Er = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ar = Number.MAX_VALUE, jr = function(n2) { function o2() { var e3 = n2.call(this) || this; return (0, t2.bindAll)(e3, "sortRules"), e3.compCls = [], e3.ids = [], e3; } return Er(o2, n2), o2.prototype.buildFromModel = function(t3, e3) { var n3 = this; void 0 === e3 && (e3 = {}); var o3 = "", r2 = this.em, i2 = r2 && r2.getConfig().avoidInlineStyle, s2 = t3.styleToString(), a2 = t3.classes; return this.ids.push("#".concat(t3.getId())), a2.forEach(function(t4) { return n3.compCls.push(t4.getFullName()); }), !i2 && s2 && (o3 = "#".concat(t3.getId(), "{").concat(s2, "}")), t3.components().forEach(function(t4) { return o3 += n3.buildFromModel(t4, e3); }), o3; }, o2.prototype.build = function(n3, o3) { var r2 = this; void 0 === o3 && (o3 = {}); var i2 = o3.json, s2 = o3.em, a2 = o3.cssc || (null == s2 ? void 0 : s2.Css); this.em = s2, this.compCls = [], this.ids = [], this.model = n3; var l2 = [], c2 = n3 ? this.buildFromModel(n3, o3) : "", u2 = (0, t2.isUndefined)(o3.clearStyles) && s2 ? s2.getConfig().clearStyles : o3.clearStyles; if (a2) { var p2 = o3.rules || a2.getAll(), d2 = {}, f2 = []; o3.onlyMatched && n3 && (0, e2.hasWin)() && (p2 = this.matchedRules(n3, p2)), p2.forEach(function(t3) { var e3 = t3.getAtRule(); if (e3) { var n4 = d2[e3]; n4 ? n4.push(t3) : d2[e3] = [t3]; } else { var s3 = r2.buildFromRule(t3, f2, o3); i2 ? l2.push(s3) : c2 += s3; } }), this.sortMediaObject(d2).forEach(function(t3) { var e3 = "", n4 = t3.key; t3.value.forEach(function(t4) { var s3 = r2.buildFromRule(t4, f2, o3); t4.get("singleAtRule") ? c2 += "".concat(n4, "{").concat(s3, "}") : e3 += s3, i2 && l2.push(s3); }), e3 && (c2 += "".concat(n4, "{").concat(e3, "}")); }), s2 && u2 && p2.remove && p2.remove(f2); } return i2 ? l2.filter(function(t3) { return t3; }) : c2; }, o2.prototype.buildFromRule = function(t3, e3, n3) { var o3, r2 = this; void 0 === n3 && (n3 = {}); var i2, s2 = "", a2 = this.model, l2 = t3.selectorsToString({ skipAdd: 1 }), c2 = t3.get("selectorsAdd"), u2 = t3.get("singleAtRule"); if (null === (o3 = t3.get("selectors")) || void 0 === o3 || o3.forEach(function(t4) { var e4 = t4.getFullName(); (r2.compCls.indexOf(e4) >= 0 || r2.ids.indexOf(e4) >= 0 || n3.keepUnusedStyles) && (i2 = 1); }), l2 && i2 || c2 || u2 || !a2) { var p2 = t3.getDeclaration({ body: 1 }); p2 && (n3.json ? s2 = t3 : s2 += p2); } else e3.push(t3); return s2; }, o2.prototype.matchedRules = function(t3, e3) { var n3 = this, o3 = t3.getEl(), r2 = []; return e3.forEach(function(t4) { try { t4.selectorsToString().split(",").some(function(t5) { return null == o3 ? void 0 : o3.matches(n3.__cleanSelector(t5)); }) && r2.push(t4); } catch (t5) { } }), t3.components().forEach(function(t4) { r2 = r2.concat(n3.matchedRules(t4, e3)); }), r2 = r2.filter(function(t4, e4) { return r2.indexOf(t4) === e4; }); }, o2.prototype.getQueryLength = function(t3) { var e3 = /(-?\d*\.?\d+)\w{0,}/.exec(t3); return e3 ? parseFloat(e3[1]) : Ar; }, o2.prototype.sortMediaObject = function(e3) { var n3 = this; void 0 === e3 && (e3 = {}); var o3 = []; return (0, t2.each)(e3, function(t3, e4) { return o3.push({ key: e4, value: t3 }); }), o3.sort(function(t3, e4) { var o4 = [t3.key, e4.key].every(function(t4) { return -1 !== t4.indexOf("min-width"); }), r2 = o4 ? t3.key : e4.key, i2 = o4 ? e4.key : t3.key; return n3.getQueryLength(r2) - n3.getQueryLength(i2); }); }, o2.prototype.sortRules = function(t3, e3) { var n3 = function(t4) { return t4.get("mediaText") || ""; }, o3 = [n3(t3), n3(e3)].every(function(t4) { return -1 !== t4.indexOf("min-width"); }), r2 = n3(o3 ? t3 : e3), i2 = n3(o3 ? e3 : t3); return this.getQueryLength(r2) - this.getQueryLength(i2); }, o2.prototype.__cleanSelector = function(t3) { return t3.split(" ").map(function(t4) { return t4.split(":")[0]; }).join(" "); }, o2; }(u.Hn); const Mr = jr; var Lr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Dr = function() { return Dr = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Dr.apply(this, arguments); }, Nr = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Ir = ((0, e2.hasWin)() ? window : {}).CSS, Fr = function(n2) { function o2(t3, e3) { void 0 === e3 && (e3 = {}); var o3 = n2.call(this, t3) || this; return o3.config = t3 || {}, o3.opt = e3, o3.em = e3.em, o3.ensureSelectors(null, null, {}), o3.on("change", o3.__onChange), o3; } return Lr(o2, n2), o2.prototype.defaults = function() { return { selectors: [], selectorsAdd: "", style: {}, mediaText: "", state: "", stylable: true, atRuleType: "", singleAtRule: false, important: false, group: "", shallow: false, _undo: true }; }, o2.prototype.__onChange = function(t3, n3) { var o3 = this.em, r2 = this.changedAttributes(); r2 && !(0, e2.isEmptyObj)(r2) && (null == o3 || o3.changesUp(n3)); }, o2.prototype.clone = function() { var t3 = Dr({}, this.opt), e3 = Dr({}, this.attributes); return e3.selectors = this.get("selectors").map(function(t4) { return t4.clone(); }), new this.constructor(e3, t3); }, o2.prototype.ensureSelectors = function(e3, n3, o3) { var r2 = this.em, i2 = null == r2 ? void 0 : r2.get("SelectorManager"), s2 = [this, "change:selectors", this.ensureSelectors], a2 = this.getSelectors(); if (this.stopListening.apply(this, s2), a2.models && (a2 = Nr([], a2.models, true)), a2 = (0, t2.isString)(a2) ? [a2] : a2, Array.isArray(a2)) { var l2 = a2.filter(function(t3) { return t3; }).map(function(t3) { return i2 ? i2.add(t3) : t3; }); a2 = new Fe(l2); } this.set("selectors", a2, o3), this.listenTo.apply(this, s2); }, o2.prototype.getAtRule = function() { var t3 = this.get("atRuleType"), e3 = this.get("mediaText"), n3 = t3 ? "@".concat(t3) : e3 ? "@media" : ""; return n3 + (e3 && n3 ? " ".concat(e3) : ""); }, o2.prototype.selectorsToString = function(t3) { void 0 === t3 && (t3 = {}); var e3 = [], n3 = this.get("state"), o3 = this.get("selectorsAdd"), r2 = { escape: function(t4) { return Ir && Ir.escape ? Ir.escape(t4) : t4; } }, i2 = this.get("selectors").getFullString(0, r2), s2 = n3 && !t3.skipState ? ":".concat(n3) : ""; return i2 && e3.push("".concat(i2).concat(s2)), o3 && !t3.skipAdd && e3.push(o3), e3.join(", "); }, o2.prototype.getDeclaration = function(t3) { void 0 === t3 && (t3 = {}); var e3 = "", n3 = this.attributes.important, o3 = this.selectorsToString(t3), r2 = this.styleToString(Dr({ important: n3 }, t3)), i2 = this.get("singleAtRule"); return (o3 || i2) && (r2 || t3.allowEmpty) && (e3 = i2 ? r2 : "".concat(o3, "{").concat(r2, "}")), e3; }, o2.prototype.getDevice = function() { var t3 = this.em, e3 = this.attributes, n3 = e3.atRuleType, o3 = e3.mediaText, r2 = (null == t3 ? void 0 : t3.get("DeviceManager").getDevices()) || [], i2 = r2.filter(function(t4) { return "" === t4.getWidthMedia(); })[0]; return "media" === n3 && o3 ? r2.filter(function(t4) { return t4.getWidthMedia() === ((e4 = /(-?\d*\.?\d+)\w{0,}/.exec(o3)) ? e4[0] : ""); var e4; })[0] || null : i2 || null; }, o2.prototype.getState = function() { var t3 = this.em, e3 = this.get("state"); return ((null == t3 ? void 0 : t3.get("SelectorManager").getStates()) || []).filter(function(t4) { return t4.getName() === e3; })[0] || null; }, o2.prototype.getComponent = function() { var t3, e3 = this.getSelectors(), n3 = 1 == e3.length && e3.at(0), o3 = n3 && n3.isId() && n3.get("name"); return o3 && (null === (t3 = this.em) || void 0 === t3 ? void 0 : t3.get("DomComponents").getById(o3)) || null; }, o2.prototype.toCSS = function(t3) { void 0 === t3 && (t3 = {}); var e3 = "", n3 = this.getAtRule(), o3 = this.getDeclaration(t3); return (o3 || t3.allowEmpty) && (e3 = o3), n3 && e3 && (e3 = "".concat(n3, "{").concat(e3, "}")), e3; }, o2.prototype.toJSON = function() { for (var e3, n3 = [], o3 = 0; o3 < arguments.length; o3++) n3[o3] = arguments[o3]; var r2 = u.Hn.prototype.toJSON.apply(this, n3); if (null === (e3 = this.em) || void 0 === e3 ? void 0 : e3.getConfig().avoidDefaults) { var i2 = this.defaults(); (0, t2.forEach)(i2, function(t3, e4) { r2[e4] === t3 && delete r2[e4]; }), delete r2.style.__p, (0, t2.isEmpty)(r2.selectors) && delete r2.selectors, (0, t2.isEmpty)(r2.style) && delete r2.style; } return r2; }, o2.prototype.compare = function(e3, n3, o3, r2) { var i2; void 0 === r2 && (r2 = {}); var s2 = n3 || "", a2 = o3 || "", l2 = r2.selectorsAdd || "", c2 = r2.atRuleType || ""; a2 && !c2 && (c2 = "media"); var u2 = ((0, t2.isArray)(e3) || e3.models ? e3.models || e3 : [e3]).map(function(t3) { return t3.getFullName(); }), p2 = null === (i2 = this.get("selectors")) || void 0 === i2 ? void 0 : i2.map(function(t3) { return t3.getFullName(); }), d2 = u2.slice().sort(), f2 = p2.slice().sort(); return !(u2.length !== p2.length || !d2.every(function(t3, e4) { return t3 === f2[e4]; })) && (this.get("state") === s2 && this.get("mediaText") === a2 && this.get("selectorsAdd") === l2 && this.get("atRuleType") === c2); }, o2; }(_e); const Vr = Fr; var Rr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Hr = function(t3) { function e3(e4, n2) { var o2 = t3.call(this, e4) || this; return o2.editor = null == n2 ? void 0 : n2.em, setTimeout(function() { o2.on("remove", o2.onRemove), o2.on("add", o2.onAdd); }), o2; } return Rr(e3, t3), e3.prototype.toJSON = function(t4) { return u.FE.prototype.toJSON.call(this, t4).filter(function(t5) { return t5.style && !t5.shallow; }); }, e3.prototype.onAdd = function(t4, e4, n2) { t4.ensureSelectors(t4, e4, n2); }, e3.prototype.onRemove = function(t4) { var e4 = this.editor; e4.stopListening(t4), e4.UndoManager.remove(t4); }, e3.prototype.add = function(t4, e4) { return void 0 === e4 && (e4 = {}), "string" == typeof t4 && (t4 = this.editor.get("Parser").parseCss(t4)), e4.em = this.editor, u.FE.prototype.add.apply(this, [t4, e4]); }, e3; }(u.FE); const zr = Hr; Hr.prototype.model = Vr; var Br = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ur = function() { return Ur = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ur.apply(this, arguments); }, Wr = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, $r = function(n2) { function o2(t3) { var e3 = n2.call(this, t3, "CssComposer", null, {}, Pr) || this; e3.Selectors = Fe, e3.storageKey = "styles"; var o3 = e3.config, r2 = o3.pStylePrefix; return r2 && (o3.stylePrefix = r2 + o3.stylePrefix), o3.rules = e3.em.config.style || o3.rules || "", e3.rules = new zr([], o3), e3; } return Br(o2, n2), o2.prototype.onLoad = function() { this.rules.add(this.config.rules, { silent: true }); }, o2.prototype.postLoad = function() { var t3, e3 = null === (t3 = this.em) || void 0 === t3 ? void 0 : t3.get("UndoManager"); e3 && e3.add(this.getAll()); }, o2.prototype.store = function() { return this.getProjectData(); }, o2.prototype.load = function(t3) { return this.loadProjectData(t3, { all: this.rules }); }, o2.prototype.add = function(t3, e3, n3, o3, r2) { void 0 === o3 && (o3 = {}), void 0 === r2 && (r2 = {}); var i2 = e3 || "", s2 = n3 || "", a2 = Ur({}, o3), l2 = this.get(t3, i2, s2, a2); return l2 && l2.config && !l2.config.singleAtRule || (a2.state = i2, a2.mediaText = s2, a2.selectors = [], s2 && !a2.atRuleType && (a2.atRuleType = "media"), (l2 = new Vr(a2, this.config)).get("selectors").add(t3, r2), this.rules.add(l2, r2)), l2; }, o2.prototype.get = function(e3, n3, o3, r2) { var i2 = e3; if ((0, t2.isString)(e3)) { var s2 = this.em.Selectors, a2 = e3.split(",")[0].trim(), l2 = this.em.Parser.parserCss.checkNode({ selectors: a2 })[0]; i2 = s2.get(l2.selectors); } return this.rules.find(function(t3) { return t3.compare(i2, n3, o3, r2); }) || null; }, o2.prototype.getAll = function() { return this.rules; }, o2.prototype.addCollection = function(n3, o3, r2) { void 0 === o3 && (o3 = {}), void 0 === r2 && (r2 = {}); var i2 = this.em, s2 = []; (0, t2.isString)(n3) && (n3 = i2.Parser.parseCss(n3)); for (var a2 = n3 instanceof Array ? n3 : [n3], l2 = 0, c2 = a2.length; l2 < c2; l2++) { var u2 = a2[l2] || {}; if (u2.selectors) { var p2 = null == i2 ? void 0 : i2.Selectors; p2 || console.warn("Selector Manager not found"); for (var d2 = u2.selectors, f2 = d2 instanceof Array ? d2 : [d2], h2 = [], g2 = 0, v2 = f2.length; g2 < v2; g2++) { var y2 = p2.add(f2[g2]); h2.push(y2); } var m2 = this.get(h2, u2.state, u2.mediaText, u2), b2 = this.add(h2, u2.state, u2.mediaText, u2, o3), _2 = !m2 || !o3.avoidUpdateStyle, w2 = u2.style || {}; if ((0, e2.isObject)(r2) && b2.set(r2, o3), _2) { var x2 = o3.extend ? Ur(Ur({}, b2.get("style")), w2) : w2; b2.set("style", x2, o3); } s2.push(b2); } } return s2; }, o2.prototype.addRules = function(t3) { return this.addCollection(t3); }, o2.prototype.setRule = function(t3, e3, n3) { void 0 === e3 && (e3 = {}), void 0 === n3 && (n3 = {}); var o3 = n3.atRuleType, r2 = n3.atRuleParams, i2 = this.em.Parser.parserCss.checkNode({ selectors: t3, style: e3 })[0], s2 = i2.state, a2 = i2.selectorsAdd, l2 = this.em.Selectors.add(i2.selectors), c2 = this.add(l2, s2, r2, { selectorsAdd: a2, atRule: o3 }); return c2.setStyle(e3, n3), c2; }, o2.prototype.getRule = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.em, o3 = n3.Selectors, r2 = n3.Parser.parserCss.checkNode({ selectors: t3 })[0], i2 = o3.get(r2.selectors), s2 = r2.state, a2 = r2.selectorsAdd, l2 = e3.atRuleType, c2 = e3.atRuleParams; return i2 ? this.get(i2, s2, c2, { selectorsAdd: a2, atRuleType: l2 }) : void 0; }, o2.prototype.getRules = function(e3) { var n3 = this.getAll(); if (!e3) return Wr([], n3.models, true); var o3 = { sort: true }, r2 = (0, t2.isString)(e3) ? e3.split(",").map(function(t3) { return t3.trim(); }) : e3; return n3.filter(function(t3) { return r2.indexOf(t3.getSelectors().getFullString(null, o3)) >= 0; }); }, o2.prototype.setIdRule = function(e3, n3, o3) { void 0 === n3 && (n3 = {}), void 0 === o3 && (o3 = {}); var r2 = o3.addOpts, i2 = void 0 === r2 ? {} : r2, s2 = o3.mediaText, a2 = o3.state || "", l2 = (0, t2.isUndefined)(s2) ? this.em.getCurrentMedia() : s2, c2 = this.em.Selectors.add({ name: e3, type: Le.TYPE_ID }, i2), u2 = this.add(c2, a2, l2, {}, i2); return u2.setStyle(n3, Ur(Ur({}, o3), i2)), u2; }, o2.prototype.getIdRule = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = n3.mediaText, r2 = n3.state || "", i2 = (0, t2.isUndefined)(o3) ? this.em.getCurrentMedia() : o3, s2 = this.em.Selectors.get(e3, Le.TYPE_ID); return s2 && this.get(s2, r2, i2); }, o2.prototype.setClassRule = function(t3, e3, n3) { void 0 === e3 && (e3 = {}), void 0 === n3 && (n3 = {}); var o3 = n3.state || "", r2 = n3.mediaText || this.em.getCurrentMedia(), i2 = this.em.Selectors.add({ name: t3, type: Le.TYPE_CLASS }), s2 = this.add(i2, o3, r2); return s2.setStyle(e3, n3), s2; }, o2.prototype.getClassRule = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = e3.state || "", o3 = e3.mediaText || this.em.getCurrentMedia(), r2 = this.em.Selectors.get(t3, Le.TYPE_CLASS); return r2 && this.get(r2, n3, o3); }, o2.prototype.remove = function(e3, n3) { var o3 = (0, t2.isString)(e3) ? this.getRules(e3) : e3, r2 = this.getAll().remove(o3, n3); return (0, t2.isArray)(r2) ? r2 : [r2]; }, o2.prototype.clear = function(t3) { return void 0 === t3 && (t3 = {}), this.getAll().reset([], t3), this; }, o2.prototype.getComponentRules = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = n3.state, r2 = n3.mediaText; n3.current && (o3 = this.em.get("state") || "", r2 = this.em.getCurrentMedia()); var i2 = e3.getId(); return this.getAll().filter(function(e4) { return !(!(0, t2.isUndefined)(o3) && e4.get("state") !== o3) && (!(!(0, t2.isUndefined)(r2) && e4.get("mediaText") !== r2) && e4.getSelectorsString() === "#".concat(i2)); }); }, o2.prototype.render = function() { var t3; return null === (t3 = this.rulesView) || void 0 === t3 || t3.remove(), this.rulesView = new Rt({ collection: this.rules, config: this.config }), this.rulesView.render().el; }, o2.prototype.destroy = function() { var t3; this.rules.reset(), this.rules.stopListening(), null === (t3 = this.rulesView) || void 0 === t3 || t3.remove(); }, o2; }(b); const qr = $r; const Gr = { appendTo: "", blocks: [], appendOnClick: false, custom: false }; var Kr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Yr = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return Kr(n2, e3), n2.prototype.defaults = function() { return { label: "", content: "", media: "", category: "", activate: false, select: void 0, resetId: false, disable: false, onClick: void 0, attributes: {} }; }, n2.prototype.getId = function() { return this.id; }, n2.prototype.getLabel = function() { return this.get("label"); }, n2.prototype.getMedia = function() { return this.get("media"); }, n2.prototype.getContent = function() { return this.get("content"); }, n2.prototype.getCategoryLabel = function() { var e4 = this.get("category"); return (0, t2.isFunction)(null == e4 ? void 0 : e4.get) ? e4.get("label") : (null == e4 ? void 0 : e4.label) ? null == e4 ? void 0 : e4.label : e4; }, n2; }(u.Hn); var Xr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Jr = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Xr(e3, t3), e3; }(u.FE); const Zr = Jr; Jr.prototype.model = Yr; var Qr = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const ti = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Qr(e3, t3), e3.prototype.defaults = function() { return { id: "", label: "", open: true, attributes: {} }; }, e3; }(u.Hn); var ei = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ni = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return ei(e3, t3), e3; }(u.FE); const oi = ni; ni.prototype.model = ti; var ri = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ii = function(n2) { function o2(t3, e3) { void 0 === e3 && (e3 = {}); var o3 = n2.call(this, t3) || this, r2 = o3.model; return o3.em = e3.em, o3.config = e3, o3.endDrag = o3.endDrag.bind(o3), o3.ppfx = e3.pStylePrefix || "", o3.listenTo(r2, "destroy remove", o3.remove), o3.listenTo(r2, "change", o3.render), o3; } return ri(o2, n2), o2.prototype.events = function() { return { click: "handleClick", mousedown: "startDrag", dragstart: "handleDragStart", drag: "handleDrag", dragend: "handleDragEnd" }; }, o2.prototype.__getModule = function() { return this.em.Blocks; }, o2.prototype.handleClick = function(e3) { var n3 = this, o3 = n3.config, r2 = n3.model, i2 = n3.em, s2 = r2.get("onClick") || o3.appendOnClick; if (i2.trigger("block:click", r2, e3), s2) { if ((0, t2.isFunction)(s2)) return s2(r2, null == i2 ? void 0 : i2.getEditor(), { event: e3 }); var a2, l2, c2 = o3.getSorter(), u2 = r2.get("content"), p2 = i2.getSelected(); if (c2.setDropContent(u2), p2) if (c2.validTarget(p2.getEl(), u2).valid) a2 = p2; else { var d2 = p2.parent(); d2 && c2.validTarget(d2.getEl(), u2).valid && (a2 = d2, l2 = d2.components().indexOf(p2) + 1); } if (!a2) { var f2 = i2.getWrapper(); c2.validTarget(f2.getEl(), u2).valid && (a2 = f2); } var h2 = a2 && a2.append(u2, { at: l2 })[0]; h2 && i2.setSelected(h2, { scroll: 1 }); } }, o2.prototype.startDrag = function(t3) { var n3 = this, o3 = n3.config, r2 = n3.em, i2 = n3.model, s2 = i2.get("disable"); if (0 === t3.button && o3.getSorter && !this.el.draggable && !s2) { r2.refreshCanvas(); var a2 = o3.getSorter(); a2.__currentBlock = i2, a2.setDragHelper(this.el, t3), a2.setDropContent(this.model.get("content")), a2.startSort(this.el), (0, e2.on)(document, "mouseup", this.endDrag); } }, o2.prototype.handleDragStart = function(t3) { this.__getModule().__startDrag(this.model, t3); }, o2.prototype.handleDrag = function(t3) { this.__getModule().__drag(t3); }, o2.prototype.handleDragEnd = function() { this.__getModule().__endDrag(); }, o2.prototype.endDrag = function() { (0, e2.off)(document, "mouseup", this.endDrag); var t3 = this.config.getSorter(); t3.moved = 0, t3.endMove(); }, o2.prototype.render = function() { var t3, n3 = this, o3 = n3.em, r2 = n3.el, i2 = n3.$el, s2 = n3.ppfx, a2 = n3.model, l2 = a2.get("disable"), c2 = a2.get("attributes") || {}, u2 = c2.class || "", p2 = "".concat(s2, "block"), d2 = o3 && o3.t("blockManager.labels.".concat(a2.id)) || a2.get("label"), f2 = a2.get("render"), h2 = a2.get("media"), g2 = l2 ? "".concat(p2, "--disable") : "".concat(s2, "four-color-h"); i2.attr(c2), r2.className = "".concat(u2, " ").concat(p2, " ").concat(s2, "one-bg ").concat(g2).trim(), r2.innerHTML = "\n ".concat(h2 ? '
').concat(h2, "
") : "", '\n
').concat(d2, "
\n "), r2.title = c2.title || (null === (t3 = r2.textContent) || void 0 === t3 ? void 0 : t3.trim()), r2.setAttribute("draggable", "".concat(!(!(0, e2.hasDnd)(o3) || l2))); var v2 = f2 && f2({ el: r2, model: a2, className: p2, prefix: s2 }); return v2 && (r2.innerHTML = v2), this; }, o2; }(u.G7); const si = ii; var ai = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), li = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }, ci = function(t3) { function e3(e4, n2) { var o2 = t3.call(this, e4) || this; o2.config = n2; var r2 = n2.pStylePrefix || ""; return o2.em = n2.em, o2.pfx = r2, o2.caretR = "fa fa-caret-right", o2.caretD = "fa fa-caret-down", o2.iconClass = "".concat(r2, "caret-icon"), o2.activeClass = "".concat(r2, "open"), o2.className = "".concat(r2, "block-category"), o2.listenTo(o2.model, "change:open", o2.updateVisibility), o2.model.view = o2, o2; } return ai(e3, t3), e3.prototype.events = function() { return { "click [data-title]": "toggle" }; }, e3.prototype.template = function(t4) { var e4 = t4.pfx, n2 = t4.label; return r(pi || (pi = li(['\n
\n \n ', '\n
\n
\n '], ['\n
\n \n ', '\n
\n
\n '])), e4, e4, n2, e4); }, e3.prototype.attributes = function() { return this.model.get("attributes") || {}; }, e3.prototype.updateVisibility = function() { this.model.get("open") ? this.open() : this.close(); }, e3.prototype.open = function() { this.$el.addClass(this.activeClass), this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretD), this.getBlocksEl().style.display = ""; }, e3.prototype.close = function() { this.$el.removeClass(this.activeClass), this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretR), this.getBlocksEl().style.display = "none"; }, e3.prototype.toggle = function() { var t4 = this.model; t4.set("open", !t4.get("open")); }, e3.prototype.getIconEl = function() { return this.iconEl || (this.iconEl = this.el.querySelector(".".concat(this.iconClass))), this.iconEl; }, e3.prototype.getBlocksEl = function() { return this.blocksEl || (this.blocksEl = this.el.querySelector(".".concat(this.pfx, "blocks-c"))), this.blocksEl; }, e3.prototype.append = function(t4) { this.getBlocksEl().appendChild(t4); }, e3.prototype.render = function() { var t4 = this, e4 = t4.em, n2 = t4.el, o2 = t4.$el, r2 = t4.model, i2 = t4.pfx, s2 = e4.t("blockManager.categories.".concat(r2.id)) || r2.get("label"); return n2.innerHTML = this.template({ pfx: i2, label: s2 }), o2.addClass(this.className), o2.css({ order: r2.get("order") }), this.updateVisibility(), this; }, e3; }(u.G7); const ui = ci; var pi, di = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), fi = function() { return fi = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, fi.apply(this, arguments); }, hi = function(e3) { function n2(n3, o2) { var r2 = e3.call(this, n3) || this; (0, t2.bindAll)(r2, "getSorter", "onDrag", "onDrop", "onMove"), r2.config = o2 || {}, r2.categories = n3.categories || "", r2.renderedCategories = {}; var i2 = r2.config.pStylePrefix || ""; r2.ppfx = i2, r2.noCatClass = "".concat(i2, "blocks-no-cat"), r2.blockContClass = "".concat(i2, "blocks-c"), r2.catsClass = "".concat(i2, "block-categories"); var s2 = r2.collection; return r2.listenTo(s2, "add", r2.addTo), r2.listenTo(s2, "reset", r2.render), r2.em = r2.config.em, r2.em && (r2.config.getSorter = r2.getSorter), r2; } return di(n2, e3), n2.prototype.__getModule = function() { return this.em.Blocks; }, n2.prototype.updateConfig = function(t3) { void 0 === t3 && (t3 = {}), this.config = fi(fi({}, this.config), t3); }, n2.prototype.getSorter = function() { var t3 = this.em; if (t3) { if (!this.sorter) { var e4 = t3.Utils, n3 = t3.Canvas; this.sorter = new e4.Sorter({ container: n3.getBody(), placer: n3.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: this.ppfx, onStart: this.onDrag, onEndMove: this.onDrop, onMove: this.onMove, document: n3.getFrameEl().contentDocument, direction: "a", wmargin: 1, nested: 1, em: t3, canvasRelative: 1 }); } return this.sorter; } }, n2.prototype.onDrag = function(t3) { this.em.stopDefault(), this.__getModule().__startDrag(this.sorter.__currentBlock, t3); }, n2.prototype.onMove = function(t3) { this.__getModule().__drag(t3), this.em.trigger("block:drag:move", t3); }, n2.prototype.onDrop = function(t3) { this.em.runDefault(), this.__getModule().__endDrag({ component: t3 }), delete this.sorter.__currentBlock; }, n2.prototype.addTo = function(t3) { this.add(t3); }, n2.prototype.add = function(e4, n3) { var o2 = this.config, r2 = new si({ model: e4, attributes: e4.get("attributes") }, o2).render().el, i2 = e4.get("category"); if (i2 && this.categories && !o2.ignoreCategories) { (0, t2.isString)(i2) ? i2 = { id: i2, label: i2 } : (0, t2.isObject)(i2) && !i2.id && (i2.id = i2.label); var s2 = this.categories.add(i2), a2 = s2.get("id"), l2 = this.getCategoriesEl(), c2 = this.renderedCategories[a2]; return e4.set("category", s2, { silent: true }), !c2 && l2 && (c2 = new ui({ model: s2 }, o2).render(), this.renderedCategories[a2] = c2, l2.appendChild(c2.el)), void (c2 && c2.append(r2)); } n3 ? n3.appendChild(r2) : this.append(r2); }, n2.prototype.getCategoriesEl = function() { return this.catsEl || (this.catsEl = this.el.querySelector(".".concat(this.catsClass))), this.catsEl; }, n2.prototype.getBlocksEl = function() { return this.blocksEl || (this.blocksEl = this.el.querySelector(".".concat(this.noCatClass, " .").concat(this.blockContClass))), this.blocksEl; }, n2.prototype.append = function(t3) { var e4 = this.getBlocksEl(); e4 && e4.appendChild(t3); }, n2.prototype.render = function() { var t3 = this, e4 = this.ppfx, n3 = document.createDocumentFragment(); delete this.catsEl, delete this.blocksEl, this.renderedCategories = {}, this.el.innerHTML = '\n
\n
\n
\n
\n '), this.collection.each(function(e5) { return t3.add(e5, n3); }), this.append(n3); var o2 = "".concat(this.blockContClass, "s ").concat(e4, "one-bg ").concat(e4, "two-color"); return this.$el.addClass(o2), this.rendered = true, this; }, n2; }(u.G7); const gi = hi; var vi = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), yi = function() { return yi = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, yi.apply(this, arguments); }, mi = "block", bi = "".concat(mi, ":"), _i = "".concat(bi, "add"), wi = "".concat(bi, "update"), xi = "".concat(bi, "remove"), Ci = "".concat(xi, ":before"), Si = "".concat(bi, "drag"), Oi = { all: mi, update: wi, add: _i, remove: xi, removeBefore: Ci, drag: Si, dragStart: "".concat(Si, ":start"), dragEnd: "".concat(Si, ":stop"), custom: "".concat(bi, "custom") }, Ti = function(e3) { function n2(t3) { var n3, o2 = this; return (o2 = e3.call(this, t3, "BlockManager", new Zr((null === (n3 = t3.config.blockManager) || void 0 === n3 ? void 0 : n3.blocks) || []), Oi, Gr) || this).Block = Yr, o2.Blocks = Zr, o2.Category = ti, o2.Categories = oi, o2.storageKey = "", o2.blocks = o2.all, o2.blocksVisible = new Zr(o2.blocks.models), o2.categories = new oi(), o2.blocks.on("add", function(t4) { return o2.blocksVisible.add(t4); }), o2.blocks.on("remove", function(t4) { return o2.blocksVisible.remove(t4); }), o2.blocks.on("reset", function(t4) { return o2.blocksVisible.reset(t4.models); }), o2; } return vi(n2, e3), n2.prototype.__trgCustom = function() { this.em.trigger(this.events.custom, this.__customData()); }, n2.prototype.__customData = function() { var t3 = this, e4 = this.__getBehaviour(); return { bm: this, blocks: this.getAll().models, container: e4.container, dragStart: function(e5, n3) { return t3.startDrag(e5, n3); }, drag: function(e5) { return t3.__drag(e5); }, dragStop: function(e5) { return t3.endDrag(e5); } }; }, n2.prototype.__startDrag = function(t3, e4) { var n3 = this, o2 = n3.em, r2 = n3.events, i2 = n3.blocks, s2 = t3.getContent ? t3.getContent() : t3; this._dragBlock = t3, o2.set({ dragResult: null, dragContent: s2 }), [o2, i2].map(function(n4) { return n4.trigger(r2.dragStart, t3, e4); }); }, n2.prototype.__drag = function(t3) { var e4 = this, n3 = e4.em, o2 = e4.events, r2 = e4.blocks, i2 = this._dragBlock; [n3, r2].map(function(e5) { return e5.trigger(o2.drag, i2, t3); }); }, n2.prototype.__endDrag = function(e4) { void 0 === e4 && (e4 = {}); var n3 = this, o2 = n3.em, r2 = n3.events, i2 = n3.blocks, s2 = this._dragBlock, a2 = e4.component || o2.get("dragResult"); if (delete this._dragBlock, a2 && s2) { var l2 = "activeOnRender", c2 = a2.get && a2.get(l2), u2 = s2.get("activate") || c2, p2 = s2.get("select"), d2 = (0, t2.isArray)(a2) ? a2[0] : a2; (p2 || u2 && false !== p2) && o2.setSelected(d2), u2 && (d2.trigger("active"), c2 && d2.unset(l2)), s2.get("resetId") && d2.onAll(function(t3) { return t3.resetId(); }); } o2.set({ dragResult: null, dragContent: null }), s2 && [o2, i2].map(function(t3) { return t3.trigger(r2.dragEnd, a2, s2); }); }, n2.prototype.__getFrameViews = function() { return this.em.get("Canvas").getFrames().map(function(t3) { return t3.view; }); }, n2.prototype.__behaviour = function(t3) { return void 0 === t3 && (t3 = {}), this._bhv = yi(yi({}, this._bhv || {}), t3); }, n2.prototype.__getBehaviour = function() { return this._bhv || {}; }, n2.prototype.startDrag = function(t3, e4) { this.__startDrag(t3, e4), this.__getFrameViews().forEach(function(t4) { return t4.droppable.startCustom(); }); }, n2.prototype.endDrag = function(t3) { this.__getFrameViews().forEach(function(e4) { return e4.droppable.endCustom(t3); }), this.__endDrag(); }, n2.prototype.postRender = function() { var t3 = this, e4 = t3.categories, n3 = t3.config, o2 = t3.em, r2 = this.blocksVisible; this.blocksView = new gi({ collection: r2, categories: e4 }, yi(yi({}, n3), { em: o2 })), this.__appendTo(r2.models), this.__trgCustom(); }, n2.prototype.add = function(t3, e4, n3) { void 0 === n3 && (n3 = {}); var o2 = e4 || {}; return o2.id = t3, this.blocks.add(o2, n3); }, n2.prototype.get = function(t3) { return this.blocks.get(t3); }, n2.prototype.getAll = function() { return this.blocks; }, n2.prototype.getAllVisible = function() { return this.blocksVisible; }, n2.prototype.remove = function(t3, e4) { return void 0 === e4 && (e4 = {}), this.__remove(t3, e4); }, n2.prototype.getCategories = function() { return this.categories; }, n2.prototype.getContainer = function() { var t3; return null === (t3 = this.blocksView) || void 0 === t3 ? void 0 : t3.el; }, n2.prototype.render = function(t3, e4) { void 0 === e4 && (e4 = {}); var n3 = this, o2 = n3.categories, r2 = n3.config, i2 = n3.em, s2 = t3 || this.getAll().models; if (e4.external) { var a2 = new Zr(s2); return new gi({ collection: a2, categories: o2 }, yi(yi({ em: i2 }, r2), e4)).render().el; } return this.blocksView && (this.blocksView.updateConfig(e4), this.blocksView.collection.reset(s2), this.blocksView.rendered || (this.blocksView.render(), this.blocksView.rendered = true)), this.getContainer(); }, n2.prototype.destroy = function() { var t3, e4 = [this.blocks, this.blocksVisible, this.categories]; e4.map(function(t4) { return t4.stopListening(); }), e4.map(function(t4) { return t4.reset(); }), null === (t3 = this.blocksView) || void 0 === t3 || t3.remove(); }, n2; }(b); const ki = Ti; const Pi = { stylePrefix: "clm-", appendTo: "", selectors: [], states: [{ name: "hover" }, { name: "active" }, { name: "nth-of-type(2n)" }], iconAdd: '', iconSync: '', iconTagOn: '', iconTagOff: '', iconTagRemove: '', componentFirst: false, custom: false }; var Ei = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ai = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Ei(e3, t3), e3.prototype.defaults = function() { return { name: "", label: "" }; }, e3.prototype.getName = function() { return this.get("name"); }, e3.prototype.getLabel = function() { return this.get("label") || this.getName(); }, e3; }(u.Hn); const ji = Ai; Ai.prototype.idAttribute = "name"; var Mi = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Li = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }, Di = "contentEditable", Ni = function(t3) { function e3(e4) { void 0 === e4 && (e4 = {}); var n2 = t3.call(this, e4) || this, o2 = e4.config || {}; return n2.config = o2, n2.module = e4.module, n2.coll = e4.coll || null, n2.pfx = o2.stylePrefix || "", n2.ppfx = o2.pStylePrefix || "", n2.em = o2.em, n2.listenTo(n2.model, "change:active", n2.updateStatus), n2; } return Mi(e3, t3), e3.prototype.template = function() { var t4 = this, e4 = t4.pfx, n2 = t4.model, o2 = t4.config, i2 = n2.get("label") || ""; return r(Fi || (Fi = Li(['\n \n ', '\n $', " \n "], ['\n \n ', '\n $', " \n "])), e4, e4, e4, i2, e4, e4, o2.iconTagRemove); }, e3.prototype.events = function() { return { "click [data-tag-remove]": "removeTag", "click [data-tag-status]": "changeStatus", "dblclick [data-tag-name]": "startEditTag", "focusout [data-tag-name]": "endEditTag" }; }, e3.prototype.getInputEl = function() { return this.inputEl || (this.inputEl = this.el.querySelector("[data-tag-name]")), this.inputEl; }, e3.prototype.startEditTag = function() { var t4 = this.em, e4 = this.getInputEl(); e4[Di] = "true", e4.focus(), null == t4 || t4.setEditing(true); }, e3.prototype.endEditTag = function() { var t4 = this.model, e4 = this.em, n2 = this.getInputEl(), o2 = n2.textContent || "", r2 = null == e4 ? void 0 : e4.Selectors; n2[Di] = "false", null == e4 || e4.setEditing(false), r2 && r2.rename(t4, o2) !== t4 && (n2.innerText = t4.get("label")); }, e3.prototype.changeStatus = function() { var t4 = this.model; t4.set("active", !t4.get("active")); }, e3.prototype.removeTag = function() { this.module.removeSelected(this.model); }, e3.prototype.updateStatus = function() { var t4 = this, e4 = t4.model, n2 = t4.$el, o2 = t4.config, r2 = o2.iconTagOn, i2 = o2.iconTagOff, s2 = n2.find("[data-tag-status]"); e4.get("active") ? (s2.html(r2), n2.removeClass("opac50")) : (s2.html(i2), n2.addClass("opac50")); }, e3.prototype.render = function() { var t4 = this.pfx, e4 = this.ppfx; return this.$el.html(this.template()), this.$el.attr("class", "".concat(t4, "tag ").concat(e4, "three-bg")), this.updateStatus(), this; }, e3; }(u.G7); const Ii = Ni; var Fi, Vi = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ri = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }, Hi = function(e3) { function n2(n3) { void 0 === n3 && (n3 = {}); var o2 = e3.call(this, n3) || this; o2.config = n3.config || {}, o2.pfx = o2.config.stylePrefix || "", o2.ppfx = o2.config.pStylePrefix || "", o2.className = o2.pfx + "tags", o2.stateInputId = o2.pfx + "states", o2.stateInputC = o2.pfx + "input-c", o2.states = o2.config.states || []; var r2 = o2.config.em, i2 = o2.collection; o2.target = r2; var s2 = r2.Selectors; o2.module = s2, o2.em = r2, o2.componentChanged = (0, t2.debounce)(o2.componentChanged.bind(o2), 0), o2.checkSync = (0, t2.debounce)(o2.checkSync.bind(o2), 0); return o2.listenTo(r2, "component:toggled component:update:classes", o2.componentChanged), o2.listenTo(r2, "styleManager:update", o2.componentChanged), o2.listenTo(r2, "component:update:classes change:state", o2.__handleStateChange), o2.listenTo(r2, "styleable:change change:device", o2.checkSync), o2.listenTo(i2, "add", o2.addNew), o2.listenTo(i2, "reset", o2.renderClasses), o2.listenTo(i2, "remove", o2.tagRemoved), o2.listenTo(s2.getAll(), s2.events.state, (0, t2.debounce)(function() { return o2.renderStates(); }, 0)), o2.delegateEvents(), o2; } return Vi(n2, e3), n2.prototype.template = function(t3) { var e4 = t3.labelInfo, n3 = t3.labelHead, o2 = t3.iconSync, i2 = t3.iconAdd, s2 = t3.pfx, a2 = t3.ppfx; return r(Bi || (Bi = Ri(['
\n
', '
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $', ' \n \n
\n
\n
', ':
\n
\n
'], ['
\n
', '
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $', ' \n \n
\n
\n
', ':
\n
\n
'])), s2, s2, s2, s2, n3, s2, s2, s2, a2, a2, a2, s2, a2, a2, s2, a2, s2, s2, s2, s2, s2, i2, s2, s2, o2, s2, s2, e4, s2); }, n2.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" }; }, n2.prototype.syncStyle = function() { var t3, e4 = this.em, n3 = this.getTarget(), o2 = e4.Css, r2 = this.getCommonSelectors({ opts: { noDisabled: 1 } }), i2 = e4.get("state"), s2 = e4.getCurrentMedia(), a2 = [], l2 = o2.get(r2, i2, s2) || o2.add(r2, i2, s2); this.getTargets().forEach(function(e5) { var n4 = o2.getIdRule(e5.getId(), { state: i2, mediaText: s2 }); t3 = n4.getStyle(), n4.setStyle({}), a2.push(n4); }), t3 && l2.addStyle(t3), e4.trigger("component:toggled"), e4.trigger("component:sync-style", { component: n3, selectors: r2, mediaText: s2, rule: l2, ruleComponents: a2, state: i2 }); }, n2.prototype.tagRemoved = function(t3) { this.updateStateVis(); }, n2.prototype.addNew = function(t3) { this.addToClasses(t3); }, n2.prototype.startNewTag = function() { var t3, e4; null === (t3 = this.$addBtn) || void 0 === t3 || t3.css({ display: "none" }), null === (e4 = this.$input) || void 0 === e4 || e4.show().focus(); }, n2.prototype.endNewTag = function() { var t3, e4; null === (t3 = this.$addBtn) || void 0 === t3 || t3.css({ display: "" }), null === (e4 = this.$input) || void 0 === e4 || e4.hide().val(""); }, n2.prototype.onInputKeyUp = function(t3) { var e4; 13 === t3.keyCode ? (t3.preventDefault(), this.addNewTag(null === (e4 = this.$input) || void 0 === e4 ? void 0 : e4.val())) : 27 === t3.keyCode && this.endNewTag(); }, n2.prototype.checkStates = function() { var t3 = this.em.getState(), e4 = this.getStates(); e4 && e4.val(t3); }, n2.prototype.componentChanged = function(t3) { var e4 = (void 0 === t3 ? {} : t3).targets; this.updateSelection(e4); }, n2.prototype.updateSelection = function(e4) { var n3 = e4 || this.getTargets(), o2 = []; return (n3 = (0, t2.isArray)(n3) ? n3 : [n3]) && n3.length && (o2 = this.getCommonSelectors({ targets: n3 }), this.checkSync({ validSelectors: o2 })), this.collection.reset(o2), this.updateStateVis(n3), this.module.__trgCustom(), o2; }, n2.prototype.getCommonSelectors = function(t3) { var e4 = void 0 === t3 ? {} : t3, n3 = e4.targets, o2 = e4.opts, r2 = void 0 === o2 ? {} : o2, i2 = n3 || this.getTargets(); return this.module.__getCommonSelectors(i2, r2); }, n2.prototype._commonSelectors = function() { for (var t3, e4 = [], n3 = 0; n3 < arguments.length; n3++) e4[n3] = arguments[n3]; return (t3 = this.module).__common.apply(t3, e4); }, n2.prototype.checkSync = function() { var e4, n3 = this, o2 = n3.$btnSyncEl, r2 = n3.config, i2 = n3.collection, s2 = this.getTarget(); if (s2 && r2.componentFirst && i2.length) { var a2 = s2.getStyle(); e4 = !(0, t2.isEmpty)(a2); } o2 && o2[e4 ? "show" : "hide"](); }, n2.prototype.getTarget = function() { return this.target.getSelected(); }, n2.prototype.getTargets = function() { return this.target.getSelectedAll(); }, n2.prototype.updateStateVis = function(t3) { var e4 = this.em, n3 = e4 && e4.getConfig().avoidInlineStyle, o2 = this.collection.length || n3 ? "" : "none"; this.getStatesC().css("display", o2), this.updateSelector(t3); }, n2.prototype.__handleStateChange = function() { this.updateSelector(this.getTargets()); }, n2.prototype.updateSelector = function(e4) { var n3 = this, o2 = this.el.querySelector("[data-selected]"), r2 = [], i2 = e4 || this.getTargets(); (i2 = (0, t2.isArray)(i2) ? i2 : [i2]).forEach(function(t3) { return r2.push(n3.__getName(t3)); }), o2 && (o2.innerHTML = r2.join(", ")), this.checkStates(); }, n2.prototype.__getName = function(e4) { var n3, o2 = this, i2 = o2.pfx, s2 = o2.config, a2 = o2.em, l2 = s2.selectedName, c2 = s2.componentFirst; if ((0, t2.isString)(e4)) n3 = r(Ui || (Ui = Ri(['', ""], ['', ""])), i2, e4); else { var u2 = null == e4 ? void 0 : e4.getSelectors(); if (!u2) return ""; var p2 = u2.getStyleable(), d2 = a2.get("state"), f2 = e4.getId ? r(Wi || (Wi = Ri(['', '\n #', ""], ['', '\n #', ""])), i2, e4.getName(), i2, e4.getId()) : ""; n3 = (n3 = this.collection.getFullString(p2)) ? r($i || ($i = Ri(['', ""], ['', ""])), i2, n3) : e4.get("selectorsAdd") || f2, n3 = c2 && f2 ? f2 : n3, n3 += d2 ? r(qi || (qi = Ri([':', ""], [':', ""])), i2, d2) : "", n3 = l2 ? l2({ result: n3, state: d2, target: e4 }) : n3; } return n3 && '').concat(n3, ""); }, n2.prototype.stateChanged = function(t3) { var e4 = this.em, n3 = t3.target.value; e4.set("state", n3); }, n2.prototype.addNewTag = function(t3) { var e4 = t3.trim(); e4 && (this.module.addSelected({ label: e4 }), this.endNewTag()); }, n2.prototype.addToClasses = function(t3, e4) { var n3 = e4, o2 = this.getClasses(), r2 = new Ii({ model: t3, config: this.config, coll: this.collection, module: this.module }).render().el; return n3 ? n3.appendChild(r2) : o2.append(r2), r2; }, n2.prototype.renderClasses = function() { var t3 = this, e4 = document.createDocumentFragment(), n3 = this.getClasses(); n3.empty(), this.collection.each(function(n4) { return t3.addToClasses(n4, e4); }), n3.append(e4); }, n2.prototype.getClasses = function() { return this.$el.find("[data-selectors]"); }, n2.prototype.getStates = function() { if (!this.$states) { var t3 = this.$el.find("[data-states]"); this.$states = t3[0] && t3; } return this.$states; }, n2.prototype.getStatesC = function() { return this.$statesC || (this.$statesC = this.$el.find("#" + this.stateInputC)), this.$statesC; }, n2.prototype.renderStates = function() { var t3 = this.module, e4 = this.em, n3 = e4.t("selectorManager.emptyState"), o2 = t3.getStates().map(function(t4) { var n4 = e4.t("selectorManager.states.".concat(t4.id)) || t4.getLabel() || t4.id; return '"); }).join(""), r2 = this.getStates(); r2 && r2.html('").concat(o2)), this.checkStates(); }, n2.prototype.render = function() { var t3 = this, e4 = t3.em, n3 = t3.pfx, o2 = t3.ppfx, r2 = t3.config, i2 = t3.$el, s2 = t3.el, a2 = r2.render, l2 = { iconSync: r2.iconSync, iconAdd: r2.iconAdd, labelHead: e4.t("selectorManager.label"), labelInfo: e4.t("selectorManager.selected"), ppfx: o2, pfx: n3, el: s2 }; i2.html(this.template(l2)); var c2 = a2 && a2(l2); return c2 && c2 !== s2 && i2.empty().append(c2), this.$input = i2.find("[data-input]"), this.$addBtn = i2.find("[data-add]"), this.$classes = i2.find("#" + n3 + "tags-c"), this.$btnSyncEl = i2.find("[data-sync-style]"), this.$input.hide(), this.renderStates(), this.renderClasses(), i2.attr("class", "".concat(this.className, " ").concat(o2, "one-bg ").concat(o2, "two-color")), this; }, n2; }(u.G7); const zi = Hi; var Bi, Ui, Wi, $i, qi, Gi = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ki = function() { return Ki = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ki.apply(this, arguments); }, Yi = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Xi = function(e3) { return (0, t2.isString)(e3) && "#" == e3[0]; }, Ji = function(e3) { return (0, t2.isString)(e3) && "." == e3[0]; }, Zi = "selector", Qi = "".concat(Zi, ":"), ts = "".concat(Qi, "add"), es = "".concat(Qi, "update"), ns = "".concat(Qi, "remove"), os = "".concat(ns, ":before"), rs = "".concat(Qi, "custom"), is = "".concat(Qi, "state"), ss = { all: Zi, update: es, add: ts, remove: ns, removeBefore: os, state: is, custom: rs }, as = function(n2) { function o2(e3) { var o3 = n2.call(this, e3, "SelectorManager", new Fe([]), ss, Pi, { skipListen: true }) || this; o3.Selector = Le, o3.Selectors = Fe, o3.storageKey = "", (0, t2.bindAll)(o3, "__updateSelectedByComponents"); var r2 = o3.config, i2 = r2.pStylePrefix; i2 && (r2.stylePrefix = i2 + r2.stylePrefix), o3.all = new Fe(r2.selectors), o3.selected = new Fe([], { em: e3, config: r2 }), o3.states = new u.FE(r2.states.map(function(t3) { return new ji(t3); }), { model: ji }), o3.model = new u.Hn({ cFirst: r2.componentFirst, _undo: true }), o3.__update = (0, t2.debounce)(function() { return o3.__trgCustom(); }, 0), o3.__initListen({ collections: [o3.states, o3.selected], propagate: [{ entity: o3.states, event: o3.events.state }] }), e3.on("change:state", function(t3, n3) { return e3.trigger(is, n3); }), o3.model.on("change:cFirst", function(t3, n3) { return e3.trigger("selector:type", n3); }), e3.on("component:toggled component:update:classes", o3.__updateSelectedByComponents); return o3.model.listenTo(e3, "component:toggled component:update:classes change:device styleManager:update selector:state selector:type style:target", function() { return o3.__update(); }), o3; } return Gi(o2, n2), o2.prototype.__trgCustom = function(t3) { this.em.trigger(this.events.custom, this.__customData(t3)); }, o2.prototype.getAll = function(t3) { return void 0 === t3 && (t3 = {}), this.all ? t3.array ? Yi([], this.all.models, true) : this.all : []; }, o2.prototype.__customData = function(t3) { void 0 === t3 && (t3 = {}); var e3 = t3.container; return { states: this.getStates(), selected: this.getSelected(), container: e3 }; }, o2.prototype.postRender = function() { this.__appendTo(), this.__trgCustom(); }, o2.prototype.select = function(t3, n3) { void 0 === n3 && (n3 = {}); var o3 = Array.isArray(t3) ? t3 : [t3], r2 = this.em.Styles.select(o3, n3); this.selected.reset(this.__getCommonSelectors(r2)); var i2 = this.selectorTags, s2 = r2.filter(function(t4) { return t4; }).map(function(t4) { return (0, e2.isComponent)(t4) || (0, e2.isRule)(t4) && !t4.get("selectorsAdd") ? t4 : t4.getSelectorsString(); }); return i2 && i2.componentChanged({ targets: s2 }), this; }, o2.prototype.addSelector = function(e3, n3, o3) { void 0 === n3 && (n3 = {}), void 0 === o3 && (o3 = {}); var r2 = Ki({}, n3); (0, t2.isObject)(e3) ? r2 = e3 : r2.name = e3, Xi(r2.name) ? (r2.name = r2.name.substr(1), r2.type = Le.TYPE_ID) : Ji(r2.name) && (r2.name = r2.name.substr(1)), r2.label && !r2.name && (r2.name = this.escapeName(r2.label)); var i2 = r2.name, s2 = this.getConfig(), a2 = this.all, l2 = this.em, c2 = i2 ? this.get(i2, r2.type) : a2.where(r2)[0]; if (!c2) { var u2 = r2 instanceof Le ? r2 : new Le(r2, Ki(Ki({}, o3), { config: s2, em: l2 })); return a2.add(u2, o3); } return c2; }, o2.prototype.getSelector = function(t3, e3) { return void 0 === e3 && (e3 = Le.TYPE_CLASS), Xi(t3) ? (t3 = t3.substr(1), e3 = Le.TYPE_ID) : Ji(t3) && (t3 = t3.substr(1)), this.all.where({ name: t3, type: e3 })[0]; }, o2.prototype.add = function(e3, n3) { var o3 = this; void 0 === n3 && (n3 = {}); var r2 = (0, t2.isString)(e3) ? {} : n3; return (0, t2.isArray)(e3) ? e3.map(function(t3) { return o3.addSelector(t3, n3, r2); }) : this.addSelector(e3, n3, r2); }, o2.prototype.addClass = function(e3) { var n3 = this, o3 = []; return (0, t2.isString)(e3) && (e3 = e3.trim().split(" ")), e3.forEach(function(t3) { return o3.push(n3.addSelector(t3)); }), o3; }, o2.prototype.get = function(e3, n3) { var o3 = this; if ((0, t2.isArray)(e3)) { var r2 = []; return e3.map(function(t3) { return o3.getSelector(t3); }).filter(Boolean).forEach(function(t3) { return r2.indexOf(t3) < 0 && r2.push(t3); }), r2; } return this.getSelector(e3, n3); }, o2.prototype.remove = function(t3, e3) { return this.__remove(t3, e3); }, o2.prototype.rename = function(t3, e3, n3) { var o3 = this.escapeName(e3); return this.get(o3) || t3.set({ name: o3, label: e3 }, n3); }, o2.prototype.setState = function(t3) { return this.em.setState(t3), this; }, o2.prototype.getState = function() { return this.em.getState(); }, o2.prototype.getStates = function() { return Yi([], this.states.models, true); }, o2.prototype.setStates = function(t3, e3) { return this.states.reset(t3.map(function(t4) { return new ji(t4); }), e3); }, o2.prototype.getSelected = function() { return this.__getCommon(); }, o2.prototype.getSelectedAll = function() { return Yi([], this.selected.models, true); }, o2.prototype.addSelected = function(t3) { var e3 = this.add(t3); this.em.getSelectedAll().forEach(function(t4) { t4.getSelectors().add(e3); }); }, o2.prototype.removeSelected = function(t3) { this.em.getSelectedAll().forEach(function(e3) { !t3.get("protected") && e3 && e3.getSelectors().remove(t3); }); }, o2.prototype.duplicateSelected = function(t3, e3) { var n3 = this; void 0 === e3 && (e3 = {}); var o3 = this.em, r2 = this.getSelected(); if (!(r2.indexOf(t3) < 0)) { var i2 = this.getState(), s2 = o3.getCurrentMedia(), a2 = o3.Css.get(r2, i2, s2), l2 = null == a2 ? void 0 : a2.getStyle(); if (o3.getSelectedAll().forEach(function(o4) { var r3 = o4.getSelectors(); if (r3.includes(t3)) { var i3 = e3.suffix || " copy", s3 = t3.getLabel(), a3 = n3.addSelector("".concat(s3).concat(i3)), l3 = r3.indexOf(t3); r3.remove(t3), r3.add(a3, { at: l3 }); } }), l2) o3.Css.add(this.getSelected(), i2, s2).setStyle(l2); } }, o2.prototype.getSelectedTargets = function() { return this.em.Styles.getSelectedAll(); }, o2.prototype.setComponentFirst = function(t3) { this.getConfig().componentFirst = t3, this.model.set({ cFirst: t3 }); }, o2.prototype.getComponentFirst = function() { return this.getConfig().componentFirst; }, o2.prototype.escapeName = function(t3) { var e3 = this.getConfig().escapeName; return e3 ? e3(t3) : Le.escapeName(t3); }, o2.prototype.render = function(t3) { var e3 = this.selectorTags, n3 = this.getConfig(), o3 = null == e3 ? void 0 : e3.el; return this.selected.reset(t3), this.selectorTags = new zi({ el: o3, collection: this.selected, module: this, config: n3 }), this.selectorTags.render().el; }, o2.prototype.destroy = function() { var t3 = this.selectorTags; this.model.stopListening(), this.__update.cancel(), this.__destroy(), null == t3 || t3.remove(), this.selectorTags = void 0; }, o2.prototype.__getCommon = function() { return this.__getCommonSelectors(this.em.getSelectedAll()); }, o2.prototype.__getCommonSelectors = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = t3.map(function(t4) { return t4.getSelectors && t4.getSelectors().getValid(e3); }).filter(Boolean); return this.__common.apply(this, n3); }, o2.prototype.__common = function() { for (var t3 = this, e3 = [], n3 = 0; n3 < arguments.length; n3++) e3[n3] = arguments[n3]; return e3.length ? 1 === e3.length ? e3[0] : 2 === e3.length ? e3[0].filter(function(t4) { return e3[1].indexOf(t4) >= 0; }) : e3.slice(1).reduce(function(e4, n4) { return t3.__common(e4, n4); }, e3[0]) : []; }, o2.prototype.__updateSelectedByComponents = function() { this.selected.reset(this.__getCommon()); }, o2; }(b); const ls = as; const cs = { textTags: ["br", "b", "i", "u", "a", "ul", "ol"], parserCss: void 0, parserHtml: void 0, optionsHtml: { htmlType: "text/html", allowScripts: false, allowUnsafeAttr: false, keepEmptyTextNodes: false } }; var us = { 4: "media", 5: "font-face", 6: "page", 7: "keyframes", 11: "counter-style", 12: "supports", 13: "document", 14: "font-feature-values", 15: "viewport" }, ps = (0, t2.keys)(us), ds = ["5", "6", "11", "15"], fs = ["font-face", "page", "counter-style", "viewport"], hs = function(t3) { void 0 === t3 && (t3 = ""); for (var e3 = [], n2 = [], o2 = t3.split(","), r2 = 0, i2 = o2.length; r2 < i2; r2++) { var s2 = o2[r2].trim(); if (/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(s2) || /^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(s2)) { var a2 = s2.split(".").filter(Boolean); n2.push(a2); } else e3.push(s2); } return { result: n2, add: e3 }; }, gs = function(t3) { for (var e3 = t3.style, n2 = {}, o2 = 0, r2 = e3.length; o2 < r2; o2++) { var i2 = e3[o2], s2 = e3.getPropertyValue(i2), a2 = e3.getPropertyPriority(i2); n2[i2] = "".concat(s2).concat(a2 ? " !".concat(a2) : ""); } return n2; }, vs = function(t3) { return (t3.conditionText || t3.media && t3.media.mediaText || t3.name || t3.selectorText || "").trim(); }, ys = function(t3, e3, n2) { void 0 === e3 && (e3 = {}), void 0 === n2 && (n2 = {}); var o2 = {}, r2 = t3.length, i2 = t3[r2 - 1], s2 = i2 ? i2.split(/:(.+)/) : [], a2 = s2[1], l2 = n2.atRule, c2 = n2.selectorsAdd, u2 = n2.mediaText; return fs.indexOf(l2) >= 0 && (o2.singleAtRule = true), l2 && (o2.atRuleType = l2), c2 && (o2.selectorsAdd = c2), u2 && (o2.mediaText = u2), a2 && (t3[r2 - 1] = s2[0], o2.state = a2, s2.splice(s2.length - 1, 1)), o2.selectors = t3, o2.style = e3, o2; }, ms = function(t3) { for (var e3 = [], n2 = t3.cssRules || [], o2 = 0, r2 = n2.length; o2 < r2; o2++) { var i2 = n2[o2], s2 = i2.type.toString(), a2 = false, l2 = "", c2 = "", u2 = i2.selectorText || i2.keyText, p2 = ds.indexOf(s2) >= 0; if (p2) a2 = true, l2 = us[s2], c2 = vs(i2); else if (ps.indexOf(s2) >= 0) { var d2 = ms(i2); c2 = vs(i2); for (var f2 = 0, h2 = d2.length; f2 < h2; f2++) { var g2 = d2[f2]; c2 && (g2.mediaText = c2), g2.atRuleType = us[s2]; } e3 = e3.concat(d2); } if (u2 || p2) { for (var v2 = gs(i2), y2 = hs(u2), m2 = y2.add, b2 = y2.result, _2 = void 0, w2 = 0, x2 = b2.length; w2 < x2; w2++) { var C2 = ys(b2[w2], v2, { atRule: us[s2] }); e3.push(C2), _2 = C2; } if (m2.length) { var S2 = m2.join(", "); if (_2) _2.selectorsAdd = S2; else { C2 = { selectors: [], selectorsAdd: S2, style: v2 }; a2 && (C2.singleAtRule = a2), l2 && (C2.atRuleType = l2), c2 && (C2.mediaText = c2), e3.push(C2); } } } } return e3; }; const bs = function(e3, n2) { return void 0 === n2 && (n2 = {}), { parse: function(t3) { var o2 = this, r2 = [], i2 = n2.parserCss, s2 = null == e3 ? void 0 : e3.Editor, a2 = i2 ? i2(t3, s2) : function(t4) { var e4 = document.createElement("style"); e4.innerHTML = t4, document.head.appendChild(e4); var n3 = e4.sheet; return document.head.removeChild(e4), ms(n3); }(t3); return a2.forEach(function(t4) { return r2 = r2.concat(o2.checkNode(t4)); }), null == e3 || e3.trigger("parse:css", { input: t3, output: r2 }), r2; }, checkNode: function(e4) { var n3 = e4.selectors, o2 = e4.style, r2 = [e4]; if ((0, t2.isString)(n3)) { var i2 = [], s2 = e4, a2 = hs(n3), l2 = a2.result, c2 = a2.add.join(", "), u2 = { atRule: s2.atRule, mediaText: s2.params }; if (l2.length ? l2.forEach(function(t3) { i2.push(ys(t3, o2, u2)); }) : i2.push(ys([], o2, u2)), c2) i2[i2.length - 1].selectorsAdd = c2; r2 = i2; } return r2; } }; }; var _s = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ws = function(t3) { function e3(e4) { var n2 = t3.call(this, e4, "Parser", cs) || this, o2 = n2.config; return n2.parserCss = bs(e4, o2), n2.parserHtml = ve(e4, o2), n2; } return _s(e3, t3), e3.prototype.parseHtml = function(t4, e4) { void 0 === e4 && (e4 = {}); var n2 = this.em, o2 = this.parserHtml; return o2.compTypes = n2.Components.getTypes() || {}, o2.parse(t4, this.parserCss, e4); }, e3.prototype.parseCss = function(t4) { return this.parserCss.parse(t4); }, e3.prototype.destroy = function() { }, e3; }(m); const xs = ws; const Cs = { id: "gjs-", type: "local", autosave: true, autoload: true, stepsBeforeSave: 1, recovery: false, onStore: function(t3) { return t3; }, onLoad: function(t3) { return t3; }, options: { local: { key: "gjsProject", checkLocal: true }, remote: { headers: {}, urlStore: "", urlLoad: "", contentTypeJson: true, fetchOptions: "", credentials: "include", onStore: function(t3) { return t3; }, onLoad: function(t3) { return t3; } } } }; var Ss = function(t3, e3, n2, o2) { return new (n2 || (n2 = Promise))(function(r2, i2) { function s2(t4) { try { l2(o2.next(t4)); } catch (t5) { i2(t5); } } function a2(t4) { try { l2(o2["throw"](t4)); } catch (t5) { i2(t5); } } function l2(t4) { var e4; t4.done ? r2(t4.value) : (e4 = t4.value, e4 instanceof n2 ? e4 : new n2(function(t5) { t5(e4); })).then(s2, a2); } l2((o2 = o2.apply(t3, e3 || [])).next()); }); }, Os = function(t3, e3) { var n2, o2, r2, i2, s2 = { label: 0, sent: function() { if (1 & r2[0]) throw r2[1]; return r2[1]; }, trys: [], ops: [] }; return i2 = { next: a2(0), throw: a2(1), return: a2(2) }, "function" == typeof Symbol && (i2[Symbol.iterator] = function() { return this; }), i2; function a2(a3) { return function(l2) { return function(a4) { if (n2) throw new TypeError("Generator is already executing."); for (; i2 && (i2 = 0, a4[0] && (s2 = 0)), s2; ) try { if (n2 = 1, o2 && (r2 = 2 & a4[0] ? o2["return"] : a4[0] ? o2["throw"] || ((r2 = o2["return"]) && r2.call(o2), 0) : o2.next) && !(r2 = r2.call(o2, a4[1])).done) return r2; switch (o2 = 0, r2 && (a4 = [2 & a4[0], r2.value]), a4[0]) { case 0: case 1: r2 = a4; break; case 4: return s2.label++, { value: a4[1], done: false }; case 5: s2.label++, o2 = a4[1], a4 = [0]; continue; case 7: a4 = s2.ops.pop(), s2.trys.pop(); continue; default: if (!(r2 = s2.trys, (r2 = r2.length > 0 && r2[r2.length - 1]) || 6 !== a4[0] && 2 !== a4[0])) { s2 = 0; continue; } if (3 === a4[0] && (!r2 || a4[1] > r2[0] && a4[1] < r2[3])) { s2.label = a4[1]; break; } if (6 === a4[0] && s2.label < r2[1]) { s2.label = r2[1], r2 = a4; break; } if (r2 && s2.label < r2[2]) { s2.label = r2[2], s2.ops.push(a4); break; } r2[2] && s2.ops.pop(), s2.trys.pop(); continue; } a4 = e3.call(t3, s2); } catch (t4) { a4 = [6, t4], o2 = 0; } finally { n2 = r2 = 0; } if (5 & a4[0]) throw a4[1]; return { value: a4[0] ? a4[1] : void 0, done: true }; }([a3, l2]); }; } }; const Ts = function() { function t3() { } return t3.prototype.store = function(t4, e3) { return void 0 === e3 && (e3 = {}), Ss(this, void 0, void 0, function() { return Os(this, function(n2) { return this.hasLocal(e3, true) && localStorage.setItem(e3.key, JSON.stringify(t4)), [2, t4]; }); }); }, t3.prototype.load = function(t4) { return void 0 === t4 && (t4 = {}), Ss(this, void 0, void 0, function() { var e3; return Os(this, function(n2) { return e3 = {}, this.hasLocal(t4, true) && (e3 = JSON.parse(localStorage.getItem(t4.key) || "{}")), [2, e3]; }); }); }, t3.prototype.hasLocal = function(t4, n2) { if (void 0 === t4 && (t4 = {}), t4.checkLocal && (!(0, e2.hasWin)() || !localStorage)) { if (n2) throw new Error("localStorage not available"); return false; } return true; }, t3; }(); function ks(t3) { return ks = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t4) { return typeof t4; } : function(t4) { return t4 && "function" == typeof Symbol && t4.constructor === Symbol && t4 !== Symbol.prototype ? "symbol" : typeof t4; }, ks(t3); } const Ps = function(t3) { var e3 = this.constructor; return this.then(function(n2) { return e3.resolve(t3()).then(function() { return n2; }); }, function(n2) { return e3.resolve(t3()).then(function() { return e3.reject(n2); }); }); }; const Es = function(t3) { return new this(function(e3, n2) { if (!t3 || void 0 === t3.length) return n2(new TypeError(ks(t3) + " " + t3 + " is not iterable(cannot read property Symbol(Symbol.iterator))")); var o2 = Array.prototype.slice.call(t3); if (0 === o2.length) return e3([]); var r2 = o2.length; function i2(t4, n3) { if (n3 && ("object" === ks(n3) || "function" == typeof n3)) { var s3 = n3.then; if ("function" == typeof s3) return void s3.call(n3, function(e4) { i2(t4, e4); }, function(n4) { o2[t4] = { status: "rejected", reason: n4 }, 0 == --r2 && e3(o2); }); } o2[t4] = { status: "fulfilled", value: n3 }, 0 == --r2 && e3(o2); } for (var s2 = 0; s2 < o2.length; s2++) i2(s2, o2[s2]); }); }; function As(t3, e3) { this.name = "AggregateError", this.errors = t3, this.message = e3 || ""; } As.prototype = Error.prototype; const js = function(t3) { var e3 = this; return new e3(function(n2, o2) { if (!t3 || void 0 === t3.length) return o2(new TypeError("Promise.any accepts an array")); var r2 = Array.prototype.slice.call(t3); if (0 === r2.length) return o2(); for (var i2 = [], s2 = 0; s2 < r2.length; s2++) try { e3.resolve(r2[s2]).then(n2).catch(function(t4) { i2.push(t4), i2.length === r2.length && o2(new As(i2, "All promises were rejected")); }); } catch (t4) { o2(t4); } }); }; var Ms = setTimeout; function Ls(t3) { return Boolean(t3 && void 0 !== t3.length); } function Ds() { } function Ns(t3) { if (!(this instanceof Ns)) throw new TypeError("Promises must be constructed via new"); if ("function" != typeof t3) throw new TypeError("not a function"); this._state = 0, this._handled = false, this._value = void 0, this._deferreds = [], zs(t3, this); } function Is(t3, e3) { for (; 3 === t3._state; ) t3 = t3._value; 0 !== t3._state ? (t3._handled = true, Ns._immediateFn(function() { var n2 = 1 === t3._state ? e3.onFulfilled : e3.onRejected; if (null !== n2) { var o2; try { o2 = n2(t3._value); } catch (t4) { return void Vs(e3.promise, t4); } Fs(e3.promise, o2); } else (1 === t3._state ? Fs : Vs)(e3.promise, t3._value); })) : t3._deferreds.push(e3); } function Fs(t3, e3) { try { if (e3 === t3) throw new TypeError("A promise cannot be resolved with itself."); if (e3 && ("object" === ks(e3) || "function" == typeof e3)) { var n2 = e3.then; if (e3 instanceof Ns) return t3._state = 3, t3._value = e3, void Rs(t3); if ("function" == typeof n2) return void zs((o2 = n2, r2 = e3, function() { o2.apply(r2, arguments); }), t3); } t3._state = 1, t3._value = e3, Rs(t3); } catch (e4) { Vs(t3, e4); } var o2, r2; } function Vs(t3, e3) { t3._state = 2, t3._value = e3, Rs(t3); } function Rs(t3) { 2 === t3._state && 0 === t3._deferreds.length && Ns._immediateFn(function() { t3._handled || Ns._unhandledRejectionFn(t3._value); }); for (var e3 = 0, n2 = t3._deferreds.length; e3 < n2; e3++) Is(t3, t3._deferreds[e3]); t3._deferreds = null; } function Hs(t3, e3, n2) { this.onFulfilled = "function" == typeof t3 ? t3 : null, this.onRejected = "function" == typeof e3 ? e3 : null, this.promise = n2; } function zs(t3, e3) { var n2 = false; try { t3(function(t4) { n2 || (n2 = true, Fs(e3, t4)); }, function(t4) { n2 || (n2 = true, Vs(e3, t4)); }); } catch (t4) { if (n2) return; n2 = true, Vs(e3, t4); } } Ns.prototype["catch"] = function(t3) { return this.then(null, t3); }, Ns.prototype.then = function(t3, e3) { var n2 = new this.constructor(Ds); return Is(this, new Hs(t3, e3, n2)), n2; }, Ns.prototype["finally"] = Ps, Ns.all = function(t3) { return new Ns(function(e3, n2) { if (!Ls(t3)) return n2(new TypeError("Promise.all accepts an array")); var o2 = Array.prototype.slice.call(t3); if (0 === o2.length) return e3([]); var r2 = o2.length; function i2(t4, s3) { try { if (s3 && ("object" === ks(s3) || "function" == typeof s3)) { var a2 = s3.then; if ("function" == typeof a2) return void a2.call(s3, function(e4) { i2(t4, e4); }, n2); } o2[t4] = s3, 0 == --r2 && e3(o2); } catch (t5) { n2(t5); } } for (var s2 = 0; s2 < o2.length; s2++) i2(s2, o2[s2]); }); }, Ns.any = js, Ns.allSettled = Es, Ns.resolve = function(t3) { return t3 && "object" === ks(t3) && t3.constructor === Ns ? t3 : new Ns(function(e3) { e3(t3); }); }, Ns.reject = function(t3) { return new Ns(function(e3, n2) { n2(t3); }); }, Ns.race = function(t3) { return new Ns(function(e3, n2) { if (!Ls(t3)) return n2(new TypeError("Promise.race accepts an array")); for (var o2 = 0, r2 = t3.length; o2 < r2; o2++) Ns.resolve(t3[o2]).then(e3, n2); }); }, Ns._immediateFn = "function" == typeof setImmediate && function(t3) { setImmediate(t3); } || function(t3) { Ms(t3, 0); }, Ns._unhandledRejectionFn = function(t3) { "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", t3); }; const Bs = Ns; (0, e2.hasWin)() && (window.Promise = window.Promise || Bs); const Us = "function" == typeof fetch ? fetch.bind() : function(t3, e3) { return new Bs(function(n2, o2) { var r2 = new XMLHttpRequest(); for (var i2 in r2.open(e3.method || "get", t3), r2.withCredentials = "include" == e3.credentials, e3.headers || {}) r2.setRequestHeader(i2, e3.headers[i2]); r2.onload = function(t4) { return n2({ status: r2.status, statusText: r2.statusText, text: function() { return Bs.resolve(r2.responseText); } }); }, r2.onerror = o2, r2.upload && e3.onProgress && (r2.upload.onprogress = e3.onProgress), e3.body ? r2.send(e3.body) : r2.send(); }); }; var Ws = function() { return Ws = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ws.apply(this, arguments); }, $s = function(t3, e3, n2, o2) { return new (n2 || (n2 = Promise))(function(r2, i2) { function s2(t4) { try { l2(o2.next(t4)); } catch (t5) { i2(t5); } } function a2(t4) { try { l2(o2["throw"](t4)); } catch (t5) { i2(t5); } } function l2(t4) { var e4; t4.done ? r2(t4.value) : (e4 = t4.value, e4 instanceof n2 ? e4 : new n2(function(t5) { t5(e4); })).then(s2, a2); } l2((o2 = o2.apply(t3, e3 || [])).next()); }); }, qs = function(t3, e3) { var n2, o2, r2, i2, s2 = { label: 0, sent: function() { if (1 & r2[0]) throw r2[1]; return r2[1]; }, trys: [], ops: [] }; return i2 = { next: a2(0), throw: a2(1), return: a2(2) }, "function" == typeof Symbol && (i2[Symbol.iterator] = function() { return this; }), i2; function a2(a3) { return function(l2) { return function(a4) { if (n2) throw new TypeError("Generator is already executing."); for (; i2 && (i2 = 0, a4[0] && (s2 = 0)), s2; ) try { if (n2 = 1, o2 && (r2 = 2 & a4[0] ? o2["return"] : a4[0] ? o2["throw"] || ((r2 = o2["return"]) && r2.call(o2), 0) : o2.next) && !(r2 = r2.call(o2, a4[1])).done) return r2; switch (o2 = 0, r2 && (a4 = [2 & a4[0], r2.value]), a4[0]) { case 0: case 1: r2 = a4; break; case 4: return s2.label++, { value: a4[1], done: false }; case 5: s2.label++, o2 = a4[1], a4 = [0]; continue; case 7: a4 = s2.ops.pop(), s2.trys.pop(); continue; default: if (!(r2 = s2.trys, (r2 = r2.length > 0 && r2[r2.length - 1]) || 6 !== a4[0] && 2 !== a4[0])) { s2 = 0; continue; } if (3 === a4[0] && (!r2 || a4[1] > r2[0] && a4[1] < r2[3])) { s2.label = a4[1]; break; } if (6 === a4[0] && s2.label < r2[1]) { s2.label = r2[1], r2 = a4; break; } if (r2 && s2.label < r2[2]) { s2.label = r2[2], s2.ops.push(a4); break; } r2[2] && s2.ops.pop(), s2.trys.pop(); continue; } a4 = e3.call(t3, s2); } catch (t4) { a4 = [6, t4], o2 = 0; } finally { n2 = r2 = 0; } if (5 & a4[0]) throw a4[1]; return { value: a4[0] ? a4[1] : void 0, done: true }; }([a3, l2]); }; } }; const Gs = function() { function e3() { } return e3.prototype.store = function(t3, e4) { return void 0 === e4 && (e4 = {}), $s(this, void 0, void 0, function() { return qs(this, function(n2) { switch (n2.label) { case 0: return [4, this.request(e4.urlStore, this.__props(e4, t3), e4)]; case 1: return [2, n2.sent()]; } }); }); }, e3.prototype.load = function(t3) { return void 0 === t3 && (t3 = {}), $s(this, void 0, void 0, function() { return qs(this, function(e4) { switch (e4.label) { case 0: return [4, this.request(t3.urlLoad, this.__props(t3), t3)]; case 1: return [2, e4.sent()]; } }); }); }, e3.prototype.request = function(e4, n2, o2) { return void 0 === n2 && (n2 = {}), void 0 === o2 && (o2 = {}), Us(e4, n2).then(function(t3) { var e5 = t3.text(); return 1 == (t3.status / 200 | 0) ? e5 : e5.then(Promise.reject); }).then(function(e5) { var n3 = e5 && (0, t2.isString)(e5); return o2.contentTypeJson && n3 ? JSON.parse(e5) : e5; }); }, e3.prototype.__props = function(e4, n2) { void 0 === e4 && (e4 = {}); var o2, r2 = e4.contentTypeJson, i2 = e4.headers || {}, s2 = e4.fetchOptions || {}, a2 = "X-Requested-With", l2 = "Content-Type"; if ((0, t2.isUndefined)(i2[a2]) && (i2[a2] = "XMLHttpRequest"), (0, t2.isUndefined)(i2[l2]) && r2 && (i2[l2] = "application/json; charset=utf-8"), n2) if (r2) o2 = JSON.stringify(n2); else for (var c2 in o2 = new FormData(), n2) o2.append(c2, n2[c2]); var u2 = { method: o2 ? "POST" : "GET", credentials: e4.credentials, headers: i2, body: o2 }; return Ws(Ws({}, u2), (0, t2.isFunction)(s2) ? s2(u2) : s2); }, e3; }(); var Ks = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ys = function() { return Ys = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ys.apply(this, arguments); }, Xs = function(t3, e3, n2, o2) { return new (n2 || (n2 = Promise))(function(r2, i2) { function s2(t4) { try { l2(o2.next(t4)); } catch (t5) { i2(t5); } } function a2(t4) { try { l2(o2["throw"](t4)); } catch (t5) { i2(t5); } } function l2(t4) { var e4; t4.done ? r2(t4.value) : (e4 = t4.value, e4 instanceof n2 ? e4 : new n2(function(t5) { t5(e4); })).then(s2, a2); } l2((o2 = o2.apply(t3, e3 || [])).next()); }); }, Js = function(t3, e3) { var n2, o2, r2, i2, s2 = { label: 0, sent: function() { if (1 & r2[0]) throw r2[1]; return r2[1]; }, trys: [], ops: [] }; return i2 = { next: a2(0), throw: a2(1), return: a2(2) }, "function" == typeof Symbol && (i2[Symbol.iterator] = function() { return this; }), i2; function a2(a3) { return function(l2) { return function(a4) { if (n2) throw new TypeError("Generator is already executing."); for (; i2 && (i2 = 0, a4[0] && (s2 = 0)), s2; ) try { if (n2 = 1, o2 && (r2 = 2 & a4[0] ? o2["return"] : a4[0] ? o2["throw"] || ((r2 = o2["return"]) && r2.call(o2), 0) : o2.next) && !(r2 = r2.call(o2, a4[1])).done) return r2; switch (o2 = 0, r2 && (a4 = [2 & a4[0], r2.value]), a4[0]) { case 0: case 1: r2 = a4; break; case 4: return s2.label++, { value: a4[1], done: false }; case 5: s2.label++, o2 = a4[1], a4 = [0]; continue; case 7: a4 = s2.ops.pop(), s2.trys.pop(); continue; default: if (!(r2 = s2.trys, (r2 = r2.length > 0 && r2[r2.length - 1]) || 6 !== a4[0] && 2 !== a4[0])) { s2 = 0; continue; } if (3 === a4[0] && (!r2 || a4[1] > r2[0] && a4[1] < r2[3])) { s2.label = a4[1]; break; } if (6 === a4[0] && s2.label < r2[1]) { s2.label = r2[1], r2 = a4; break; } if (r2 && s2.label < r2[2]) { s2.label = r2[2], s2.ops.push(a4); break; } r2[2] && s2.ops.pop(), s2.trys.pop(); continue; } a4 = e3.call(t3, s2); } catch (t4) { a4 = [6, t4], o2 = 0; } finally { n2 = r2 = 0; } if (5 & a4[0]) throw a4[1]; return { value: a4[0] ? a4[1] : void 0, done: true }; }([a3, l2]); }; } }, Zs = "storage:start", Qs = "storage:after", ta = "storage:end", ea = "storage:error", na = "local", oa = "remote", ra = function(e3) { function n2(t3) { var n3 = e3.call(this, t3, "StorageManager", Cs) || this; n3.storages = {}; var o2 = n3.config; return o2._disable && (o2.type = ""), n3.storages = {}, n3.add(na, new Ts()), n3.add(oa, new Gs()), n3.setCurrent(o2.type), n3; } return Ks(n2, e3), n2.prototype.isAutosave = function() { return !!this.config.autosave; }, n2.prototype.setAutosave = function(t3) { return this.config.autosave = !!t3, this; }, n2.prototype.getStepsBeforeSave = function() { return this.config.stepsBeforeSave; }, n2.prototype.setStepsBeforeSave = function(t3) { return this.config.stepsBeforeSave = t3, this; }, n2.prototype.add = function(t3, e4) { return this.storages[t3] = e4, this; }, n2.prototype.get = function(t3) { return this.storages[t3]; }, n2.prototype.getStorages = function() { return this.storages; }, n2.prototype.getCurrent = function() { return this.config.currentStorage; }, n2.prototype.setCurrent = function(t3) { return this.getConfig().currentStorage = t3, this; }, n2.prototype.getCurrentStorage = function() { return this.get(this.getCurrent()); }, n2.prototype.getStorageOptions = function(t3) { return this.getCurrentOptions(t3); }, n2.prototype.store = function(t3, e4) { return void 0 === e4 && (e4 = {}), Xs(this, void 0, void 0, function() { var n3, o2, r2, i2, s2; return Js(this, function(a2) { switch (a2.label) { case 0: n3 = this.getCurrentStorage(), o2 = Ys(Ys({}, this.getCurrentOptions()), e4), r2 = this.getRecoveryStorage(), i2 = this.getCurrentOptions(na), a2.label = 1; case 1: return a2.trys.push([1, 5, , 9]), [4, this.__exec(n3, o2, t3)]; case 2: return a2.sent(), r2 ? [4, this.__exec(r2, i2, {})] : [3, 4]; case 3: a2.sent(), a2.label = 4; case 4: return [3, 9]; case 5: return s2 = a2.sent(), r2 ? [4, this.__exec(r2, i2, t3)] : [3, 7]; case 6: return a2.sent(), [3, 8]; case 7: throw s2; case 8: return [3, 9]; case 9: return [2, t3]; } }); }); }, n2.prototype.load = function(e4) { return void 0 === e4 && (e4 = {}), Xs(this, void 0, void 0, function() { var n3, o2, r2, i2, s2; return Js(this, function(a2) { switch (a2.label) { case 0: return n3 = this.getCurrentStorage(), o2 = Ys(Ys({}, this.getCurrentOptions()), e4), (r2 = this.getRecoveryStorage()) ? [4, this.__exec(r2, this.getCurrentOptions(na))] : [3, 5]; case 1: if (s2 = a2.sent(), (0, t2.isEmpty)(s2)) return [3, 5]; a2.label = 2; case 2: return a2.trys.push([2, 4, , 5]), [4, this.__askRecovery()]; case 3: return a2.sent(), i2 = s2, [3, 5]; case 4: return a2.sent(), [3, 5]; case 5: return i2 ? [3, 7] : [4, this.__exec(n3, o2)]; case 6: i2 = a2.sent(), a2.label = 7; case 7: return [2, i2 || {}]; } }); }); }, n2.prototype.__askRecovery = function() { var e4 = this.em, n3 = this.getRecovery(); return new Promise(function(o2, r2) { (0, t2.isFunction)(n3) ? n3(o2, r2, null == e4 ? void 0 : e4.getEditor()) : confirm(null == e4 ? void 0 : e4.t("storageManager.recover")) ? o2(null) : r2(); }); }, n2.prototype.getRecovery = function() { return this.config.recovery; }, n2.prototype.getRecoveryStorage = function() { return this.getRecovery() && this.getCurrent() === oa && this.get(na); }, n2.prototype.__exec = function(t3, e4, n3) { var o2; return Xs(this, void 0, void 0, function() { var r2, i2, s2, a2, l2, c2, u2, p2, d2, f2, h2, g2, v2; return Js(this, function(y2) { switch (y2.label) { case 0: if (r2 = n3 ? "store" : "load", i2 = this.getConfig(), s2 = i2.onStore, a2 = i2.onLoad, this.onStart(r2, n3), !t3) return [2, n3 || {}]; y2.label = 1; case 1: return y2.trys.push([1, 14, , 15]), c2 = null === (o2 = this.em) || void 0 === o2 ? void 0 : o2.getEditor(), u2 = void 0, n3 ? (d2 = s2) ? [4, s2(n3, c2)] : [3, 3] : [3, 7]; case 2: d2 = y2.sent(), y2.label = 3; case 3: return p2 = d2 || n3, (f2 = e4.onStore) ? [4, e4.onStore(p2, c2)] : [3, 5]; case 4: f2 = y2.sent(), y2.label = 5; case 5: return p2 = f2 || p2, [4, t3.store(p2, e4)]; case 6: return u2 = y2.sent(), l2 = n3, [3, 13]; case 7: return [4, t3.load(e4)]; case 8: return u2 = y2.sent(), l2 = this.__clearKeys(u2), (h2 = e4.onLoad) ? [4, e4.onLoad(l2, c2)] : [3, 10]; case 9: h2 = y2.sent(), y2.label = 10; case 10: return l2 = h2 || l2, (g2 = a2) ? [4, a2(l2, c2)] : [3, 12]; case 11: g2 = y2.sent(), y2.label = 12; case 12: l2 = g2 || l2, y2.label = 13; case 13: return this.onAfter(r2, l2, u2), this.onEnd(r2, l2), [3, 15]; case 14: throw v2 = y2.sent(), this.onError(r2, v2), v2; case 15: return [2, l2]; } }); }); }, n2.prototype.__clearKeys = function(t3) { void 0 === t3 && (t3 = {}); var e4 = this.getConfig(), n3 = new RegExp("^".concat(e4.id)), o2 = {}; for (var r2 in t3) { o2[r2.replace(n3, "")] = t3[r2]; } return o2; }, n2.prototype.getCurrentOptions = function(t3) { var e4 = this.getConfig(), n3 = t3 || this.getCurrent(); return e4.options[n3] || {}; }, n2.prototype.onStart = function(t3, e4) { var n3 = this.em; n3 && (n3.trigger(Zs), t3 && n3.trigger("".concat(Zs, ":").concat(t3), e4)); }, n2.prototype.onAfter = function(t3, e4, n3) { var o2 = this.em; o2 && (o2.trigger(Qs), o2.trigger("".concat(Qs, ":").concat(t3), e4, n3), o2.trigger("storage:".concat(t3), e4, n3)); }, n2.prototype.onEnd = function(t3, e4) { var n3 = this.em; n3 && (n3.trigger(ta), t3 && n3.trigger("".concat(ta, ":").concat(t3), e4)); }, n2.prototype.onError = function(t3, e4) { var n3 = this.em; n3 && (n3.trigger(ea, e4), t3 && n3.trigger("".concat(ea, ":").concat(t3), e4), this.onEnd(t3, e4)); }, n2.prototype.canAutoload = function() { return !!this.getCurrentStorage() && !!this.config.autoload; }, n2.prototype.destroy = function() { this.storages = {}; }, n2; }(m); const ia = ra; const sa = { stylePrefix: "trt-", appendTo: "", optionsTarget: [{ value: false }, { value: "_blank" }] }; var aa = n(330), la = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ca = function() { return ca = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, ca.apply(this, arguments); }, ua = function(n2) { function o2(t3) { void 0 === t3 && (t3 = {}); var e3 = n2.call(this, t3) || this; e3.events = {}, e3.appendInput = true; var o3 = t3.config, r2 = void 0 === o3 ? {} : o3, i2 = e3, s2 = i2.model, a2 = i2.eventCapture, l2 = s2.target, c2 = s2.attributes.type; e3.config = r2, e3.em = r2.em, e3.pfx = r2.stylePrefix || "", e3.ppfx = r2.pStylePrefix || "", e3.target = l2; var u2 = e3.ppfx; return e3.clsField = "".concat(u2, "field ").concat(u2, "field-").concat(c2), [["change:value", e3.onValueChange], ["remove", e3.removeView]].forEach(function(t4) { var n3 = t4[0], o4 = t4[1]; s2.off(n3, o4), e3.listenTo(s2, n3, o4); }), s2.view = e3, e3.listenTo(s2, "change:label", e3.render), e3.listenTo(s2, "change:placeholder", e3.rerender), e3.events = {}, a2.forEach(function(t4) { return e3.events[t4] = "onChange"; }), e3.delegateEvents(), e3.init(), e3; } return la(o2, n2), o2.prototype.attributes = function() { return this.model.get("attributes") || {}; }, o2.prototype.templateLabel = function(t3) { var e3 = this.ppfx, n3 = this.getLabel(); return '
').concat(n3, "
"); }, o2.prototype.templateInput = function(t3) { var e3 = this.clsField; return '
'); }, o2.prototype.getClbOpts = function() { return { component: this.target, trait: this.model, elInput: this.getInputElem() }; }, o2.prototype.removeView = function() { this.remove(), this.removed(); }, o2.prototype.init = function() { }, o2.prototype.removed = function() { }, o2.prototype.onRender = function(t3) { }, o2.prototype.onUpdate = function(t3) { }, o2.prototype.onEvent = function(t3) { }, o2.prototype.onChange = function(e3) { var n3 = this.getInputElem(); n3 && !(0, t2.isUndefined)(n3.value) && this.model.set("value", n3.value), this.onEvent(ca(ca({}, this.getClbOpts()), { event: e3 })); }, o2.prototype.getValueForTarget = function() { return this.model.get("value"); }, o2.prototype.setInputValue = function(t3) { var e3 = this.getInputElem(); e3 && (e3.value = t3); }, o2.prototype.onValueChange = function(t3, e3, n3) { if (void 0 === n3 && (n3 = {}), n3.fromTarget) this.setInputValue(t3.get("value")), this.postUpdate(); else { var o3 = this.getValueForTarget(); t3.setTargetValue(o3, n3); } }, o2.prototype.renderLabel = function() { var t3 = this.$el, e3 = this.target, n3 = this.getLabel(), o3 = this.templateLabel(e3); this.createLabel && (o3 = this.createLabel({ label: n3, component: e3, trait: this }) || ""), t3.find("[data-label]").append(o3); }, o2.prototype.getLabel = function() { var t3 = this.em, n3 = this.model.attributes, o3 = n3.label, r2 = n3.name; return t3.t("traitManager.traits.labels.".concat(r2)) || (0, e2.capitalize)(o3 || r2).replace(/-/g, " "); }, o2.prototype.getComponent = function() { return this.target; }, o2.prototype.getInputEl = function() { if (!this.$input) { var e3 = this.em, n3 = this.model, o3 = n3, r2 = n3.attributes.name, i2 = o3.get("placeholder") || o3.get("default") || "", s2 = o3.get("type") || "text", a2 = o3.get("min"), c2 = o3.get("max"), u2 = this.getModelValue(), p2 = (0, l["default"])('')), d2 = e3.t("traitManager.traits.attributes.".concat(r2)) || {}; p2.attr(ca({ placeholder: i2 }, d2)), (0, t2.isUndefined)(u2) || (o3.set({ value: u2 }, { silent: true }), p2.prop("value", u2)), a2 && p2.prop("min", a2), c2 && p2.prop("max", c2), this.$input = p2; } return this.$input.get(0); }, o2.prototype.getInputElem = function() { var t3 = this.input, e3 = this.$input; return t3 || e3 && e3.get && e3.get(0) || this.getElInput(); }, o2.prototype.getModelValue = function() { var e3, n3 = this.model, o3 = this.target, r2 = n3.getName(); if (n3.get("changeProp")) e3 = o3.get(r2); else { var i2 = o3.get("attributes"); e3 = n3.get("value") || i2[r2]; } return (0, t2.isUndefined)(e3) ? "" : e3; }, o2.prototype.getElInput = function() { return this.elInput; }, o2.prototype.renderField = function() { var e3 = this, n3 = e3.$el, o3 = e3.appendInput, r2 = e3.model, i2 = n3.find("[data-input]"), s2 = i2[i2.length - 1], a2 = r2.el; a2 || (a2 = this.createInput ? this.createInput(this.getClbOpts()) : this.getInputEl()), (0, t2.isString)(a2) ? (s2.innerHTML = a2, this.elInput = s2.firstChild) : (o3 ? s2.appendChild(a2) : s2.insertBefore(a2, s2.firstChild), this.elInput = a2), r2.el = this.elInput; }, o2.prototype.hasLabel = function() { var t3 = this.model.attributes.label; return !this.noLabel && false !== t3; }, o2.prototype.rerender = function() { delete this.model.el, this.render(); }, o2.prototype.postUpdate = function() { this.onUpdate(this.getClbOpts()); }, o2.prototype.render = function() { var e3 = this, n3 = e3.$el, o3 = e3.pfx, r2 = e3.ppfx, i2 = e3.model.attributes, s2 = i2.type, a2 = i2.id, l2 = this.hasLabel && this.hasLabel(), c2 = "".concat(o3, "trait"); delete this.$input; var u2 = '
\n ').concat(l2 ? '
') : "", '\n
\n ').concat(this.templateInput ? (0, t2.isFunction)(this.templateInput) ? this.templateInput(this.getClbOpts()) : this.templateInput : "", "\n
\n
"); return n3.empty().append(u2), l2 && this.renderLabel(), this.renderField(), this.el.className = "".concat(c2, "__wrp ").concat(c2, "__wrp-").concat(a2), this.postUpdate(), this.onRender(this.getClbOpts()), this; }, o2; }(u.G7); const pa = ua; ua.prototype.eventCapture = ["change"]; var da = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), fa = function(t3) { function e3(e4, n2) { void 0 === e4 && (e4 = {}); var o2 = t3.call(this, e4) || this; o2.reuseView = true, o2.itemsView = n2; var r2 = e4.config || {}, i2 = r2.stylePrefix || "", s2 = e4.editor; return o2.config = r2, o2.em = s2, o2.pfx = i2, o2.ppfx = r2.pStylePrefix || "", o2.className = "".concat(i2, "traits"), o2.listenTo(s2, "component:toggled", o2.updatedCollection), o2.updatedCollection(), o2; } return da(e3, t3), e3.prototype.updatedCollection = function() { var t4 = this, e4 = t4.ppfx, n2 = t4.className, o2 = t4.em.getSelected(); this.el.className = "".concat(n2, " ").concat(e4, "one-bg ").concat(e4, "two-color"), this.collection = o2 ? o2.traits : [], this.render(); }, e3; }(aa.Z); const ha = fa; fa.prototype.itemView = pa; var ga = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const va = function(e3) { function n2(t3) { void 0 === t3 && (t3 = {}); var n3 = e3.call(this, t3) || this; return n3.listenTo(n3.model, "change:options", n3.rerender), n3; } return ga(n2, e3), n2.prototype.templateInput = function() { var t3 = this.ppfx, e4 = this.clsField; return '
\n
\n
\n
\n
\n
'); }, n2.prototype.getInputEl = function() { if (!this.$input) { var e4 = this.model, n3 = this.em, o2 = e4.get("name"), r2 = e4.get("options") || [], i2 = [], s2 = "", this.$input = (0, l["default"])(s2); var a2 = e4.getTargetValue(), c2 = i2.indexOf(a2) >= 0 ? a2 : e4.get("default"); !(0, t2.isUndefined)(c2) && this.$input.val(c2); } return this.$input.get(0); }, n2; }(pa); var ya = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const ma = function(e3) { function n2() { var t3 = null !== e3 && e3.apply(this, arguments) || this; return t3.appendInput = false, t3; } return ya(n2, e3), n2.prototype.templateInput = function() { var t3 = this.ppfx, e4 = this.clsField; return ''); }, n2.prototype.onChange = function() { this.model.set("value", this.getInputElem().checked); }, n2.prototype.setInputValue = function(t3) { var e4 = this.getInputElem(); e4 && (e4.checked = !!t3); }, n2.prototype.getInputEl = function() { for (var e4 = [], n3 = 0; n3 < arguments.length; n3++) e4[n3] = arguments[n3]; var o2 = !this.$input, r2 = pa.prototype.getInputEl.apply(this, e4); if (o2) { var i2 = void 0, s2 = void 0, a2 = this, l2 = a2.model, c2 = a2.target, u2 = l2.attributes.valueFalse, p2 = l2.getName(); l2.get("changeProp") ? s2 = i2 = c2.get(p2) : i2 = !(!(s2 = c2.get("attributes")[p2]) && "" !== s2), (0, t2.isUndefined)(u2) || s2 !== u2 || (i2 = false), r2.checked = i2; } return r2; }, n2; }(pa); var ba = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), _a = function(t3) { function e3(e4) { void 0 === e4 && (e4 = {}); var n2 = t3.call(this, e4) || this, o2 = e4.ppfx || ""; return n2.opts = e4, n2.ppfx = o2, n2.em = e4.target || {}, !e4.onChange && n2.listenTo(n2.model, "change:value", n2.handleModelChange), n2; } return ba(e3, t3), e3.prototype.template = function() { return ''); }, e3.prototype.inputClass = function() { return "".concat(this.ppfx, "field"); }, e3.prototype.holderClass = function() { return "".concat(this.ppfx, "input-holder"); }, e3.prototype.elementUpdated = function() { this.model.trigger("el:change"); }, e3.prototype.setValue = function(t4, e4) { var n2 = this.model, o2 = t4 || n2.get("defaults"), r2 = this.getInputEl(); r2 && (r2.value = o2); }, e3.prototype.handleModelChange = function(t4, e4, n2) { this.setValue(e4, n2); }, e3.prototype.handleChange = function(t4) { t4.stopPropagation(); var e4 = this.getInputEl().value; this.__onInputChange(e4), this.elementUpdated(); }, e3.prototype.__onInputChange = function(t4) { this.model.set({ value: t4 }, { fromInput: 1 }); }, e3.prototype.getInputEl = function() { if (!this.inputEl) { var t4 = this.model, e4 = this.opts.type || "text", n2 = t4.get("placeholder") || t4.get("defaults") || t4.get("default") || ""; this.inputEl = (0, l["default"])('')); } return this.inputEl.get(0); }, e3.prototype.render = function() { this.inputEl = null; var t4 = this.$el; return t4.addClass(this.inputClass()), t4.html(this.template()), t4.find(".".concat(this.holderClass())).append(this.getInputEl()), this; }, e3; }(u.G7); const wa = _a; _a.prototype.events = { change: "handleChange" }; var xa = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ca = function(n2) { function o2(e3) { void 0 === e3 && (e3 = {}); var o3 = n2.call(this, e3) || this; return (0, t2.bindAll)(o3, "moveIncrement", "upIncrement"), o3.doc = document, o3.listenTo(o3.model, "change:unit", o3.handleModelChange), o3; } return xa(o2, n2), o2.prototype.template = function() { var t3 = this.ppfx; return '\n \n \n
\n
\n
\n
\n '); }, o2.prototype.inputClass = function() { var t3 = this.ppfx; return this.opts.contClass || "".concat(t3, "field ").concat(t3, "field-integer"); }, o2.prototype.setValue = function(t3, e3) { var n3 = e3 || {}, o3 = this.validateInputValue(t3, { deepCheck: 1 }), r2 = { value: o3.value, unit: "" }; (o3.unit || o3.force) && (r2.unit = o3.unit), this.model.set(r2, n3), n3.silent && this.handleModelChange(); }, o2.prototype.handleChange = function(t3) { t3.stopPropagation(), this.setValue(this.getInputEl().value), this.elementUpdated(); }, o2.prototype.handleUnitChange = function(t3) { t3.stopPropagation(); var e3 = this.getUnitEl().value; this.model.set("unit", e3), this.elementUpdated(); }, o2.prototype.handleKeyDown = function(t3) { "ArrowUp" === t3.key && (t3.preventDefault(), this.upArrowClick()), "ArrowDown" === t3.key && (t3.preventDefault(), this.downArrowClick()); }, o2.prototype.elementUpdated = function() { this.model.trigger("el:change"); }, o2.prototype.handleModelChange = function() { var t3 = this.model; this.getInputEl().value = t3.get("value"); var e3 = this.getUnitEl(); e3 && (e3.value = t3.get("unit") || ""); }, o2.prototype.getUnitEl = function() { if (!this.unitEl) { var t3 = this.model, e3 = t3.get("units") || []; if (e3.length) { var n3 = ['']; e3.forEach(function(e4) { var o4 = e4 == t3.get("unit") ? "selected" : ""; n3.push("")); }); var o3 = document.createElement("div"); o3.innerHTML = '"), this.unitEl = o3.firstChild; } } return this.unitEl; }, o2.prototype.upArrowClick = function() { var t3 = this.model, e3 = t3.get("step"), n3 = parseFloat(t3.get("value")); this.setValue(this.normalizeValue(n3 + e3)), this.elementUpdated(); }, o2.prototype.downArrowClick = function() { var t3 = this.model, e3 = t3.get("step"), n3 = parseFloat(t3.get("value")); this.setValue(this.normalizeValue(n3 - e3)), this.elementUpdated(); }, o2.prototype.downIncrement = function(t3) { t3.preventDefault(), this.moved = false; var n3 = this.model.get("value") || 0; n3 = this.normalizeValue(n3), this.current = { y: t3.pageY, val: n3 }, (0, e2.on)(this.doc, "mousemove", this.moveIncrement), (0, e2.on)(this.doc, "mouseup", this.upIncrement); }, o2.prototype.moveIncrement = function(t3) { this.moved = true; var e3 = this.model, n3 = e3.get("step"), o3 = this.current, r2 = this.normalizeValue(o3.val + (o3.y - t3.pageY) * n3), i2 = this.validateInputValue(r2), s2 = i2.value, a2 = i2.unit; return this.prValue = s2, e3.set({ value: s2, unit: a2 }, { avoidStore: 1 }), false; }, o2.prototype.upIncrement = function() { var t3 = this.model, n3 = t3.get("step"); if ((0, e2.off)(this.doc, "mouseup", this.upIncrement), (0, e2.off)(this.doc, "mousemove", this.moveIncrement), this.prValue && this.moved) { var o3 = this.prValue - n3; t3.set("value", o3, { avoidStore: 1 }).set("value", o3 + n3), this.elementUpdated(); } }, o2.prototype.normalizeValue = function(t3, e3) { void 0 === e3 && (e3 = 0); var n3 = this.model.get("step"), o3 = 0; if (isNaN(t3)) return e3; if (t3 = parseFloat(t3), Math.floor(t3) !== t3) { var r2 = n3.toString().split(".")[1]; o3 = r2 ? r2.length : 0; } return o3 ? parseFloat(t3.toFixed(o3)) : t3; }, o2.prototype.validateInputValue = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = 0, r2 = n3 || {}, i2 = this.model, s2 = "", a2 = (0, t2.isUndefined)(e3) ? s2 : e3, l2 = n3.units || i2.get("units") || [], c2 = i2.get("unit") || l2.length && l2[0] || "", u2 = (0, t2.isUndefined)(n3.max) ? i2.get("max") : n3.max, p2 = (0, t2.isUndefined)(n3.min) ? i2.get("min") : n3.min, d2 = !!i2.get("limitlessMax"), f2 = !!i2.get("limitlessMin"); if (r2.deepCheck) { var h2 = i2.get("fixedValues") || []; if ("" === a2 && (c2 = ""), a2) { var g2 = new RegExp("^" + h2.join("|"), "g"); if (h2.length && g2.test(a2)) a2 = a2.match(g2)[0], c2 = "", o3 = 1; else { var v2 = a2 + ""; a2 += "", a2 = parseFloat(a2.replace(",", ".")), a2 = isNaN(a2) ? s2 : a2; var y2 = v2.replace(a2, ""); (0, t2.indexOf)(l2, y2) >= 0 && (c2 = y2); } } } return d2 || (0, t2.isUndefined)(u2) || "" === u2 || (a2 = a2 > u2 ? u2 : a2), f2 || (0, t2.isUndefined)(p2) || "" === p2 || (a2 = a2 < p2 ? p2 : a2), { force: o3, value: a2, unit: c2 }; }, o2.prototype.render = function() { wa.prototype.render.call(this), this.unitEl = null; var t3 = this.getUnitEl(); return t3 && this.$el.find(".".concat(this.ppfx, "field-units")).get(0).appendChild(t3), this; }, o2; }(wa); const Sa = Ca; Ca.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 Oa = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Ta = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return Oa(n2, e3), n2.prototype.getValueForTarget = function() { var e4 = this.model, n3 = e4.attributes, o2 = n3.value, r2 = n3.unit; return (0, t2.isUndefined)(o2) || "" === o2 ? e4.get("default") : o2 + r2; }, n2.prototype.getInputEl = function() { if (!this.input) { var t3 = this.ppfx, e4 = this.model, n3 = this.getModelValue(), o2 = new Sa({ contClass: "".concat(t3, "field-int"), type: "number", model: e4, ppfx: t3 }); o2.render(), this.$input = o2.inputEl, this.$unit = o2.unitEl, e4.set("value", n3, { fromTarget: true }), this.$input.val(n3), this.input = o2.el; } return this.input; }, n2; }(pa); var ka = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Pa = function() { return Pa = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Pa.apply(this, arguments); }; l["default"] && function(t3, n2) { if ((0, e2.hasWin)()) { var o2 = { beforeShow: k2, move: k2, change: k2, show: k2, hide: k2, color: false, flat: false, showInput: false, allowEmpty: false, showButtons: true, clickoutFiresChange: true, showInitial: false, showPalette: false, showPaletteOnly: false, hideAfterPaletteSelect: false, togglePaletteOnly: false, showSelectionPalette: true, localStorageKey: false, appendTo: "body", maxSelectionSize: 7, cancelText: "cancel", chooseText: "choose", togglePaletteMoreText: "more", togglePaletteLessText: "less", clearText: "Clear Color Selection", noColorSelectedText: "No Color Selected", preferredFormat: false, className: "", containerClassName: "", replacerClassName: "", showAlpha: false, theme: "sp-light", palette: [["#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"]], selectionPalette: [], disabled: false, offset: null }, r2 = [], i2 = !!/msie/i.exec(window.navigator.userAgent), s2 = function() { function t4(t5, e4) { return !!~("" + t5).indexOf(e4); } var e3 = document.createElement("div").style; return e3.cssText = "background-color:rgba(0,0,0,.5)", t4(e3.backgroundColor, "rgba") || t4(e3.backgroundColor, "hsla"); }(), a2 = ["
", "
", "
▼
", "
"].join(""), l2 = function() { var t4 = ""; if (i2) for (var e3 = 1; e3 <= 6; e3++) t4 += "
"; return ["
", "
", "
", "
", "", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", "
", t4, "
", "
", "
", "
", "
", "", "
", "
", "
", "", "", "
", "
", "
"].join(""); }(), c2 = "spectrum.id"; t3.fn.spectrum = function(e3, n3) { if ("string" == typeof e3) { var o3 = this, i3 = Array.prototype.slice.call(arguments, 1); return this.each(function() { var n4 = r2[t3(this).data(c2)]; if (n4) { var s3 = n4[e3]; if (!s3) throw new Error("Spectrum: no such method: '" + e3 + "'"); "get" == e3 ? o3 = n4.get() : "container" == e3 ? o3 = n4.container : "option" == e3 ? o3 = n4.option.apply(n4, i3) : "destroy" == e3 ? (n4.destroy(), t3(this).removeData(c2)) : s3.apply(n4, i3); } }), o3; } return this.spectrum("destroy").each(function() { var n4 = T2(this, t3.extend({}, e3, t3(this).data())); t3(this).data(c2, n4.id); }); }, t3.fn.spectrum.load = true, t3.fn.spectrum.loadOpts = {}, t3.fn.spectrum.draggable = A2, t3.fn.spectrum.defaults = o2, t3.fn.spectrum.inputTypeColorSupport = function e3() { if (void 0 === e3._cachedResult) { var n3 = t3("")[0]; e3._cachedResult = "color" === n3.type && "" !== n3.value; } return e3._cachedResult; }, t3.spectrum = {}, t3.spectrum.localization = {}, t3.spectrum.palettes = {}, t3.fn.spectrum.processNativeColorInputs = function() { var e3 = t3("input[type=color]"); e3.length && !j2() && e3.spectrum({ preferredFormat: "hex6" }); }; var u2 = /^[\s,#]+/, p2 = /\s+$/, d2 = 0, f2 = Math, h2 = f2.round, g2 = f2.min, v2 = f2.max, y2 = f2.random, m2 = function(t4, e3) { if (e3 = e3 || {}, (t4 = t4 || "") instanceof m2) return t4; if (!(this instanceof m2)) return new m2(t4, e3); var n3 = function(t5) { var e4 = { r: 0, g: 0, b: 0 }, n4 = 1, o3 = false, r3 = false; "string" == typeof t5 && (t5 = function(t6) { t6 = t6.replace(u2, "").replace(p2, "").toLowerCase(); var e5, n5 = false; if (x2[t6]) t6 = x2[t6], n5 = true; else if ("transparent" == t6) return { r: 0, g: 0, b: 0, a: 0, format: "name" }; if (e5 = S2.rgb.exec(t6)) return { r: e5[1], g: e5[2], b: e5[3] }; if (e5 = S2.rgba.exec(t6)) return { r: e5[1], g: e5[2], b: e5[3], a: e5[4] }; if (e5 = S2.hsl.exec(t6)) return { h: e5[1], s: e5[2], l: e5[3] }; if (e5 = S2.hsla.exec(t6)) return { h: e5[1], s: e5[2], l: e5[3], a: e5[4] }; if (e5 = S2.hsv.exec(t6)) return { h: e5[1], s: e5[2], v: e5[3] }; if (e5 = S2.hsva.exec(t6)) return { h: e5[1], s: e5[2], v: e5[3], a: e5[4] }; if (e5 = S2.hex8.exec(t6)) return { a: et2(e5[1]), r: Z2(e5[2]), g: Z2(e5[3]), b: Z2(e5[4]), format: n5 ? "name" : "hex8" }; if (e5 = S2.hex6.exec(t6)) return { r: Z2(e5[1]), g: Z2(e5[2]), b: Z2(e5[3]), format: n5 ? "name" : "hex" }; if (e5 = S2.hex3.exec(t6)) return { r: Z2(e5[1] + "" + e5[1]), g: Z2(e5[2] + "" + e5[2]), b: Z2(e5[3] + "" + e5[3]), format: n5 ? "name" : "hex" }; return false; }(t5)); "object" == typeof t5 && (t5.hasOwnProperty("r") && t5.hasOwnProperty("g") && t5.hasOwnProperty("b") ? (i3 = t5.r, s3 = t5.g, a3 = t5.b, e4 = { r: 255 * X2(i3, 255), g: 255 * X2(s3, 255), b: 255 * X2(a3, 255) }, o3 = true, r3 = "%" === String(t5.r).substr(-1) ? "prgb" : "rgb") : t5.hasOwnProperty("h") && t5.hasOwnProperty("s") && t5.hasOwnProperty("v") ? (t5.s = tt2(t5.s), t5.v = tt2(t5.v), e4 = function(t6, e5, n5) { t6 = 6 * X2(t6, 360), e5 = X2(e5, 100), n5 = X2(n5, 100); var o4 = f2.floor(t6), r4 = t6 - o4, i4 = n5 * (1 - e5), s4 = n5 * (1 - r4 * e5), a4 = n5 * (1 - (1 - r4) * e5), l3 = o4 % 6, c3 = [n5, s4, i4, i4, a4, n5][l3], u3 = [a4, n5, n5, s4, i4, i4][l3], p3 = [i4, i4, a4, n5, n5, s4][l3]; return { r: 255 * c3, g: 255 * u3, b: 255 * p3 }; }(t5.h, t5.s, t5.v), o3 = true, r3 = "hsv") : t5.hasOwnProperty("h") && t5.hasOwnProperty("s") && t5.hasOwnProperty("l") && (t5.s = tt2(t5.s), t5.l = tt2(t5.l), e4 = function(t6, e5, n5) { var o4, r4, i4; function s4(t7, e6, n6) { return n6 < 0 && (n6 += 1), n6 > 1 && (n6 -= 1), n6 < 1 / 6 ? t7 + 6 * (e6 - t7) * n6 : n6 < 1 / 2 ? e6 : n6 < 2 / 3 ? t7 + (e6 - t7) * (2 / 3 - n6) * 6 : t7; } if (t6 = X2(t6, 360), e5 = X2(e5, 100), n5 = X2(n5, 100), 0 === e5) o4 = r4 = i4 = n5; else { var a4 = n5 < 0.5 ? n5 * (1 + e5) : n5 + e5 - n5 * e5, l3 = 2 * n5 - a4; o4 = s4(l3, a4, t6 + 1 / 3), r4 = s4(l3, a4, t6), i4 = s4(l3, a4, t6 - 1 / 3); } return { r: 255 * o4, g: 255 * r4, b: 255 * i4 }; }(t5.h, t5.s, t5.l), o3 = true, r3 = "hsl"), t5.hasOwnProperty("a") && (n4 = t5.a)); var i3, s3, a3; return n4 = Y2(n4), { ok: o3, format: t5.format || r3, r: g2(255, v2(e4.r, 0)), g: g2(255, v2(e4.g, 0)), b: g2(255, v2(e4.b, 0)), a: n4 }; }(t4); this._originalInput = t4, this._r = n3.r, this._g = n3.g, this._b = n3.b, this._a = n3.a, this._roundA = h2(100 * this._a) / 100, this._format = e3.format || n3.format, this._gradientType = e3.gradientType, this._r < 1 && (this._r = h2(this._r)), this._g < 1 && (this._g = h2(this._g)), this._b < 1 && (this._b = h2(this._b)), this._ok = n3.ok, this._tc_id = d2++; }; m2.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 t4 = this.toRgb(); return (299 * t4.r + 587 * t4.g + 114 * t4.b) / 1e3; }, setAlpha: function(t4) { return this._a = Y2(t4), this._roundA = h2(100 * this._a) / 100, this; }, toHsv: function() { var t4 = L2(this._r, this._g, this._b); return { h: 360 * t4.h, s: t4.s, v: t4.v, a: this._a }; }, toHsvString: function() { var t4 = L2(this._r, this._g, this._b), e3 = h2(360 * t4.h), n3 = h2(100 * t4.s), o3 = h2(100 * t4.v); return 1 == this._a ? "hsv(" + e3 + ", " + n3 + "%, " + o3 + "%)" : "hsva(" + e3 + ", " + n3 + "%, " + o3 + "%, " + this._roundA + ")"; }, toHsl: function() { var t4 = M2(this._r, this._g, this._b); return { h: 360 * t4.h, s: t4.s, l: t4.l, a: this._a }; }, toHslString: function() { var t4 = M2(this._r, this._g, this._b), e3 = h2(360 * t4.h), n3 = h2(100 * t4.s), o3 = h2(100 * t4.l); return 1 == this._a ? "hsl(" + e3 + ", " + n3 + "%, " + o3 + "%)" : "hsla(" + e3 + ", " + n3 + "%, " + o3 + "%, " + this._roundA + ")"; }, toHex: function(t4) { return D2(this._r, this._g, this._b, t4); }, toHexString: function(t4) { return "#" + this.toHex(t4); }, toHex8: function() { return N2(this._r, this._g, this._b, this._a); }, toHex8String: function() { return "#" + this.toHex8(); }, toRgb: function() { return { r: h2(this._r), g: h2(this._g), b: h2(this._b), a: this._a }; }, toRgbString: function() { return 1 == this._a ? "rgb(" + h2(this._r) + ", " + h2(this._g) + ", " + h2(this._b) + ")" : "rgba(" + h2(this._r) + ", " + h2(this._g) + ", " + h2(this._b) + ", " + this._roundA + ")"; }, toPercentageRgb: function() { return { r: h2(100 * X2(this._r, 255)) + "%", g: h2(100 * X2(this._g, 255)) + "%", b: h2(100 * X2(this._b, 255)) + "%", a: this._a }; }, toPercentageRgbString: function() { return 1 == this._a ? "rgb(" + h2(100 * X2(this._r, 255)) + "%, " + h2(100 * X2(this._g, 255)) + "%, " + h2(100 * X2(this._b, 255)) + "%)" : "rgba(" + h2(100 * X2(this._r, 255)) + "%, " + h2(100 * X2(this._g, 255)) + "%, " + h2(100 * X2(this._b, 255)) + "%, " + this._roundA + ")"; }, toName: function() { return 0 === this._a ? "transparent" : !(this._a < 1) && (C2[D2(this._r, this._g, this._b, true)] || false); }, toFilter: function(t4) { var e3 = "#" + N2(this._r, this._g, this._b, this._a), n3 = e3, o3 = this._gradientType ? "GradientType = 1, " : ""; t4 && (n3 = m2(t4).toHex8String()); return "progid:DXImageTransform.Microsoft.gradient(" + o3 + "startColorstr=" + e3 + ",endColorstr=" + n3 + ")"; }, toString: function(t4) { var e3 = !!t4; t4 = t4 || this._format; var n3 = false, o3 = this._a < 1 && this._a >= 0; return e3 || !o3 || "hex" !== t4 && "hex6" !== t4 && "hex3" !== t4 && "name" !== t4 ? ("rgb" === t4 && (n3 = this.toRgbString()), "prgb" === t4 && (n3 = this.toPercentageRgbString()), "hex" !== t4 && "hex6" !== t4 || (n3 = this.toHexString()), "hex3" === t4 && (n3 = this.toHexString(true)), "hex8" === t4 && (n3 = this.toHex8String()), "name" === t4 && (n3 = this.toName()), "hsl" === t4 && (n3 = this.toHslString()), "hsv" === t4 && (n3 = this.toHsvString()), n3 || this.toHexString()) : "name" === t4 && 0 === this._a ? this.toName() : this.toRgbString(); }, _applyModification: function(t4, e3) { var n3 = t4.apply(null, [this].concat([].slice.call(e3))); return this._r = n3._r, this._g = n3._g, this._b = n3._b, this.setAlpha(n3._a), this; }, lighten: function() { return this._applyModification(R2, arguments); }, brighten: function() { return this._applyModification(H2, arguments); }, darken: function() { return this._applyModification(z2, arguments); }, desaturate: function() { return this._applyModification(I2, arguments); }, saturate: function() { return this._applyModification(F2, arguments); }, greyscale: function() { return this._applyModification(V2, arguments); }, spin: function() { return this._applyModification(B2, arguments); }, _applyCombination: function(t4, e3) { return t4.apply(null, [this].concat([].slice.call(e3))); }, analogous: function() { return this._applyCombination(G2, arguments); }, complement: function() { return this._applyCombination(U2, arguments); }, monochromatic: function() { return this._applyCombination(K2, arguments); }, splitcomplement: function() { return this._applyCombination(q2, arguments); }, triad: function() { return this._applyCombination(W2, arguments); }, tetrad: function() { return this._applyCombination($2, arguments); } }, m2.fromRatio = function(t4, e3) { if ("object" == typeof t4) { var n3 = {}; for (var o3 in t4) t4.hasOwnProperty(o3) && (n3[o3] = "a" === o3 ? t4[o3] : tt2(t4[o3])); t4 = n3; } return m2(t4, e3); }, m2.equals = function(t4, e3) { return !(!t4 || !e3) && m2(t4).toRgbString() == m2(e3).toRgbString(); }, m2.random = function() { return m2.fromRatio({ r: y2(), g: y2(), b: y2() }); }, m2.mix = function(t4, e3, n3) { n3 = 0 === n3 ? 0 : n3 || 50; var o3, r3 = m2(t4).toRgb(), i3 = m2(e3).toRgb(), s3 = n3 / 100, a3 = 2 * s3 - 1, l3 = i3.a - r3.a, c3 = 1 - (o3 = ((o3 = a3 * l3 == -1 ? a3 : (a3 + l3) / (1 + a3 * l3)) + 1) / 2), u3 = { r: i3.r * o3 + r3.r * c3, g: i3.g * o3 + r3.g * c3, b: i3.b * o3 + r3.b * c3, a: i3.a * s3 + r3.a * (1 - s3) }; return m2(u3); }, m2.readability = function(t4, e3) { var n3 = m2(t4), o3 = m2(e3), r3 = n3.toRgb(), i3 = o3.toRgb(), s3 = n3.getBrightness(), a3 = o3.getBrightness(), l3 = Math.max(r3.r, i3.r) - Math.min(r3.r, i3.r) + Math.max(r3.g, i3.g) - Math.min(r3.g, i3.g) + Math.max(r3.b, i3.b) - Math.min(r3.b, i3.b); return { brightness: Math.abs(s3 - a3), color: l3 }; }, m2.isReadable = function(t4, e3) { var n3 = m2.readability(t4, e3); return n3.brightness > 125 && n3.color > 500; }, m2.mostReadable = function(t4, e3) { for (var n3 = null, o3 = 0, r3 = false, i3 = 0; i3 < e3.length; i3++) { var s3 = m2.readability(t4, e3[i3]), a3 = s3.brightness > 125 && s3.color > 500, l3 = 3 * (s3.brightness / 125) + s3.color / 500; (a3 && !r3 || a3 && r3 && l3 > o3 || !a3 && !r3 && l3 > o3) && (r3 = a3, o3 = l3, n3 = m2(e3[i3])); } return n3; }; var b2, _2, w2, x2 = m2.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" }, C2 = m2.hexNames = function(t4) { var e3 = {}; for (var n3 in t4) t4.hasOwnProperty(n3) && (e3[t4[n3]] = n3); return e3; }(x2), S2 = (_2 = "[\\s|\\(]+(" + (b2 = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)") + ")[,|\\s]+(" + b2 + ")[,|\\s]+(" + b2 + ")\\s*\\)?", w2 = "[\\s|\\(]+(" + b2 + ")[,|\\s]+(" + b2 + ")[,|\\s]+(" + b2 + ")[,|\\s]+(" + b2 + ")\\s*\\)?", { rgb: new RegExp("rgb" + _2), rgba: new RegExp("rgba" + w2), hsl: new RegExp("hsl" + _2), hsla: new RegExp("hsla" + w2), hsv: new RegExp("hsv" + _2), hsva: new RegExp("hsva" + w2), 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 = m2, t3(function() { t3.fn.spectrum.load && t3.fn.spectrum.processNativeColorInputs(); }); } function O2(e3, n3, o3, r3) { for (var i3 = [], a3 = 0; a3 < e3.length; a3++) { var l3 = e3[a3]; if (l3) { var c3 = m2(l3), u3 = c3.toHsl().l < 0.5 ? "sp-thumb-el sp-thumb-dark" : "sp-thumb-el sp-thumb-light"; u3 += m2.equals(n3, l3) ? " sp-thumb-active" : ""; var p3 = c3.toString(r3.preferredFormat || "rgb"), d3 = s2 ? "background-color:" + c3.toRgbString() : "filter:" + c3.toFilter(); i3.push(''); } else { i3.push(t3("
").append(t3('').attr("title", r3.noColorSelectedText)).html()); } } return "
" + i3.join("") + "
"; } function T2(e3, c3) { var u3, p3, f3, h3 = function(e4, n3) { var r3 = t3.extend({}, o2, e4); return r3.callbacks = { move: E2(r3.move, n3), change: E2(r3.change, n3), show: E2(r3.show, n3), hide: E2(r3.hide, n3), beforeShow: E2(r3.beforeShow, n3) }, r3; }(c3, e3), g3 = h3.flat, v3 = h3.showSelectionPalette, y3 = h3.localStorageKey, b3 = h3.theme, _3 = h3.callbacks, w3 = (u3 = $t2, p3 = 10, function() { var t4 = this, e4 = arguments, n3 = function() { f3 = null, u3.apply(t4, e4); }; f3 || (f3 = setTimeout(n3, p3)); }), x3 = false, C3 = false, S3 = true, T3 = 0, k3 = 0, M3 = 0, L3 = 0, D3 = 0, N3 = 0, I3 = 0, F3 = 0, V3 = 0, R3 = 0, H3 = 1, z3 = [], B3 = [], U3 = {}, W3 = h3.selectionPalette.slice(0), $3 = h3.maxSelectionSize, q3 = "sp-dragging", G3 = null, K3 = e3.ownerDocument, Y3 = (K3.body, t3(e3)), X3 = false, J3 = t3(l2, K3).addClass(b3), Z3 = J3.find(".sp-picker-container"), Q3 = J3.find(".sp-color"), tt3 = J3.find(".sp-dragger"), et3 = J3.find(".sp-hue"), nt2 = J3.find(".sp-slider"), ot2 = J3.find(".sp-alpha-inner"), rt2 = J3.find(".sp-alpha"), it2 = J3.find(".sp-alpha-handle"), st2 = J3.find(".sp-input"), at2 = J3.find(".sp-palette"), lt2 = J3.find(".sp-initial"), ct2 = J3.find(".sp-cancel"), ut2 = J3.find(".sp-clear"), pt2 = J3.find(".sp-choose"), dt2 = J3.find(".sp-palette-toggle"), ft2 = Y3.is("input"), ht2 = ft2 && "color" === Y3.attr("type") && j2(), gt2 = ft2 && !g3, vt2 = gt2 ? t3(a2).addClass(b3).addClass(h3.className).addClass(h3.replacerClassName) : t3([]), yt2 = gt2 ? vt2 : Y3, mt2 = vt2.find(".sp-preview-inner"), bt2 = h3.color || ft2 && Y3.val(), _t2 = false, wt2 = h3.preferredFormat, xt2 = !h3.showButtons || h3.clickoutFiresChange, Ct2 = !bt2, St2 = h3.allowEmpty && !ht2; function Ot2() { if (h3.showPaletteOnly && (h3.showPalette = true), dt2.text(h3.showPaletteOnly ? h3.togglePaletteMoreText : h3.togglePaletteLessText), h3.palette) { z3 = h3.palette.slice(0), B3 = t3.isArray(z3[0]) ? z3 : [z3], U3 = {}; for (var e4 = 0; e4 < B3.length; e4++) for (var n3 = 0; n3 < B3[e4].length; n3++) { var o3 = m2(B3[e4][n3]).toRgbString(); U3[o3] = true; } } J3.toggleClass("sp-flat", g3), J3.toggleClass("sp-input-disabled", !h3.showInput), J3.toggleClass("sp-alpha-enabled", h3.showAlpha), J3.toggleClass("sp-clear-enabled", St2), J3.toggleClass("sp-buttons-disabled", !h3.showButtons), J3.toggleClass("sp-palette-buttons-disabled", !h3.togglePaletteOnly), J3.toggleClass("sp-palette-disabled", !h3.showPalette), J3.toggleClass("sp-palette-only", h3.showPaletteOnly), J3.toggleClass("sp-initial-disabled", !h3.showInitial), J3.addClass(h3.className).addClass(h3.containerClassName), $t2(); } function Tt2() { if (y3 && window.localStorage) { try { var e4 = window.localStorage[y3].split(",#"); e4.length > 1 && (delete window.localStorage[y3], t3.each(e4, function(t4, e5) { kt2(e5); })); } catch (t4) { } try { W3 = window.localStorage[y3].split(";"); } catch (t4) { } } } function kt2(e4) { if (v3) { var n3 = m2(e4).toRgbString(); if (!U3[n3] && -1 === t3.inArray(n3, W3)) for (W3.push(n3); W3.length > $3; ) W3.shift(); if (y3 && window.localStorage) try { window.localStorage[y3] = W3.join(";"); } catch (t4) { } } } function Pt2() { var e4 = Ht2(), n3 = t3.map(B3, function(t4, n4) { return O2(t4, e4, "sp-palette-row sp-palette-row-" + n4, h3); }); Tt2(), W3 && n3.push(O2(function() { var t4 = []; if (h3.showPalette) for (var e5 = 0; e5 < W3.length; e5++) { var n4 = m2(W3[e5]).toRgbString(); U3[n4] || t4.push(W3[e5]); } return t4.reverse().slice(0, h3.maxSelectionSize); }(), e4, "sp-palette-row sp-palette-row-selection", h3)), at2.html(n3.join("")); } function Et2() { if (h3.showInitial) { var t4 = _t2, e4 = Ht2(); lt2.html(O2([t4, e4], e4, "sp-palette-row-initial", h3)); } } function At2() { (k3 <= 0 || T3 <= 0 || L3 <= 0) && $t2(), C3 = true, J3.addClass(q3), G3 = null, Y3.trigger("dragstart.spectrum", [Ht2()]); } function jt2() { C3 = false, J3.removeClass(q3), Y3.trigger("dragstop.spectrum", [Ht2()]); } function Mt2() { var t4 = st2.val(); if (null !== t4 && "" !== t4 || !St2) { var e4 = m2(t4); e4.isValid() ? (Rt2(e4), Wt2(true)) : st2.addClass("sp-validation-error"); } else Rt2(null), Wt2(true); } function Lt2() { x3 ? Ft2() : Dt2(); } function Dt2() { var e4 = t3.Event("beforeShow.spectrum"); if (x3) $t2(); else if (Y3.trigger("beforeShow.spectrum", [Ht2()]), false !== _3.beforeShow(Ht2()) && !e4.isDefaultPrevented()) { !function() { for (var t4 = 0; t4 < r2.length; t4++) r2[t4] && r2[t4].hide(); }(), x3 = true; var n3 = t3(K3); n3.bind("keydown.spectrum", Nt2), n3.bind("click.spectrum", It2), t3(window).bind("resize.spectrum", w3), vt2.addClass("sp-active"), J3.removeClass("sp-hidden"), $t2(), Bt2(), _t2 = Ht2(), Et2(), _3.show(_t2), Y3.trigger("show.spectrum", [_t2]); } } function Nt2(t4) { 27 === t4.keyCode && Ft2(); } function It2(t4) { 2 != t4.button && (C3 || (xt2 ? Wt2(true) : Vt2(), Ft2())); } function Ft2() { x3 && !g3 && (x3 = false, t3(K3).unbind("keydown.spectrum", Nt2), t3(K3).unbind("click.spectrum", It2), t3(window).unbind("resize.spectrum", w3), vt2.removeClass("sp-active"), J3.addClass("sp-hidden"), _3.hide(Ht2()), Y3.trigger("hide.spectrum", [Ht2()])); } function Vt2() { Rt2(_t2, true); } function Rt2(t4, e4) { var n3, o3; m2.equals(t4, Ht2()) ? Bt2() : (!t4 && St2 ? Ct2 = true : (Ct2 = false, S3 = !t4, o3 = (n3 = m2(t4)).toHsv(), F3 = o3.h % 360 / 360, V3 = o3.s, R3 = o3.v, H3 = o3.a), Bt2(), n3 && n3.isValid() && !e4 && (wt2 = h3.preferredFormat || n3.getFormat())); } function Ht2(t4) { return t4 = t4 || {}, St2 && Ct2 ? null : m2.fromRatio({ h: F3, s: V3, v: R3, a: Math.round(100 * H3) / 100 }, { format: t4.format || wt2 }); } function zt2() { Bt2(), _3.move(Ht2()), Y3.trigger("move.spectrum", [Ht2()]); } function Bt2() { st2.removeClass("sp-validation-error"), Ut2(); var t4 = m2.fromRatio({ h: F3, s: 1, v: 1 }); Q3.css("background-color", t4.toHexString()); var e4 = wt2; H3 < 1 && (0 !== H3 || "name" !== e4) && ("hex" !== e4 && "hex3" !== e4 && "hex6" !== e4 && "name" !== e4 || (e4 = "rgb")); var n3 = Ht2({ format: e4 }), o3 = ""; if (mt2.removeClass("sp-clear-display"), mt2.css("background-color", "transparent"), !n3 && St2) mt2.addClass("sp-clear-display"); else { var r3 = n3.toHexString(), a3 = n3.toRgbString(); if (s2 || 1 === n3.alpha ? mt2.css("background-color", a3) : (mt2.css("background-color", "transparent"), mt2.css("filter", n3.toFilter())), h3.showAlpha) { var l3 = n3.toRgb(); l3.a = 0; var c4 = m2(l3).toRgbString(), u4 = "linear-gradient(left, " + c4 + ", " + r3 + ")"; i2 ? ot2.css("filter", m2(c4).toFilter({ gradientType: 1 }, r3)) : (ot2.css("background", "-webkit-" + u4), ot2.css("background", "-moz-" + u4), ot2.css("background", "-ms-" + u4), ot2.css("background", "linear-gradient(to right, " + c4 + ", " + r3 + ")")); } o3 = n3.toString(e4); } h3.showInput && st2.val(o3), h3.showPalette && Pt2(), Et2(); } function Ut2() { var t4 = V3, e4 = R3; if (St2 && Ct2) it2.hide(), nt2.hide(), tt3.hide(); else { it2.show(), nt2.show(), tt3.show(); var n3 = t4 * T3, o3 = k3 - e4 * k3; n3 = Math.max(-M3, Math.min(T3 - M3, n3 - M3)), o3 = Math.max(-M3, Math.min(k3 - M3, o3 - M3)), tt3.css({ top: o3 + "px", left: n3 + "px" }); var r3 = H3 * D3; it2.css({ left: r3 - N3 / 2 + "px" }); var i3 = F3 * L3; nt2.css({ top: i3 - I3 + "px" }); } } function Wt2(t4) { var e4 = Ht2(), n3 = "", o3 = !!S3 || !m2.equals(e4, _t2); e4 && (n3 = e4.toString(wt2), !x3 && kt2(e4)), ft2 && Y3.val(n3), t4 && o3 && (_3.change(e4), Y3.trigger("change", [e4])); } function $t2() { x3 && (T3 = Q3.width(), k3 = Q3.height(), M3 = tt3.height(), et3.width(), L3 = et3.height(), I3 = nt2.height(), D3 = rt2.width(), N3 = it2.width(), g3 || (J3.css("position", "absolute"), h3.offset ? J3.offset(h3.offset) : J3.offset(function(e4, n3) { var o3 = 0, r3 = e4.outerWidth(), i3 = e4.outerHeight(), s3 = n3.outerHeight(), a3 = e4[0].ownerDocument, l3 = a3.documentElement, c4 = l3.clientWidth, u4 = l3.clientHeight, p4 = t3(a3).scrollLeft(), d3 = t3(a3).scrollTop(), f4 = c4 + p4, h4 = u4 + d3, g4 = n3.offset(); return g4.top += s3, g4.left -= Math.min(g4.left, g4.left + r3 > f4 && f4 > r3 ? Math.abs(g4.left + r3 - f4) : 0), g4.top -= Math.min(g4.top, g4.top + i3 > h4 && h4 > i3 ? Math.abs(i3 + s3 - o3) : o3), g4; }(J3, yt2))), Ut2(), h3.showPalette && Pt2(), Y3.trigger("reflow.spectrum")); } function qt2() { Ft2(), X3 = true, Y3.attr("disabled", true), yt2.addClass("sp-disabled"); } !function() { if (i2 && J3.find("*:not(input)").attr("unselectable", "on"), Ot2(), gt2 && Y3.after(vt2).hide(), St2 || ut2.hide(), g3) Y3.after(J3).hide(); else { var e4 = "parent" === h3.appendTo ? Y3.parent() : t3(h3.appendTo); 1 !== e4.length && (e4 = t3("body")), e4.append(J3); } function n3(e5) { return e5.data && e5.data.ignore ? (Rt2(t3(e5.target).closest(".sp-thumb-el").data("color")), zt2()) : (Rt2(t3(e5.target).closest(".sp-thumb-el").data("color")), zt2(), h3.hideAfterPaletteSelect && (Wt2(true), Ft2())), false; } Tt2(), yt2.bind("click.spectrum touchstart.spectrum", function(e5) { X3 || Lt2(), e5.stopPropagation(), t3(e5.target).is("input") || e5.preventDefault(); }), (Y3.is(":disabled") || true === h3.disabled) && qt2(), J3.click(P2), st2.change(Mt2), st2.bind("paste", function() { setTimeout(Mt2, 1); }), st2.keydown(function(t4) { 13 == t4.keyCode && Mt2(); }), ct2.text(h3.cancelText), ct2.bind("click.spectrum", function(t4) { t4.stopPropagation(), t4.preventDefault(), Vt2(), Ft2(); }), ut2.attr("title", h3.clearText), ut2.bind("click.spectrum", function(t4) { t4.stopPropagation(), t4.preventDefault(), Ct2 = true, zt2(), g3 && Wt2(true); }), pt2.text(h3.chooseText), pt2.bind("click.spectrum", function(t4) { t4.stopPropagation(), t4.preventDefault(), i2 && st2.is(":focus") && st2.trigger("change"), st2.hasClass("sp-validation-error") || (Wt2(true), Ft2()); }), dt2.text(h3.showPaletteOnly ? h3.togglePaletteMoreText : h3.togglePaletteLessText), dt2.bind("click.spectrum", function(t4) { t4.stopPropagation(), t4.preventDefault(), h3.showPaletteOnly = !h3.showPaletteOnly, h3.showPaletteOnly || g3 || J3.css("left", "-=" + (Z3.outerWidth(true) + 5)), Ot2(); }), A2(rt2, function(t4, e5, n4) { H3 = t4 / D3, Ct2 = false, n4.shiftKey && (H3 = Math.round(10 * H3) / 10), zt2(); }, At2, jt2), A2(et3, function(t4, e5) { F3 = parseFloat(e5 / L3), Ct2 = false, h3.showAlpha || (H3 = 1), zt2(); }, At2, jt2), A2(Q3, function(t4, e5, n4) { if (n4.shiftKey) { if (!G3) { var o4 = V3 * T3, r3 = k3 - R3 * k3, i3 = Math.abs(t4 - o4) > Math.abs(e5 - r3); G3 = i3 ? "x" : "y"; } } else G3 = null; var s3 = !G3 || "y" === G3; (!G3 || "x" === G3) && (V3 = parseFloat(t4 / T3)), s3 && (R3 = parseFloat((k3 - e5) / k3)), Ct2 = false, h3.showAlpha || (H3 = 1), zt2(); }, At2, jt2), bt2 ? (Rt2(bt2), Bt2(), wt2 = h3.preferredFormat || m2(bt2).getFormat(), kt2(bt2)) : Bt2(), g3 && Dt2(); var o3 = i2 ? "mousedown.spectrum" : "click.spectrum touchstart.spectrum"; at2.delegate(".sp-thumb-el", o3, n3), lt2.delegate(".sp-thumb-el:nth-child(1)", o3, { ignore: true }, n3); }(); var Gt2 = { show: Dt2, hide: Ft2, toggle: Lt2, reflow: $t2, option: function(e4, o3) { return e4 === n2 ? t3.extend({}, h3) : o3 === n2 ? h3[e4] : (h3[e4] = o3, "preferredFormat" === e4 && (wt2 = h3.preferredFormat), void Ot2()); }, enable: function() { X3 = false, Y3.attr("disabled", false), yt2.removeClass("sp-disabled"); }, disable: qt2, offset: function(t4) { h3.offset = t4, $t2(); }, set: function(t4) { Rt2(t4), Wt2(); }, get: Ht2, destroy: function() { Y3.show(), yt2.unbind("click.spectrum touchstart.spectrum"), J3.remove(), vt2.remove(), r2[Gt2.id] = null; }, container: J3 }; return Gt2.id = r2.push(Gt2) - 1, Gt2; } function k2() { } function P2(t4) { t4.stopPropagation(); } function E2(t4, e3) { var n3 = Array.prototype.slice, o3 = n3.call(arguments, 2); return function() { return t4.apply(e3, o3.concat(n3.call(arguments))); }; } function A2(e3, n3, o3, r3) { n3 = n3 || function() { }, o3 = o3 || function() { }, r3 = r3 || function() { }; var s3 = document, a3 = false, l3 = {}, c3 = 0, u3 = 0, p3 = "ontouchstart" in window, d3 = {}; function f3(t4) { t4.stopPropagation && t4.stopPropagation(), t4.preventDefault && t4.preventDefault(), t4.returnValue = false; } function h3(t4) { if (a3) { if (i2 && s3.documentMode < 9 && !t4.button) return g3(); var o4 = t4 && t4.touches && t4.touches[0], r4 = o4 && o4.pageX || t4.pageX, d4 = o4 && o4.pageY || t4.pageY, h4 = Math.max(0, Math.min(r4 - l3.left, u3)), v3 = Math.max(0, Math.min(d4 - l3.top, c3)); p3 && f3(t4), n3.apply(e3, [h4, v3, t4]); } } function g3() { a3 && (t3(s3).unbind(d3), t3(s3.body).removeClass("sp-dragging"), setTimeout(function() { r3.apply(e3, arguments); }, 0)), a3 = false; } d3["selectstart"] = f3, d3["dragstart"] = f3, d3["touchmove mousemove"] = h3, d3["touchend mouseup"] = g3, t3(e3).bind("touchstart mousedown", function(n4) { var r4 = n4.which ? 3 == n4.which : 2 == n4.button; r4 || a3 || false !== o3.apply(e3, arguments) && (a3 = true, c3 = t3(e3).height(), u3 = t3(e3).width(), l3 = t3(e3).offset(), t3(s3).bind(d3), t3(s3.body).addClass("sp-dragging"), h3(n4), f3(n4)); }); } function j2() { return t3.fn.spectrum.inputTypeColorSupport(); } function M2(t4, e3, n3) { t4 = X2(t4, 255), e3 = X2(e3, 255), n3 = X2(n3, 255); var o3, r3, i3 = v2(t4, e3, n3), s3 = g2(t4, e3, n3), a3 = (i3 + s3) / 2; if (i3 == s3) o3 = r3 = 0; else { var l3 = i3 - s3; switch (r3 = a3 > 0.5 ? l3 / (2 - i3 - s3) : l3 / (i3 + s3), i3) { case t4: o3 = (e3 - n3) / l3 + (e3 < n3 ? 6 : 0); break; case e3: o3 = (n3 - t4) / l3 + 2; break; case n3: o3 = (t4 - e3) / l3 + 4; } o3 /= 6; } return { h: o3, s: r3, l: a3 }; } function L2(t4, e3, n3) { t4 = X2(t4, 255), e3 = X2(e3, 255), n3 = X2(n3, 255); var o3, r3, i3 = v2(t4, e3, n3), s3 = g2(t4, e3, n3), a3 = i3, l3 = i3 - s3; if (r3 = 0 === i3 ? 0 : l3 / i3, i3 == s3) o3 = 0; else { switch (i3) { case t4: o3 = (e3 - n3) / l3 + (e3 < n3 ? 6 : 0); break; case e3: o3 = (n3 - t4) / l3 + 2; break; case n3: o3 = (t4 - e3) / l3 + 4; } o3 /= 6; } return { h: o3, s: r3, v: a3 }; } function D2(t4, e3, n3, o3) { var r3 = [Q2(h2(t4).toString(16)), Q2(h2(e3).toString(16)), Q2(h2(n3).toString(16))]; return o3 && r3[0].charAt(0) == r3[0].charAt(1) && r3[1].charAt(0) == r3[1].charAt(1) && r3[2].charAt(0) == r3[2].charAt(1) ? r3[0].charAt(0) + r3[1].charAt(0) + r3[2].charAt(0) : r3.join(""); } function N2(t4, e3, n3, o3) { var r3; return [Q2((r3 = o3, Math.round(255 * parseFloat(r3)).toString(16))), Q2(h2(t4).toString(16)), Q2(h2(e3).toString(16)), Q2(h2(n3).toString(16))].join(""); } function I2(t4, e3) { e3 = 0 === e3 ? 0 : e3 || 10; var n3 = m2(t4).toHsl(); return n3.s -= e3 / 100, n3.s = J2(n3.s), m2(n3); } function F2(t4, e3) { e3 = 0 === e3 ? 0 : e3 || 10; var n3 = m2(t4).toHsl(); return n3.s += e3 / 100, n3.s = J2(n3.s), m2(n3); } function V2(t4) { return m2(t4).desaturate(100); } function R2(t4, e3) { e3 = 0 === e3 ? 0 : e3 || 10; var n3 = m2(t4).toHsl(); return n3.l += e3 / 100, n3.l = J2(n3.l), m2(n3); } function H2(t4, e3) { e3 = 0 === e3 ? 0 : e3 || 10; var n3 = m2(t4).toRgb(); return n3.r = v2(0, g2(255, n3.r - h2(255 * (-e3 / 100)))), n3.g = v2(0, g2(255, n3.g - h2(255 * (-e3 / 100)))), n3.b = v2(0, g2(255, n3.b - h2(255 * (-e3 / 100)))), m2(n3); } function z2(t4, e3) { e3 = 0 === e3 ? 0 : e3 || 10; var n3 = m2(t4).toHsl(); return n3.l -= e3 / 100, n3.l = J2(n3.l), m2(n3); } function B2(t4, e3) { var n3 = m2(t4).toHsl(), o3 = (h2(n3.h) + e3) % 360; return n3.h = o3 < 0 ? 360 + o3 : o3, m2(n3); } function U2(t4) { var e3 = m2(t4).toHsl(); return e3.h = (e3.h + 180) % 360, m2(e3); } function W2(t4) { var e3 = m2(t4).toHsl(), n3 = e3.h; return [m2(t4), m2({ h: (n3 + 120) % 360, s: e3.s, l: e3.l }), m2({ h: (n3 + 240) % 360, s: e3.s, l: e3.l })]; } function $2(t4) { var e3 = m2(t4).toHsl(), n3 = e3.h; return [m2(t4), m2({ h: (n3 + 90) % 360, s: e3.s, l: e3.l }), m2({ h: (n3 + 180) % 360, s: e3.s, l: e3.l }), m2({ h: (n3 + 270) % 360, s: e3.s, l: e3.l })]; } function q2(t4) { var e3 = m2(t4).toHsl(), n3 = e3.h; return [m2(t4), m2({ h: (n3 + 72) % 360, s: e3.s, l: e3.l }), m2({ h: (n3 + 216) % 360, s: e3.s, l: e3.l })]; } function G2(t4, e3, n3) { e3 = e3 || 6, n3 = n3 || 30; var o3 = m2(t4).toHsl(), r3 = 360 / n3, i3 = [m2(t4)]; for (o3.h = (o3.h - (r3 * e3 >> 1) + 720) % 360; --e3; ) o3.h = (o3.h + r3) % 360, i3.push(m2(o3)); return i3; } function K2(t4, e3) { e3 = e3 || 6; for (var n3 = m2(t4).toHsv(), o3 = n3.h, r3 = n3.s, i3 = n3.v, s3 = [], a3 = 1 / e3; e3--; ) s3.push(m2({ h: o3, s: r3, v: i3 })), i3 = (i3 + a3) % 1; return s3; } function Y2(t4) { return t4 = parseFloat(t4), (isNaN(t4) || t4 < 0 || t4 > 1) && (t4 = 1), t4; } function X2(t4, e3) { (function(t5) { return "string" == typeof t5 && -1 != t5.indexOf(".") && 1 === parseFloat(t5); })(t4) && (t4 = "100%"); var n3 = function(t5) { return "string" == typeof t5 && -1 != t5.indexOf("%"); }(t4); return t4 = g2(e3, v2(0, parseFloat(t4))), n3 && (t4 = parseInt(t4 * e3, 10) / 100), f2.abs(t4 - e3) < 1e-6 ? 1 : t4 % e3 / parseFloat(e3); } function J2(t4) { return g2(1, v2(0, t4)); } function Z2(t4) { return parseInt(t4, 16); } function Q2(t4) { return 1 == t4.length ? "0" + t4 : "" + t4; } function tt2(t4) { return t4 <= 1 && (t4 = 100 * t4 + "%"), t4; } function et2(t4) { return Z2(t4) / 255; } }(l["default"]); var Ea = function(t3) { var e3 = "name" === t3.getFormat() && t3.toName(), n2 = 1 == t3.getAlpha() ? t3.toHexString() : t3.toRgbString(); return e3 || n2.replace(/ /g, ""); }; const Aa = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return ka(n2, e3), n2.prototype.template = function() { var t3 = this.ppfx; return '\n
\n
\n
\n
\n
\n
\n '); }, n2.prototype.inputClass = function() { var t3 = this.ppfx; return "".concat(t3, "field ").concat(t3, "field-color"); }, n2.prototype.holderClass = function() { return "".concat(this.ppfx, "input-holder"); }, n2.prototype.remove = function() { return e3.prototype.remove.call(this), this.colorEl.spectrum("destroy"), this; }, n2.prototype.handleChange = function(e4) { e4.stopPropagation(); var n3 = e4.target.value; (0, t2.isUndefined)(n3) || this.__onInputChange(n3); }, n2.prototype.__onInputChange = function(t3) { var e4 = this.model, n3 = this.opts.onChange, o2 = t3, r2 = this.getColorEl(); if (r2) { r2.spectrum("set", o2); var i2 = r2.spectrum("get"), s2 = o2 && Ea(i2); s2 && (o2 = s2); } n3 ? n3(o2) : e4.set({ value: o2 }, { fromInput: 1 }); }, n2.prototype.setValue = function(e4, n3) { void 0 === n3 && (n3 = {}); var o2 = this.model, r2 = (0, t2.isUndefined)(n3.def) ? o2.get("defaults") : n3.def, i2 = (0, t2.isUndefined)(e4) ? (0, t2.isUndefined)(r2) ? "" : r2 : e4, s2 = this.getInputEl(), a2 = this.getColorEl(), l2 = "none" != i2 ? i2 : ""; s2.value = i2, a2.get(0).style.backgroundColor = l2, (n3.fromTarget || n3.fromInput && !n3.avoidStore) && (a2.spectrum("set", l2), this.noneColor = "none" == i2, this.movedColor = l2); }, n2.prototype.getColorEl = function() { var t3 = this; if (!this.colorEl) { var e4 = this, n3 = e4.em, o2 = e4.model, r2 = e4.opts, i2 = this.ppfx, s2 = r2.onChange, a2 = (0, l["default"])('
')), c2 = a2.get(0).style, u2 = n3 && n3.config ? n3.config.el : "", p2 = n3 && n3.getConfig && n3.getConfig().colorPicker || {}; this.movedColor = ""; var d2, f2 = false; this.$el.find("[data-colorp-c]").append(a2); var h2 = function(t4, e5) { void 0 === e5 && (e5 = true), s2 ? s2(t4, !e5) : (e5 && o2.setValueFromInput(0, false), o2.setValueFromInput(t4, e5)); }; a2.spectrum(Pa(Pa(Pa({ color: o2.getValue() || false, containerClassName: "".concat(i2, "one-bg ").concat(i2, "two-color"), appendTo: u2 || "body", maxSelectionSize: 8, showPalette: true, showAlpha: true, chooseText: "Ok", cancelText: "⨯", palette: [] }, p2), o2.get("colorPicker") || {}), { move: function(e5) { var n4 = Ea(e5); t3.movedColor = n4, c2.backgroundColor = n4, h2(n4, false); }, change: function(e5) { f2 = true; var n4 = Ea(e5); c2.backgroundColor = n4, h2(n4), t3.noneColor = false; }, show: function(e5) { f2 = false, t3.movedColor = "", d2 = s2 ? o2.getValue({ noDefault: true }) : Ea(e5); }, hide: function() { f2 || !d2 && !s2 || (t3.noneColor && (d2 = ""), c2.backgroundColor = d2, a2.spectrum("set", d2), h2(d2, false)); } })), n3 && n3.on && this.listenTo(n3, "component:selected", function() { t3.movedColor && h2(t3.movedColor), f2 = true, t3.movedColor = "", a2.spectrum("hide"); }), this.colorEl = a2; } return this.colorEl; }, n2.prototype.render = function() { return wa.prototype.render.call(this), this.getColorEl(), this; }, n2; }(wa); var ja = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Ma = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return ja(e3, t3), e3.prototype.templateInput = function() { return ""; }, e3.prototype.getInputEl = function() { if (!this.input) { var t4 = this.model, e4 = this.getModelValue(), n2 = new Aa({ model: t4, target: this.config.em, contClass: this.ppfx + "field-color", ppfx: this.ppfx }).render(); n2.setValue(e4, { fromTarget: 1 }), this.input = n2.el; } return this.input; }, e3; }(pa); var La = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Da = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return La(n2, e3), n2.prototype.templateInput = function() { return ""; }, n2.prototype.onChange = function() { this.handleClick(); }, n2.prototype.handleClick = function() { var e4 = this.model, n3 = this.em, o2 = e4.get("command"); o2 && ((0, t2.isString)(o2) ? n3.Commands.run(o2) : o2(n3.Editor, e4)); }, n2.prototype.renderLabel = function() { this.model.get("label") && pa.prototype.renderLabel.apply(this); }, n2.prototype.getInputEl = function() { var t3 = this.model, e4 = this.ppfx, n3 = t3.props(), o2 = n3.labelButton, r2 = n3.text, i2 = n3.full, s2 = o2 || r2, a2 = "".concat(e4, "btn"); return '"); }, n2; }(pa); const Na = Da; Da.prototype.eventCapture = ["click button"]; var Ia = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Fa = function() { return Fa = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Fa.apply(this, arguments); }, Va = "trait", Ra = "".concat(Va, ":"), Ha = "".concat(Ra, "custom"), za = { text: pa, number: Ta, select: va, checkbox: ma, color: Ma, button: Na }, Ba = function(e3) { function n2(n3) { var o2 = e3.call(this, n3, "TraitManager", sa) || this; o2.TraitsView = ha, o2.events = { all: Va, custom: Ha }; var r2 = o2.config, i2 = new u.Hn(); o2.model = i2; var s2 = r2.pStylePrefix; o2.types = Fa({}, za), s2 && (r2.stylePrefix = "".concat(s2).concat(r2.stylePrefix)); var a2 = (0, t2.debounce)(function() { return o2.__upSel(); }, 0); i2.listenTo(n3, "component:toggled", a2); var l2 = (0, t2.debounce)(function() { return o2.__onUp(); }, 0); return i2.listenTo(n3, "trait:update", l2), o2; } return Ia(n2, e3), n2.prototype.__upSel = function() { this.select(this.em.getSelected()); }, n2.prototype.__onUp = function() { this.select(this.getSelected()); }, n2.prototype.select = function(t3) { var e4 = t3 ? t3.getTraits() : []; this.model.set({ component: t3, traits: e4 }), this.__trgCustom(); }, n2.prototype.getSelected = function() { return this.model.get("component") || null; }, n2.prototype.getCurrent = function() { return this.model.get("traits") || []; }, n2.prototype.__trgCustom = function(t3) { void 0 === t3 && (t3 = {}), this.__ctn = this.__ctn || t3.container, this.em.trigger(this.events.custom, { container: this.__ctn }); }, n2.prototype.postRender = function() { this.__appendTo(); }, n2.prototype.getTraitsViewer = function() { return this.view; }, n2.prototype.addType = function(t3, e4) { var n3 = this.getType("text"); this.types[t3] = n3.extend(e4); }, n2.prototype.getType = function(t3) { return this.getTypes()[t3]; }, n2.prototype.getTypes = function() { return this.types; }, n2.prototype.render = function() { var t3 = this.view, e4 = this.em, n3 = this.getConfig(), o2 = t3 && t3.el; return t3 = new ha({ el: o2, collection: [], editor: e4, config: n3 }, this.getTypes()), this.view = t3, t3.el; }, n2.prototype.destroy = function() { this.model.stopListening(), this.model.clear(); }, n2; }(m); const Ua = Ba; const Wa = { stylePrefix: "", appendTo: "", sortable: true, hidable: true, hideTextnode: true, root: "", showWrapper: true, showHover: true, scrollCanvas: { behavior: "smooth", block: "nearest" }, scrollLayers: { behavior: "auto", block: "nearest" }, highlightHover: true, custom: false, onInit: function() { }, onRender: function() { }, extend: {} }; var $a = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), qa = function(t3) { function e3(e4) { void 0 === e4 && (e4 = {}); var n2 = t3.call(this, e4) || this; n2.items = [], n2.opt = e4; var o2 = e4.config || {}; n2.config = o2, n2.parentView = e4.parentView; var r2 = o2.stylePrefix || "", i2 = o2.pStylePrefix || "", s2 = n2.collection; n2.listenTo(s2, "add", n2.addTo), n2.listenTo(s2, "reset resetNavigator", n2.render), n2.listenTo(s2, "remove", n2.removeChildren), n2.className = "".concat(r2, "layers"); var a2 = o2.em; if (o2.sortable && !n2.opt.sorter) { var l2 = a2.Utils; n2.opt.sorter = new l2.Sorter({ container: o2.sortContainer || n2.el, containerSel: ".".concat(n2.className), itemSel: ".".concat(r2, "layer"), ignoreViewChildren: 1, onEndMove: function(t4, e5, n3) { var o3 = e5.getSourceModel(); a2.setSelected(o3, { forceChange: 1 }), a2.trigger("".concat(Ke, ":end"), n3); }, avoidSelectOnEnd: 1, nested: 1, ppfx: i2, pfx: r2 }); } return n2.$el.data("collection", s2), e4.parent && n2.$el.data("model", e4.parent), n2; } return $a(e3, t3), e3.prototype.removeChildren = function(t4) { var e4 = t4.viewLayer; e4 && (e4.remove(), delete t4.viewLayer); }, e3.prototype.addTo = function(t4) { var e4 = this.collection.indexOf(t4); this.addToCollection(t4, null, e4); }, e3.prototype.addToCollection = function(t4, e4, n2) { var o2 = this, r2 = o2.parentView, i2 = o2.opt, s2 = o2.config, a2 = i2.ItemView, l2 = i2.opened, c2 = i2.module, u2 = e4 || null, p2 = new a2({ ItemView: a2, level: i2.level, model: t4, parentView: r2, config: s2, sorter: i2.sorter, opened: l2, module: c2 }), d2 = p2.render().el; if (u2) u2.appendChild(d2); else if (void 0 !== n2) { var f2 = "before"; this.$el.children().length == n2 && (n2--, f2 = "after"), n2 < 0 ? this.$el.append(d2) : this.$el.children().eq(n2)[f2](d2); } else this.$el.append(d2); return this.items.push(p2), d2; }, e3.prototype.remove = function() { for (var t4 = [], e4 = 0; e4 < arguments.length; e4++) t4[e4] = arguments[e4]; return u.G7.prototype.remove.apply(this, t4), this.items.map(function(t5) { return t5.remove(); }), this; }, e3.prototype.render = function() { var t4 = this, e4 = document.createDocumentFragment(), n2 = this.el; return n2.innerHTML = "", this.collection.each(function(n3) { return t4.addToCollection(n3, e4); }), n2.appendChild(e4), n2.className = this.className, this; }, e3; }(u.G7); const Ga = qa; var Ka = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ya = "contentEditable", Xa = function(n2) { function o2(e3) { var o3 = n2.call(this, e3) || this; (0, t2.bindAll)(o3, "__render"), o3.opt = e3, o3.module = e3.module, o3.config = e3.config || {}, o3.sorter = e3.sorter || "", o3.parentView = e3.parentView; var r2 = o3, i2 = r2.model, s2 = r2.pfx, a2 = r2.ppfx, l2 = i2.get("type") || "default"; return o3.className = "".concat(s2, "layer ").concat(s2, "layer__t-").concat(l2, " no-select ").concat(a2, "two-color"), o3.inputNameCls = "".concat(a2, "layer-name"), o3.clsTitleC = "".concat(s2, "layer-title-c"), o3.clsTitle = "".concat(s2, "layer-title"), o3.clsCaret = "".concat(s2, "layer-caret"), o3.clsCount = "".concat(s2, "layer-count"), o3.clsMove = "".concat(s2, "layer-move"), o3.clsChildren = "".concat(s2, "layer-children"), o3.clsNoChild = "".concat(s2, "layer-no-chld"), o3.clsEdit = "".concat(o3.inputNameCls, "--edit"), o3.clsNoEdit = "".concat(o3.inputNameCls, "--no-edit"), o3.initComponent(), o3; } return Ka(o2, n2), o2.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" }; }, o2.prototype.template = function(t3) { var e3 = this, n3 = e3.pfx, o3 = e3.ppfx, r2 = e3.config, i2 = e3.clsNoEdit, s2 = e3.module, a2 = e3.opt, l2 = e3.em, c2 = r2.hidable, u2 = s2.getComponents(t3).length, p2 = u2 ? "" : this.clsNoChild, d2 = "".concat(this.clsTitle, " ").concat(p2), f2 = "".concat(this.clsTitleC, " ").concat(o3, "one-bg"), h2 = "".concat(this.inputNameCls, " ").concat(i2, " ").concat(o3, "no-app"), g2 = a2.level + 1, v2 = "".concat(30 + 10 * g2, "px"), y2 = t3.getName(), m2 = t3.getIcon(), b2 = "".concat(n3, "layer"), _2 = (null == l2 ? void 0 : l2.getConfig()).icons, w2 = _2.move, x2 = _2.eye, C2 = _2.eyeOff, S2 = _2.chevron; return "\n ".concat(c2 ? '\n ').concat(x2, '\n ').concat(C2, "\n ") : "", '\n
\n
\n
\n ').concat(S2, "\n ").concat(m2 ? '').concat(m2, "") : "", '\n ').concat(y2, '\n
\n
\n
\n
').concat(u2 || "", '
\n
').concat(w2 || "", '
\n
'); }, Object.defineProperty(o2.prototype, "em", { get: function() { return this.module.em; }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "ppfx", { get: function() { return this.em.getConfig().stylePrefix; }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "pfx", { get: function() { return this.config.stylePrefix; }, enumerable: false, configurable: true }), o2.prototype.initComponent = function() { var t3 = this, e3 = this.model, n3 = this.config.onInit, o3 = e3.components(); this.listenTo(o3, "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(n4) { return t3.listenTo(e3, n4[0], n4[1]); }), this.$el.data("model", e3), this.$el.data("collection", o3), e3.viewLayer = this, n3.bind(this)({ component: e3, render: this.__render, listenTo: this.listenTo }); }, o2.prototype.updateName = function() { this.getInputName().innerText = this.model.getName(); }, o2.prototype.getVisibilityEl = function() { return this.eyeEl || (this.eyeEl = this.$el.children(".".concat(this.pfx, "layer-vis"))), this.eyeEl; }, o2.prototype.updateVisibility = function() { var t3 = this, e3 = t3.pfx, n3 = t3.model, o3 = t3.module, r2 = "".concat(e3, "layer-hidden"), i2 = !o3.isVisible(n3) ? "addClass" : "removeClass"; this.$el[i2](r2), this.getVisibilityEl()[i2]("".concat(e3, "layer-off")); }, o2.prototype.toggleVisibility = function(t3) { null == t3 || t3.stopPropagation(); var e3 = this.module, n3 = this.model; e3.setVisible(n3, !e3.isVisible(n3)); }, o2.prototype.handleEdit = function(t3) { null == t3 || t3.stopPropagation(); var e3 = this, n3 = e3.em, o3 = e3.$el, r2 = e3.clsNoEdit, i2 = e3.clsEdit, s2 = this.getInputName(); s2[Ya] = "true", s2.focus(), document.execCommand("selectAll", false), n3.setEditing(true), o3.find(".".concat(this.inputNameCls)).removeClass(r2).addClass(i2); }, o2.prototype.handleEditKey = function(t3) { t3.stopPropagation(), ((0, e2.isEscKey)(t3) || (0, e2.isEnterKey)(t3)) && this.handleEditEnd(t3); }, o2.prototype.handleEditEnd = function(t3) { null == t3 || t3.stopPropagation(); var e3 = this, n3 = e3.em, o3 = e3.$el, r2 = e3.clsNoEdit, i2 = e3.clsEdit, s2 = this.getInputName(), a2 = s2.textContent; s2.scrollLeft = 0, s2[Ya] = "false", this.setName(a2, { component: this.model, propName: "custom-name" }), n3.setEditing(false), o3.find(".".concat(this.inputNameCls)).addClass(r2).removeClass(i2), this.updateName(); }, o2.prototype.setName = function(t3, e3) { var n3 = e3.propName; this.model.set(n3, t3); }, o2.prototype.getInputName = function() { return this.inputName || (this.inputName = this.el.querySelector(".".concat(this.inputNameCls))), this.inputName; }, o2.prototype.updateOpening = function() { var t3 = this, e3 = t3.$el, n3 = t3.model, o3 = t3.pfx, r2 = "open", i2 = "".concat(o3, "layer-open"), s2 = this.getCaret(); this.module.isOpen(n3) ? (e3.addClass(r2), s2.addClass(i2)) : (e3.removeClass(r2), s2.removeClass(i2)); }, o2.prototype.toggleOpening = function(t3) { var e3 = this.model, n3 = this.module; null == t3 || t3.stopImmediatePropagation(), e3.get("components").length && n3.setOpen(e3, !n3.isOpen(e3)); }, o2.prototype.handleSelect = function(t3) { null == t3 || t3.stopPropagation(); var e3 = this.module, n3 = this.model; e3.setLayerData(n3, { selected: true }, { event: t3 }); }, o2.prototype.handleHover = function(t3) { null == t3 || t3.stopPropagation(); var e3 = this.module, n3 = this.model; e3.setLayerData(n3, { hovered: true }); }, o2.prototype.handleHoverOut = function(t3) { null == t3 || t3.stopPropagation(); var e3 = this.module, n3 = this.model; e3.setLayerData(n3, { hovered: false }); }, o2.prototype.startSort = function(t3) { t3.stopPropagation(); var e3 = this.em, n3 = this.sorter; t3.button && 0 !== t3.button || n3 && (n3.onStart = function(t4) { return e3.trigger("".concat(Ke, ":start"), t4); }, n3.onMoveClb = function(t4) { return e3.trigger(Ke, t4); }, n3.startSort(t3.target)); }, o2.prototype.updateStatus = function() { cn.prototype.updateStatus.apply(this, [{ avoidHover: !this.config.highlightHover, noExtHl: true }]); }, o2.prototype.checkChildren = function() { var t3 = this, e3 = t3.model, n3 = t3.clsNoChild, o3 = t3.$el, r2 = t3.module, i2 = r2.getComponents(e3).length, s2 = o3.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)), a2 = this.cnt; a2 || (a2 = o3.children("[data-count]").get(0), this.cnt = a2), s2[i2 ? "removeClass" : "addClass"](n3), a2 && (a2.innerHTML = i2 || ""), !i2 && r2.setOpen(e3, false); }, o2.prototype.getCaret = function() { return this.caret && this.caret.length || (this.caret = this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))), this.caret; }, o2.prototype.setRoot = function(n3) { n3 = (0, t2.isString)(n3) ? this.em.getWrapper().find(n3)[0] : n3; var o3 = (0, e2.getModel)(n3, 0); o3 && (this.stopListening(), this.model = o3, this.initComponent(), this._rendered && this.render()); }, o2.prototype.updateLayerable = function() { (this.parentView || this).render(); }, o2.prototype.__clearItems = function() { var t3; null === (t3 = this.items) || void 0 === t3 || t3.remove(); }, o2.prototype.remove = function() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; return u.G7.prototype.remove.apply(this, t3), this.__clearItems(), this; }, o2.prototype.render = function() { var t3 = this, e3 = t3.model, n3 = t3.config, o3 = t3.pfx, r2 = t3.ppfx, i2 = t3.opt, s2 = t3.sorter; this.__clearItems(); var a2 = i2.opened, l2 = i2.module, c2 = i2.ItemView, u2 = !l2.__isLayerable(e3), p2 = this.$el.empty(), d2 = i2.level + 1; delete this.inputName, this.items = new Ga({ ItemView: c2, collection: e3.get("components"), config: n3, sorter: s2, opened: a2, parentView: this, parent: e3, level: d2, module: l2 }); var f2 = this.items.render().$el; return n3.showWrapper || 1 !== d2 ? (p2.html(this.template(e3)), p2.find(".".concat(this.clsChildren)).append(f2)) : p2.append(f2), e3.get("draggable") && n3.sortable || p2.children(".".concat(this.clsMove)).remove(), !l2.isVisible(e3) && (this.className += " ".concat(o3, "hide")), u2 && (this.className += " ".concat(r2, "hidden")), p2.attr("class", this.className), this.updateStatus(), this.updateOpening(), this.updateVisibility(), this.__render(), this._rendered = true, this; }, o2.prototype.__render = function() { var t3 = this, e3 = t3.model, n3 = t3.config, o3 = { component: e3, el: t3.el }; n3.onRender.bind(this)(o3), this.em.trigger("layer:render", o3); }, o2; }(u.G7); const Ja = Xa; var Za = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Qa = function() { return Qa = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Qa.apply(this, arguments); }, tl = "layer", el = "".concat(tl, ":"), nl = "".concat(el, "root"), ol = "".concat(el, "component"), rl = "".concat(el, "custom"), il = { all: tl, root: nl, component: ol, custom: rl }, sl = { mediaText: "" }, al = ["open", "status", "locked", "custom-name", "components", "classes"].map(function(t3) { return "component:update:".concat(t3); }).join(" "), ll = function(n2) { function o2(e3) { var o3 = n2.call(this, e3, "LayerManager", Wa) || this; return o3.events = il, (0, t2.bindAll)(o3, "componentChanged", "__onRootChange", "__onComponent"), o3.model = new x(o3, { opened: {} }), o3.config.stylePrefix = o3.config.pStylePrefix, o3; } return Za(o2, n2), o2.prototype.onLoad = function() { var t3 = this, e3 = this, n3 = e3.em, o3 = e3.config, r2 = e3.model; r2.listenTo(n3, "component:selected", this.componentChanged), r2.on("change:root", this.__onRootChange), r2.listenTo(n3, al, this.__onComponent), this.componentChanged(), r2.listenToOnce(n3, "load", function() { t3.setRoot(o3.root), t3.__appendTo(); }); }, o2.prototype.setRoot = function(n3) { var o3 = this.em.getWrapper(), r2 = (0, e2.isComponent)(n3) ? n3 : o3; return n3 && (0, t2.isString)(n3) && (0, e2.hasWin)() && (r2 = o3.find(n3)[0] || o3), this.model.set("root", r2), r2; }, o2.prototype.getRoot = function() { return this.model.get("root"); }, o2.prototype.getComponents = function(t3) { var e3 = this; return t3.components().filter(function(t4) { return e3.__isLayerable(t4); }); }, o2.prototype.setOpen = function(t3, e3) { t3.set("open", e3); }, o2.prototype.isOpen = function(t3) { return !!t3.get("open"); }, o2.prototype.setVisible = function(t3, e3) { var n3 = "__prev-display", o3 = t3.getStyle(sl), r2 = o3.display; if (e3) { var i2 = t3.get(n3); delete o3.display, i2 && (o3.display = i2, t3.unset(n3)); } else r2 && t3.set(n3, r2), o3.display = "none"; t3.setStyle(o3, sl), this.updateLayer(t3), this.em.trigger("component:toggled"); }, o2.prototype.isVisible = function(t3) { return void 0 === (e3 = t3.getStyle(sl)) && (e3 = {}), !(0 === (e3.display || "").trim().indexOf("none")); var e3; }, o2.prototype.setLocked = function(t3, e3) { t3.set("locked", e3); }, o2.prototype.isLocked = function(t3) { return !!t3.get("locked"); }, o2.prototype.setName = function(t3, e3) { t3.set("custom-name", e3); }, o2.prototype.getName = function(t3) { return t3.getName(); }, o2.prototype.getLayerData = function(t3) { var e3 = t3.get("status"); return { name: t3.getName(), open: this.isOpen(t3), selected: "selected" === e3, hovered: "hovered" === e3, visible: this.isVisible(t3), locked: this.isLocked(t3), components: this.getComponents(t3) }; }, o2.prototype.setLayerData = function(t3, n3, o3) { var r2; void 0 === o3 && (o3 = {}); var i2 = this.em, s2 = this.config, a2 = n3.open, l2 = n3.selected, c2 = n3.hovered, u2 = n3.visible, p2 = n3.locked, d2 = n3.name, f2 = Qa({ fromLayers: true }, o3); if ((0, e2.isDef)(a2) && this.setOpen(t3, a2), (0, e2.isDef)(l2)) if (l2) { i2.setSelected(t3, f2); var h2 = s2.scrollCanvas; h2 && (null === (r2 = t3.views) || void 0 === r2 || r2.forEach(function(t4) { return t4.scrollIntoView(h2); })); } else i2.removeSelected(t3, f2); (0, e2.isDef)(c2) && s2.showHover && (c2 ? i2.setHovered(t3, f2) : i2.setHovered(null, f2)), (0, e2.isDef)(u2) && u2 !== this.isVisible(t3) && this.setVisible(t3, u2), (0, e2.isDef)(p2) && this.setLocked(t3, p2), (0, e2.isDef)(d2) && this.setName(t3, d2); }, o2.prototype.componentChanged = function(t3, e3) { var n3; if (void 0 === e3 && (e3 = {}), !e3.fromLayers) { var o3 = this.em, r2 = this.config.scrollLayers, i2 = this.model.get("opened"), s2 = o3.getSelected(), a2 = null == s2 ? void 0 : s2.parent(); for (var l2 in i2) i2[l2].set("open", false), delete i2[l2]; for (; a2; ) a2.set("open", true), i2[a2.cid] = a2, a2 = a2.parent(); if (s2 && r2) { var c2 = null === (n3 = s2.viewLayer) || void 0 === n3 ? void 0 : n3.el; null == c2 || c2.scrollIntoView(r2); } } }, o2.prototype.getAll = function() { return this.view; }, o2.prototype.render = function() { var t3, e3, n3 = this.config, o3 = this.model, r2 = Ja.extend(n3.extend); return this.view = new r2({ el: null === (t3 = this.view) || void 0 === t3 ? void 0 : t3.el, ItemView: r2, level: 0, config: n3, opened: o3.get("opened"), model: this.getRoot(), module: this }), null === (e3 = this.view) || void 0 === e3 ? void 0 : e3.render().el; }, o2.prototype.destroy = function() { var t3; null === (t3 = this.view) || void 0 === t3 || t3.remove(); }, o2.prototype.__onRootChange = function() { var t3, e3 = this.getRoot(); null === (t3 = this.view) || void 0 === t3 || t3.setRoot(e3), this.em.trigger(nl, e3); }, o2.prototype.__onComponent = function(t3) { this.updateLayer(t3); }, o2.prototype.__isLayerable = function(t3) { var e3 = t3.get("tagName"); return (!this.config.hideTextnode || !t3.is("textnode") && "br" !== e3) && t3.get("layerable"); }, o2.prototype.__trgCustom = function(t3) { this.em.trigger(this.events.custom, { container: t3.container, root: this.getRoot() }); }, o2.prototype.updateLayer = function(t3, e3) { this.em.trigger(ol, t3, e3); }, o2; }(m); const cl = ll; const ul = { assets: [], noAssets: "", stylePrefix: "am-", upload: "", uploadName: "files", headers: {}, params: {}, credentials: "include", multiUpload: true, autoAdd: true, customFetch: void 0, uploadFile: void 0, embedAsBase64: true, handleAdd: void 0, beforeUpload: void 0, showUrlInput: true, custom: false, dropzone: false, openAssetsOnDrop: true, dropzoneContent: "" }; var pl = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), dl = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return pl(n2, e3), n2.getDefaults = function() { return (0, t2.result)(this.prototype, "defaults"); }, n2.prototype.defaults = function() { return { type: "", src: "" }; }, n2.prototype.getType = function() { return this.get("type"); }, n2.prototype.getSrc = function() { return this.get("src"); }, n2.prototype.getFilename = function() { return this.get("src").split("/").pop().split("?").shift(); }, n2.prototype.getExtension = function() { return this.getFilename().split(".").pop(); }, n2; }(u.Hn); const fl = dl; dl.prototype.idAttribute = "src"; var hl = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), gl = function() { return gl = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, gl.apply(this, arguments); }; const vl = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return hl(e3, t3), e3.prototype.defaults = function() { return gl(gl({}, fl.getDefaults()), { type: "image", unitDim: "px", height: 0, width: 0 }); }, e3; }(fl); var yl = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ml = function(e3) { function n2(t3) { var n3 = e3.call(this, t3) || this; n3.options = t3, n3.collection = t3.collection; var o2 = t3.config || {}; n3.config = o2, n3.pfx = o2.stylePrefix || "", n3.ppfx = o2.pStylePrefix || "", n3.em = o2.em, n3.className = n3.pfx + "asset", n3.listenTo(n3.model, "destroy remove", n3.remove), n3.model.view = n3; var r2 = n3.init && n3.init.bind(n3); return r2 && r2(t3), n3; } return yl(n2, e3), n2.prototype.__getBhv = function() { var t3 = this.em, e4 = null == t3 ? void 0 : t3.Assets; return (null == e4 ? void 0 : e4.__getBehaviour()) || {}; }, n2.prototype.template = function(t3, e4) { var n3 = this.pfx; return '\n
\n ').concat(this.getPreview(), '\n
\n
\n ').concat(this.getInfo(), '\n
\n
\n ⨯\n
\n '); }, n2.prototype.updateTarget = function(e4) { e4 && e4.set && (e4.set("attributes", (0, t2.clone)(e4.get("attributes"))), e4.set("src", this.model.get("src"))); }, n2.prototype.getPreview = function() { return ""; }, n2.prototype.getInfo = function() { return ""; }, n2.prototype.render = function() { var t3 = this.el; return t3.innerHTML = this.template(this, this.model), t3.className = this.className, this; }, n2; }(u.G7); const bl = ml; var _l = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), wl = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }, xl = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return _l(n2, e3), n2.prototype.getPreview = function() { var t3 = this, e4 = t3.pfx, n3 = t3.ppfx, o2 = t3.model.get("src"); return r(Sl || (Sl = wl(['\n
\n '], ['\n
\n '])), e4, o2, e4, n3); }, n2.prototype.getInfo = function() { var t3 = this.pfx, e4 = this.model, n3 = e4.get("name"), o2 = e4.get("width"), i2 = e4.get("height"), s2 = e4.get("unitDim"), a2 = o2 && i2 ? "".concat(o2, "x").concat(i2).concat(s2) : ""; return n3 = n3 || e4.getFilename(), r(Ol || (Ol = wl(['\n
', '
\n
', "
\n "], ['\n
', '
\n
', "
\n "])), t3, n3, t3, a2); }, n2.prototype.init = function(t3) { var e4 = this.pfx; this.className += " ".concat(e4, "asset-image"); }, n2.prototype.onClick = function() { var e4 = this.model, n3 = this.pfx, o2 = this.__getBhv().select, r2 = this.config.onClick, i2 = this.collection; i2.trigger("deselectAll"), this.$el.addClass(n3 + "highlight"), (0, t2.isFunction)(o2) ? o2(e4, false) : (0, t2.isFunction)(r2) ? r2(e4) : this.updateTarget(i2.target); }, n2.prototype.onDblClick = function() { var e4 = this.em, n3 = this.model, o2 = this.__getBhv().select, r2 = this.config.onDblClick, i2 = this.collection, s2 = i2.target, a2 = i2.onSelect; (0, t2.isFunction)(o2) ? o2(n3, true) : (0, t2.isFunction)(r2) ? r2(n3) : (this.updateTarget(s2), null == e4 || e4.Modal.close()), (0, t2.isFunction)(a2) && a2(n3); }, n2.prototype.onRemove = function(t3) { t3.stopImmediatePropagation(), this.model.collection.remove(this.model); }, n2; }(bl); const Cl = xl; var Sl, Ol; xl.prototype.events = { "click [data-toggle=asset-remove]": "onRemove", click: "onClick", dblclick: "onDblClick" }; var Tl = function() { return Tl = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Tl.apply(this, arguments); }, kl = { types: [], initialize: function(t3, e3) { var n2 = this; void 0 === e3 && (e3 = {}); var o2 = e3.em; this.em = o2, this.opts = e3, this.model = function(t4, e4) { var r3, i2, s2; if (void 0 === t4 && (t4 = {}), void 0 === e4 && (e4 = {}), t4 && t4.type) { var a2 = n2.getBaseType(); r3 = (s2 = n2.getType(t4.type)) ? s2.model : a2.model, i2 = s2 ? s2.view : a2.view; } else { var l2 = n2.recognizeType(t4); r3 = (s2 = l2.type).model, i2 = s2.view, t4 = l2.attributes; } var c2 = new r3(t4, Tl(Tl({}, e4), { em: o2 })); return c2.typeView = i2, c2; }; var r2 = this.init && this.init.bind(this); r2 && r2(); }, recognizeType: function(t3) { for (var e3 = this.getTypes(), n2 = 0; n2 < e3.length; n2++) { var o2 = e3[n2], r2 = o2.isType(t3); if (r2 = "boolean" == typeof r2 && r2 ? { type: o2.id } : r2) return { type: o2, attributes: r2 }; } return { type: this.getBaseType(), attributes: t3 }; }, getBaseType: function() { var t3 = this.getTypes(); return t3[t3.length - 1]; }, getTypes: function() { return this.types; }, getType: function(t3) { for (var e3 = this.getTypes(), n2 = 0; n2 < e3.length; n2++) { var o2 = e3[n2]; if (o2.id === t3) return o2; } }, addType: function(e3, n2) { var o2 = this.getType(e3), r2 = this.getBaseType(), i2 = o2 ? o2.model : r2.model, s2 = o2 ? o2.view : r2.view, a2 = n2.model, l2 = n2.view, c2 = n2.isType; a2 = a2 instanceof u.Hn || (0, t2.isFunction)(a2) ? a2 : i2.extend(a2 || {}), l2 = l2 instanceof u.G7 || (0, t2.isFunction)(l2) ? l2 : s2.extend(l2 || {}), !this.extendViewApi || n2.model || n2.view || (l2 = l2.extend(n2)), o2 ? (o2.model = a2, o2.view = l2, o2.isType = c2 || o2.isType) : (n2.id = e3, n2.model = a2, n2.view = l2, n2.isType = c2 || function(t3) { if (t3 && t3.type == e3) return true; }, this.getTypes().unshift(n2)); } }; const Pl = kl; var El = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Al = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return El(e3, t3), e3; }(u.FE.extend(Pl)); const jl = Al; Al.prototype.types = [{ id: "image", model: vl, view: Cl, isType: function(t3) { return "string" == typeof t3 ? { type: "image", src: t3 } : t3; } }]; var Ml = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ll = function(t3) { function e3(e4) { void 0 === e4 && (e4 = {}); var n2 = t3.call(this, e4) || this; n2.options = e4, n2.config = e4.config, n2.pfx = n2.config.stylePrefix || "", n2.ppfx = n2.config.pStylePrefix || "", n2.em = n2.config.em; var o2 = n2.collection; return n2.listenTo(o2, "reset", n2.renderAssets), n2.listenTo(o2, "add", n2.addToAsset), n2.listenTo(o2, "remove", n2.removedAsset), n2.listenTo(o2, "deselectAll", n2.deselectAll), n2; } return Ml(e3, t3), e3.prototype.template = function(t4) { var e4 = t4.pfx, n2 = t4.ppfx, o2 = t4.em, r2 = ""; return this.config.showUrlInput && (r2 = '\n
\n
\n \n
\n \n
\n
\n ')), '\n
\n
\n ').concat(r2, '\n
\n
\n
\n
\n '); }, e3.prototype.handleSubmit = function(t4) { t4.preventDefault(); var e4 = this.getAddInput(), n2 = e4 && e4.value.trim(), o2 = this.config.handleAdd; if (n2) { e4.value = ""; var r2 = this.getAssetsEl(); r2 && (r2.scrollTop = 0), o2 ? o2.bind(this)(n2) : this.options.globalCollection.add(n2, { at: 0 }); } }, e3.prototype.getAssetsEl = function() { return this.el.querySelector(".".concat(this.pfx, "assets")); }, e3.prototype.getAddInput = function() { return this.inputUrl && this.inputUrl.value || (this.inputUrl = this.el.querySelector(".".concat(this.pfx, "add-asset input"))), this.inputUrl; }, e3.prototype.removedAsset = function(t4) { this.collection.length || this.toggleNoAssets(); }, e3.prototype.addToAsset = function(t4) { 1 == this.collection.length && this.toggleNoAssets(true), this.addAsset(t4); }, e3.prototype.addAsset = function(t4, e4) { void 0 === e4 && (e4 = null); var n2 = e4, o2 = this.collection, r2 = this.config, i2 = new t4.typeView({ model: t4, collection: o2, config: r2 }).render().el; if (n2) n2.appendChild(i2); else { var s2 = this.getAssetsEl(); s2 && s2.insertBefore(i2, s2.firstChild); } return i2; }, e3.prototype.toggleNoAssets = function(t4) { void 0 === t4 && (t4 = false); var e4 = this.$el.find(".".concat(this.pfx, "assets")); if (t4) e4.empty(); else { var n2 = this.config.noAssets; n2 && e4.append(n2); } }, e3.prototype.deselectAll = function() { var t4 = this.pfx; this.$el.find(".".concat(t4, "highlight")).removeClass("".concat(t4, "highlight")); }, e3.prototype.renderAssets = function() { var t4 = this, e4 = document.createDocumentFragment(), n2 = this.$el.find(".".concat(this.pfx, "assets")); n2.empty(), this.toggleNoAssets(!!this.collection.length), this.collection.each(function(n3) { return t4.addAsset(n3, e4); }), n2.append(e4); }, e3.prototype.render = function() { var t4 = this.options.fu.render().el; return this.$el.empty(), this.$el.append(t4).append(this.template(this)), this.el.className = "".concat(this.ppfx, "asset-manager"), this.renderAssets(), this; }, e3; }(u.G7); const Dl = Ll; Ll.prototype.events = { submit: "handleSubmit" }; var Nl = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Il = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }, Fl = function(t3) { function e3(n2) { void 0 === n2 && (n2 = {}); var o2 = t3.call(this, n2) || this; o2.options = n2; var r2 = n2.config || {}; o2.module = n2.module, o2.config = r2, o2.em = o2.config.em, o2.pfx = r2.stylePrefix || "", o2.ppfx = r2.pStylePrefix || "", o2.target = o2.options.globalCollection || {}, o2.uploadId = o2.pfx + "uploadFile", o2.disabled = void 0 !== r2.disableUpload ? r2.disableUpload : !r2.upload && !r2.embedAsBase64, o2.multiUpload = void 0 === r2.multiUpload || r2.multiUpload; var i2 = r2.uploadFile; return i2 ? o2.uploadFile = i2.bind(o2) : !r2.upload && r2.embedAsBase64 && (o2.uploadFile = e3.embedAsBase64), o2.delegateEvents(), o2; } return Nl(e3, t3), e3.prototype.template = function(t4) { var e4 = t4.pfx, n2 = t4.title, o2 = t4.uploadId, i2 = t4.disabled, s2 = t4.multiUpload; return r(Rl || (Rl = Il(['\n
\n
', '
\n \n
\n \n '], ['\n
\n
', '
\n \n
\n \n '])), e4, n2, o2, i2 ? "disabled" : "", s2 ? "multiple" : ""); }, e3.prototype.events = function() { return { "change [data-input]": "uploadFile" }; }, e3.prototype.onUploadStart = function() { var t4 = this.module; t4 && t4.__propEv("asset:upload:start"); }, e3.prototype.onUploadEnd = function(t4) { var e4 = this.$el, n2 = this.module; n2 && n2.__propEv("asset:upload:end", t4); var o2 = e4.find("input"); o2 && o2.val(""); }, e3.prototype.onUploadError = function(t4) { var e4 = this.module; console.error(t4), this.onUploadEnd(t4), e4 && e4.__propEv("asset:upload:error", t4); }, e3.prototype.onUploadResponse = function(t4, e4) { var n2, o2 = this, r2 = o2.module, i2 = o2.config, s2 = o2.target; try { n2 = "string" == typeof t4 ? JSON.parse(t4) : t4; } catch (e5) { n2 = t4; } r2 && r2.__propEv("asset:upload:response", n2), i2.autoAdd && s2 && s2.add(n2.data, { at: 0 }), this.onUploadEnd(t4), null == e4 || e4(n2); }, e3.prototype.uploadFile = function(t4, e4) { var n2 = this, o2 = t4.dataTransfer ? t4.dataTransfer.files : t4.target.files, r2 = this.config, i2 = r2.beforeUpload; if (false !== (i2 && i2(o2))) { var s2 = new FormData(), a2 = r2.params, l2 = r2.customFetch, c2 = r2.fetchOptions; for (var u2 in a2) s2.append(u2, a2[u2]); if (this.multiUpload) for (var p2 = 0; p2 < o2.length; p2++) s2.append("".concat(r2.uploadName, "[]"), o2[p2]); else o2.length && s2.append(r2.uploadName, o2[0]); var d2 = r2.upload, f2 = r2.headers, h2 = "X-Requested-With"; if (void 0 === f2[h2] && (f2[h2] = "XMLHttpRequest"), d2) { this.onUploadStart(); var g2 = { method: "post", credentials: r2.credentials || "include", headers: f2, body: s2 }, v2 = (null == c2 ? void 0 : c2(g2)) || g2; return (l2 ? l2(d2, v2) : Us(d2, v2).then(function(t5) { return 1 == (t5.status / 200 | 0) ? t5.text() : t5.text().then(function(t6) { return Promise.reject(t6); }); })).then(function(t5) { return n2.onUploadResponse(t5, e4); }).catch(function(t5) { return n2.onUploadError(t5); }); } } }, e3.prototype.initDrop = function() { var t4 = this; if (!this.uploadForm) { this.uploadForm = this.$el.find("form").get(0); var e4 = this.uploadForm; "draggable" in e4 && (this.uploadForm.ondragover = function() { return e4.className = t4.pfx + "hover", false; }, this.uploadForm.ondragleave = function() { return e4.className = "", false; }, this.uploadForm.ondrop = function(n2) { e4.className = "", n2.preventDefault(), t4.uploadFile(n2); }); } }, e3.prototype.initDropzone = function(t4) { var e4 = this, n2 = 0, o2 = this.config, r2 = t4.model, i2 = t4.el, s2 = r2.Editor, a2 = r2.Canvas.getBody(), l2 = this.ppfx, c2 = "".concat(l2, "dropzone-active"), u2 = "".concat(l2, "dropzone"), p2 = function() { i2.className = i2.className.replace(c2, "").trim(), n2 = 0; }, d2 = function() { return n2 || (i2.className += " ".concat(c2), n2 = 1), false; }, f2 = function() { return p2(), false; }, h2 = function(t5) { if (p2(), t5.preventDefault(), t5.stopPropagation(), e4.uploadFile(t5), o2.openAssetsOnDrop && s2) { var n3 = s2.getSelected(); s2.runCommand("open-assets", { target: n3, onSelect: function() { s2.Modal.close(), s2.AssetManager.setTarget(null); } }); } return false; }; t4.$el.append('
').concat(o2.dropzoneContent, "
")), p2(), "draggable" in i2 && [i2, a2].forEach(function(t5) { t5.ondragover = d2, t5.ondragleave = f2, t5.ondrop = h2; }); }, e3.prototype.render = function() { var t4 = this, e4 = t4.$el, n2 = t4.pfx, o2 = t4.em; return e4.html(this.template({ title: o2 && o2.t("assetManager.uploadTitle"), uploadId: this.uploadId, disabled: this.disabled, multiUpload: this.multiUpload, pfx: n2 })), this.initDrop(), e4.attr("class", n2 + "file-uploader"), this; }, e3.embedAsBase64 = function(t4, e4) { var n2 = this, o2 = t4.dataTransfer ? t4.dataTransfer.files : t4.target.files, r2 = { data: [] }; if (FileReader) { for (var i2 = [], s2 = /^(.+)\/(.+)$/, a2 = function(t5) { var e5 = new Promise(function(e6, n3) { var o3 = new FileReader(); o3.addEventListener("load", function(r3) { var i3, a3 = t5.name, l3 = s2.exec(t5.type); if ("image" === (i3 = l3 ? l3[1] : t5.type)) { var c3 = { src: o3.result, name: a3, type: i3, height: 0, width: 0 }, u2 = new Image(); u2.addEventListener("error", function(t6) { n3(t6); }), u2.addEventListener("load", function() { c3.height = u2.height, c3.width = u2.width, e6(c3); }), u2.src = c3.src; } else e6(i3 ? { src: o3.result, name: a3, type: i3 } : o3.result); }), o3.addEventListener("error", function(t6) { n3(t6); }), o3.addEventListener("abort", function(t6) { n3("Aborted"); }), o3.readAsDataURL(t5); }); i2.push(e5); }, l2 = 0, c2 = o2; l2 < c2.length; l2++) { a2(c2[l2]); } return Promise.all(i2).then(function(t5) { r2.data = t5, n2.onUploadResponse(r2, e4); }, function(t5) { n2.onUploadError(t5); }); } this.onUploadError(new Error("Unsupported platform, FileReader is not defined")); }, e3; }(u.G7); const Vl = Fl; var Rl, Hl = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), zl = function() { return zl = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, zl.apply(this, arguments); }, Bl = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Ul = "asset", Wl = "".concat(Ul, ":"), $l = "".concat(Wl, "select"), ql = "".concat(Wl, "update"), Gl = "".concat(Wl, "add"), Kl = "".concat(Wl, "remove"), Yl = "".concat(Kl, ":before"), Xl = "".concat(Wl, "custom"), Jl = "".concat(Wl, "open"), Zl = "".concat(Wl, "close"), Ql = "".concat(Wl, "upload"), tc = "".concat(Ql, ":start"), ec = "".concat(Ql, ":end"), nc = "".concat(Ql, ":error"), oc = "".concat(Ql, ":response"), rc = "open-assets", ic = { all: Ul, select: $l, update: ql, add: Gl, remove: Kl, removeBefore: Yl, custom: Xl, open: Jl, close: Zl, uploadStart: tc, uploadEnd: ec, uploadError: nc, uploadResponse: oc }, sc = function(e3) { function n2(n3) { var o2 = e3.call(this, n3, "AssetManager", new jl([], n3), ic, ul) || this; o2.storageKey = "assets", o2.Asset = fl, o2.Assets = jl; var r2 = o2, i2 = r2.all, s2 = r2.config; o2.assetsVis = new jl([]); var a2 = s2.pStylePrefix; return a2 && (s2.stylePrefix = "".concat(a2).concat(s2.stylePrefix)), i2.on("add", function(t3) { return o2.getAllVisible().add(t3); }), i2.on("remove", function(t3) { return o2.getAllVisible().remove(t3); }), o2.__onAllEvent = (0, t2.debounce)(function() { return o2.__trgCustom(); }, 0), o2; } return Hl(n2, e3), n2.prototype.__propEv = function(t3) { for (var e4, n3, o2 = [], r2 = 1; r2 < arguments.length; r2++) o2[r2 - 1] = arguments[r2]; (e4 = this.em).trigger.apply(e4, Bl([t3], o2, false)), (n3 = this.getAll()).trigger.apply(n3, Bl([t3], o2, false)); }, n2.prototype.__trgCustom = function() { var t3 = this.__getBehaviour(), e4 = this.getConfig().custom; (t3.container || e4.open) && this.em.trigger(this.events.custom, this.__customData()); }, n2.prototype.__customData = function() { var e4 = this, n3 = this.__getBehaviour(); return { am: this, open: this.isOpen(), assets: this.getAll().models, types: n3.types || [], container: n3.container, close: function() { return e4.close(); }, remove: function(t3, n4) { return e4.remove(t3, n4); }, select: function(o2, r2) { var i2 = e4.add(o2); (0, t2.isFunction)(n3.select) && n3.select(i2, r2); }, options: n3.options || {} }; }, n2.prototype.open = function(t3) { void 0 === t3 && (t3 = {}), this.em.Commands.run(rc, zl({ types: ["image"], select: function() { } }, t3)); }, n2.prototype.close = function() { this.em.Commands.stop(rc); }, n2.prototype.isOpen = function() { var t3 = this.em.Commands; return !!(null == t3 ? void 0 : t3.isActive(rc)); }, n2.prototype.add = function(t3, e4) { return void 0 === e4 && (e4 = {}), void 0 === e4.at && (e4.at = 0), this.all.add(t3, e4); }, n2.prototype.get = function(t3) { return this.all.where({ src: t3 })[0] || null; }, n2.prototype.getAll = function() { return this.all; }, n2.prototype.getAllVisible = function() { return this.assetsVis; }, n2.prototype.remove = function(t3, e4) { return this.__remove(t3, e4); }, n2.prototype.store = function() { return this.getProjectData(); }, n2.prototype.load = function(t3) { return this.loadProjectData(t3); }, n2.prototype.getContainer = function() { var t3; return this.__getBehaviour().container || (null === (t3 = this.am) || void 0 === t3 ? void 0 : t3.el); }, n2.prototype.getAssetsEl = function() { var t3; return null === (t3 = this.am) || void 0 === t3 ? void 0 : t3.el.querySelector("[data-el=assets]"); }, n2.prototype.render = function(t3) { if (!this.getConfig().custom) { var e4 = t3 || this.getAll().models; if (!this.am) { var n3 = this.__viewParams(); n3.fu = this.FileUploader(), this.am = new Dl(zl({}, n3)), this.am.render(); } return this.assetsVis.reset(e4), this.getContainer(); } }, n2.prototype.__viewParams = function() { return { collection: this.assetsVis, globalCollection: this.all, config: this.config, module: this, fu: void 0 }; }, n2.prototype.addType = function(t3, e4) { this.getAll().addType(t3, e4); }, n2.prototype.getType = function(t3) { return this.getAll().getType(t3); }, n2.prototype.getTypes = function() { return this.getAll().getTypes(); }, n2.prototype.AssetsView = function() { return this.am; }, n2.prototype.FileUploader = function() { return this.fu || (this.fu = new Vl(this.__viewParams())), this.fu; }, n2.prototype.onLoad = function() { var t3 = this; this.getAll().reset(this.config.assets); var e4 = this.em, n3 = this.events; e4.on("run:".concat(rc), function() { return t3.__propEv(n3.open); }), e4.on("stop:".concat(rc), function() { return t3.__propEv(n3.close); }); }, n2.prototype.postRender = function(t3) { var e4; this.config.dropzone && (null === (e4 = this.fu) || void 0 === e4 || e4.initDropzone(t3)); }, n2.prototype.setTarget = function(t3) { this.assetsVis.target = t3; }, n2.prototype.onSelect = function(t3) { this.assetsVis.onSelect = t3; }, n2.prototype.onClick = function(t3) { this.config.onClick = t3; }, n2.prototype.onDblClick = function(t3) { this.config.onDblClick = t3; }, n2.prototype.__behaviour = function(t3) { return void 0 === t3 && (t3 = {}), this._bhv = zl(zl({}, this._bhv || {}), t3); }, n2.prototype.__getBehaviour = function(t3) { return this._bhv || {}; }, n2.prototype.destroy = function() { var t3, e4; this.all.stopListening(), this.all.reset(), this.assetsVis.stopListening(), this.assetsVis.reset(), null === (t3 = this.fu) || void 0 === t3 || t3.remove(), null === (e4 = this.am) || void 0 === e4 || e4.remove(), this._bhv = {}; }, n2; }(b); const ac = sc; var lc = { placeholder: "eg. Text here" }; const cc = { locale: "en", localeFallback: "en", detectLocale: true, debug: false, 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: lc, alt: lc, title: lc, 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 uc = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), pc = function(n2) { function o2(t3) { var e3 = n2.call(this, t3, "I18n", cc) || this, o3 = e3.config.messagesAdd; return o3 && e3.addMessages(o3), e3.config.detectLocale && (e3.config.locale = e3._localLang()), e3; } return uc(o2, n2), o2.prototype.setLocale = function(t3) { var e3 = this.em, n3 = this.config, o3 = { value: t3, valuePrev: n3.locale }; return e3 && e3.trigger("i18n:locale", o3), n3.locale = t3, this; }, o2.prototype.getLocale = function() { return this.config.locale; }, o2.prototype.getMessages = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.config.messages; return t3 && !n3[t3] && this._debug("'".concat(t3, "' i18n lang not found"), e3), t3 ? n3[t3] : n3; }, o2.prototype.setMessages = function(t3) { var e3 = this.em; return this.config.messages = t3, e3 && e3.trigger("i18n:update", t3), this; }, o2.prototype.addMessages = function(t3) { var n3 = this.em, o3 = this.config.messages; return n3 && n3.trigger("i18n:add", t3), this.setMessages((0, e2.deepMerge)(o3, t3)), this; }, o2.prototype.t = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.config, r2 = n3.params || {}, i2 = n3.l || this.getLocale(), s2 = n3.lFlb || o3.localeFallback, a2 = this._getMsg(e3, i2, n3); return a2 || (a2 = this._getMsg(e3, s2, n3)), !a2 && this._debug("'".concat(e3, "' i18n key not found in '").concat(i2, "' lang"), n3), a2 = a2 && (0, t2.isString)(a2) ? this._addParams(a2, r2) : a2; }, o2.prototype._localLang = function() { var t3 = (0, e2.hasWin)() && window.navigator || {}, n3 = t3.language || t3.userLanguage; return n3 ? n3.split("-")[0] : "en"; }, o2.prototype._addParams = function(t3, e3) { var n3 = new RegExp("{([\\w\\d-]*)}", "g"); return t3.replace(n3, function(t4, n4) { return e3[n4] || ""; }).trim(); }, o2.prototype._getMsg = function(e3, n3, o3) { void 0 === o3 && (o3 = {}); var r2 = this.getMessages(n3, o3); if (r2) { var i2 = r2[e3]; return !i2 && e3.indexOf(".") > 0 && (i2 = e3.split(".").reduce(function(e4, n4) { if (!(0, t2.isUndefined)(e4)) return e4[n4]; }, r2)), i2; } }, o2.prototype._debug = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.em, o3 = this.config; (e3.debug || o3.debug) && n3 && n3.logWarning(t3); }, o2.prototype.destroy = function() { }, o2; }(m); const dc = pc; var fc = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), hc = function() { return hc = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, hc.apply(this, arguments); }, gc = function() { }, vc = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return fc(o2, n2), o2.prototype.initialize = function(e3) { void 0 === e3 && (e3 = {}), this.opt = e3 || {}, (0, t2.bindAll)(this, "startSort", "onMove", "endMove", "rollback", "updateOffset", "moveDragHelper"); var n3 = e3 || {}; this.elT = 0, this.elL = 0, this.borderOffset = n3.borderOffset || 10; var o3 = n3.container; this.el = "string" == typeof o3 ? document.querySelector(o3) : o3, this.$el = (0, l["default"])(this.el), this.containerSel = n3.containerSel || "div", this.itemSel = n3.itemSel || "div", this.draggable = n3.draggable || true, this.nested = !!n3.nested, this.pfx = n3.pfx || "", this.ppfx = n3.ppfx || "", this.freezeClass = n3.freezeClass || this.pfx + "freezed", this.onStart = n3.onStart || gc, this.onEndMove = n3.onEndMove, this.customTarget = n3.customTarget, this.onEnd = n3.onEnd, this.direction = n3.direction || "v", this.onMoveClb = n3.onMove, this.relative = n3.relative || false, this.ignoreViewChildren = !!n3.ignoreViewChildren, this.plh = n3.placer, this.wmargin = n3.wmargin || 0, this.offTop = n3.offsetTop || 0, this.offLeft = n3.offsetLeft || 0, this.document = n3.document || document, this.em = n3.em, this.canvasRelative = !!n3.canvasRelative, this.selectOnEnd = !n3.avoidSelectOnEnd, this.scale = n3.scale, this.em && this.em.on && (this.em.on("change:canvasOffset", this.updateOffset), this.updateOffset()); }, o2.prototype.getScale = function() { return (0, t2.result)(this, "scale") || 1; }, o2.prototype.getContainerEl = function(t3) { if (t3 && (this.el = t3), !this.el) { var e3 = this.opt.container; this.el = "string" == typeof e3 ? document.querySelector(e3) : e3, this.$el = (0, l["default"])(this.el); } return this.el; }, o2.prototype.getDocuments = function(t3) { var e3 = this.em, n3 = t3 ? t3.ownerDocument : null == e3 ? void 0 : e3.Canvas.getBody().ownerDocument, o3 = [document]; return n3 && o3.push(n3), o3; }, o2.prototype.updateOffset = function() { var t3, e3 = (null === (t3 = this.em) || void 0 === t3 ? void 0 : t3.get("canvasOffset")) || {}; this.offTop = e3.top, this.offLeft = e3.left; }, o2.prototype.setDropContent = function(t3) { delete this.dropModel, this.dropContent = t3; }, o2.prototype.updateTextViewCursorPosition = function(t3) { var n3 = this.em; if (n3) { var o3 = n3.get("Canvas"), r2 = o3.getDocument(), i2 = null; if (r2.caretRangeFromPoint) { var s2 = (0, e2.getPointerEvent)(t3); i2 = r2.caretRangeFromPoint(s2.clientX, s2.clientY); } else t3.rangeParent && (i2 = r2.createRange()).setStart(t3.rangeParent, t3.rangeOffset); var a2 = o3.getWindow().getSelection(); o3.getFrameEl().focus(), a2.removeAllRanges(), i2 && a2.addRange(i2), this.setContentEditable(this.activeTextModel, true); } }, o2.prototype.setContentEditable = function(t3, e3) { if (t3) { var n3 = t3.getEl(); n3.contentEditable != e3 && (n3.contentEditable = e3); } }, o2.prototype.toggleSortCursor = function(t3) { var e3 = this.em, n3 = e3 && e3.get("Canvas"); n3 && (t3 ? n3.startAutoscroll() : n3.stopAutoscroll()); }, o2.prototype.setDragHelper = function(t3, e3) { for (var n3 = e3 || "", o3 = t3.cloneNode(true), r2 = t3.getBoundingClientRect(), i2 = getComputedStyle(t3), s2 = "", a2 = 0; a2 < i2.length; a2++) { var c2 = i2[a2]; s2 += "".concat(c2, ":").concat(i2.getPropertyValue(c2), ";"); } (document.body.appendChild(o3), o3.className += " ".concat(this.pfx, "bdrag"), o3.setAttribute("style", s2), this.dragHelper = o3, o3.style.width = "".concat(r2.width, "px"), o3.style.height = "".concat(r2.height, "px"), n3 && this.moveDragHelper(n3), this.em) && (0, l["default"])(this.em.Canvas.getBody().ownerDocument).off("mousemove", this.moveDragHelper).on("mousemove", this.moveDragHelper); (0, l["default"])(document).off("mousemove", this.moveDragHelper).on("mousemove", this.moveDragHelper); }, o2.prototype.moveDragHelper = function(t3) { var e3 = t3.target.ownerDocument; if (this.dragHelper && e3) { var n3 = t3.pageY, o3 = t3.pageX, r2 = 0, i2 = 0, s2 = (e3.defaultView || e3.parentWindow).frameElement, a2 = this.dragHelper.style; if (s2) { var l2 = s2.getBoundingClientRect(); r2 = l2.top + document.documentElement.scrollTop, i2 = l2.left + document.documentElement.scrollLeft, n3 = t3.clientY, o3 = t3.clientX; } a2.top = n3 + r2 + "px", a2.left = o3 + i2 + "px"; } }, o2.prototype.matches = function(t3, n3) { return e2.matches.call(t3, n3); }, o2.prototype.closest = function(t3, e3) { if (t3) for (var n3 = t3.parentNode; n3 && 1 === n3.nodeType; ) { if (this.matches(n3, e3)) return n3; n3 = n3.parentNode; } }, o2.prototype.offset = function(t3) { var e3 = t3.getBoundingClientRect(); return { top: e3.top + document.body.scrollTop, left: e3.left + document.body.scrollLeft }; }, o2.prototype.createPlaceholder = function() { var t3 = this.pfx, e3 = document.createElement("div"), n3 = document.createElement("div"); return e3.className = t3 + "placeholder", e3.style.display = "none", e3.style.pointerEvents = "none", n3.className = t3 + "placeholder-int", e3.appendChild(n3), e3; }, o2.prototype.startSort = function(t3, n3) { var o3, r2; void 0 === n3 && (n3 = {}); var i2, s2 = this, a2 = s2.em, l2 = s2.itemSel, c2 = s2.containerSel, u2 = s2.plh, p2 = this.getContainerEl(n3.container), d2 = this.getDocuments(t3); delete this.dropModel, delete this.target, delete this.prevTarget, this.moved = false, t3 && !this.matches(t3, "".concat(l2, ", ").concat(c2)) && (t3 = this.closest(t3, l2)), this.sourceEl = t3, u2 || (this.plh = this.createPlaceholder(), p2.appendChild(this.plh)), t3 && ((i2 = this.getSourceModel(t3)) && i2.set && i2.set("status", "freezed"), this.srcModel = i2), (0, e2.on)(p2, "mousemove dragover", this.onMove), (0, e2.on)(d2, "mouseup dragend touchend", this.endMove), (0, e2.on)(d2, "keydown", this.rollback), this.onStart({ sorter: this, target: i2, parent: i2 && (null === (o3 = i2.parent) || void 0 === o3 ? void 0 : o3.call(i2)), index: i2 && (null === (r2 = i2.index) || void 0 === r2 ? void 0 : r2.call(i2)) }), null == a2 || a2.clearSelection(), this.toggleSortCursor(true), null == a2 || a2.trigger("sorter:drag:start", t3, i2); }, o2.prototype.getTargetModel = function(t3) { var e3 = t3 || this.target; return (0, l["default"])(e3).data("model"); }, o2.prototype.getSourceModel = function(t3, e3) { var n3 = this, o3 = void 0 === e3 ? {} : e3, r2 = o3.target, i2 = o3.avoidChildren, s2 = void 0 === i2 ? 1 : i2, a2 = this.em, c2 = this.sourceEl, u2 = t3 || c2, p2 = this.dropModel, d2 = this.dropContent, f2 = function(t4) { return t4 && r2 && t4.opt && t4.opt.avoidChildren && n3.isTextableActive(t4, r2); }; if (d2 && a2) { if (f2(p2) && (p2 = void 0), !p2) { var h2 = a2.Components.getComponents(), g2 = { avoidChildren: s2, avoidStore: 1, avoidUpdateStyle: 1 }, v2 = h2.add(d2, hc(hc({}, g2), { temporary: true })); if (p2 = (p2 = h2.remove(v2, g2)) instanceof Array ? p2[0] : p2, this.dropModel = p2, f2(p2)) return this.getSourceModel(u2, { target: r2, avoidChildren: 0 }); } return p2; } return u2 && (0, l["default"])(u2).data("model"); }, o2.prototype.selectTargetModel = function(t3, e3) { if (!(t3 instanceof u.FE || e3 && e3 === t3)) { var n3 = this.targetModel; n3 && n3 !== this.srcModel && n3.set("status", ""), t3 && t3.set && (t3.set("status", "selected-parent"), this.targetModel = t3); } }, o2.prototype.onMove = function(e3) { var n3 = e3, o3 = this, r2 = o3.em, i2 = o3.onMoveClb, s2 = o3.plh, a2 = o3.customTarget; this.moved = true; var c2 = s2.style.display; c2 && "none" !== c2 || (s2.style.display = "block"); var u2 = this.offset(this.el); this.elT = this.wmargin ? Math.abs(u2.top) : u2.top, this.elL = this.wmargin ? Math.abs(u2.left) : u2.left; var p2 = e3.pageY - this.elT + this.el.scrollTop, d2 = e3.pageX - this.elL + this.el.scrollLeft; if (this.canvasRelative && r2) { var f2 = r2.get("Canvas").getMouseRelativeCanvas(e3, { noScroll: 1 }); d2 = f2.x, p2 = f2.y; } this.rX = d2, this.rY = p2, this.eventMove = e3; var h2 = this.getSourceModel(), g2 = a2 ? a2({ sorter: this, event: e3 }) : e3.target, v2 = this.dimsFromTarget(g2, d2, p2), y2 = this.target, m2 = y2 && this.getTargetModel(y2); if (this.selectTargetModel(m2, h2), m2 || (s2.style.display = "none"), y2) { this.lastDims = v2; var b2 = this.findPosition(v2, d2, p2); this.isTextableActive(h2, m2) ? (this.activeTextModel = m2, s2.style.display = "none", this.lastPos = b2, this.updateTextViewCursorPosition(n3)) : (this.disableTextable(), delete this.activeTextModel, this.lastPos && this.lastPos.index == b2.index && this.lastPos.method == b2.method || (this.movePlaceholder(this.plh, v2, b2, this.prevTargetDim), this.$plh || (this.$plh = (0, l["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 = b2)), (0, t2.isFunction)(i2) && i2({ event: e3, target: h2, parent: m2, index: b2.index + ("after" == b2.method ? 1 : 0) }), r2 && r2.trigger("sorter:drag", { target: y2, targetModel: m2, sourceModel: h2, dims: v2, pos: b2, x: d2, y: p2 }); } }, o2.prototype.isTextableActive = function(t3, e3) { var n3; return (null === (n3 = null == t3 ? void 0 : t3.get) || void 0 === n3 ? void 0 : n3.call(t3, "textable")) && (null == e3 ? void 0 : e3.isInstanceOf("text")); }, o2.prototype.disableTextable = function() { var t3 = this.activeTextModel; null == t3 || t3.getView().disableEditing(), this.setContentEditable(t3, false); }, o2.prototype.isInFlow = function(t3, e3) { if (!t3) return false; e3 = e3 || document.body; var n3 = t3; return n3.offsetHeight, !!this.styleInFlow(n3, e3); }, o2.prototype.styleInFlow = function(t3, n3) { if (!(0, e2.isTextNode)(t3)) { var o3 = t3.style || {}, r2 = (0, l["default"])(t3), i2 = n3 && (0, l["default"])(n3); if (!o3.overflow || "visible" === o3.overflow) { var s2 = r2.css("float"); if (!(s2 && "none" !== s2 || i2 && "flex" == i2.css("display") && "column" !== i2.css("flex-direction"))) { switch (o3.position) { case "static": case "relative": case "": break; default: return; } switch (t3.tagName) { case "TR": case "TBODY": case "THEAD": case "TFOOT": return true; } switch (r2.css("display")) { case "block": case "list-item": case "table": case "flex": case "grid": return true; } } } } }, o2.prototype.validTarget = function(e3, n3) { var o3 = this.getTargetModel(e3), r2 = this.getSourceModel(n3, { target: o3 }), i2 = { valid: true, src: n3 = r2 && r2.view && r2.view.el, srcModel: r2, trg: e3 = o3 && o3.view && o3.view.el, trgModel: o3, draggable: false, droppable: false, dragInfo: "", dropInfo: "" }; if (!n3 || !e3) return i2.valid = false, i2; var s2 = r2.get("draggable"); if ((0, t2.isFunction)(s2)) { var a2 = s2(r2, o3); i2.dragInfo = a2, i2.draggable = a2, s2 = a2; } else s2 = s2 instanceof Array ? s2.join(", ") : s2, i2.dragInfo = s2, s2 = (0, t2.isString)(s2) ? this.matches(e3, s2) : s2, i2.draggable = s2; var l2 = o3.get("droppable"); if ((0, t2.isFunction)(l2)) { a2 = l2(r2, o3); i2.droppable = a2, i2.dropInfo = a2, l2 = a2; } else l2 = (l2 = l2 instanceof u.FE ? 1 : l2) instanceof Array ? l2.join(", ") : l2, i2.dropInfo = l2, l2 = (0, t2.isString)(l2) ? this.matches(n3, l2) : l2, l2 = s2 && this.isTextableActive(r2, o3) ? 1 : l2, i2.droppable = l2; return l2 && s2 || (i2.valid = false), i2; }, o2.prototype.dimsFromTarget = function(t3, e3, n3) { var o3 = this.em, r2 = []; if (!t3) return r2; if (this.matches(t3, "".concat(this.itemSel, ", ").concat(this.containerSel)) || (t3 = this.closest(t3, this.itemSel)), this.draggable instanceof Array && (t3 = this.closest(t3, this.draggable.join(","))), !t3) return r2; if (this.prevTarget && this.prevTarget != t3 && delete this.prevTarget, !this.prevTarget) { this.targetP = this.closest(t3, this.containerSel); var i2 = this.validTarget(t3); if (o3 && o3.trigger("sorter:drag:validation", i2), !i2.valid && this.targetP) return this.dimsFromTarget(this.targetP, e3, n3); this.prevTarget = t3, this.prevTargetDim = this.getDim(t3), this.cacheDimsP = this.getChildrenDim(this.targetP), this.cacheDims = this.getChildrenDim(t3); } if (this.prevTarget == t3 && (r2 = this.cacheDims), this.target = this.prevTarget, this.nearBorders(this.prevTargetDim, e3, n3) || !this.nested && !this.cacheDims.length) { var s2 = this.targetP; s2 && this.validTarget(s2).valid && (r2 = this.cacheDimsP, this.target = s2); } return delete this.lastPos, r2; }, o2.prototype.getTargetFromEl = function(t3) { var e3, n3 = t3, o3 = this.targetPrev, r2 = this.em, i2 = this.containerSel, s2 = this.itemSel; if (this.matches(n3, "".concat(s2, ", ").concat(i2)) || (n3 = this.closest(n3, s2)), this.draggable instanceof Array && (n3 = this.closest(n3, this.draggable.join(","))), o3 && o3 != n3 && delete this.targetPrev, !this.targetPrev) { e3 = this.closest(n3, i2); var a2 = this.validTarget(n3); if (r2 && r2.trigger("sorter:drag:validation", a2), !a2.valid && e3) return this.getTargetFromEl(e3); this.targetPrev = n3; } return this.nearElBorders(n3) && (e3 = this.closest(n3, i2)) && this.validTarget(e3).valid && (n3 = e3), n3; }, o2.prototype.nearElBorders = function(t3) { var e3 = 10, n3 = t3.getBoundingClientRect(), o3 = t3.ownerDocument.body, r2 = this.getCurrentPos(), i2 = r2.x, s2 = r2.y, a2 = n3.top + o3.scrollTop, l2 = n3.left + o3.scrollLeft, c2 = n3.width, u2 = n3.height; if (s2 < a2 + e3 || s2 > a2 + u2 - e3 || i2 < l2 + e3 || i2 > l2 + c2 - e3) return 1; }, o2.prototype.getCurrentPos = function() { var t3 = this.eventMove; return { x: (null == t3 ? void 0 : t3.pageX) || 0, y: (null == t3 ? void 0 : t3.pageY) || 0 }; }, o2.prototype.getDim = function(t3) { var e3, n3, o3, r2, i2 = this.em, s2 = this.canvasRelative, a2 = null == i2 ? void 0 : i2.Canvas, l2 = a2 ? a2.getElementOffsets(t3) : {}; if (s2 && i2) { var c2 = a2.getElementPos(t3, { noScroll: 1 }); e3 = c2.top, n3 = c2.left, o3 = c2.height, r2 = c2.width; } else { var u2 = this.offset(t3); e3 = this.relative ? t3.offsetTop : u2.top - (this.wmargin ? -1 : 1) * this.elT, n3 = this.relative ? t3.offsetLeft : u2.left - (this.wmargin ? -1 : 1) * this.elL, o3 = t3.offsetHeight, r2 = t3.offsetWidth; } return { top: e3, left: n3, height: o3, width: r2, offsets: l2 }; }, o2.prototype.getChildrenDim = function(n3) { var o3 = this, r2 = []; if (!n3) return r2; var i2 = this.getTargetModel(n3); if (i2 && i2.view && !this.ignoreViewChildren) { var s2 = i2.getCurrentView ? i2.getCurrentView() : i2.view; n3 = s2.getChildrenContainer(); } return (0, t2.each)(n3.children, function(t3, i3) { var s3 = t3, a2 = (0, e2.getModel)(s3, l["default"]), c2 = a2 && a2.index ? a2.index() : i3; if ((0, e2.isTextNode)(s3) || o3.matches(s3, o3.itemSel)) { var u2, p2 = o3.getDim(s3), d2 = o3.direction; u2 = "v" == d2 || "h" != d2 && o3.isInFlow(s3, n3), p2.dir = u2, p2.el = s3, p2.indexEl = c2, r2.push(p2); } }), r2; }, o2.prototype.nearBorders = function(t3, e3, n3) { var o3 = false, r2 = this.borderOffset, i2 = e3 || 0, s2 = n3 || 0, a2 = t3.top, l2 = t3.left, c2 = t3.height, u2 = t3.width; return (a2 + r2 > s2 || s2 > a2 + c2 - r2 || l2 + r2 > i2 || i2 > l2 + u2 - r2) && (o3 = true), o3; }, o2.prototype.findPosition = function(t3, e3, n3) { for (var o3, r2 = { index: 0, indexEl: 0, method: "before" }, i2 = 0, s2 = 0, a2 = 0, l2 = 0, c2 = 0, u2 = 0, p2 = 0, d2 = t3.length; p2 < d2; p2++) { var f2 = (o3 = t3[p2]).top, h2 = o3.left, g2 = o3.height, v2 = o3.width; if (u2 = f2 + g2, l2 = h2 + v2 / 2, c2 = f2 + g2 / 2, !(s2 && h2 > s2 || a2 && c2 >= a2 || i2 && h2 + v2 < i2)) if (r2.index = p2, r2.indexEl = o3.indexEl, o3.dir) { if (n3 < c2) { r2.method = "before"; break; } r2.method = "after"; } else n3 < u2 && (a2 = u2), e3 < l2 ? (s2 = l2, r2.method = "before") : (i2 = l2, r2.method = "after"); } return r2; }, o2.prototype.movePlaceholder = function(t3, e3, n3, o3) { var r2 = 0, i2 = 0, s2 = 0, a2 = "", l2 = "", c2 = "px", u2 = 5, p2 = n3.method, d2 = e3[n3.index]; if (t3.classList.remove("vertical"), t3.classList.add("horizontal"), d2) { var f2 = d2.top, h2 = d2.left, g2 = d2.height, v2 = d2.width; d2.dir ? (a2 = v2 + c2, l2 = "auto", i2 = "before" == p2 ? f2 - r2 : f2 + g2 - r2, s2 = h2) : (a2 = "auto", l2 = g2 - 2 * r2 + c2, i2 = f2 + r2, s2 = "before" == p2 ? h2 - r2 : h2 + v2 - r2, t3.classList.remove("horizontal"), t3.classList.add("vertical")); } else { if (!this.nested) return void (t3.style.display = "none"); if (o3) { var y2 = o3.offsets || {}, m2 = y2.paddingTop || u2, b2 = y2.paddingLeft || u2; i2 = o3.top + m2, s2 = o3.left + b2, a2 = parseInt("".concat(o3.width)) - 2 * b2 + c2, l2 = "auto"; } } t3.style.top = i2 + c2, t3.style.left = s2 + c2, a2 && (t3.style.width = a2), l2 && (t3.style.height = l2); }, o2.prototype.parents = function(t3) { return t3 ? [t3].concat(this.parents(t3.parent())) : []; }, o2.prototype.sort = function(t3, e3) { var n3 = t3.parents.filter(function(t4) { return e3.parents.includes(t4); })[0]; if (!n3) return e3.model.index() - t3.model.index(); var o3 = t3.parents[t3.parents.indexOf(n3) - 1]; return e3.parents[e3.parents.indexOf(n3) - 1].index() - o3.index(); }, o2.prototype.endMove = function() { var n3, o3 = this, r2 = this.sourceEl, i2 = [], s2 = this.getDocuments(), a2 = this.getContainerEl(), l2 = this.onEndMove, c2 = this.onEnd, u2 = this.target, p2 = this.lastPos; if ((0, e2.off)(a2, "mousemove dragover", this.onMove), (0, e2.off)(s2, "mouseup dragend touchend", this.endMove), (0, e2.off)(s2, "keydown", this.rollback), this.plh.style.display = "none", r2 && (n3 = this.getSourceModel(), this.selectOnEnd && n3 && n3.set && (n3.set("status", ""), n3.set("status", "selected"))), this.moved && u2) { var d2 = this.toMove, f2 = (0, t2.isArray)(d2) ? d2 : d2 ? [d2] : [r2], h2 = 0; 1 === f2.length ? i2.push(this.move(u2, f2[0], p2)) : f2.map(function(t3) { return { model: t3, parents: o3.parents(t3) }; }).sort(this.sort).forEach(function(t3) { var e3 = t3.model, n4 = e3.index(), r3 = e3.parent().getEl(); i2.push(o3.move(u2, e3, hc(hc({}, p2), { indexEl: p2.indexEl - h2, index: p2.index - h2 }))), r3 === u2 && n4 <= p2.index && h2++; }); } this.plh && (this.plh.style.display = "none"); var g2 = this.dragHelper; if (g2 && (g2.parentNode.removeChild(g2), delete this.dragHelper), this.disableTextable(), this.selectTargetModel(), this.toggleSortCursor(), delete this.toMove, delete this.eventMove, delete this.dropModel, (0, t2.isFunction)(l2)) { var v2 = { target: n3, parent: n3 && n3.parent(), index: n3 && n3.index() }; i2.length ? i2.forEach(function(t3) { return l2(t3, o3, v2); }) : l2(null, this, hc(hc({}, v2), { cancelled: 1 })); } (0, t2.isFunction)(c2) && c2({ sorter: this }); }, o2.prototype.move = function(n3, o3, r2) { var i2, s2, a2 = this.em, c2 = this.dropContent, p2 = (0, e2.getElement)(o3), d2 = [], f2 = "after" === r2.method ? r2.indexEl + 1 : r2.indexEl, h2 = this.validTarget(n3, p2), g2 = (0, l["default"])(n3).data("collection"), v2 = h2.trgModel, y2 = h2.srcModel, m2 = h2.draggable, b2 = v2 instanceof u.FE ? 1 : h2.droppable; if (g2 && b2 && m2) { var _2 = { at: f2, action: "move-component" }, w2 = this.isTextableActive(y2, v2); if (c2) i2 = (0, t2.isFunction)(c2) ? c2() : c2, _2.avoidUpdateStyle = true, _2.action = "add-component"; else { var x2 = y2.collection.indexOf(y2), C2 = g2 === y2.collection; (!C2 || !(x2 === f2 || x2 === f2 - 1) || w2) && (i2 = y2.collection.remove(y2, { temporary: true }), C2 && f2 > x2 && (_2.at = f2 - 1)); } i2 && (w2 ? (delete _2.at, s2 = v2.getView().insertComponent(i2, _2)) : s2 = g2.add(i2, _2)), delete this.dropContent, delete this.prevTarget; } else if (a2) { var S2 = h2.dropInfo || (null == v2 ? void 0 : v2.get("droppable")), O2 = h2.dragInfo || (null == y2 ? void 0 : y2.get("draggable")); !g2 && d2.push("Target collection not found"), !b2 && S2 && d2.push("Target is not droppable, accepts [".concat(S2, "]")), !m2 && O2 && d2.push("Component not draggable, acceptable by [".concat(O2, "]")), a2.logWarning("Invalid target position", { errors: d2, model: y2, context: "sorter", target: v2 }); } return null == a2 || a2.trigger("sorter:drag:end", { targetCollection: g2, modelToDrop: i2, warns: d2, validResult: h2, dst: n3, srcEl: p2 }), s2; }, o2.prototype.rollback = function(t3) { (0, e2.off)(this.getDocuments(), "keydown", this.rollback), 27 == (t3.which || t3.keyCode) && (this.moved = false, this.endMove()); }, o2; }(u.G7); const yc = vc; var mc = function() { return mc = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, mc.apply(this, arguments); }, bc = function() { function n2(e3) { void 0 === e3 && (e3 = {}), this.defOpts = { ratioDefault: false, onUpdateContainer: function() { }, step: 1, minDim: 10, maxDim: 1 / 0, unitHeight: "px", unitWidth: "px", keyHeight: "height", keyWidth: "width", currentUnit: true, silentFrames: false, avoidContainerUpdate: false, keepAutoHeight: false, keepAutoWidth: false, autoHeight: false, autoWidth: false, tl: true, tc: true, tr: true, cl: true, cr: true, bl: true, bc: true, br: true }, this.opts = mc({}, this.defOpts), this.setOptions(e3), (0, t2.bindAll)(this, "handleKeyDown", "handleMouseDown", "move", "stop"); } return n2.prototype.getConfig = function() { return this.opts; }, n2.prototype.setOptions = function(t3, e3) { void 0 === t3 && (t3 = {}), this.opts = mc(mc({}, e3 ? this.defOpts : this.opts), t3), this.setup(); }, n2.prototype.setup = function() { var t3 = this.opts, e3 = t3.prefix || "", n3 = t3.appendTo || document.body, o2 = this.container; for (o2 || ((o2 = document.createElement("div")).className = "".concat(e3, "resizer-c"), n3.appendChild(o2), this.container = o2); o2.firstChild; ) o2.removeChild(o2.firstChild); var r2 = {}; for (var i2 in ["tl", "tc", "tr", "cl", "cr", "bl", "bc", "br"].forEach(function(e4) { return r2[e4] = t3[e4] ? function(t4, e5) { void 0 === e5 && (e5 = {}); var n4 = e5.prefix || "", o3 = document.createElement("i"); return o3.className = n4 + "resizer-h " + n4 + "resizer-h-" + t4, o3.setAttribute("data-" + n4 + "handler", t4), o3; }(e4, t3) : null; }), r2) { var s2 = r2[i2]; s2 && o2.appendChild(s2); } this.handlers = r2, this.mousePosFetcher = t3.mousePosFetcher, this.updateTarget = t3.updateTarget, this.posFetcher = t3.posFetcher, this.onStart = t3.onStart, this.onMove = t3.onMove, this.onEnd = t3.onEnd, this.onUpdateContainer = t3.onUpdateContainer; }, n2.prototype.toggleFrames = function(e3) { if (this.opts.silentFrames) { var n3 = document.querySelectorAll("iframe"); (0, t2.each)(n3, function(t3) { return t3.style.pointerEvents = e3 ? "none" : ""; }); } }, n2.prototype.isHandler = function(t3) { var e3 = this.handlers; for (var n3 in e3) if (e3[n3] === t3) return true; return false; }, n2.prototype.getFocusedEl = function() { return this.el; }, n2.prototype.getParentEl = function() { var t3; return null === (t3 = this.el) || void 0 === t3 ? void 0 : t3.parentElement; }, n2.prototype.getDocumentEl = function() { return [this.el.ownerDocument, document]; }, n2.prototype.getElementPos = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.posFetcher; return n3 ? n3(t3, e3) : function(t4, e4) { var n4 = e4 || window, o2 = t4.getBoundingClientRect(); return { left: o2.left + n4.pageXOffset, top: o2.top + n4.pageYOffset, width: o2.width, height: o2.height }; }(t3); }, n2.prototype.focus = function(t3) { t3 && t3 === this.el || (this.el = t3, this.updateContainer({ forceShow: true }), (0, e2.on)(this.getDocumentEl(), "pointerdown", this.handleMouseDown)); }, n2.prototype.blur = function() { this.container.style.display = "none", this.el && ((0, e2.off)(this.getDocumentEl(), "pointerdown", this.handleMouseDown), delete this.el); }, n2.prototype.start = function(n3) { var o2 = n3; if (0 === o2.button) { o2.preventDefault(), o2.stopPropagation(); var r2 = this.el, i2 = this.getParentEl(), s2 = this.opts || {}, a2 = this.mousePosFetcher, l2 = "data-" + s2.prefix + "handler", c2 = this.getElementPos(r2, { avoidFrameZoom: true, avoidFrameOffset: true }), u2 = this.getElementPos(i2), p2 = o2.target; this.handlerAttr = p2.getAttribute(l2), this.clickedHandler = p2, this.startDim = { t: c2.top, l: c2.left, w: c2.width, h: c2.height }, this.rectDim = { t: c2.top, l: c2.left, w: c2.width, h: c2.height }, this.startPos = a2 ? a2(o2) : { x: o2.clientX, y: o2.clientY }, this.parentDim = { t: u2.top, l: u2.left, w: u2.width, h: u2.height }; var d2 = this.getDocumentEl(); this.docs = d2, (0, e2.on)(d2, "pointermove", this.move), (0, e2.on)(d2, "keydown", this.handleKeyDown), (0, e2.on)(d2, "pointerup", this.stop), (0, t2.isFunction)(this.onStart) && this.onStart(o2, { docs: d2, config: s2, el: r2, resizer: this }), this.toggleFrames(true), this.move(o2); } }, n2.prototype.move = function(t3) { var e3 = t3, n3 = this.onMove, o2 = this.mousePosFetcher, r2 = o2 ? o2(e3) : { x: e3.clientX, y: e3.clientY }; this.currentPos = r2, this.delta = { x: r2.x - this.startPos.x, y: r2.y - this.startPos.y }, this.keys = { shift: e3.shiftKey, ctrl: e3.ctrlKey, alt: e3.altKey }, this.rectDim = this.calc(this), this.updateRect(false), n3 && n3(e3); }, n2.prototype.stop = function(n3) { var o2 = this.el, r2 = this.opts, i2 = this.docs || this.getDocumentEl(); (0, e2.off)(i2, "pointermove", this.move), (0, e2.off)(i2, "keydown", this.handleKeyDown), (0, e2.off)(i2, "pointerup", this.stop), this.updateRect(true), this.toggleFrames(), (0, t2.isFunction)(this.onEnd) && this.onEnd(n3, { docs: i2, config: r2, el: o2, resizer: this }), delete this.docs; }, n2.prototype.updateRect = function(e3) { var n3 = this.el, o2 = this.opts, r2 = this.rectDim, i2 = this.updateTarget, s2 = this.getSelectedHandler(), a2 = o2.unitHeight, l2 = o2.unitWidth, c2 = o2.keyWidth, u2 = o2.keyHeight; if ((0, t2.isFunction)(i2)) i2(n3, r2, { store: e3, selectedHandler: s2, resizer: this, config: o2 }); else { var p2 = n3.style; p2[c2] = r2.w + l2, p2[u2] = r2.h + a2, p2.top = r2.t + a2, p2.left = r2.l + l2; } this.updateContainer(); }, n2.prototype.updateContainer = function(t3) { var e3; void 0 === t3 && (t3 = {}); var n3 = this, o2 = n3.opts, r2 = n3.container, i2 = n3.el, s2 = r2.style; !o2.avoidContainerUpdate && i2 && t3.forceShow && (s2.display = "block"), null === (e3 = this.onUpdateContainer) || void 0 === e3 || e3.call(this, { el: r2, resizer: this, opts: mc(mc({}, o2), t3) }); }, n2.prototype.getSelectedHandler = function() { var t3 = this.handlers; if (this.selectedHandler) { for (var e3 in t3) if (t3[e3] === this.selectedHandler) return e3; } }, n2.prototype.handleKeyDown = function(t3) { 27 === t3.keyCode && (this.rectDim = this.startDim, this.stop(t3)); }, n2.prototype.handleMouseDown = function(t3) { var e3 = t3.target; this.isHandler(e3) ? (this.selectedHandler = e3, this.start(t3)) : e3 !== this.el && (delete this.selectedHandler, this.blur()); }, n2.prototype.calc = function(t3) { var n3, o2 = this.opts || {}, r2 = o2.step, i2 = this.startDim, s2 = o2.minDim, a2 = o2.maxDim, l2 = t3.delta.x, c2 = t3.delta.y, u2 = this.parentDim.w, p2 = this.parentDim.h, d2 = this.opts.unitWidth, f2 = this.opts.unitHeight, h2 = "%" === d2 ? i2.w / 100 * u2 : i2.w, g2 = "%" === f2 ? i2.h / 100 * p2 : i2.h, v2 = { t: i2.t, l: i2.l, w: h2, h: g2 }; if (t3) { var y2 = t3.handlerAttr; ~y2.indexOf("r") && (n3 = "%" === d2 ? (0, e2.normalizeFloat)((h2 + l2 * r2) / u2 * 100, 0.01) : (0, e2.normalizeFloat)(h2 + l2 * r2, r2), n3 = Math.max(s2, n3), a2 && (n3 = Math.min(a2, n3)), v2.w = n3), ~y2.indexOf("b") && (n3 = "%" === f2 ? (0, e2.normalizeFloat)((g2 + c2 * r2) / p2 * 100, 0.01) : (0, e2.normalizeFloat)(g2 + c2 * r2, r2), n3 = Math.max(s2, n3), a2 && (n3 = Math.min(a2, n3)), v2.h = n3), ~y2.indexOf("l") && (n3 = "%" === d2 ? (0, e2.normalizeFloat)((h2 - l2 * r2) / u2 * 100, 0.01) : (0, e2.normalizeFloat)(h2 - l2 * r2, r2), n3 = Math.max(s2, n3), a2 && (n3 = Math.min(a2, n3)), v2.w = n3), ~y2.indexOf("t") && (n3 = "%" === f2 ? (0, e2.normalizeFloat)((g2 - c2 * r2) / p2 * 100, 0.01) : (0, e2.normalizeFloat)(g2 - c2 * r2, r2), n3 = Math.max(s2, n3), a2 && (n3 = Math.min(a2, n3)), v2.h = n3); var m2 = o2.ratioDefault ? !t3.keys.shift : t3.keys.shift; if (y2.indexOf("c") < 0 && m2) { var b2 = i2.w / i2.h; v2.w / v2.h > b2 ? v2.h = Math.round(v2.w / b2) : v2.w = Math.round(v2.h * b2); } for (var _2 in ~y2.indexOf("l") && (v2.l += i2.w - v2.w), ~y2.indexOf("t") && (v2.t += i2.h - v2.h), v2) { var w2 = _2; v2[w2] = parseInt("".concat(v2[w2]), 10); } return v2; } }, n2; }(); const _c = bc; var wc = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), xc = function() { return xc = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, xc.apply(this, arguments); }; const Cc = function(t3) { function n2(n3) { var o2 = t3.call(this, n3, "Utils") || this; return o2.Sorter = yc, o2.Resizer = _c, o2.Dragger = Kt.Z, o2.helpers = xc({}, e2), o2; } return wc(n2, t3), n2.prototype.destroy = function() { }, n2; }(m); var Sc, Oc = {}, Tc = { 16: false, 18: false, 17: false, 91: false }, kc = "all", Pc = { "⇧": 16, shift: 16, "⌥": 18, alt: 18, option: 18, "⌃": 17, ctrl: 17, control: 17, "⌘": 91, command: 91 }, Ec = { 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 }, Ac = function(t3) { return Ec[t3] || t3.toUpperCase().charCodeAt(0); }, jc = []; for (Sc = 1; Sc < 20; Sc++) Ec["f" + Sc] = 111 + Sc; function Mc(t3, e3) { for (var n2 = t3.length; n2--; ) if (t3[n2] === e3) return n2; return -1; } function Lc(t3, e3) { if (t3.length != e3.length) return false; for (var n2 = 0; n2 < t3.length; n2++) if (t3[n2] !== e3[n2]) return false; return true; } var Dc = { 16: "shiftKey", 18: "altKey", 17: "ctrlKey", 91: "metaKey" }; function Nc(t3) { for (Sc in Tc) Tc[Sc] = t3[Dc[Sc]]; } function Ic(t3) { var e3, n2 = t3.keyCode, o2 = Mc(jc, n2); if (o2 >= 0 && jc.splice(o2, 1), 93 != n2 && 224 != n2 || (n2 = 91), n2 in Tc) for (e3 in Tc[n2] = false, Pc) Pc[e3] == n2 && (Vc[e3] = false); } function Fc() { for (Sc in Tc) Tc[Sc] = false; for (Sc in Pc) Vc[Sc] = false; } function Vc(t3, e3, n2) { var o2, r2; o2 = Hc(t3), void 0 === n2 && (n2 = e3, e3 = "all"); for (var i2 = 0; i2 < o2.length; i2++) r2 = [], (t3 = o2[i2].split("+")).length > 1 && (r2 = zc(t3), t3 = [t3[t3.length - 1]]), t3 = t3[0], (t3 = Ac(t3)) in Oc || (Oc[t3] = []), Oc[t3].push({ shortcut: o2[i2], scope: e3, method: n2, key: o2[i2], mods: r2 }); } for (Sc in Pc) Vc[Sc] = false; function Rc() { return kc || "all"; } function Hc(t3) { var e3; return "" == (e3 = (t3 = t3.replace(/\s/g, "")).split(","))[e3.length - 1] && (e3[e3.length - 2] += ","), e3; } function zc(t3) { for (var e3 = t3.slice(0, t3.length - 1), n2 = 0; n2 < e3.length; n2++) e3[n2] = Pc[e3[n2]]; return e3; } function Bc(t3, e3, n2) { t3.addEventListener ? t3.addEventListener(e3, n2, false) : t3.attachEvent && t3.attachEvent("on" + e3, function() { n2(window.event); }); } Vc.setScope = function(t3) { kc = t3 || "all"; }, Vc.getScope = Rc, Vc.deleteScope = function(t3) { var e3, n2, o2; for (e3 in Oc) for (n2 = Oc[e3], o2 = 0; o2 < n2.length; ) n2[o2].scope === t3 ? n2.splice(o2, 1) : o2++; }, Vc.filter = function(t3) { var e3 = (t3.target || t3.srcElement).tagName; return !("INPUT" == e3 || "SELECT" == e3 || "TEXTAREA" == e3); }, Vc.isPressed = function(t3) { return "string" == typeof t3 && (t3 = Ac(t3)), -1 != Mc(jc, t3); }, Vc.getPressedKeyCodes = function() { return jc.slice(0); }, Vc.unbind = function(t3, e3) { var n2, o2, r2, i2, s2, a2 = []; for (n2 = Hc(t3), i2 = 0; i2 < n2.length; i2++) { if ((o2 = n2[i2].split("+")).length > 1 && (a2 = zc(o2)), t3 = o2[o2.length - 1], t3 = Ac(t3), void 0 === e3 && (e3 = Rc()), !Oc[t3]) return; for (r2 = 0; r2 < Oc[t3].length; r2++) (s2 = Oc[t3][r2]).scope === e3 && Lc(s2.mods, a2) && (Oc[t3][r2] = {}); } }, Vc.handlers = Oc, Vc.init = function(t3) { Bc(t3.document, "keydown", function(t4) { !function(t5) { var e3, n2, o2, r2, i2, s2; if (e3 = t5.keyCode, -1 == Mc(jc, e3) && jc.push(e3), 93 != e3 && 224 != e3 || (e3 = 91), e3 in Tc) for (o2 in Tc[e3] = true, Pc) Pc[o2] == e3 && (Vc[o2] = true); else if (Nc(t5), Vc.filter.call(this, t5) && e3 in Oc) { for (s2 = Rc(), r2 = 0; r2 < Oc[e3].length; r2++) if ((n2 = Oc[e3][r2]).scope == s2 || "all" == n2.scope) { for (o2 in i2 = n2.mods.length > 0, Tc) (!Tc[o2] && Mc(n2.mods, +o2) > -1 || Tc[o2] && -1 == Mc(n2.mods, +o2)) && (i2 = false); (0 != n2.mods.length || Tc[16] || Tc[18] || Tc[17] || Tc[91]) && !i2 || false === n2.method(t5, n2) && (t5.preventDefault ? t5.preventDefault() : t5.returnValue = false, t5.stopPropagation && t5.stopPropagation(), t5.cancelBubble && (t5.cancelBubble = true)); } } }(t4); }), Bc(t3.document, "keyup", Ic), Bc(t3, "focus", Fc); }; const Uc = Vc; const Wc = { 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: true } } } }; var $c = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), qc = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }; (0, e2.hasWin)() && Uc.init(window); var Gc = function(e3) { function n2(t3) { var n3 = e3.call(this, t3, "Keymaps", Wc) || this; return n3.keymaster = Uc, n3.keymaps = {}, n3; } return $c(n2, e3), n2.prototype.onLoad = function() { var t3 = this.config.defaults; for (var e4 in t3) { var n3 = t3[e4]; this.add(e4, n3.keys, n3.handler, n3.opts || {}); } }, n2.prototype.add = function(e4, n3, o2, r2) { void 0 === r2 && (r2 = {}); var i2 = this.em, s2 = i2.Commands, a2 = i2.getEditor(), l2 = i2.Canvas, c2 = { id: e4, keys: n3, handler: o2 }; return this.keymaps[e4] && this.remove(e4), this.keymaps[e4] = c2, Uc(n3, function(n4, c3) { var u2 = { event: n4, h: c3 }, p2 = (0, t2.isString)(o2) ? s2.get(o2) : o2; if (!i2.isEditing() && !a2.Canvas.isInputFocused() || r2.force) { r2.prevent && l2.getCanvasView().preventDefault(n4), (0, t2.isFunction)(p2) ? p2(a2, 0, u2) : s2.runCommand(p2, u2); var d2 = [e4, c3.shortcut, n4]; i2.trigger.apply(i2, qc(["keymap:emit"], d2, false)), i2.trigger.apply(i2, qc(["keymap:emit:".concat(e4)], d2, false)); } }, void 0), i2.trigger("keymap:add", c2), c2; }, n2.prototype.get = function(t3) { return this.keymaps[t3]; }, n2.prototype.getAll = function() { return this.keymaps; }, n2.prototype.remove = function(t3) { var e4 = this.em, n3 = this.get(t3); if (n3) return delete this.keymaps[t3], n3.keys.split(", ").forEach(function(t4) { Uc.unbind(t4.trim()); }), null == e4 || e4.trigger("keymap:remove", n3), n3; }, n2.prototype.removeAll = function() { var t3 = this; return Object.keys(this.keymaps).forEach(function(e4) { return t3.remove(e4); }), Uc.handlers = {}, this; }, n2.prototype.destroy = function() { this.removeAll(), this.keymaps = {}; }, n2; }(m); const Kc = Gc; const Yc = { stylePrefix: "mdl-", title: "", content: "", backdrop: true, custom: false, extend: {} }; var Xc = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Jc = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Xc(e3, t3), e3.prototype.defaults = function() { return { title: "", content: "", attributes: {}, open: false }; }, e3.prototype.open = function() { this.set("open", true); }, e3.prototype.close = function() { this.set("open", false); }, e3; }(x); var Zc = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Qc = function() { return Qc = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Qc.apply(this, arguments); }; const tu = function(t3) { function e3(e4) { var n2 = t3.call(this, e4) || this, o2 = n2.model; return n2.listenTo(o2, "change:open", n2.updateOpen), n2.listenTo(o2, "change:title", n2.updateTitle), n2.listenTo(o2, "change:content", n2.updateContent), n2; } return Zc(e3, t3), e3.prototype.template = function(t4) { var e4 = t4.pfx, n2 = t4.ppfx, o2 = t4.content, r2 = t4.title; return '
\n
\n
').concat(r2, '
\n
⨯
\n
\n
\n
').concat(o2, '
\n
\n
\n
\n '); }, e3.prototype.events = function() { return { click: "onClick", "click [data-close-modal]": "hide" }; }, e3.prototype.onClick = function(t4) { this.config.backdrop && t4.target === this.el && this.hide(); }, e3.prototype.getCollector = function() { return this.$collector || (this.$collector = this.$el.find("." + this.pfx + "collector")), this.$collector; }, e3.prototype.getContent = function() { var t4 = this.pfx; return this.$content || (this.$content = this.$el.find(".".concat(t4, "content #").concat(t4, "c"))), this.$content; }, e3.prototype.getTitle = function(t4) { return void 0 === t4 && (t4 = {}), this.$title || (this.$title = this.$el.find("." + this.pfx + "title")), t4.$ ? this.$title : this.$title.get(0); }, e3.prototype.updateContent = function() { var t4 = this.getContent(), e4 = t4.children(), n2 = this.getCollector(), o2 = this.model.get("content"); e4.length && n2.append(e4), t4.empty().append(o2); }, e3.prototype.updateTitle = function() { var t4 = this.getTitle({ $: true }); t4 && t4.empty().append(this.model.get("title")); }, e3.prototype.updateOpen = function() { this.el.style.display = this.model.get("open") ? "" : "none"; }, e3.prototype.hide = function() { this.model.close(); }, e3.prototype.show = function() { this.model.open(); }, e3.prototype.updateAttr = function(t4) { var e4 = this, n2 = e4.pfx, o2 = e4.$el, r2 = e4.el, i2 = [].slice.call(r2.attributes).map(function(t5) { return t5.name; }); o2.removeAttr(i2.join(" ")), o2.attr(Qc(Qc({}, t4 || {}), { class: "".concat(n2, "container ").concat(t4 && t4.class || "").trim() })); }, e3.prototype.render = function() { var t4 = this.$el, e4 = this.model.toJSON(); return e4.pfx = this.pfx, e4.ppfx = this.ppfx, t4.html(this.template(e4)), this.updateAttr(), this.updateOpen(), this; }, e3; }(Pt); var eu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const nu = function(e3) { function n2(n3) { var o2 = e3.call(this, n3, "Modal", Yc) || this; return o2.model = new Jc(o2), o2.model.on("change:open", function(t3, e4) { n3.trigger("modal:".concat(e4 ? "open" : "close")); }), o2.model.on("change", (0, t2.debounce)(function() { var e4 = o2._evData(), r2 = o2.config.custom; (0, t2.isFunction)(r2) && r2(e4), n3.trigger("modal", e4); }, 0)), o2; } return eu(n2, e3), n2.prototype._evData = function() { var e4 = this, n3 = this.getTitle(), o2 = this.getContent(), r2 = this.model.attributes; return { open: r2.open, attributes: r2.attributes, title: (0, t2.isString)(n3) ? (0, Et.rw)(n3) : n3, content: (0, t2.isString)(o2) ? (0, Et.rw)(o2) : o2.get ? o2.get(0) : o2, close: function() { e4.close(); } }; }, n2.prototype.postRender = function(t3) { var e4 = t3.model.config.el || t3.el, n3 = this.render(); n3 && (null == e4 || e4.appendChild(n3)); }, n2.prototype.open = function(t3) { void 0 === t3 && (t3 = {}); var e4 = t3.attributes || {}; return t3.title && this.setTitle(t3.title), t3.content && this.setContent(t3.content), this.model.set("attributes", e4), this.model.open(), this.modal && this.modal.updateAttr(e4), this; }, n2.prototype.close = function() { return this.model.close(), this; }, n2.prototype.onceClose = function(t3) { return this.em.once("modal:close", t3), this; }, n2.prototype.onceOpen = function(t3) { return this.em.once("modal:open", t3), this; }, n2.prototype.isOpen = function() { return !!this.model.get("open"); }, n2.prototype.setTitle = function(t3) { return this.model.set("title", t3), this; }, n2.prototype.getTitle = function() { return this.model.get("title"); }, n2.prototype.setContent = function(t3) { return this.model.set("content", " "), this.model.set("content", t3), this; }, n2.prototype.getContent = function() { return this.model.get("content"); }, n2.prototype.getContentEl = function() { var t3; return null === (t3 = this.modal) || void 0 === t3 ? void 0 : t3.getContent().get(0); }, n2.prototype.getModel = function() { return this.model; }, n2.prototype.render = function() { var t3; if (!this.config.custom) { var e4 = tu.extend(this.config.extend), n3 = this.modal && this.modal.el; return this.modal = new e4({ el: n3, model: this.model, config: this.config }), null === (t3 = this.modal) || void 0 === t3 ? void 0 : t3.render().el; } }, n2.prototype.destroy = function() { var t3; null === (t3 = this.modal) || void 0 === t3 || t3.remove(); }, n2; }(m); var ou = "sw-visibility", ru = "export-template", iu = "open-sm", su = "open-tm", au = "open-layers", lu = "open-blocks", cu = "fullscreen", uu = "preview"; const pu = { stylePrefix: "pn-", defaults: [{ id: "commands", buttons: [{}] }, { id: "options", buttons: [{ active: true, id: ou, className: "fa fa-square-o", command: "core:component-outline", context: ou, attributes: { title: "View components" } }, { id: uu, className: "fa fa-eye", command: uu, context: uu, attributes: { title: "Preview" } }, { id: cu, className: "fa fa-arrows-alt", command: cu, context: cu, attributes: { title: "Fullscreen" } }, { id: ru, className: "fa fa-code", command: ru, attributes: { title: "View code" } }] }, { id: "views", buttons: [{ id: iu, className: "fa fa-paint-brush", command: iu, active: true, togglable: false, attributes: { title: "Open Style Manager" } }, { id: su, className: "fa fa-cog", command: su, togglable: false, attributes: { title: "Settings" } }, { id: au, className: "fa fa-bars", command: au, togglable: false, attributes: { title: "Open Layer Manager" } }, { id: lu, className: "fa fa-th-large", command: lu, togglable: false, attributes: { title: "Open Blocks" } }] }] }; var du = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const fu = function(t3) { function e3(e4, n2) { var o2 = t3.call(this, e4, n2) || this; return o2.get("buttons").length && o2.set("buttons", new vu(o2.module, o2.get("buttons"))), o2; } return du(e3, t3), e3.prototype.defaults = function() { return { id: "", label: "", tagName: "span", className: "", command: "", context: "", buttons: [], attributes: {}, options: {}, active: false, dragDrop: false, togglable: true, runDefaultCommand: true, stopDefaultCommand: false, disable: false }; }, Object.defineProperty(e3.prototype, "className", { get: function() { return this.get("className"); }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "command", { get: function() { return this.get("command"); }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "active", { get: function() { return this.get("active"); }, set: function(t4) { this.set("active", t4); }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "togglable", { get: function() { return this.get("togglable"); }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "runDefaultCommand", { get: function() { return this.get("runDefaultCommand"); }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "stopDefaultCommand", { get: function() { return this.get("stopDefaultCommand"); }, enumerable: false, configurable: true }), Object.defineProperty(e3.prototype, "disable", { get: function() { return this.get("disable"); }, enumerable: false, configurable: true }), e3; }(x); var hu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), gu = function(t3) { function e3(e4, n2) { return t3.call(this, e4, n2, fu) || this; } return hu(e3, t3), e3.prototype.deactivateAllExceptOne = function(t4, e4) { this.forEach(function(n2, o2) { n2 !== t4 && (n2.set("active", false), e4 && n2.get("buttons").length && n2.get("buttons").deactivateAllExceptOne(t4, e4)); }); }, e3.prototype.deactivateAll = function(t4, e4) { var n2 = t4 || ""; this.forEach(function(t5) { t5.get("context") == n2 && t5 !== e4 && t5.set("active", false, { fromCollection: true }); }); }, e3.prototype.disableAllButtons = function(t4) { var e4 = t4 || ""; this.forEach(function(t5, n2) { t5.get("context") == e4 && t5.set("disable", true); }); }, e3.prototype.disableAllButtonsExceptOne = function(t4, e4) { this.forEach(function(n2, o2) { n2 !== t4 && (n2.set("disable", true), e4 && n2.get("buttons").length && n2.get("buttons").disableAllButtonsExceptOne(t4, e4)); }); }, e3; }(S); const vu = gu; gu.prototype.model = fu; var yu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const mu = function(t3) { function e3(e4, n2) { var o2 = t3.call(this, e4, n2) || this, r2 = o2.get("buttons") || []; return o2.buttons = new vu(e4, r2), o2; } return yu(e3, t3), e3.prototype.defaults = function() { return { id: "", content: "", visible: true, buttons: [], attributes: {} }; }, Object.defineProperty(e3.prototype, "buttons", { get: function() { return this.get("buttons"); }, set: function(t4) { this.set("buttons", t4); }, enumerable: false, configurable: true }), e3; }(x); var bu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), _u = function(t3) { function e3(e4, n2) { return t3.call(this, e4, n2, mu) || this; } return bu(e3, t3), e3; }(S); const wu = _u; _u.prototype.model = mu; var xu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Cu = function() { return Cu = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Cu.apply(this, arguments); }, Su = function(e3) { function n2(n3) { var o2 = e3.call(this, n3) || this, r2 = o2, i2 = r2.model, s2 = r2.em, a2 = r2.pfx, l2 = r2.ppfx, c2 = i2.className, u2 = i2.attributes, p2 = u2.command, d2 = u2.listen; if (o2.id = a2 + i2.get("id"), o2.activeCls = "".concat(a2, "active ").concat(l2, "four-color"), o2.disableCls = "".concat(l2, "disabled"), o2.btnsVisCls = "".concat(a2, "visible"), o2.className = a2 + "btn" + (c2 ? " " + c2 : ""), o2.listenTo(i2, "change", o2.render), o2.listenTo(i2, "change:active updateActive", o2.updateActive), o2.listenTo(i2, "checkActive", o2.checkActive), o2.listenTo(i2, "change:bntsVis", o2.updateBtnsVis), o2.listenTo(i2, "change:attributes", o2.updateAttributes), o2.listenTo(i2, "change:className", o2.updateClassName), o2.listenTo(i2, "change:disable", o2.updateDisable), s2 && (0, t2.isString)(p2) && d2) { var f2 = { fromListen: true }; o2.listenTo(s2, "run:".concat(p2), function() { return i2.set("active", true, f2); }), o2.listenTo(s2, "stop:".concat(p2), function() { return i2.set("active", false, f2); }); } return s2 && s2.get && (o2.commands = s2.get("Commands")), o2; } return xu(n2, e3), n2.prototype.tagName = function() { return this.model.get("tagName"); }, n2.prototype.events = function() { return { click: "clicked" }; }, n2.prototype.updateClassName = function() { var t3 = this.model, e4 = this.pfx, n3 = t3.className, o2 = t3.get("attributes").class, r2 = "".concat(o2 || "", " ").concat(e4, "btn ").concat(n3 || ""); this.$el.attr("class", r2.trim()); }, n2.prototype.updateAttributes = function() { var t3 = this, e4 = t3.em, n3 = t3.model, o2 = t3.$el, r2 = n3.get("attributes") || {}, i2 = e4 && e4.t && e4.t("panels.buttons.titles.".concat(n3.id)); o2.attr(r2), i2 && o2.attr({ title: i2 }), this.updateClassName(); }, n2.prototype.updateBtnsVis = function() { this.$buttons && (this.model.get("bntsVis") ? this.$buttons.addClass(this.btnsVisCls) : this.$buttons.removeClass(this.btnsVisCls)); }, n2.prototype.updateActive = function(e4, n3, o2) { var r2; void 0 === o2 && (o2 = {}); var i2 = this, s2 = i2.model, a2 = i2.commands, l2 = i2.$el, c2 = i2.activeCls, u2 = o2.fromCollection, p2 = o2.fromListen, d2 = s2.get("context"), f2 = s2.get("options"), h2 = s2.command, g2 = {}; h2 && (a2 && (0, t2.isString)(h2) ? g2 = a2.get(h2) || {} : (0, t2.isFunction)(h2) ? g2 = a2.create({ run: h2 }) : null !== h2 && (0, t2.isObject)(h2) && (g2 = a2.create(h2)), s2.active ? (!u2 && (null === (r2 = s2.collection) || void 0 === r2 || r2.deactivateAll(d2, s2)), s2.set("active", true, { silent: true }).trigger("checkActive"), !p2 && a2.runCommand(g2, Cu(Cu({}, f2), { sender: s2 })), g2.noStop && s2.set("active", false)) : (l2.removeClass(c2), !p2 && a2.stopCommand(g2, Cu(Cu({}, f2), { sender: s2, force: 1 })))); }, n2.prototype.updateDisable = function() { var t3 = this.disableCls, e4 = this.model.disable; this.$el[e4 ? "addClass" : "removeClass"](t3); }, n2.prototype.checkActive = function() { var t3 = this, e4 = t3.model, n3 = t3.$el, o2 = t3.activeCls; e4.active ? n3.addClass(o2) : n3.removeClass(o2); }, n2.prototype.clicked = function(t3) { var e4 = this.model; e4.get("bntsVis") || e4.disable || !e4.command || this.toggleActive(); }, n2.prototype.toggleActive = function() { var t3 = this.model, e4 = this.em, n3 = t3.active, o2 = t3.togglable; n3 && !o2 || (t3.active = !n3, n3 ? t3.runDefaultCommand && e4.runDefault() : t3.stopDefaultCommand && e4.stopDefault()); }, n2.prototype.render = function() { var t3 = this.model, e4 = t3.get("label"), n3 = this.$el; return !t3.get("el") && n3.empty(), this.updateAttributes(), e4 && n3.append(e4), this.checkActive(), this.updateDisable(), this; }, n2; }(Pt); const Ou = Su; var Tu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const ku = function(e3) { function n2(t3) { var n3 = e3.call(this, { collection: t3 }) || this; return n3.listenTo(n3.collection, "add", n3.addTo), n3.listenTo(n3.collection, "reset remove", n3.render), n3.className = n3.pfx + "buttons", n3; } return Tu(n2, e3), n2.prototype.addTo = function(t3) { this.addToCollection(t3); }, n2.prototype.addToCollection = function(t3, e4) { var n3 = e4 || null, o2 = t3.get("el"), r2 = new Ou({ el: o2, model: t3 }).render().el; return n3 ? n3.appendChild(r2) : this.$el.append(r2), r2; }, n2.prototype.render = function() { var e4 = this, n3 = document.createDocumentFragment(); return this.$el.empty(), this.collection.each(function(t3) { return e4.addToCollection(t3, n3); }), this.$el.append(n3), this.$el.attr("class", (0, t2.result)(this, "className")), this; }, n2; }(Pt); var Pu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Eu = function() { return Eu = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Eu.apply(this, arguments); }, Au = function(t3) { function e3(e4) { var n2 = t3.call(this, { model: e4, el: e4.get("el") }) || this; return n2.className = n2.pfx + "panel", n2.id = n2.pfx + e4.get("id"), n2.listenTo(e4, "change:appendContent", n2.appendContent), n2.listenTo(e4, "change:content", n2.updateContent), n2.listenTo(e4, "change:visible", n2.toggleVisible), e4.view = n2, n2; } return Pu(e3, t3), e3.prototype.appendContent = function() { this.$el.append(this.model.get("appendContent")); }, e3.prototype.updateContent = function() { this.$el.html(this.model.get("content")); }, e3.prototype.toggleVisible = function() { this.model.get("visible") ? this.$el.removeClass("".concat(this.ppfx, "hidden")) : this.$el.addClass("".concat(this.ppfx, "hidden")); }, e3.prototype.attributes = function() { return this.model.get("attributes"); }, e3.prototype.initResize = function() { var t4 = this.em, e4 = null == t4 ? void 0 : t4.Editor, n2 = this.model.get("resizable"); if (e4 && n2) { var o2, r2, i2, s2 = true === n2 ? [1, 1, 1, 1] : n2, a2 = s2.length, l2 = 0; 2 == a2 ? (o2 = s2[0], i2 = s2[0], r2 = s2[1], l2 = s2[1]) : 4 == a2 && (o2 = s2[0], r2 = s2[1], i2 = s2[2], l2 = s2[3]); var c2 = new e4.Utils.Resizer(Eu({ tc: o2, cr: r2, bc: i2, cl: l2, tl: 0, tr: 0, bl: 0, br: 0, appendTo: this.el, silentFrames: 1, avoidContainerUpdate: 1, prefix: e4.getConfig().stylePrefix, onEnd: function() { t4 && t4.trigger("change:canvasOffset"); }, posFetcher: function(t5, e5) { var n3 = e5.target, o3 = t5.style, r3 = c2.getConfig(), i3 = r3.keyWidth, s3 = r3.keyHeight, a3 = t5.getBoundingClientRect(), l3 = "container" == n3, u2 = o3[i3], p2 = o3[s3]; return { left: 0, top: 0, width: u2 && !l3 ? parseFloat(u2) : a3.width, height: p2 && !l3 ? parseFloat(p2) : a3.height }; } }, n2)); c2.blur = function() { }, c2.focus(this.el); } }, e3.prototype.render = function() { var t4 = this.model.buttons, e4 = this.$el, n2 = this.ppfx, o2 = "".concat(this.className, " ").concat(this.id, " ").concat(n2, "one-bg ").concat(n2, "two-color"); if (e4.addClass(o2), this.toggleVisible(), t4.length) { var r2 = new ku(t4); e4.append(r2.render().el); } return e4.append(this.model.get("content")), this; }, e3; }(Pt); const ju = Au; var Mu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Lu = function(t3) { function e3(e4) { var n2 = t3.call(this, { collection: e4 }) || this; return n2.listenTo(e4, "add", n2.addTo), n2.listenTo(e4, "reset", n2.render), n2.listenTo(e4, "remove", n2.onRemove), n2.className = n2.pfx + "panels", n2; } return Mu(e3, t3), e3.prototype.onRemove = function(t4) { var e4 = t4.view; e4 && e4.remove(); }, e3.prototype.addTo = function(t4) { this.addToCollection(t4); }, e3.prototype.addToCollection = function(t4, e4) { var n2 = e4 || null, o2 = (this.config, t4.get("el")), r2 = new ju(t4), i2 = r2.render().el, s2 = t4.get("appendTo"); if (o2) ; else if (s2) { document.querySelector(s2).appendChild(i2); } else n2 ? n2.appendChild(i2) : this.$el.append(i2); return r2.initResize(), i2; }, e3.prototype.render = function() { var t4 = this, e4 = this.$el, n2 = document.createDocumentFragment(); return e4.empty(), this.collection.each(function(e5) { return t4.addToCollection(e5, n2); }), e4.append(n2), e4.attr("class", this.className), this; }, e3; }(Pt); var Du = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Nu = function(t3) { function e3(e4) { var n2 = t3.call(this, e4, "Panels", pu) || this; for (var o2 in n2.panels = new wu(n2, n2.config.defaults), pu) o2 in n2.config || (n2.config[o2] = pu[o2]); return n2; } return Du(e3, t3), e3.prototype.getPanels = function() { return this.panels; }, e3.prototype.getPanelsEl = function() { return this.PanelsViewObj && this.PanelsViewObj.el; }, e3.prototype.addPanel = function(t4) { return this.panels.add(t4); }, e3.prototype.removePanel = function(t4) { return this.panels.remove(t4); }, e3.prototype.getPanel = function(t4) { var e4 = this.panels.where({ id: t4 }); return e4.length ? e4[0] : null; }, e3.prototype.addButton = function(t4, e4) { var n2 = this.getPanel(t4); return n2 ? n2.get("buttons").add(e4) : null; }, e3.prototype.removeButton = function(t4, e4) { var n2 = this.getPanel(t4); return n2 && n2.get("buttons").remove(e4); }, e3.prototype.getButton = function(t4, e4) { var n2 = this.getPanel(t4); if (n2) { var o2 = n2.get("buttons").where({ id: e4 }); return o2.length ? o2[0] : null; } return null; }, e3.prototype.render = function() { return this.PanelsViewObj && this.PanelsViewObj.remove(), this.PanelsViewObj = new Lu(this.panels), this.PanelsViewObj.render().el; }, e3.prototype.active = function() { this.getPanels().each(function(t4) { t4.get("buttons").each(function(t5) { t5.get("active") && t5.trigger("updateActive"); }); }); }, e3.prototype.disableButtons = function() { this.getPanels().each(function(t4) { t4.get("buttons").each(function(t5) { t5.get("disable") && t5.trigger("change:disable"); }); }); }, e3.prototype.destroy = function() { this.panels.reset(), this.panels.stopListening(), this.PanelsViewObj && this.PanelsViewObj.remove(); }, e3; }(m); const Iu = { stylePrefix: "cm-", inlineCss: false }; var Fu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Vu = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }; const Ru = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Fu(e3, t3), e3.prototype.build = function(t4, e4) { void 0 === e4 && (e4 = {}); var n2 = e4.em, o2 = Vu(e4, ["em"]); if (e4.cleanId && n2) { var r2 = n2.Css.getAll().toJSON().map(function(t5) { var e5 = t5.selectors, n3 = e5 && 1 === e5.length && e5.models[0]; return n3 && n3.isId() && n3.get("name"); }).filter(Boolean); o2.attributes || (o2.attributes = function(t5, e5) { var n3 = e5.id; return n3 && "i" === n3[0] && !t5.get("script") && !t5.get("attributes").id && r2.indexOf(n3) < 0 && delete e5.id, e5; }); } return t4.toHTML(o2); }, e3; }(u.Hn); var Hu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), zu = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return Hu(n2, e3), n2.prototype.build = function(e4) { var n3 = this, o2 = e4.toJSON(); return this.beforeEach(o2), (0, t2.each)(o2, function(t3, e5) { var r2 = o2[e5]; if (r2 instanceof u.Hn) o2[e5] = n3.build(r2); else if (r2 instanceof u.FE) { var i2 = r2; o2[e5] = [], i2.length && i2.forEach(function(t4, r3) { o2[e5][r3] = n3.build(t4); }); } }), o2; }, n2.prototype.beforeEach = function(t3) { delete t3.status; }, n2; }(u.Hn); const Bu = zu; var Uu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); var Wu = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return Uu(n2, e3), n2.prototype.mapModel = function(e4) { var n3, o2 = this, r2 = "", i2 = e4.get("script-export") || e4.get("script"), s2 = e4.get("type"), a2 = e4.get("components"), l2 = e4.getId(); if (i2) { var c2 = e4.get("attributes"); c2 = (0, t2.extend)({}, c2, { id: l2 }), e4.set("attributes", c2, { silent: true }); var u2 = e4.getScriptString(i2), p2 = e4.get("script-props"); if (e4.get("scriptUpdated") && !p2) this.mapJs[s2 + "-" + l2] = { ids: [l2], code: u2 }; else { var d2 = void 0, f2 = this.mapJs[s2]; if (p2 && (d2 = e4.__getScriptProps()), f2) f2.ids.push(l2), d2 && (f2.props[l2] = d2); else { var h2 = { ids: [l2], code: u2 }; d2 && (h2.props = ((n3 = {})[l2] = d2, n3)), this.mapJs[s2] = h2; } } } return a2.forEach(function(t3) { r2 += o2.mapModel(t3); }), r2; }, n2.prototype.build = function(t3) { this.mapJs = {}, this.mapModel(t3); var e4, n3, o2 = ""; for (var r2 in this.mapJs) { var i2 = this.mapJs[r2]; if (i2.code) if (i2.props) { if (e4 = i2.code, n3 = void 0, 0 === ((null === (n3 = e4.toString().match(/\{([\s\S]*)\}/m)) || void 0 === n3 ? void 0 : n3[1]) || "").replace(/^\s*\/\/.*$/gm, "").trim().length) continue; o2 += "\n var props = ".concat(JSON.stringify(i2.props), ";\n var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n var els = document.querySelectorAll(ids);\n for (var i = 0, len = els.length; i < len; i++) {\n var el = els[i];\n (").concat(i2.code, ".bind(el))(props[el.id]);\n }"); } else { var s2 = "#" + i2.ids.join(", #"); o2 += "\n var items = document.querySelectorAll('".concat(s2, "');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){\n").concat(i2.code, "\n}.bind(items[i]))();\n }"); } } return o2; }, n2; }(u.Hn); const $u = Wu; var qu, Gu = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ku = function() { return Ku = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ku.apply(this, arguments); }; (0, e2.hasWin)() && (qu = n(631), n(531), n(629), n(210)); var Yu = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return Gu(n2, e3), n2.prototype.defaults = function() { return { input: "", label: "", codeName: "", theme: "hopscotch", readOnly: true, lineNumbers: true }; }, n2.prototype.init = function(e4) { return (0, t2.bindAll)(this, "onChange"), this.editor = qu.fromTextArea(e4, Ku({ dragDrop: false, lineWrapping: true, mode: this.get("codeName") }, this.attributes)), this.element = e4, this.editor.on("change", this.onChange), this; }, n2.prototype.onChange = function() { this.trigger("update", this); }, n2.prototype.getEditor = function() { return this.editor; }, n2.prototype.getElement = function() { return this.element; }, n2.prototype.setElement = function(t3) { return this.element = t3, this; }, n2.prototype.refresh = function() { return this.getEditor().refresh(), this; }, n2.prototype.focus = function() { return this.getEditor().focus(), this; }, n2.prototype.getContent = function() { var t3 = this.getEditor(); return t3 && t3.getValue(); }, n2.prototype.setContent = function(t3, e4) { var n3 = this; void 0 === e4 && (e4 = {}); var o2 = this.editor; o2 && (o2.setValue(t3), o2.autoFormatRange && (qu.commands.selectAll(o2), o2.autoFormatRange(o2.getCursor(true), o2.getCursor(false)), qu.commands.goDocStart(o2)), !e4.noRefresh && setTimeout(function() { return n3.refresh(); })); }, n2; }(u.Hn); const Xu = Yu; Yu.prototype.CodeMirror = qu; var Ju = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Zu = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }; const Qu = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Ju(e3, t3), e3.prototype.template = function(t4) { var e4 = t4.pfx, n2 = t4.codeName, o2 = t4.label; return r(tp || (tp = Zu(['\n
\n
', '
\n
\n
\n '], ['\n
\n
', '
\n
\n
\n '])), e4, e4, n2, e4, o2, e4); }, e3.prototype.initialize = function(t4) { this.config = t4.config || {}, this.pfx = this.config.stylePrefix; }, e3.prototype.render = function() { var t4 = this, e4 = t4.model, n2 = t4.pfx, o2 = t4.$el, r2 = e4.toJSON(); return r2.pfx = n2, o2.html(this.template(r2)), o2.attr("class", "".concat(n2, "editor-c")), o2.find("#".concat(n2, "code")).append(e4.get("input")), this; }, e3; }(u.G7); var tp, ep = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), np = "CodeMirror", op = function(e3) { function n2(t3) { var n3 = e3.call(this, t3, "CodeManager", Iu) || this; n3.EditorView = Qu; var o2 = n3.config, r2 = o2.pStylePrefix; return r2 && (o2.stylePrefix = r2 + o2.stylePrefix), n3.generators = {}, n3.viewers = {}, n3.defGenerators = { html: new Ru(), css: new Mr(), json: new Bu(), js: new $u() }, n3.defViewers = { CodeMirror: new Xu() }, n3.loadDefaultGenerators().loadDefaultViewers(), n3; } return ep(n2, e3), n2.prototype.addGenerator = function(t3, e4) { return this.generators[t3] = e4, this; }, n2.prototype.getGenerator = function(t3) { return this.generators[t3]; }, n2.prototype.getGenerators = function() { return this.generators; }, n2.prototype.addViewer = function(t3, e4) { return this.viewers[t3] = e4, this; }, n2.prototype.getViewer = function(t3) { return this.viewers[t3]; }, n2.prototype.getViewers = function() { return this.viewers; }, n2.prototype.createViewer = function(e4) { void 0 === e4 && (e4 = {}); var n3 = (0, t2.isUndefined)(e4.type) ? np : e4.type, o2 = this.getViewer(n3) && this.getViewer(n3).clone(), r2 = document.createElement("div"), i2 = document.createElement("textarea"); return r2.appendChild(i2), o2.set(e4), o2.init(i2), o2.setElement(r2), o2; }, n2.prototype.updateViewer = function(t3, e4) { t3.setContent(e4); }, n2.prototype.getCode = function(t3, e4, n3) { void 0 === n3 && (n3 = {}), n3.em = this.em; var o2 = this.getGenerator(e4); return o2 ? o2.build(t3, n3) : ""; }, n2.prototype.loadDefaultGenerators = function() { for (var t3 in this.defGenerators) this.addGenerator(t3, this.defGenerators[t3]); return this; }, n2.prototype.loadDefaultViewers = function() { for (var t3 in this.defViewers) this.addViewer(t3, this.defViewers[t3]); return this; }, n2.prototype.destroy = function() { }, n2; }(m); const rp = op; var ip = n(410), sp = n.n(ip); const ap = { maximumStackLength: 500, trackSelection: true }; var lp = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), cp = function() { return cp = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, cp.apply(this, arguments); }, up = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, pp = function(t3) { return t3.avoidStore || t3.noUndo; }, dp = function(t3) { return Object.keys(t3.changedAttributes()); }, fp = function(e3) { function n2(n3) { var o2 = e3.call(this, n3, "UndoManager", ap) || this; o2.config._disable && (o2.config.maximumStackLength = 0); var r2 = true; return o2.um = new (sp())(cp({ track: true, register: [] }, o2.config)), o2.um.changeUndoType("change", { condition: function(e4) { var n4 = e4.get("_undo"); if (n4) { var o3 = e4.get("_undoexc"); if ((0, t2.isArray)(o3) && dp(e4).some(function(t3) { return o3.indexOf(t3) >= 0; })) return false; if ((0, t2.isBoolean)(n4)) return true; if ((0, t2.isArray)(n4) && dp(e4).some(function(t3) { return n4.indexOf(t3) >= 0; })) return true; } return false; }, on: function(e4, n4, o3) { var i2 = this; !this.beforeCache && (this.beforeCache = e4.previousAttributes()); var s2 = o3 || n4 || {}; if (s2.noUndo && setTimeout(function() { i2.beforeCache = null; }), !pp(s2)) { var a2 = e4.toJSON({ fromUndo: r2 }), l2 = { object: e4, before: this.beforeCache, after: a2 }; if (this.beforeCache = null, !(0, t2.isEmpty)(a2)) return l2; } } }), o2.um.changeUndoType("add", { on: function(t3, e4, n4) { if (void 0 === n4 && (n4 = {}), !pp(n4) && o2.isRegistered(e4)) return { object: e4, before: void 0, after: t3, options: cp(cp({}, n4), { fromUndo: r2 }) }; } }), o2.um.changeUndoType("remove", { on: function(t3, e4, n4) { if (void 0 === n4 && (n4 = {}), !pp(n4) && o2.isRegistered(e4)) return { object: e4, before: t3, after: void 0, options: cp(cp({}, n4), { fromUndo: r2 }) }; } }), o2.um.changeUndoType("reset", { undo: function(t3, e4) { t3.reset(e4, { fromUndo: r2 }); }, redo: function(t3, e4, n4) { t3.reset(n4, { fromUndo: r2 }); }, on: function(t3, e4) { if (void 0 === e4 && (e4 = {}), !pp(e4) && o2.isRegistered(t3)) return { object: t3, before: e4.previousModels, after: up([], t3.models, true), options: cp(cp({}, e4), { fromUndo: r2 }) }; } }), o2.um.on("undo redo", function() { n3.trigger("change:canvasOffset"), n3.getSelectedAll().map(function(t3) { return t3.trigger("rerender:layer"); }); }), ["undo", "redo"].forEach(function(t3) { return o2.um.on(t3, function() { return n3.trigger(t3); }); }), o2; } return lp(n2, e3), n2.prototype.postLoad = function() { var t3 = this.config, e4 = this.em; t3.trackSelection && e4 && this.add(e4.get("selected")); }, n2.prototype.add = function(t3) { return this.um.register(t3), this; }, n2.prototype.remove = function(t3) { return this.um.unregister(t3), this; }, n2.prototype.removeAll = function() { return this.um.unregisterAll(), this; }, n2.prototype.start = function() { return this.um.startTracking(), this; }, n2.prototype.stop = function() { return this.um.stopTracking(), this; }, n2.prototype.undo = function(t3) { void 0 === t3 && (t3 = true); var e4 = this.em, n3 = this.um; return !e4.isEditing() && n3.undo(t3), this; }, n2.prototype.undoAll = function() { return this.um.undoAll(), this; }, n2.prototype.redo = function(t3) { void 0 === t3 && (t3 = true); var e4 = this.em, n3 = this.um; return !e4.isEditing() && n3.redo(t3), this; }, n2.prototype.redoAll = function() { return this.um.redoAll(), this; }, n2.prototype.hasUndo = function() { return !!this.um.isAvailable("undo"); }, n2.prototype.hasRedo = function() { return !!this.um.isAvailable("redo"); }, n2.prototype.isRegistered = function(t3) { return !!this.getInstance().objectRegistry.isRegistered(t3); }, n2.prototype.getStack = function() { return this.um.stack; }, n2.prototype.getStackGroup = function() { var t3 = [], e4 = []; return this.getStack().forEach(function(n3) { var o2 = n3.get("magicFusionIndex"); e4.indexOf(o2) < 0 && (e4.push(o2), t3.push(n3)); }), t3; }, n2.prototype.skip = function(t3) { this.stop(), t3(), this.start(); }, n2.prototype.getGroupedStack = function() { var e4 = {}, n3 = this.getStack(); return n3.forEach(function(t3, n4) { var o2 = t3.get("magicFusionIndex"), r2 = function(t4, e5) { var n5 = t4.attributes, o3 = n5.type, r3 = n5.after, i2 = n5.before, s2 = n5.object, a2 = n5.options; return { index: e5, type: o3, after: r3, before: i2, object: s2, options: void 0 === a2 ? {} : a2 }; }(t3, n4); e4[o2] ? e4[o2].push(r2) : e4[o2] = [r2]; }), Object.keys(e4).map(function(n4) { var o2 = e4[n4]; return { index: o2[o2.length - 1].index, actions: o2, labels: (0, t2.unique)(o2.reduce(function(t3, e5) { var n5, o3 = null === (n5 = e5.options) || void 0 === n5 ? void 0 : n5.action; return o3 && t3.push(o3), t3; }, [])) }; }); }, n2.prototype.goToGroup = function(e4) { var n3 = this; if (e4) { var o2 = this.getPointer(), r2 = e4.index - o2; (0, t2.times)(Math.abs(r2), function() { n3[r2 < 0 ? "undo" : "redo"](false); }); } }, n2.prototype.getPointer = function() { return this.getStack().pointer; }, n2.prototype.clear = function() { return this.um.clear(), this; }, n2.prototype.getInstance = function() { return this.um; }, n2.prototype.destroy = function() { this.clear().removeAll(); }, n2; }(m); const hp = fp; const gp = { stylePrefix: "rte-", adjustToolbar: true, actions: ["bold", "italic", "underline", "strikethrough", "link", "wrap"], custom: false }; var vp, yp = function() { return yp = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, yp.apply(this, arguments); }; !function(t3) { t3[t3["ACTIVE"] = 1] = "ACTIVE", t3[t3["INACTIVE"] = 0] = "INACTIVE", t3[t3["DISABLED"] = -1] = "DISABLED"; }(vp || (vp = {})); var mp = "_rte", bp = 1, _p = 0, wp = -1, xp = function(t3, e3) { void 0 === e3 && (e3 = "A"); var n2 = t3.selection() || {}, o2 = n2.anchorNode, r2 = n2.focusNode, i2 = null == o2 ? void 0 : o2.parentNode, s2 = null == r2 ? void 0 : r2.parentNode; return (null == i2 ? void 0 : i2.nodeName) == e3 || (null == s2 ? void 0 : s2.nodeName) == e3; }, Cp = "data-selectme", Sp = { bold: { name: "bold", icon: "B", attributes: { title: "Bold" }, result: function(t3) { return t3.exec("bold"); } }, italic: { name: "italic", icon: "I", attributes: { title: "Italic" }, result: function(t3) { return t3.exec("italic"); } }, underline: { name: "underline", icon: "U", attributes: { title: "Underline" }, result: function(t3) { return t3.exec("underline"); } }, strikethrough: { name: "strikethrough", icon: "S", attributes: { title: "Strike-through" }, result: function(t3) { return t3.exec("strikeThrough"); } }, link: { icon: '\n \n ', name: "link", attributes: { style: "font-size:1.4rem;padding:0 4px 2px;", title: "Link" }, state: function(t3) { return t3 && t3.selection() && xp(t3) ? bp : _p; }, result: function(t3) { xp(t3) ? t3.exec("unlink") : t3.insertHTML('").concat(t3.selection(), ""), { select: true }); } }, wrap: { name: "wrap", icon: '\n \n ', attributes: { title: "Wrap for style" }, state: function(t3) { return (null == t3 ? void 0 : t3.selection()) && xp(t3, "SPAN") ? wp : _p; }, result: function(t3) { !xp(t3, "SPAN") && t3.insertHTML("").concat(t3.selection(), ""), { select: true }); } } }, Op = function() { function n2(e3, n3, o2) { void 0 === o2 && (o2 = {}); var r2 = this; if (this.em = e3, this.settings = o2, n3[mp]) return n3[mp]; n3[mp] = this, this.setEl(n3), this.updateActiveActions = this.updateActiveActions.bind(this), this.__onKeydown = this.__onKeydown.bind(this), this.__onPaste = this.__onPaste.bind(this); var i2 = (o2.actions || []).map(function(e4) { var n4 = e4; return (0, t2.isString)(e4) ? n4 = yp({}, Sp[e4]) : Sp[e4.name] && (n4 = yp(yp({}, Sp[e4.name]), e4)), n4; }), s2 = i2.length ? i2 : Object.keys(Sp).map(function(t3) { return Sp[t3]; }); o2.classes = yp({ actionbar: "actionbar", button: "action", active: "active", disabled: "disabled", inactive: "inactive" }, o2.classes); var a2 = o2.classes, l2 = o2.actionbar; if (this.actionbar = l2, this.classes = a2, this.actions = s2, !l2) { if (!this.isCustom(o2.module)) { var c2 = o2.actionbarContainer; (l2 = document.createElement("div")).className = a2.actionbar, null == c2 || c2.appendChild(l2), this.actionbar = l2; } s2.forEach(function(t3) { return r2.addAction(t3); }); } return o2.styleWithCSS && this.exec("styleWithCSS"), this; } return n2.prototype.isCustom = function(t3) { var e3 = t3 || this.em.RichTextEditor; return !(!(null == e3 ? void 0 : e3.config.custom) && !(null == e3 ? void 0 : e3.customRte)); }, n2.prototype.destroy = function() { }, n2.prototype.setEl = function(t3) { this.el = t3, this.doc = t3.ownerDocument; }, n2.prototype.updateActiveActions = function() { var t3 = this, e3 = this.getActions(); e3.forEach(function(e4) { var n3 = e4.update, o2 = e4.btn, r2 = t3.classes, i2 = r2.active, s2 = r2.inactive, a2 = r2.disabled, l2 = e4.state, c2 = e4.name, u2 = t3.doc, p2 = vp.INACTIVE; if (o2 && (o2.className = o2.className.replace(i2, "").trim(), o2.className = o2.className.replace(s2, "").trim(), o2.className = o2.className.replace(a2, "").trim()), l2) { var d2 = l2(t3, u2); if (p2 = d2, o2) switch (d2) { case bp: o2.className += " ".concat(i2); break; case _p: o2.className += " ".concat(s2); break; case wp: o2.className += " ".concat(a2); } } else u2.queryCommandSupported(c2) && u2.queryCommandState(c2) && (o2 && (o2.className += " ".concat(i2)), p2 = vp.ACTIVE); e4.currentState = p2, null == n3 || n3(t3, e4); }), e3.length && this.em.RichTextEditor.__dbdTrgCustom(); }, n2.prototype.enable = function(t3) { return this.enabled ? this : this.__toggleEffects(true, t3); }, n2.prototype.disable = function() { return this.__toggleEffects(false); }, n2.prototype.__toggleEffects = function(t3, n3) { void 0 === t3 && (t3 = false), void 0 === n3 && (n3 = {}); var o2 = t3 ? e2.on : e2.off, r2 = this.el, i2 = this.doc, s2 = this.actionbarEl(); if (s2 && (s2.style.display = t3 ? "" : "none"), r2.contentEditable = "".concat(!!t3), o2(r2, "mouseup keyup", this.updateActiveActions), o2(i2, "keydown", this.__onKeydown), o2(i2, "paste", this.__onPaste), this.enabled = t3, t3) { var a2 = n3.event; if (this.syncActions(), this.updateActiveActions(), a2) { var l2 = null; if (i2.caretRangeFromPoint) { var c2 = (0, e2.getPointerEvent)(a2); l2 = i2.caretRangeFromPoint(c2.clientX, c2.clientY); } else a2.rangeParent && (l2 = i2.createRange()).setStart(a2.rangeParent, a2.rangeOffset); var u2 = i2.getSelection(); null == u2 || u2.removeAllRanges(), l2 && (null == u2 || u2.addRange(l2)); } r2.focus(); } return this; }, n2.prototype.__onKeydown = function(t3) { var e3 = t3, n3 = this.doc; "Enter" !== e3.key || ["insertOrderedList", "insertUnorderedList"].some(function(t4) { return n3.queryCommandState(t4); }) || (n3.execCommand("insertLineBreak"), e3.preventDefault()); }, n2.prototype.__onPaste = function(t3) { var e3 = t3.clipboardData || window.clipboardData, n3 = e3.getData("text"), o2 = e3.getData("text/html"); if (n3 && !o2) { t3.preventDefault(); var r2 = n3.replace(/(?:\r\n|\r|\n)/g, "
"); this.doc.execCommand("insertHTML", false, r2); } }, n2.prototype.syncActions = function() { var t3 = this; this.getActions().forEach(function(e3) { if (t3.actionbar && (!e3.state || e3.state && e3.state(t3, t3.doc) >= 0)) { var n3 = e3.event || "click", o2 = e3.btn; o2 && (o2["on".concat(n3)] = function() { e3.result(t3, e3), t3.updateActiveActions(); }); } }); }, n2.prototype.addAction = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = e3.sync, o2 = this.actionbarEl(); if (o2) { var r2 = t3.icon, i2 = t3.attributes, s2 = void 0 === i2 ? {} : i2, a2 = document.createElement("span"); for (var l2 in a2.className = this.classes.button, t3.btn = a2, s2) a2.setAttribute(l2, s2[l2]); "string" == typeof r2 ? a2.innerHTML = r2 : a2.appendChild(r2), o2.appendChild(a2); } n3 && (this.actions.push(t3), this.syncActions()); }, n2.prototype.getActions = function() { return this.actions; }, n2.prototype.selection = function() { return this.doc.getSelection(); }, n2.prototype.exec = function(t3, e3) { this.doc.execCommand(t3, false, e3); }, n2.prototype.actionbarEl = function() { return this.actionbar; }, n2.prototype.insertHTML = function(n3, o2) { var r2 = (void 0 === o2 ? {} : o2).select, i2 = this, s2 = i2.em, a2 = i2.doc, l2 = i2.el, c2 = a2.getSelection(); if (c2 && c2.rangeCount) { var u2 = (0, e2.getModel)(l2), p2 = a2.createElement("div"), d2 = c2.getRangeAt(0); d2.deleteContents(), (0, t2.isString)(n3) ? p2.innerHTML = n3 : n3 && p2.appendChild(n3), Array.prototype.slice.call(p2.childNodes).forEach(function(t3) { d2.insertNode(t3); }), c2.removeAllRanges(), c2.addRange(d2), l2.focus(), r2 && u2 && (u2.once("rte:disable", function() { var t3 = u2.find("[".concat(Cp, "]"))[0]; t3 && (s2.setSelected(t3), t3.removeAttributes(Cp)); }), u2.trigger("disable")); } }, n2; }(); const Tp = Op; var kp = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Pp = function(t3, e3, n2, o2) { return new (n2 || (n2 = Promise))(function(r2, i2) { function s2(t4) { try { l2(o2.next(t4)); } catch (t5) { i2(t5); } } function a2(t4) { try { l2(o2["throw"](t4)); } catch (t5) { i2(t5); } } function l2(t4) { var e4; t4.done ? r2(t4.value) : (e4 = t4.value, e4 instanceof n2 ? e4 : new n2(function(t5) { t5(e4); })).then(s2, a2); } l2((o2 = o2.apply(t3, e3 || [])).next()); }); }, Ep = function(t3, e3) { var n2, o2, r2, i2, s2 = { label: 0, sent: function() { if (1 & r2[0]) throw r2[1]; return r2[1]; }, trys: [], ops: [] }; return i2 = { next: a2(0), throw: a2(1), return: a2(2) }, "function" == typeof Symbol && (i2[Symbol.iterator] = function() { return this; }), i2; function a2(a3) { return function(l2) { return function(a4) { if (n2) throw new TypeError("Generator is already executing."); for (; i2 && (i2 = 0, a4[0] && (s2 = 0)), s2; ) try { if (n2 = 1, o2 && (r2 = 2 & a4[0] ? o2["return"] : a4[0] ? o2["throw"] || ((r2 = o2["return"]) && r2.call(o2), 0) : o2.next) && !(r2 = r2.call(o2, a4[1])).done) return r2; switch (o2 = 0, r2 && (a4 = [2 & a4[0], r2.value]), a4[0]) { case 0: case 1: r2 = a4; break; case 4: return s2.label++, { value: a4[1], done: false }; case 5: s2.label++, o2 = a4[1], a4 = [0]; continue; case 7: a4 = s2.ops.pop(), s2.trys.pop(); continue; default: if (!(r2 = s2.trys, (r2 = r2.length > 0 && r2[r2.length - 1]) || 6 !== a4[0] && 2 !== a4[0])) { s2 = 0; continue; } if (3 === a4[0] && (!r2 || a4[1] > r2[0] && a4[1] < r2[3])) { s2.label = a4[1]; break; } if (6 === a4[0] && s2.label < r2[1]) { s2.label = r2[1], r2 = a4; break; } if (r2 && s2.label < r2[2]) { s2.label = r2[2], s2.ops.push(a4); break; } r2[2] && s2.ops.pop(), s2.trys.pop(); continue; } a4 = e3.call(t3, s2); } catch (t4) { a4 = [6, t4], o2 = 0; } finally { n2 = r2 = 0; } if (5 & a4[0]) throw a4[1]; return { value: a4[0] ? a4[1] : void 0, done: true }; }([a3, l2]); }; } }, Ap = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, jp = "change:canvasOffset frame:scroll component:update", Mp = { enable: "rte:enable", disable: "rte:disable", custom: "rte:custom" }, Lp = function(n2) { function o2(e3) { var o3 = n2.call(this, e3, "RichTextEditor", gp) || this; o3.events = Mp; var r2 = o3.config, i2 = r2.pStylePrefix; i2 && (r2.stylePrefix = i2 + r2.stylePrefix), o3.pfx = r2.stylePrefix, o3.actions = r2.actions || []; var s2 = new u.Hn(); return o3.model = s2, s2.on("change:currentView", o3.__trgCustom, o3), o3.__dbdTrgCustom = (0, t2.debounce)(function() { return o3.__trgCustom(); }, 0), o3; } return kp(o2, n2), o2.prototype.onLoad = function() { if ((0, e2.hasWin)()) { var t3 = this.config, n3 = t3.pStylePrefix, o3 = t3.custom, r2 = (0, Et.ut)("div", { class: (0, Et.cx)("".concat(n3, "rte-toolbar"), !o3 && "".concat(n3, "one-bg ").concat(n3, "rte-toolbar-ui")) }); this.toolbar = r2, this.initRte((0, Et.ut)("div")), (0, e2.on)(r2, "mousedown", function(t4) { return t4.stopPropagation(); }); } }, o2.prototype.__trgCustom = function() { var t3 = this, e3 = t3.model, n3 = t3.em, o3 = t3.events; n3.trigger(o3.custom, { enabled: !!e3.get("currentView"), container: this.getToolbarEl(), actions: this.getAll() }); }, o2.prototype.destroy = function() { var t3, e3, n3; null === (t3 = this.globalRte) || void 0 === t3 || t3.destroy(), null === (n3 = null === (e3 = this.customRte) || void 0 === e3 ? void 0 : e3.destroy) || void 0 === n3 || n3.call(e3), this.model.stopListening().clear({ silent: true }), this.__dbdTrgCustom.cancel(), (0, Et.L_)(this.toolbar); }, o2.prototype.postRender = function(t3) { var e3 = t3.model.get("Canvas"); this.toolbar.style.pointerEvents = "all", this.hideToolbar(), e3.getToolsEl().appendChild(this.toolbar); }, o2.prototype.initRte = function(t3) { var e3 = this.globalRte, n3 = this, o3 = n3.em, r2 = n3.pfx, i2 = n3.actionbar, s2 = n3.config, a2 = this.actions || Ap([], s2.actions, true), l2 = { actionbar: "".concat(r2, "actionbar"), button: "".concat(r2, "action"), active: "".concat(r2, "active"), inactive: "".concat(r2, "inactive"), disabled: "".concat(r2, "disabled") }; return e3 ? (e3.em = o3, e3.setEl(t3)) : (e3 = new Tp(o3, t3, { classes: l2, actions: a2, actionbar: i2, actionbarContainer: this.toolbar, module: this }), this.globalRte = e3), e3.actionbar && (this.actionbar = e3.actionbar), e3.actions && (this.actions = e3.actions), e3; }, o2.prototype.add = function(t3, e3) { var n3; void 0 === e3 && (e3 = {}), e3.name = t3, null === (n3 = this.globalRte) || void 0 === n3 || n3.addAction(e3, { sync: true }); }, o2.prototype.get = function(t3) { var e3, n3; return null === (e3 = this.globalRte) || void 0 === e3 || e3.getActions().forEach(function(e4) { e4.name == t3 && (n3 = e4); }), n3; }, o2.prototype.getAll = function() { var t3; return (null === (t3 = this.globalRte) || void 0 === t3 ? void 0 : t3.getActions()) || []; }, o2.prototype.remove = function(t3) { var e3, n3 = this.getAll(), o3 = this.get(t3); if (o3) { var r2 = o3.btn, i2 = n3.indexOf(o3); null === (e3 = null == r2 ? void 0 : r2.parentNode) || void 0 === e3 || e3.removeChild(r2), n3.splice(i2, 1); } return o3; }, o2.prototype.run = function(e3) { var n3 = this.globalRte, o3 = (0, t2.isString)(e3) ? this.get(e3) : e3; n3 && o3 && (o3.result(n3, o3), n3.updateActiveActions()); }, o2.prototype.getToolbarEl = function() { return this.toolbar; }, o2.prototype.updatePosition = function() { var n3 = this.em, o3 = this.toolbar, r2 = "px", i2 = n3.Canvas, s2 = o3.style, a2 = i2.getTargetToElementFixed(this.lastEl, o3, { event: "rteToolbarPosUpdate", left: 0 }); ["top", "left", "bottom", "right"].forEach(function(n4) { var o4 = a2[n4]; (0, e2.isDef)(o4) && (s2[n4] = (0, t2.isString)(o4) ? o4 : (o4 || 0) + r2); }); }, o2.prototype.enable = function(t3, e3, n3) { return void 0 === n3 && (n3 = {}), Pp(this, void 0, void 0, function() { var o3, r2, i2, s2, a2; return Ep(this, function(l2) { switch (l2.label) { case 0: return this.lastEl = t3.el, r2 = (o3 = this).customRte, i2 = o3.em, s2 = t3.getChildrenContainer(), this.toolbar.style.display = "", [4, r2 ? r2.enable(s2, e3) : this.initRte(s2).enable(n3)]; case 1: return a2 = l2.sent(), i2 && (setTimeout(this.updatePosition.bind(this), 0), i2.off(jp, this.updatePosition, this), i2.on(jp, this.updatePosition, this), i2.trigger("rte:enable", t3, a2)), this.model.set({ currentView: t3 }), [2, a2]; } }); }); }, o2.prototype.getContent = function(e3, n3) { return Pp(this, void 0, void 0, function() { var o3; return Ep(this, function(r2) { switch (r2.label) { case 0: return (o3 = this.customRte) && n3 && (0, t2.isFunction)(o3.getContent) ? [4, o3.getContent(e3.el, n3)] : [3, 2]; case 1: return [2, r2.sent()]; case 2: return [2, e3.getChildrenContainer().innerHTML]; } }); }); }, o2.prototype.hideToolbar = function() { var t3 = this.toolbar.style, e3 = "-1000px"; t3.top = e3, t3.left = e3, t3.display = "none"; }, o2.prototype.disable = function(t3, e3) { var n3 = this.em, o3 = this.customRte, r2 = t3.getChildrenContainer(); o3 ? o3.disable(r2, e3) : e3 && e3.disable(), this.hideToolbar(), n3 && (n3.off(jp, this.updatePosition, this), n3.trigger("rte:disable", t3, e3)), this.model.unset("currentView"); }, o2; }(m); const Dp = Lp; var Np = n(790); const Ip = { stylePrefix: "com-", defaults: {}, strict: true }; var Fp = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Vp = function() { return Vp = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Vp.apply(this, arguments); }, Rp = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Hp = [["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"]], zp = function(e3) { function o2(o3) { var r2 = e3.call(this, o3, "Commands", Ip) || this; r2.CommandAbstract = Np["default"], r2.defaultCommands = {}, r2.commands = {}, r2.active = {}; var i2 = r2.config, s2 = i2.pStylePrefix, a2 = r2.defaultCommands; for (var l2 in s2 && (i2.stylePrefix = s2 + i2.stylePrefix), Object.keys(i2.defaults).forEach(function(t3) { var e4 = i2.defaults[t3]; e4.id && r2.add(e4.id, e4); }), a2["tlb-delete"] = { run: function(t3) { return t3.runCommand("core:component-delete"); } }, a2["tlb-clone"] = { run: function(t3) { t3.runCommand("core:copy"), t3.runCommand("core:paste", { action: "clone-component" }); } }, a2["tlb-move"] = { run: function(e4, n2, o4) { void 0 === o4 && (o4 = {}); var r3 = e4.getModel(), i3 = o4 && o4.event, s3 = o4.target, a3 = s3 || e4.getSelected(), l3 = s3 ? [s3] : Rp([], e4.getSelectedAll(), true), c2 = i3 && "dragstart" == i3.type, u2 = { preserveSelected: 1 }; if (!a3 || !a3.get("draggable")) return r3.logWarning("The element is not draggable"); var p2 = a3.get("dmode") || r3.get("dmode"), d2 = function() { return r3.stopDefault(u2); }, f2 = (0, t2.includes)(["absolute", "translate"], p2); l3.forEach(function(t3) { return t3.trigger("disable"); }), c2 ? setTimeout(d2, 0) : d2(); var h2 = function(t3) { r3.trigger("".concat(Ke, ":start"), t3); }, g2 = function(t3) { r3.trigger(Ke, t3); }, v2 = function(t3, n3, o5) { l3.forEach(function(t4) { return t4.set("status", "selected"); }), e4.select(l3), a3.emitUpdate(), r3.trigger("".concat(Ke, ":end"), o5), setTimeout(function() { return r3.runDefault(u2); }), (f2 || o5.cancelled) && r3.set("_cmpDrag", 1); }; if (f2) e4.runCommand("core:component-drag", { guidesInfo: 1, mode: p2, target: a3, onStart: h2, onDrag: g2, onEnd: v2, event: i3 }); else { c2 && i3.dataTransfer.setDragImage(a3.view.el, 0, 0); var y2 = e4.Commands.get("move-comp"); y2.onStart = h2, y2.onDrag = g2, y2.onEndMoveFromModel = v2, y2.initSorterFromModels(l3); } l3.forEach(function(t3) { return t3.set("status", "freezed-selected"); }); } }, a2["core:undo"] = function(t3) { return t3.UndoManager.undo(); }, a2["core:redo"] = function(t3) { return t3.UndoManager.redo(); }, Hp.forEach(function(t3) { var e4 = t3[2], r3 = n(828)("./".concat(t3[1])).default, i3 = "core:".concat(t3[0]); a2[i3] = r3, e4 && (a2[e4] = r3, ["run", "stop"].forEach(function(t4) { o3.on("".concat(t4, ":").concat(e4), function() { for (var e5 = [], n2 = 0; n2 < arguments.length; n2++) e5[n2] = arguments[n2]; return o3.trigger.apply(o3, Rp(["".concat(t4, ":").concat(i3)], e5, false)); }); })); }), i2.model = o3.Canvas, a2) r2.add(l2, a2[l2]); return r2; } return Fp(o2, e3), o2.prototype.add = function(e4, n2) { var o3 = (0, t2.isFunction)(n2) ? { run: n2 } : n2; return o3.stop || (o3.noStop = true), delete o3.initialize, o3.id = e4, this.commands[e4] = Np["default"].extend(o3), this; }, o2.prototype.get = function(e4) { var n2 = this.commands[e4]; return (0, t2.isFunction)(n2) ? (n2 = new n2(this.config), this.commands[e4] = n2) : n2 || this.em.logWarning("'".concat(e4, "' command not found")), n2; }, o2.prototype.extend = function(t3, e4) { void 0 === e4 && (e4 = {}); var n2 = this.get(t3); if (n2) { var o3 = Vp(Vp({}, n2.constructor.prototype), e4); this.add(t3, o3); var r2 = Hp.filter(function(e5) { return "core:".concat(e5[0]) === t3 && e5[2]; })[0]; r2 && this.add(r2[2], o3); } return this; }, o2.prototype.has = function(t3) { return !!this.commands[t3]; }, o2.prototype.getAll = function() { return this.commands; }, o2.prototype.run = function(t3, e4) { return void 0 === e4 && (e4 = {}), this.runCommand(this.get(t3), e4); }, o2.prototype.stop = function(t3, e4) { return void 0 === e4 && (e4 = {}), this.stopCommand(this.get(t3), e4); }, o2.prototype.isActive = function(t3) { return this.getActive().hasOwnProperty(t3); }, o2.prototype.getActive = function() { return this.active; }, o2.prototype.runCommand = function(t3, e4) { var n2; if (void 0 === e4 && (e4 = {}), t3 && t3.run) { var o3 = this.em, r2 = this.config, i2 = t3.id, s2 = o3.Editor; this.isActive(i2) && !e4.force && r2.strict || (n2 = s2 && t3.callRun(s2, e4), i2 && t3.stop && !t3.noStop && !e4.abort && (this.active[i2] = n2)); } return n2; }, o2.prototype.stopCommand = function(t3, e4) { var n2; if (void 0 === e4 && (e4 = {}), t3 && t3.run) { var o3 = this.em, r2 = this.config, i2 = t3.id, s2 = o3.Editor; (this.isActive(i2) || e4.force || !r2.strict) && (i2 && delete this.active[i2], n2 = t3.callStop(s2, e4)); } return n2; }, o2.prototype.create = function(t3) { return t3.stop || (t3.noStop = true), new (Np["default"].extend(t3))(this.config); }, o2.prototype.destroy = function() { this.defaultCommands = {}, this.commands = {}, this.active = {}; }, o2; }(m); const Bp = zp, Up = { sectors: [{ name: "General", open: false, properties: ["display", "float", "position", "top", "right", "left", "bottom"] }, { name: "Flex", open: false, properties: ["flex-direction", "flex-wrap", "justify-content", "align-items", "align-content", "order", "flex-basis", "flex-grow", "flex-shrink", "align-self"] }, { name: "Dimension", open: false, properties: ["width", "height", "max-width", "min-height", "margin", "padding"] }, { name: "Typography", open: false, properties: ["font-family", "font-size", "font-weight", "letter-spacing", "color", "line-height", "text-align", "text-shadow"] }, { name: "Decorations", open: false, properties: ["background-color", "border-radius", "border", "box-shadow", "background"] }, { name: "Extra", open: false, properties: ["opacity", "transition", "transform"] }], appendTo: "", stylePrefix: "sm-", custom: false, hideNotStylable: true, highlightChanged: true, highlightComputed: true, showComputed: true, clearProperties: true, avoidComputed: ["width", "height"] }; var Wp = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), $p = function() { return $p = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, $p.apply(this, arguments); }, qp = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, Gp = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Kp = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return Wp(o2, n2), o2.getDefaults = function() { return (0, t2.result)(this.prototype, "defaults"); }, o2.prototype.defaults = function() { return { name: "", property: "", type: "", defaults: "", info: "", value: "", icon: "", functionName: "", status: "", visible: true, fixedValues: ["initial", "inherit"], full: false, important: false, toRequire: false, requires: void 0, requiresParent: null, parentTarget: null }; }, o2.prototype.initialize = function(t3, n3) { void 0 === t3 && (t3 = {}), void 0 === n3 && (n3 = {}), this.em = n3.em; var r2 = this.getId() || "", i2 = this.get("name") || this.get("label") || ""; !this.get("property") && this.set("property", (i2 || r2).replace(/ /g, "-")); var s2 = this.get("property"); !this.get("id") && this.set("id", s2), !i2 && this.set("name", (0, e2.capitalize)(s2).replace(/-/g, " ")), this.on("change", this.__upTargets), o2.callInit(this, t3, n3); }, o2.prototype.__getParentProp = function() { var t3, e3; return null === (e3 = null === (t3 = this.collection) || void 0 === t3 ? void 0 : t3.opts) || void 0 === e3 ? void 0 : e3.parentProp; }, o2.prototype.__upTargets = function(e3, n3) { var o3, r2 = this; void 0 === n3 && (n3 = {}); var i2 = this.em.Styles, s2 = this.getName(), a2 = n3.__clear, l2 = a2 ? "" : this.__getFullValue(n3), c2 = this.__getParentProp(), u2 = this.changedAttributes(), p2 = (0, t2.keys)(u2).reduce(function(t3, e4) { return t3[e4] = r2.previous(e4), t3; }, {}), d2 = Gp(Gp([], (0, t2.keys)(this.__getClearProps()), true), ["__p"], false), f2 = (0, t2.keys)(u2), h2 = !n3.__up && !c2 && (a2 || d2.some(function(t3) { return f2.indexOf(t3) >= 0; })), g2 = this.get("onChange"), v2 = { property: this, from: p2, to: u2, value: l2, opts: n3 }; i2.__trgEv(i2.events.propertyUpdate, v2), g2 && g2(v2), h2 && this.__upTargetsStyle(((o3 = {})[s2] = l2, o3), n3); }, o2.prototype.__upTargetsStyle = function(t3, e3) { var n3, o3 = null === (n3 = this.em) || void 0 === n3 ? void 0 : n3.get("StyleManager"); null == o3 || o3.addStyleTargets($p($p({}, t3), { __p: !!e3.avoidStore }), e3); }, o2.prototype._up = function(t3, e3) { void 0 === e3 && (e3 = {}), e3.noTarget && (e3.__up = true); var n3 = e3.partial, o3 = qp(e3, ["partial"]); return t3.__p = !(!o3.avoidStore && !n3), this.set(t3, $p($p({}, o3), { avoidStore: t3.__p })); }, o2.prototype.up = function(t3, e3) { void 0 === e3 && (e3 = {}), this.set(t3, $p($p({}, e3), { __up: true })); }, o2.prototype.init = function() { }, o2.prototype.getId = function() { return this.get("id"); }, o2.prototype.getType = function() { return this.get("type"); }, o2.prototype.getName = function() { return this.get("property"); }, o2.prototype.getLabel = function(t3) { var e3; void 0 === t3 && (t3 = {}); var n3 = t3.locale, o3 = void 0 === n3 || n3, r2 = this.getId(), i2 = this.get("name") || this.get("label"); return o3 && (null === (e3 = this.em) || void 0 === e3 ? void 0 : e3.t("styleManager.properties.".concat(r2))) || i2; }, o2.prototype.getValue = function(t3) { void 0 === t3 && (t3 = {}); var e3 = t3.noDefault, n3 = this.get("value"); return this.hasValue() || e3 ? n3 : this.getDefaultValue(); }, o2.prototype.hasValue = function(e3) { void 0 === e3 && (e3 = {}); var n3 = e3.noParent && this.getParentTarget(), o3 = this.get("value"); return !(0, t2.isUndefined)(o3) && "" !== o3 && !n3; }, o2.prototype.hasValueParent = function() { return this.hasValue() && !this.hasValue({ noParent: true }); }, o2.prototype.getStyle = function(t3) { var n3; void 0 === t3 && (t3 = {}); var o3 = this.getName(); return (n3 = {})[t3.camelCase ? (0, e2.camelCase)(o3) : o3] = this.__getFullValue(t3), n3; }, o2.prototype.getDefaultValue = function() { var e3 = this.get("default"); return "".concat((0, t2.isUndefined)(e3) ? this.get("defaults") : e3); }, o2.prototype.upValue = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = null === t3 || "" === t3 ? this.__getClearProps() : this.__parseValue(t3, e3); return this._up(n3, e3); }, o2.prototype.isVisible = function() { return !!this.get("visible"); }, o2.prototype.clear = function(t3) { return void 0 === t3 && (t3 = {}), this._up(this.__getClearProps(), $p($p({}, t3), { __clear: true })), this; }, o2.prototype.canClear = function() { var t3 = this.getParent(); return t3 ? t3.__canClearProp(this) : this.hasValue({ noParent: true }); }, o2.prototype.getParent = function() { return this.__getParentProp() || null; }, o2.prototype.isFull = function() { return !!this.get("full"); }, o2.prototype.__parseValue = function(t3, e3) { return this.parseValue(t3, e3); }, o2.prototype.__getClearProps = function() { return { value: "" }; }, o2.prototype.setValue = function(t3, e3, n3) { void 0 === e3 && (e3 = true), void 0 === n3 && (n3 = {}); var o3 = this.parseValue(t3), r2 = !e3; !r2 && this.set({ value: void 0 }, { avoidStore: r2, silent: true }), this.set(o3, $p({ avoidStore: r2 }, n3)); }, o2.prototype.setValueFromInput = function(t3, e3, n3) { void 0 === n3 && (n3 = {}), this.setValue(t3, e3, $p($p({}, n3), { fromInput: 1 })); }, o2.prototype.parseValue = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = { value: e3 }, r2 = "!important"; if ((0, t2.isString)(e3) && -1 !== e3.indexOf(r2) && (o3.value = e3.replace(r2, "").trim(), o3.important = true), !this.get("functionName") && !n3.complete) return o3; var i2 = [], s2 = "".concat(o3.value), a2 = s2.indexOf("(") + 1, l2 = s2.lastIndexOf(")"), c2 = s2.substring(0, a2 - 1); if (c2 && (o3.functionName = c2), i2.push(a2), l2 >= 0 && i2.push(l2), o3.value = String.prototype.substring.apply(s2, i2), n3.numeric) { var u2 = parseFloat(o3.value); o3.unit = o3.value.replace(u2, ""), o3.value = u2; } return o3; }, o2.prototype.__getFullValue = function(t3) { var e3 = (void 0 === t3 ? {} : t3).withDefault; return !this.hasValue() && e3 ? this.getDefaultValue() : this.getFullValue(); }, o2.prototype.getFullValue = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.get("functionName"), r2 = this.getDefaultValue(), i2 = (0, t2.isUndefined)(e3) ? this.get("value") : e3, s2 = !(0, t2.isUndefined)(i2) && "" !== i2; if (i2 && r2 && i2 === r2) return r2; if (o3 && s2) { var a2 = "url" === o3 ? "'".concat(i2.replace(/'|"/g, ""), "'") : i2; i2 = "".concat(o3, "(").concat(a2, ")"); } return s2 && this.get("important") && !n3.skipImportant && (i2 = "".concat(i2, " !important")), i2 || ""; }, o2.prototype.__setParentTarget = function(t3) { this.up({ parentTarget: t3 }); }, o2.prototype.getParentTarget = function() { return this.get("parentTarget") || null; }, o2.prototype.__parseFn = function(t3) { void 0 === t3 && (t3 = ""); var e3 = t3.indexOf("(") + 1, n3 = t3.lastIndexOf(")"); return { name: t3.substring(0, e3 - 1).trim(), value: String.prototype.substring.apply(t3, [e3, n3 >= 0 ? n3 : void 0]).trim() }; }, o2.prototype.__checkVisibility = function(n3) { var o3 = n3.target, r2 = n3.component, i2 = n3.sectors, s2 = r2 || o3; if (!s2) return false; var a2 = this.getId(), l2 = this.getName(), c2 = this.get("toRequire"), u2 = this.get("requires"), p2 = this.get("requiresParent"), d2 = s2.get("unstylable"), f2 = s2.get("stylable-require"), h2 = s2.get("stylable"); if ((0, t2.isArray)(h2) && (h2 = h2.indexOf(l2) >= 0), (0, t2.isArray)(d2) && (h2 = d2.indexOf(l2) < 0), c2 && (h2 = !o3 || f2 && (f2.indexOf(a2) >= 0 || f2.indexOf(l2) >= 0)), i2 && u2) { var g2 = (0, t2.keys)(u2); i2.forEach(function(e3) { e3.getProperties().forEach(function(e4) { if ((0, t2.includes)(g2, e4.id)) { var n4 = u2[e4.id]; h2 = h2 && (0, t2.includes)(n4, e4.get("value")); } }); }); } if (p2) { var v2 = r2 && r2.parent(), y2 = v2 && v2.getEl(); if (y2) { var m2 = (0, e2.hasWin)() ? window.getComputedStyle(y2) : {}; (0, t2.each)(p2, function(e3, n4) { h2 = h2 && m2[n4] && (0, t2.includes)(e3, m2[n4]); }); } else h2 = false; } return !!h2; }, o2; }(u.Hn); const Yp = Kp; Kp.callParentInit = function(t3, e3, n2, o2) { void 0 === o2 && (o2 = {}), t3.prototype.initialize.apply(e3, [n2, $p($p({}, o2), { skipInit: 1 })]); }, Kp.callInit = function(t3, e3, n2) { void 0 === n2 && (n2 = {}), !n2.skipInit && t3.init(e3, n2); }; var Xp = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Jp = function() { return Jp = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Jp.apply(this, arguments); }, Zp = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Qp = function(t3) { return "integer" === t3 || "number" === t3; }, td = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return Xp(o2, n2), o2.prototype.defaults = function() { return Jp(Jp({}, Yp.getDefaults()), { detached: false, properties: [], separator: " ", join: null, fromStyle: null, toStyle: null, full: true }); }, o2.prototype.initialize = function(t3, e3) { void 0 === t3 && (t3 = {}), void 0 === e3 && (e3 = {}), Yp.callParentInit(Yp, this, t3, e3); var n3 = this.em, o3 = new ff(this.get("properties") || [], { em: n3, parentProp: this }); this.set("properties", o3, { silent: true }), this.listenTo(o3, "change", this.__upProperties), Yp.callInit(this, t3, e3); }, Object.defineProperty(o2.prototype, "properties", { get: function() { return this.get("properties") || []; }, enumerable: false, configurable: true }), o2.prototype.getProperties = function() { return Zp([], this.get("properties").models, true); }, o2.prototype.getProperty = function(t3) { return this.properties.filter(function(e3) { return e3.getId() === t3 || e3.getName() === t3; })[0]; }, o2.prototype.getPropertyAt = function(t3) { return this.get("properties").at(t3); }, o2.prototype.isDetached = function() { return !!this.get("detached"); }, o2.prototype.getValues = function(t3) { var e3 = (void 0 === t3 ? {} : t3).byName; return this.getProperties().reduce(function(t4, n3) { return t4[e3 ? n3.getName() : n3.getId()] = "".concat(n3.__getFullValue()), t4; }, {}); }, o2.prototype.getSeparator = function() { return this.getSplitSeparator(); }, o2.prototype.getJoin = function() { return this.__getJoin(); }, o2.prototype.getStyleFromProps = function(t3) { var n3; void 0 === t3 && (t3 = {}); var o3 = this.getName(), r2 = this.__getJoin(), i2 = this.get("toStyle"), s2 = this.getValues(), a2 = {}; if (i2) a2 = i2(s2, { join: r2, name: o3, property: this }); else if (s2 = this.getValues({ byName: true }), this.isDetached()) a2 = s2; else { var l2 = this.getProperties().map(function(t4) { return t4.__getFullValue({ withDefault: 1 }); }).filter(Boolean).join(r2); (n3 = {})[o3] = l2, a2 = n3; } return this.isDetached() ? a2[o3] = "" : (a2[o3] = a2[o3] || "", a2 = Jp(Jp({}, a2), this.getProperties().reduce(function(t4, e3) { return t4[e3.getName()] = "", t4; }, {}))), t3.camelCase ? Object.keys(a2).reduce(function(t4, n4) { return t4[(0, e2.camelCase)(n4)] = a2[n4], t4; }, {}) : a2; }, o2.prototype.getSplitSeparator = function() { return new RegExp("".concat(this.get("separator"), "(?![^\\(]*\\))")); }, o2.prototype.__upProperties = function(t3, e3) { if (void 0 === e3 && (e3 = {}), !e3.__up && !e3.__clearIn) { var n3 = this.__getParentProp(); if (n3) return n3.__upProperties(this, e3); this.__upTargetsStyleProps(e3, t3); } }, o2.prototype.__upTargetsStyleProps = function(t3, e3) { var n3; void 0 === t3 && (t3 = {}); var o3 = this.getStyleFromProps(); if (this.isDetached() && e3) { var r2 = e3.getName(); (n3 = {})[r2] = o3[r2], o3 = n3; } this.__upTargetsStyle(o3, t3); }, o2.prototype._up = function(t3, e3) { return void 0 === e3 && (e3 = {}), this.__setProperties(this.__getSplitValue(t3.value), e3), Yp.prototype._up.call(this, t3, e3), this; }, o2.prototype.getStyle = function(t3) { return this.getStyleFromProps(t3); }, o2.prototype.__getFullValue = function(t3) { return void 0 === t3 && (t3 = {}), this.isDetached() || t3.__clear ? "" : this.getStyleFromProps()[this.getName()] || ""; }, o2.prototype.__getJoin = function() { var e3 = this.get("join"); return (0, t2.isString)(e3) ? e3 : this.get("separator"); }, o2.prototype.__styleHasProps = function(e3) { void 0 === e3 && (e3 = {}); var n3 = this.getName(), o3 = this.getProperties().map(function(t3) { return t3.getName(); }); return Zp([n3], o3, true).some(function(n4) { return !(0, t2.isUndefined)(e3[n4]) && "" !== e3[n4]; }); }, o2.prototype.__splitValue = function(t3, e3) { return t3.split(e3).map(function(t4) { return t4.trim(); }).filter(Boolean); }, o2.prototype.__splitStyleName = function(t3, e3, n3) { return this.__splitValue(t3[e3] || "", n3); }, o2.prototype.__getSplitValue = function(e3, n3) { void 0 === e3 && (e3 = ""); var o3 = (void 0 === n3 ? {} : n3).byName, r2 = this.getProperties(), i2 = 4 === r2.length && r2.every(function(t3) { return Qp(t3.getType()); }), s2 = this.__splitValue(e3, this.getSplitSeparator()), a2 = {}; return r2.forEach(function(e4, n4) { var r3 = s2[n4], l2 = (0, t2.isUndefined)(r3) ? "" : r3; if (i2) { var c2 = s2.length; l2 = s2[n4] || s2[n4 % c2 + (1 != c2 && c2 % 2 ? 1 : 0)] || l2; } var u2 = o3 ? e4.getName() : e4.getId(); a2[u2] = l2 || ""; }), a2; }, o2.prototype.__getPropsFromStyle = function(e3, n3) { if (void 0 === e3 && (e3 = {}), void 0 === n3 && (n3 = {}), !this.__styleHasProps(e3)) return null; var o3 = n3.byName, r2 = this.getName(), i2 = this.getProperties(), s2 = this.getSplitSeparator(), a2 = this.get("fromStyle"), l2 = a2 ? a2(e3, { property: this, name: r2, separator: s2 }) : {}; return a2 || (l2 = this.__getSplitValue(e3[r2] || "", { byName: o3 }), i2.forEach(function(n4) { var r3 = e3[n4.getName()], i3 = o3 ? n4.getName() : n4.getId(); (0, t2.isUndefined)(r3) || "" === r3 || (l2[i3] = r3); })), l2; }, o2.prototype.__setProperties = function(e3, n3) { void 0 === e3 && (e3 = {}), void 0 === n3 && (n3 = {}), this.getProperties().forEach(function(t3) { var o4 = e3[t3.getId()]; t3.__getFullValue() !== o4 && t3.upValue(o4, n3); }); var o3 = (0, t2.keys)(e3).map(function(t3) { return e3[t3]; }).join(" "); this.set("value", o3, { silent: true }); }, o2.prototype.clear = function() { var t3 = this; return this.getProperties().map(function(e3) { return e3.clear({ __clearIn: !t3.isDetached() }); }), Yp.prototype.clear.call(this), this; }, o2.prototype.hasValue = function(t3) { return this.getProperties().some(function(e3) { return e3.hasValue(t3); }); }, o2.prototype.getFullValue = function() { return this.__getFullValue(); }, o2.prototype.__canClearProp = function(t3) { return this.isDetached() && t3.hasValue({ noParent: true }); }, o2; }(Yp); const ed = td; var nd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), od = function() { return od = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, od.apply(this, arguments); }, rd = function(t3) { function n2() { return null !== t3 && t3.apply(this, arguments) || this; } return nd(n2, t3), n2.prototype.defaults = function() { return { values: {} }; }, n2.prototype.initialize = function() { var t4 = this.collection; this.prop = null == t4 ? void 0 : t4.prop; }, n2.prototype.getId = function() { return this.cid; }, n2.prototype.getIndex = function() { var t4 = this.collection; return t4 ? t4.indexOf(this) : -1; }, n2.prototype.getValues = function(t4) { void 0 === t4 && (t4 = {}); var n3 = this.get("values"); return t4.camelCase ? Object.keys(n3).reduce(function(t5, o2) { return t5[(0, e2.camelCase)(o2)] = n3[o2], t5; }, {}) : n3; }, n2.prototype.getLabel = function() { var t4; return null === (t4 = this.prop) || void 0 === t4 ? void 0 : t4.getLayerLabel(this); }, n2.prototype.isSelected = function() { var t4; return (null === (t4 = this.prop) || void 0 === t4 ? void 0 : t4.getSelectedLayer()) === this; }, n2.prototype.select = function() { var t4; return null === (t4 = this.prop) || void 0 === t4 ? void 0 : t4.selectLayer(this); }, n2.prototype.remove = function() { var t4; return null === (t4 = this.prop) || void 0 === t4 ? void 0 : t4.removeLayer(this); }, n2.prototype.move = function(t4) { var e3; return null === (e3 = this.prop) || void 0 === e3 ? void 0 : e3.moveLayer(this, t4); }, n2.prototype.getStylePreview = function(t4) { var e3; return void 0 === t4 && (t4 = {}), null === (e3 = this.prop) || void 0 === e3 ? void 0 : e3.getStylePreview(this, t4); }, n2.prototype.hasPreview = function() { var t4; return !!(null === (t4 = this.prop) || void 0 === t4 ? void 0 : t4.get("preview")); }, n2.prototype.upValues = function(t4) { return void 0 === t4 && (t4 = {}), this.set("values", od(od({}, this.getValues()), t4)); }, n2; }(u.Hn); const id = rd; var sd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ad = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return sd(e3, t3), e3.prototype.initialize = function(t4, e4) { void 0 === e4 && (e4 = {}), this.prop = e4.prop; }, e3; }(u.FE); const ld = ad; ad.prototype.model = id; var cd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), ud = function() { return ud = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, ud.apply(this, arguments); }, pd = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, dd = /,(?![^\(]*\))/, fd = /\s(?![^(]*\))/, hd = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return cd(o2, n2), o2.prototype.defaults = function() { return ud(ud({}, ed.getDefaults()), { layers: [], layerSeparator: ", ", layerJoin: "", prepend: 0, preview: false, layerLabel: null, selectedLayer: null }); }, o2.prototype.initialize = function(t3, e3) { void 0 === t3 && (t3 = {}), void 0 === e3 && (e3 = {}), ed.callParentInit(ed, this, t3, e3); var n3 = this.get("layers"), o3 = new ld(n3, { prop: this }); o3.property = this, o3.properties = this.get("properties"), this.set("layers", o3, { silent: true }), this.on("change:selectedLayer", this.__upSelected), this.listenTo(o3, "add remove", this.__upLayers), ed.callInit(this, t3, e3); }, o2.prototype.getLayers = function() { return this.__getLayers().models; }, o2.prototype.__getLayers = function() { return this.get("layers"); }, o2.prototype.getLayer = function(t3) { return void 0 === t3 && (t3 = 0), this.__getLayers().at(t3) || void 0; }, o2.prototype.getSelectedLayer = function() { var t3 = this.get("selectedLayer"); return t3 && t3.getIndex() >= 0 ? t3 : void 0; }, o2.prototype.selectLayer = function(t3) { return this.set("selectedLayer", t3, { __select: true }); }, o2.prototype.selectLayerAt = function(t3) { void 0 === t3 && (t3 = 0); var e3 = this.getLayer(t3); return e3 && this.selectLayer(e3); }, o2.prototype.moveLayer = function(e3, n3) { void 0 === n3 && (n3 = 0); var o3 = e3 ? e3.getIndex() : -1; o3 >= 0 && (0, t2.isNumber)(n3) && n3 >= 0 && n3 < this.getLayers().length && o3 !== n3 && (this.removeLayer(e3), this.__getLayers().add(e3, { at: n3 })); }, o2.prototype.addLayer = function(e3, n3) { void 0 === e3 && (e3 = {}), void 0 === n3 && (n3 = {}); var o3 = {}; return this.getProperties().forEach(function(n4) { var r2 = n4.getId(), i2 = e3[r2]; o3[r2] = (0, t2.isUndefined)(i2) ? n4.getDefaultValue() : i2; }), this.__getLayers().push({ values: o3 }, n3); }, o2.prototype.removeLayer = function(t3) { return this.__getLayers().remove(t3); }, o2.prototype.removeLayerAt = function(t3) { void 0 === t3 && (t3 = 0); var e3 = this.getLayer(t3); return e3 ? this.removeLayer(e3) : null; }, o2.prototype.getLayerLabel = function(t3) { var e3 = ""; if (t3) { var n3 = this.get("layerLabel"), o3 = t3.getValues(), r2 = t3.getIndex(); if (n3) e3 = n3(t3, { index: r2, values: o3, property: this }); else { var i2 = []; this.getProperties().map(function(t4) { i2.push(o3[t4.getId()]); }), e3 = i2.filter(Boolean).join(" "); } } return e3; }, o2.prototype.getStyleFromLayer = function(n3, o3) { var r2; void 0 === o3 && (o3 = {}); var i2, s2 = this.__getJoin(), a2 = this.__getJoinLayers(), l2 = this.get("toStyle"), c2 = this.getName(), u2 = n3.getValues(); if (l2) i2 = l2(u2, { join: s2, joinLayers: a2, name: c2, layer: n3, property: this }); else { var p2 = this.getProperties().map(function(e3) { var n4 = e3.getName(), r3 = u2[e3.getId()], i3 = (0, t2.isUndefined)(r3) ? e3.getDefaultValue() : r3; if (o3.number && Qp(e3.getType())) { var s3 = e3.parseValue(r3, o3.number); i3 = "".concat(s3.value).concat(s3.unit); } return { name: n4, value: i3 }; }); i2 = this.isDetached() ? p2.reduce(function(t3, e3) { return t3[e3.name] = e3.value, t3; }, {}) : ((r2 = {})[this.getName()] = p2.map(function(t3) { return t3.value; }).join(s2), r2); } return o3.camelCase ? Object.keys(i2).reduce(function(t3, n4) { return t3[(0, e2.camelCase)(n4)] = i2[n4], t3; }, {}) : i2; }, o2.prototype.getStylePreview = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = {}; return this.get("preview") && (n3 = this.getStyleFromLayer(t3, e3)), n3; }, o2.prototype.getLayerSeparator = function() { var e3 = this.get("layerSeparator"); return (0, t2.isString)(e3) ? new RegExp("".concat(e3, "(?![^\\(]*\\))")) : e3; }, o2.prototype.__upProperties = function(t3, e3) { var n3; void 0 === e3 && (e3 = {}); var o3 = this.getSelectedLayer(); o3 && (o3.upValues(((n3 = {})[t3.getId()] = t3.__getFullValue(), n3)), e3.__up || this.__upTargetsStyleProps(e3)); }, o2.prototype.__upLayers = function(t3, e3, n3) { this.__upTargetsStyleProps(n3 || e3); }, o2.prototype.__upTargets = function(t3, e3) { if (void 0 === e3 && (e3 = {}), !e3.__select) return Yp.prototype.__upTargets.call(this, t3, e3); }, o2.prototype.__upTargetsStyleProps = function(t3) { void 0 === t3 && (t3 = {}), this.__upTargetsStyle(this.getStyleFromLayers(), t3); }, o2.prototype.__upTargetsStyle = function(t3, e3) { return Yp.prototype.__upTargetsStyle.call(this, t3, e3); }, o2.prototype.__upSelected = function(t3, e3) { var n3 = (void 0 === t3 ? {} : t3).noEvent; void 0 === e3 && (e3 = {}); var o3 = this.em.Styles, r2 = this.getSelectedLayer(), i2 = null == r2 ? void 0 : r2.getValues(); i2 && this.getProperties().forEach(function(t4) { var n4, o4 = null !== (n4 = i2[t4.getId()]) && void 0 !== n4 ? n4 : ""; t4.__getFullValue() !== o4 && t4.upValue(o4, ud(ud({}, e3), { __up: true })); }), !n3 && o3.__trgEv(o3.events.layerSelect, { property: this }); }, o2.prototype._up = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = t3.__layers, o3 = void 0 === n3 ? [] : n3, r2 = pd(t3, ["__layers"]); return !this.isDetached() && this.__setLayers(o3), this.__upSelected({ noEvent: true }, e3), Yp.prototype._up.call(this, r2, e3), this; }, o2.prototype.__setLayers = function(t3) { void 0 === t3 && (t3 = []); var e3 = this.__getLayers(), n3 = t3.map(function(t4) { return { values: t4 }; }); e3.length === n3.length ? n3.map(function(t4, n4) { var o3; return null === (o3 = e3.at(n4)) || void 0 === o3 ? void 0 : o3.upValues(t4.values); }) : this.__getLayers().reset(n3), this.__upSelected({ noEvent: true }); }, o2.prototype.__parseValue = function(t3) { var e3 = this, n3 = this.parseValue(t3); return n3.__layers = t3.split(dd).map(function(t4) { return t4.trim(); }).map(function(t4) { return e3.__parseLayer(t4); }).filter(Boolean), n3; }, o2.prototype.__parseLayer = function(e3) { var n3 = this.get("parseLayer"), o3 = e3.split(fd), r2 = this.getProperties(); return n3 ? n3({ value: e3, values: o3 }) : r2.reduce(function(e4, n4, r3) { var i2 = o3[r3]; return e4[n4.getId()] = (0, t2.isUndefined)(i2) ? n4.getDefaultValue() : i2, e4; }, {}); }, o2.prototype.__getLayersFromStyle = function(e3) { var n3 = this; if (void 0 === e3 && (e3 = {}), !this.__styleHasProps(e3)) return null; var o3 = this.getName(), r2 = this.getProperties(), i2 = this.getLayerSeparator(), s2 = this.get("fromStyle"), a2 = s2 ? s2(e3, { property: this, name: o3, separatorLayers: i2 }) : []; if (!s2) { var l2 = this.__splitStyleName(e3, o3, i2).map(function(t3) { return t3.split(n3.getSplitSeparator()); }).map(function(e4) { var n4 = {}; return r2.forEach(function(o4, r3) { var i3 = e4[r3]; n4[o4.getId()] = (0, t2.isUndefined)(i3) ? o4.getDefaultValue() : i3; }), n4; }); r2.forEach(function(t3) { var o4 = t3.getId(); n3.__splitStyleName(e3, t3.getName(), i2).map(function(e4) { var n4; return (n4 = {})[o4] = e4 || t3.getDefaultValue(), n4; }).forEach(function(t4, e4) { l2[e4] = l2[e4] ? ud(ud({}, l2[e4]), t4) : t4; }); }), a2 = l2; } return (0, t2.isArray)(a2) ? a2 : [a2]; }, o2.prototype.getStyle = function(t3) { return void 0 === t3 && (t3 = {}), this.getStyleFromLayers(t3); }, o2.prototype.getStyleFromLayers = function(e3) { var n3 = this; void 0 === e3 && (e3 = {}); var o3 = {}, r2 = this.getName(), i2 = this.getLayers(), s2 = this.getProperties(); if (i2.map(function(t3) { return n3.getStyleFromLayer(t3, e3); }).forEach(function(e4) { (0, t2.keys)(e4).map(function(t3) { o3[t3] || (o3[t3] = []), o3[t3].push(e4[t3]); }); }), (0, t2.keys)(o3).map(function(t3) { o3[t3] = o3[t3].join(n3.__getJoinLayers()); }), this.isDetached()) o3[r2] = "", !i2.length && s2.map(function(t3) { o3[t3.getName()] = ""; }); else { var a2 = s2.reduce(function(t3, e4) { return t3[e4.getName()] = "", t3; }, {}); o3[r2] = o3[r2] || "", o3 = ud(ud({}, o3), a2); } return o3; }, o2.prototype.__getJoinLayers = function() { var e3 = this.get("layerJoin"), n3 = this.get("layerSeparator"); return e3 || ((0, t2.isString)(n3) ? n3 : e3); }, o2.prototype.__getFullValue = function() { return this.get("detached") ? "" : this.getStyleFromLayers()[this.getName()]; }, o2.prototype.hasValue = function(t3) { void 0 === t3 && (t3 = {}); var e3 = t3.noParent && this.getParentTarget(); return this.getLayers().length > 0 && !e3; }, o2.prototype.clear = function(t3) { return void 0 === t3 && (t3 = {}), this.__getLayers().reset(), this.__upTargetsStyleProps(t3), Yp.prototype.clear.call(this), this; }, o2.prototype.__canClearProp = function() { return false; }, o2; }(ed); const gd = hd; var vd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), yd = function() { return yd = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, yd.apply(this, arguments); }, md = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, bd = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, _d = "data-clear-style", wd = function(n2) { function o2(e3) { void 0 === e3 && (e3 = {}); var o3 = n2.call(this, e3) || this; (0, t2.bindAll)(o3, "__change", "__updateStyle"); var r2 = e3.config || {}, i2 = r2.em; o3.config = r2, o3.em = i2, o3.pfx = r2.stylePrefix || "", o3.ppfx = r2.pStylePrefix || "", o3.__destroyFn = o3.destroy ? o3.destroy.bind(o3) : function() { }; var s2 = o3.model; s2.view = o3, o3.onValueChange = (0, t2.debounce)(o3.onValueChange.bind(o3), 10), o3.updateStatus = (0, t2.debounce)(o3.updateStatus.bind(o3), 0), o3.listenTo(s2, "destroy remove", o3.remove), o3.listenTo(s2, "change:visible", o3.updateVisibility), o3.listenTo(s2, "change:name change:className change:full", o3.render), o3.listenTo(s2, "change:value", o3.onValueChange), o3.listenTo(s2, "change:parentTarget", o3.updateStatus), o3.listenTo(i2, "change:device", o3.onValueChange); var a2 = o3.init && o3.init.bind(o3); return a2 && a2(), o3; } return vd(o2, n2), o2.prototype.events = function() { var t3; return (t3 = { change: "inputValueChanged" })["click [".concat(_d, "]")] = "clear", t3; }, o2.prototype.template = function(t3) { var e3 = this.pfx, n3 = this.ppfx; return '\n
\n
\n '); }, o2.prototype.templateLabel = function(t3) { var e3 = this.pfx, n3 = this.em, o3 = t3.parent, r2 = t3.attributes, i2 = r2.icon, s2 = void 0 === i2 ? "" : i2, a2 = r2.info, l2 = void 0 === a2 ? "" : a2, c2 = null == n3 ? void 0 : n3.getConfig().icons, u2 = (null == c2 ? void 0 : c2.close) || ""; return '\n \n ').concat(t3.getLabel(), "\n \n ").concat(o3 ? "" : '"), "\n "); }, o2.prototype.templateInput = function(t3) { return '\n
\n \n
\n '); }, o2.prototype.remove = function() { var t3 = this; return u.G7.prototype.remove.apply(this, arguments), ["em", "input", "$input", "view"].forEach(function(e3) { return t3[e3] = null; }), this.__destroyFn(this._getClbOpts()), this; }, o2.prototype.updateStatus = function() { var t3, e3 = this, n3 = e3.model, o3 = e3.pfx, r2 = e3.ppfx, i2 = e3.config, s2 = "".concat(r2, "four-color"), a2 = "".concat(r2, "color-warn"), l2 = this.$el.children(".".concat(o3, "label")), c2 = this.getClearEl(), u2 = c2 ? c2.style : {}; l2.removeClass("".concat(s2, " ").concat(a2)), u2.display = "none", n3.hasValue({ noParent: true }) && i2.highlightChanged ? (l2.addClass(s2), i2.clearProperties && (u2.display = "")) : n3.hasValue() && i2.highlightComputed && l2.addClass(a2), null === (t3 = this.parent) || void 0 === t3 || t3.updateStatus(); }, o2.prototype.clear = function(t3) { t3 && t3.stopPropagation(), this.model.clear(); }, o2.prototype.getClearEl = function() { return this.clearEl || (this.clearEl = this.el.querySelector("[".concat(_d, "]"))), this.clearEl; }, o2.prototype.inputValueChanged = function(t3) { t3 && t3.stopPropagation(), this.emit || this.model.upValue(t3.target.value); }, o2.prototype.onValueChange = function(t3, e3, n3) { this.setValue(this.model.getFullValue(void 0, { skipImportant: true })), this.updateStatus(); }, o2.prototype.setValue = function(e3) { var n3 = this.model, o3 = (0, t2.isUndefined)(e3) || "" === e3 ? n3.getDefaultValue() : e3; if (this.update) return this.__update(o3); this.__setValueInput(o3); }, o2.prototype.__setValueInput = function(t3) { var e3 = this.getInputEl(); e3 && (e3.value = t3); }, o2.prototype.getInputEl = function() { return this.input || (this.input = this.el.querySelector("input")), this.input; }, o2.prototype.updateVisibility = function() { this.el.style.display = this.model.isVisible() ? "" : "none"; }, o2.prototype.clearCached = function() { delete this.clearEl, delete this.input, delete this.$input; }, o2.prototype.__unset = function() { var t3 = this.unset && this.unset.bind(this); t3 && t3(this._getClbOpts()); }, o2.prototype.__update = function(t3) { var e3 = this.update && this.update.bind(this); e3 && e3(yd(yd({}, this._getClbOpts()), { value: t3 })); }, o2.prototype.__change = function() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; var n3 = this.emit && this.emit.bind(this); n3 && n3.apply(void 0, bd([this._getClbOpts()], t3, false)); }, o2.prototype.__updateStyle = function(t3, n3) { void 0 === n3 && (n3 = {}); var o3 = n3.complete, r2 = n3.partial, i2 = (md(n3, ["complete", "partial"]), this.model), s2 = false !== o3 && true !== r2; (0, e2.isObject)(t3) ? i2.__upTargetsStyle(t3, { avoidStore: !s2 }) : i2.upValue(t3, { partial: !s2 }); }, o2.prototype._getClbOpts = function() { var t3 = this, e3 = t3.model; return { el: t3.el, createdEl: t3.createdEl, property: e3, props: e3.attributes, change: this.__change, updateStyle: this.__updateStyle }; }, o2.prototype.render = function() { this.clearCached(); var t3 = this, e3 = t3.pfx, n3 = t3.model, o3 = t3.el, r2 = t3.$el, i2 = n3.getName(), s2 = n3.getType(), a2 = n3.get("className") || "", l2 = "".concat(e3, "property"), c2 = "number" === s2 ? "".concat(e3).concat(s2, " ").concat(e3, "integer") : "".concat(e3).concat(s2); this.createdEl && this.__destroyFn(this._getClbOpts()), r2.empty().append(this.template(n3)), r2.find("[data-sm-label]").append(this.templateLabel(n3)); var u2 = this.create && this.create.bind(this); this.createdEl = u2 && u2(this._getClbOpts()), r2.find("[data-sm-fields]").append(this.createdEl || this.templateInput(n3)), o3.className = "".concat(l2, " ").concat(c2, " ").concat(l2, "__").concat(i2, " ").concat(a2).trim(), o3.className += n3.isFull() ? " ".concat(l2, "--full") : ""; var p2 = this.onRender && this.onRender.bind(this); return p2 && p2(), this.setValue(n3.getValue()), this; }, o2.prototype.onRender = function() { }, o2; }(u.G7); const xd = wd; var Cd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Sd = function(t3) { function e3(e4) { var n2 = t3.call(this, e4) || this; n2.config = e4.config || {}, n2.pfx = n2.config.stylePrefix || "", n2.properties = [], n2.parent = e4.parent; var o2 = n2.collection; return n2.listenTo(o2, "add", n2.addTo), n2.listenTo(o2, "reset", n2.render), n2; } return Cd(e3, t3), e3.prototype.addTo = function(t4, e4, n2) { this.add(t4, null, n2); }, e3.prototype.add = function(t4, e4, n2) { void 0 === n2 && (n2 = {}); var o2 = this.parent, r2 = this.config, i2 = e4 || this.el, s2 = new t4.typeView({ model: t4, config: r2 }); o2 && (s2.parent = o2), s2.render(); var a2 = s2.el; this.properties.push(s2), (0, Et.$Q)(i2, a2, n2.at); }, e3.prototype.remove = function() { return u.G7.prototype.remove.apply(this, arguments), this.clearItems(), this; }, e3.prototype.clearItems = function() { this.properties.forEach(function(t4) { return t4.remove(); }), this.properties = []; }, e3.prototype.render = function() { var t4 = this, e4 = this.$el, n2 = this.pfx; this.clearItems(); var o2 = document.createDocumentFragment(); return this.collection.forEach(function(e5) { return t4.add(e5, o2); }), e4.empty(), e4.append(o2), e4.attr("class", "".concat(n2, "properties")), this; }, e3; }(u.G7); const Od = Sd; var Td = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), kd = function() { return kd = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, kd.apply(this, arguments); }; const Pd = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Td(e3, t3), e3.prototype.templateInput = function() { var t4 = this.pfx; return '\n
\n \n
\n '); }, e3.prototype.remove = function() { var t4; return null === (t4 = this.props) || void 0 === t4 || t4.remove(), xd.prototype.remove.apply(this, arguments), this; }, e3.prototype.onValueChange = function() { }, e3.prototype.onRender = function() { var t4 = this.pfx, e4 = this.model, n2 = e4.get("properties"); if (n2.length && !this.props) { var o2 = e4.isDetached(), r2 = new Od({ config: kd(kd({}, this.config), { highlightComputed: o2, highlightChanged: o2 }), collection: n2, parent: this }); r2.render(), this.$el.find("#".concat(t4, "input-holder")).append(r2.el), this.props = r2; } }, e3.prototype.clearCached = function() { xd.prototype.clearCached.apply(this, arguments), delete this.props; }, e3; }(xd); var Ed = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ad = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return Ed(n2, e3), n2.prototype.events = function() { return { click: "select", "click [data-close-layer]": "removeItem", "mousedown [data-move-layer]": "initSorter", "touchstart [data-move-layer]": "initSorter" }; }, n2.prototype.template = function() { var t3 = this, e4 = t3.pfx, n3 = t3.ppfx, o2 = t3.em, r2 = null == o2 ? void 0 : o2.getConfig().icons, i2 = (null == r2 ? void 0 : r2.close) || "", s2 = (null == r2 ? void 0 : r2.move) || ""; return '\n
\n
\n ').concat(s2, '\n
\n
\n \n
\n ').concat(i2, '\n
\n
\n
\n '); }, n2.prototype.initialize = function(t3) { void 0 === t3 && (t3 = {}); var e4 = this.model, n3 = t3.config || {}; this.em = n3.em, this.config = n3, this.sorter = t3.sorter, this.pfx = n3.stylePrefix || "", this.ppfx = n3.pStylePrefix || "", this.propertyView = t3.propertyView; var o2 = this.propertyView.model; this.listenTo(e4, "destroy remove", this.remove), this.listenTo(e4, "change:values", this.updateLabel), this.listenTo(o2, "change:selectedLayer", this.updateVisibility), e4.view = this, e4.set({ droppable: 0, draggable: 1 }), this.$el.data("model", e4); }, n2.prototype.initSorter = function() { var t3; null === (t3 = this.sorter) || void 0 === t3 || t3.startSort(this.el); }, n2.prototype.removeItem = function(t3) { t3 && t3.stopPropagation(), this.model.remove(); }, n2.prototype.select = function() { this.model.select(); }, n2.prototype.getPropertiesWrapper = function() { return this.propsWrapEl || (this.propsWrapEl = this.el.querySelector("[data-properties]")), this.propsWrapEl; }, n2.prototype.getPreviewEl = function() { return this.previewEl || (this.previewEl = this.el.querySelector("[data-preview]")), this.previewEl; }, n2.prototype.getLabelEl = function() { return this.labelEl || (this.labelEl = this.el.querySelector("[data-label]")), this.labelEl; }, n2.prototype.updateLabel = function() { var e4 = this.model, n3 = e4.getLabel(); if (this.getLabelEl().innerHTML = n3, e4.hasPreview()) { var o2 = this.getPreviewEl(), r2 = e4.getStylePreview({ number: { min: -3, max: 3 } }), i2 = (0, t2.keys)(r2).map(function(t3) { return "".concat(t3, ":").concat(r2[t3]); }).join(";"); o2.setAttribute("style", i2); } }, n2.prototype.updateVisibility = function() { var t3, e4 = this, n3 = e4.pfx, o2 = e4.model, r2 = e4.propertyView, i2 = this.getPropertiesWrapper(), s2 = o2.isSelected(); i2.style.display = s2 ? "" : "none", this.$el[s2 ? "addClass" : "removeClass"]("".concat(n3, "active")), s2 && i2.appendChild(null === (t3 = r2.props) || void 0 === t3 ? void 0 : t3.el); }, n2.prototype.render = function() { var t3 = this, e4 = t3.el, n3 = t3.pfx, o2 = t3.model; return e4.innerHTML = this.template(), e4.className = "".concat(n3, "layer"), o2.hasPreview() && (e4.querySelector("[data-preview-box]").style.display = ""), this.updateLabel(), this.updateVisibility(), this; }, n2; }(u.G7); const jd = Ad; var Md = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ld = function(t3) { function e3(e4) { var n2 = t3.call(this, e4) || this, o2 = n2.collection, r2 = e4.config || {}, i2 = r2.em, s2 = r2.stylePrefix || "", a2 = r2.pStylePrefix || ""; n2.config = r2, n2.pfx = s2, n2.ppfx = a2, n2.propertyView = e4.propertyView, n2.className = "".concat(s2, "layers ").concat(a2, "field"), n2.listenTo(o2, "add", n2.addTo), n2.listenTo(o2, "reset", n2.reset), n2.items = []; var l2 = null == i2 ? void 0 : i2.Utils; return n2.sorter = l2 ? new l2.Sorter({ container: n2.el, ignoreViewChildren: 1, containerSel: ".".concat(s2, "layers"), itemSel: ".".concat(s2, "layer"), pfx: r2.pStylePrefix }) : "", o2.view = n2, n2.$el.data("model", o2), n2.$el.data("collection", o2), n2; } return Md(e3, t3), e3.prototype.addTo = function(t4) { var e4 = this.collection.indexOf(t4); this.addToCollection(t4, null, e4); }, e3.prototype.addToCollection = function(t4, e4, n2) { var o2 = e4 || null, r2 = this, i2 = r2.propertyView, s2 = r2.config, a2 = r2.sorter, l2 = r2.$el, c2 = new jd({ model: t4, config: s2, sorter: a2, propertyView: i2 }), u2 = c2.render().el; if (this.items.push(c2), o2) o2.appendChild(u2); else if (void 0 !== n2) { var p2 = "before"; l2.children().length === n2 && (n2--, p2 = "after"), n2 < 0 ? l2.append(u2) : l2.children().eq(n2)[p2](u2); } else l2.append(u2); return u2; }, e3.prototype.reset = function(t4, e4) { this.clearItems(), this.render(); }, e3.prototype.remove = function() { return this.clearItems(), u.G7.prototype.remove.apply(this, arguments), this; }, e3.prototype.clearItems = function() { this.items.forEach(function(t4) { return t4.remove(); }), this.items = []; }, e3.prototype.render = function() { var t4 = this, e4 = this.$el, n2 = this.sorter, o2 = document.createDocumentFragment(); return e4.empty(), this.collection.forEach(function(e5) { return t4.addToCollection(e5, o2); }), e4.append(o2), e4.attr("class", this.className), n2 && (n2.plh = null), this; }, e3; }(u.G7); const Dd = Ld; var Nd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Id = function() { return Id = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Id.apply(this, arguments); }, Fd = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Nd(e3, t3), e3.prototype.events = function() { return Id(Id({}, Pd.prototype.events()), { "click [data-add-layer]": "addLayer", change: "" }); }, e3.prototype.templateInput = function() { var t4 = this.pfx, e4 = this.em, n2 = null == e4 ? void 0 : e4.getConfig().icons, o2 = (null == n2 ? void 0 : n2.plus) || "+"; return '\n
\n \n
\n
\n "); }, e3.prototype.init = function() { var t4 = this.model; this.listenTo(t4.__getLayers(), "change reset", this.updateStatus); }, e3.prototype.addLayer = function() { this.model.addLayer({}, { at: 0 }); }, e3.prototype.setValue = function() { }, e3.prototype.remove = function() { var t4; return null === (t4 = this.layersView) || void 0 === t4 || t4.remove(), Pd.prototype.remove.apply(this, arguments), this; }, e3.prototype.clearCached = function() { Pd.prototype.clearCached.apply(this, arguments), delete this.layersView; }, e3.prototype.onRender = function() { var t4 = this, e4 = t4.model, n2 = t4.el, o2 = t4.config, r2 = e4.get("properties"); if (r2.length && !this.props) { var i2 = new Od({ config: Id(Id({}, o2), { highlightComputed: false, highlightChanged: false }), collection: r2, parent: this }); i2.render(); var s2 = new Dd({ collection: e4.__getLayers(), config: o2, propertyView: this }); s2.render(), n2.querySelector("[data-layers-wrapper]").appendChild(s2.el), this.props = i2, this.layersView = s2; } }, e3; }(Pd); const Vd = Fd; var Rd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Hd = function() { return Hd = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Hd.apply(this, arguments); }; const zd = function(e3) { function n2() { return null !== e3 && e3.apply(this, arguments) || this; } return Rd(n2, e3), n2.prototype.events = function() { return Hd(Hd({}, xd.prototype.events()), { "click [data-clear-asset]": "clear", "click [data-open-assets]": "openAssetManager" }); }, n2.prototype.templateInput = function() { var t3, e4 = this.pfx, n3 = this.em, o2 = null === (t3 = this.em) || void 0 === t3 ? void 0 : t3.getConfig().icons, r2 = null == o2 ? void 0 : o2.close; return '\n
\n \n
\n
\n
\n
\n
\n
').concat(r2, "
\n
\n
\n "); }, n2.prototype.__setValueInput = function(t3) { var e4 = this.model, n3 = this.el, o2 = e4.getDefaultValue(), r2 = n3.querySelector("[data-preview-box]"), i2 = n3.querySelector("[data-preview]"); r2.style.display = t3 && t3 !== o2 ? "" : "none", i2.style.backgroundImage = t3 || e4.getDefaultValue(); }, n2.prototype.openAssetManager = function() { var e4, n3 = this, o2 = null === (e4 = this.em) || void 0 === e4 ? void 0 : e4.Assets; null == o2 || o2.open({ select: function(e5, r2) { var i2 = (0, t2.isString)(e5) ? e5 : e5.get("src"); n3.model.upValue(i2, { partial: !r2 }), r2 && o2.close(); }, types: ["image"], accept: "image/*" }); }, n2; }(xd); var Bd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Ud = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Bd(e3, t3), e3.prototype.templateInput = function(t4) { return ""; }, e3.prototype.init = function() { var t4 = this.model; this.listenTo(t4, "change:unit", this.onValueChange), this.listenTo(t4, "change:units", this.render); }, e3.prototype.setValue = function(t4) { }, e3.prototype.onRender = function() { var t4 = this, e4 = t4.ppfx, n2 = t4.model, o2 = t4.el; if (!this.inputInst) { var r2 = n2.input; r2.ppfx = e4, r2.render(), o2.querySelector(".".concat(e4, "fields")).appendChild(r2.el), this.input = r2.inputEl.get(0), this.inputInst = r2; } }, e3.prototype.clearCached = function() { xd.prototype.clearCached.apply(this, arguments), this.inputInst = null; }, e3; }(xd); var Wd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const $d = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Wd(e3, t3), e3.prototype.setValue = function(t4) { var e4; null === (e4 = this.inputInst) || void 0 === e4 || e4.setValue(t4, { fromTarget: 1, def: this.model.getDefaultValue() }); }, e3.prototype.remove = function() { var t4 = this; Ud.prototype.remove.apply(this, arguments); var e4 = this.inputInst; return e4 && e4.remove && e4.remove(), ["inputInst", "$color"].forEach(function(e5) { return t4[e5] = null; }), this; }, e3.prototype.__handleChange = function(t4, e4) { this.model.upValue(t4, { partial: e4 }); }, e3.prototype.onRender = function() { var t4; if (!this.inputInst) { this.__handleChange = this.__handleChange.bind(this); var e4 = this, n2 = e4.ppfx, o2 = e4.model, r2 = e4.em, i2 = e4.el, s2 = new Aa({ target: r2, model: o2, ppfx: n2, onChange: this.__handleChange }).render(); i2.querySelector(".".concat(n2, "fields")).appendChild(s2.el), this.input = null === (t4 = s2.inputEl) || void 0 === t4 ? void 0 : t4.get(0), this.inputInst = s2; } }, e3; }(Ud); var qd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Gd = function() { return Gd = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Gd.apply(this, arguments); }, Kd = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }; const Yd = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return qd(o2, n2), o2.prototype.defaults = function() { return Gd(Gd({}, Yp.getDefaults()), { options: [], full: 0 }); }, o2.prototype.getOptions = function() { var t3 = this.attributes, e3 = t3.options, n3 = t3.list; return (e3 && e3.length ? e3 : n3) || []; }, o2.prototype.getOption = function(t3) { var n3 = this, o3 = (0, e2.isDef)(t3) ? t3 : this.getValue(); return this.getOptions().filter(function(t4) { return n3.getOptionId(t4) === o3; })[0] || null; }, o2.prototype.setOptions = function(t3) { return void 0 === t3 && (t3 = []), this.set("options", t3), this; }, o2.prototype.addOption = function(t3) { if (t3) { var e3 = this.getOptions(); this.setOptions(Kd(Kd([], e3, true), [t3], false)); } return this; }, o2.prototype.getOptionId = function(t3) { return (0, e2.isDef)(t3.id) ? t3.id : t3.value; }, o2.prototype.getOptionLabel = function(e3, n3) { var o3; void 0 === n3 && (n3 = {}); var r2 = n3.locale, i2 = void 0 === r2 || r2, s2 = ((0, t2.isString)(e3) ? this.getOption(e3) : e3) || {}, a2 = this.getOptionId(s2), l2 = s2.label || s2.name || a2, c2 = n3.property || this.getId(); return i2 && (null === (o3 = this.em) || void 0 === o3 ? void 0 : o3.t("styleManager.options.".concat(c2, ".").concat(a2))) || l2; }, o2.prototype.initialize = function() { for (var t3 = [], e3 = 0; e3 < arguments.length; e3++) t3[e3] = arguments[e3]; Yp.prototype.initialize.apply(this, t3), this.listenTo(this, "change:options", this.__onOptionChange); }, o2.prototype.__onOptionChange = function() { this.set("list", this.get("options")); }, o2; }(Yp); var Xd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const Jd = function(t3) { function e3(e4) { var n2 = t3.call(this, e4) || this; return n2.listenTo(n2.model, "change:options", n2.updateOptions), n2; } return Xd(e3, t3), e3.prototype.templateInput = function() { var t4 = this.pfx, e4 = this.ppfx; return '\n
\n \n
\n
\n
\n
\n '); }, e3.prototype.updateOptions = function() { delete this.input, this.onRender(); }, e3.prototype.onRender = function() { var t4 = this.pfx, e4 = this.model, n2 = e4.getOptions(); if (!this.input) { var o2 = []; n2.forEach(function(t5) { var n3 = e4.getOptionId(t5), r3 = e4.getOptionLabel(n3), i2 = t5.style ? t5.style.replace(/"/g, """) : "", s2 = i2 ? 'style="'.concat(i2, '"') : "", a2 = n3.replace(/"/g, """); o2.push('")); }); var r2 = this.el.querySelector("#".concat(t4, "input-holder")); r2.innerHTML = ""), this.input = r2.firstChild; } }, e3.prototype.__setValueInput = function(t4) { var e4 = this.model, n2 = this.getInputEl(), o2 = e4.getOptions()[0], r2 = o2 ? e4.getOptionId(o2) : ""; n2 && (n2.value = t4 || r2); }, e3; }(xd); var Zd = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Qd = function() { return Qd = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Qd.apply(this, arguments); }; const tf = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return Zd(e3, t3), e3.prototype.defaults = function() { return Qd(Qd({}, Yd.getDefaults()), { full: 1 }); }, e3; }(Yd); var ef = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(); const nf = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return ef(e3, t3), e3.prototype.templateInput = function() { var t4 = this.ppfx; return '
'); }, e3.prototype.onRender = function() { var t4 = this.pfx, e4 = this.ppfx, n2 = this.model, o2 = "".concat(e4, "radio-item-label"), r2 = n2.getName(), i2 = n2.getOptions(), s2 = "".concat(t4, "radio ").concat(t4, "radio-").concat(r2), a2 = n2.cid; if (!this.input) { var l2 = []; i2.forEach(function(i3) { var c3 = i3.className ? "".concat(i3.className, " ").concat(t4, "icon ").concat(o2) : "", u2 = n2.getOptionId(i3), p2 = "".concat(r2, "-").concat(u2, "-").concat(a2), d2 = c3 ? "" : n2.getOptionLabel(u2), f2 = i3.title ? 'title="'.concat(i3.title, '"') : "", h2 = n2.getValue() === u2 ? "checked" : ""; l2.push('\n
\n \n \n
\n ")); }); var c2 = this.el.querySelector(".".concat(e4, "field")); c2.innerHTML = '
').concat(l2.join(""), "
"), this.input = c2.firstChild; } }, e3.prototype.__setValueInput = function(t4) { var e4, n2 = this.model, o2 = t4 || n2.getDefaultValue(), r2 = null === (e4 = this.getInputEl()) || void 0 === e4 ? void 0 : e4.querySelector('[value="'.concat(o2, '"]')); r2 && (r2.checked = true); }, e3; }(Jd); var of = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), rf = function() { return rf = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, rf.apply(this, arguments); }; const sf = function(n2) { function o2() { return null !== n2 && n2.apply(this, arguments) || this; } return of(o2, n2), o2.prototype.defaults = function() { return rf(rf({}, Yp.getDefaults()), { units: [], unit: "", min: "", max: "", step: 1 }); }, o2.prototype.getUnits = function() { return this.get("units") || []; }, o2.prototype.getUnit = function() { return this.get("unit"); }, o2.prototype.getMin = function() { return this.get("min"); }, o2.prototype.getMax = function() { return this.get("max"); }, o2.prototype.getStep = function() { return this.get("step"); }, o2.prototype.upUnit = function(t3, e3) { return void 0 === e3 && (e3 = {}), this._up({ unit: t3 }, e3); }, o2.prototype.initialize = function(t3, n3) { void 0 === t3 && (t3 = {}), void 0 === n3 && (n3 = {}), Yp.callParentInit(Yp, this, t3, n3); var o3 = this.get("unit"), r2 = this.getUnits(); this.input = (0, e2.hasWin)() ? new Sa({ model: this }) : void 0, r2.length && !o3 && this.set("unit", r2[0], { silent: true }), Yp.callInit(this, t3, n3); }, o2.prototype.__getClearProps = function() { return rf(rf({}, Yp.prototype.__getClearProps()), { unit: "" }); }, o2.prototype.parseValue = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = Yp.prototype.parseValue.apply(this, arguments), o3 = this.input.validateInputValue(n3.value, rf({ deepCheck: 1 }, e3)), r2 = o3.value, i2 = o3.unit; return n3.value = r2, n3.unit = i2, n3; }, o2.prototype.getFullValue = function() { var e3 = this.get("value"), n3 = this.get("unit"), o3 = (0, t2.isUndefined)(e3) ? "" : "".concat(e3), r2 = !(0, t2.isUndefined)(n3) && o3 ? n3 : "", i2 = "".concat(o3).concat(r2); return Yp.prototype.getFullValue.apply(this, [i2]); }, o2; }(Yp); var af = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), lf = function() { return lf = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, lf.apply(this, arguments); }; const cf = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return af(e3, t3), e3.prototype.defaults = function() { return lf(lf({}, sf.getDefaults()), { showInput: 1 }); }, e3; }(sf); var uf = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), pf = function() { return pf = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, pf.apply(this, arguments); }; const df = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return uf(e3, t3), e3.prototype.events = function() { return pf(pf({}, Ud.prototype.events()), { "change [type=range]": "inputValueChanged", "input [type=range]": "inputValueChangedSoft", change: "" }); }, e3.prototype.templateInput = function(t4) { var e4 = this.ppfx; return '\n
\n \n
\n '); }, e3.prototype.getSliderEl = function() { return this.slider || (this.slider = this.el.querySelector("input[type=range]")), this.slider; }, e3.prototype.inputValueChanged = function(t4) { t4.stopPropagation(), this.model.upValue(this.getSliderEl().value); }, e3.prototype.inputValueChangedSoft = function(t4) { t4.stopPropagation(), this.model.upValue(this.getSliderEl().value, { partial: true }); }, e3.prototype.setValue = function(t4) { var e4 = this.model, n2 = e4.parseValue(t4); this.getSliderEl().value = "" === t4 ? e4.getDefaultValue() : parseFloat(n2.value), Ud.prototype.setValue.apply(this, arguments); }, e3.prototype.onRender = function() { Ud.prototype.onRender.apply(this, arguments), this.model.get("showInput") || (this.inputInst.el.style.display = "none"); }, e3.prototype.clearCached = function() { Ud.prototype.clearCached.apply(this, arguments), delete this.slider; }, e3; }(Ud); const ff = u.FE.extend(Pl).extend({ extendViewApi: 1, init: function() { var t3 = this.opts, e3 = this.em, n2 = t3.module || (null == e3 ? void 0 : e3.get("StyleManager")); n2 && (n2.__listenAdd(this, n2.events.propertyAdd), n2.__listenRemove(this, n2.events.propertyRemove)); }, types: [{ id: "stack", model: gd, view: Vd, isType: function(t3) { if (t3 && "stack" == t3.type) return t3; } }, { id: "composite", model: ed, view: Pd, isType: function(t3) { if (t3 && "composite" == t3.type) return t3; } }, { id: "file", model: Yp, view: zd, isType: function(t3) { if (t3 && "file" == t3.type) return t3; } }, { id: "color", model: Yp, view: $d, isType: function(t3) { if (t3 && "color" == t3.type) return t3; } }, { id: "select", model: Yd, view: Jd, isType: function(t3) { if (t3 && "select" == t3.type) return t3; } }, { id: "radio", model: tf, view: nf, isType: function(t3) { if (t3 && "radio" == t3.type) return t3; } }, { id: "slider", model: cf, view: df, isType: function(t3) { if (t3 && "slider" == t3.type) return t3; } }, { id: "integer", model: sf, view: Ud, isType: function(t3) { if (t3 && "integer" == t3.type) return t3; } }, { id: "number", model: sf, view: Ud, isType: function(t3) { if (t3 && "number" == t3.type) return t3; } }, { id: "base", model: Yp, view: xd, isType: function(t3) { return t3.type = "base", t3; } }] }); var hf = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), gf = function() { return gf = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, gf.apply(this, arguments); }, vf = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, yf = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }; const mf = function(e3) { function n2(n3, o2) { void 0 === o2 && (o2 = {}); var r2 = e3.call(this, n3) || this, i2 = o2.em; r2.em = i2; var s2 = n3 || {}, a2 = r2.buildProperties(s2.buildProps), l2 = r2.get("name") || "", c2 = []; !r2.get("id") && r2.set("id", l2.replace(/ /g, "_").toLowerCase()), c2 = (c2 = a2 ? r2.extendProperties(a2) : r2.get("properties").map(function(e4) { return (0, t2.isString)(e4) ? r2.buildProperties(e4)[0] : e4; }).filter(Boolean)).map(function(t3) { return r2.checkExtend(t3); }); var u2 = new ff(c2, { em: i2 }); return u2.sector = r2, r2.set("properties", u2), r2; } return hf(n2, e3), n2.prototype.defaults = function() { return { id: "", name: "", open: true, visible: true, extendBuilded: true, properties: [] }; }, Object.defineProperty(n2.prototype, "properties", { get: function() { return this.get("properties"); }, enumerable: false, configurable: true }), n2.prototype.getId = function() { return this.get("id"); }, n2.prototype.getName = function() { var t3, e4 = this.getId(); return (null === (t3 = this.em) || void 0 === t3 ? void 0 : t3.t("styleManager.sectors.".concat(e4))) || this.get("name"); }, n2.prototype.setName = function(t3) { return this.set("name", t3); }, n2.prototype.isOpen = function() { return !!this.get("open"); }, n2.prototype.setOpen = function(t3) { return this.set("open", t3); }, n2.prototype.isVisible = function() { return !!this.get("visible"); }, n2.prototype.getProperties = function(t3) { void 0 === t3 && (t3 = {}); var e4 = this.get("properties"); return (e4.models ? yf([], e4.models, true) : e4).filter(function(e5) { var n3 = true; (t3.withValue && (n3 = e5.hasValue({ noParent: true })), t3.withParentValue) && (n3 = !e5.hasValue({ noParent: true }) && e5.hasValue()); return n3; }); }, n2.prototype.getProperty = function(t3) { return this.getProperties().filter(function(e4) { return e4.get("id") === t3; })[0] || void 0; }, n2.prototype.addProperty = function(t3, e4) { return this.get("properties").add(this.checkExtend(t3), e4); }, n2.prototype.extendProperties = function(e4, n3, o2) { void 0 === o2 && (o2 = false); for (var r2 = e4.length, i2 = n3 || this.get("properties"), s2 = this.get("extendBuilded"), a2 = [], l2 = 0, c2 = i2.length; l2 < c2; l2++) { for (var u2 = i2[l2], p2 = 0, d2 = 0; d2 < r2; d2++) { var f2 = e4[d2]; if (u2.property != f2.property && u2.id != f2.property) ; else { var h2 = u2.properties; h2 && h2.length && (u2.properties = this.extendProperties(f2.properties || [], h2, 1)), e4[d2] = s2 ? (0, t2.extend)(f2, u2) : u2, a2[d2] = e4[d2], p2 = 1; } } p2 || (e4.push(u2), a2.push(u2)); } return o2 ? a2.filter(function(t3) { return t3; }) : e4; }, n2.prototype.checkExtend = function(e4) { var n3 = ((0, t2.isString)(e4) ? { extend: e4 } : e4) || {}, o2 = n3.extend, r2 = vf(n3, ["extend"]); return o2 ? gf(gf({}, this.buildProperties([o2])[0] || {}), r2) : e4; }, n2.prototype.buildProperties = function(t3) { var e4, n3 = t3 || []; if (!n3.length) return []; var o2 = null === (e4 = this.em) || void 0 === e4 ? void 0 : e4.get("StyleManager").builtIn; return null == o2 ? void 0 : o2.build(n3); }, n2; }(u.Hn); var bf = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), _f = function() { return _f = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, _f.apply(this, arguments); }; const wf = function(t3) { function e3() { return null !== t3 && t3.apply(this, arguments) || this; } return bf(e3, t3), e3.prototype.initialize = function(t4, e4) { void 0 === e4 && (e4 = {}); var n2 = e4.module, o2 = e4.em; this.em = o2, this.module = n2, this.listenTo(this, "reset", this.onReset); }, e3.prototype.model = function(t4, e4) { void 0 === e4 && (e4 = {}); var n2 = e4.collection.em; return new mf(t4, _f(_f({}, e4), { em: n2 })); }, e3.prototype.onReset = function(t4, e4) { void 0 === e4 && (e4 = {}), (e4.previousModels || []).forEach(function(t5) { return t5.get("properties").reset(); }); }, e3; }(u.FE); var xf = function() { return xf = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, xf.apply(this, arguments); }, Cf = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, Sf = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Of = function(t3) { return t3.map(function(t4) { return { id: t4 }; }); }, Tf = function() { function e3() { 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 t3 = ", sans-serif", e4 = ["flex-start", "flex-end", "center"], n2 = Sf(Sf([], e4, true), ["baseline", "stretch"], false); this.optsBgSize = Of(["auto", "cover", "contain"]), this.optsBgAttach = Of(["scroll", "fixed", "local"]), this.optsBgRepeat = Of(["repeat", "repeat-x", "repeat-y", "no-repeat"]), this.optsWrap = Of(["nowrap", "wrap", "wrap-reverse"]), this.optsOverflow = Of(["visible", "hidden", "scroll", "auto"]), this.optsDir = Of(["row", "row-reverse", "column", "column-reverse"]), this.opstDisplay = Of(["block", "inline", "inline-block", "flex", "none"]), this.optsTransitFn = Of(["linear", "ease", "ease-in", "ease-out", "ease-in-out"]), this.optsCursor = Of(["auto", "pointer", "copy", "crosshair", "grab", "grabbing", "help", "move", "text"]), this.optsFloat = Of(["none", "left", "right"]), this.optsPos = Of(["static", "relative", "absolute", "fixed"]), this.optsTextAlign = Of(["left", "center", "right", "justify"]), this.optsFlexAlign = Of(n2), this.optsJustCont = Of(Sf(Sf([], e4, true), ["space-between", "space-around", "space-evenly"], false)), this.optsAlignCont = Of(Sf(Sf([], e4, true), ["space-between", "space-around", "stretch"], false)), this.optsAlignSelf = Of(Sf(["auto"], n2, true)), this.optsTransitProp = Of(["all", "width", "height", "background-color", "transform", "box-shadow", "opacity"]), this.optsBorderStyle = Of(["none", "solid", "dotted", "dashed", "double", "groove", "ridge", "inset", "outset"]), this.optsBgPos = Of(["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" + t3, "Arial Black, Gadget" + t3, "Brush Script MT" + t3, "Comic Sans MS, cursive" + t3, "Courier New, Courier, monospace", "Georgia, serif", "Helvetica" + t3, "Impact, Charcoal" + t3, "Lucida Sans Unicode, Lucida Grande" + t3, "Tahoma, Geneva" + t3, "Times New Roman, Times, serif", "Trebuchet MS, Helvetica" + t3, "Verdana, Geneva" + t3].map(function(t4) { return { id: t4, label: t4.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 e3.prototype.__sub = function(e4) { var n2 = this; return function() { return e4.map(function(e5) { if ((0, t2.isString)(e5)) return n2.get(e5); var o2 = e5.extend, r2 = Cf(e5, ["extend"]); return xf(xf({}, n2.get(o2)), r2); }); }; }, e3.prototype.init = function() { var t3 = this, e4 = this, n2 = e4.fixedValues, o2 = e4.requireFlex, r2 = e4.typeNumber; this.props = {}; var i2 = [["text-shadow-h", { type: r2, default: "0", units: this.unitsSizeNoPerc }], ["top", { default: "auto", units: this.unitsSize, fixedValues: n2 }, "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: o2 }, "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: r2, default: "0", requiresParent: o2 }], ["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: true }], ["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: o2 }, "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: o2 }, "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: true, layerLabel: function(t4, e5) { var n3 = e5.values, o3 = n3["box-shadow-h"], r3 = n3["box-shadow-v"], i3 = n3["box-shadow-blur"], s2 = n3["box-shadow-spread"]; return "".concat(o3, " ").concat(r3, " ").concat(i3, " ").concat(s2); }, 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(t4, e5) { var n3 = e5.values, o3 = n3["text-shadow-h"], r3 = n3["text-shadow-v"], i3 = n3["text-shadow-blur"]; return "".concat(o3, " ").concat(r3, " ").concat(i3); }, properties: this.__sub(["text-shadow-h", "text-shadow-v", "text-shadow-blur", "text-shadow-color"]) }, "box-shadow"], ["background", { detached: true, layerLabel: function(t4, e5) { var n3 = e5.values; return [n3["background-repeat-sub"] || "", n3["background-position-sub"] || "", n3["background-attachment-sub"] || "", n3["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(t4, e5) { var n3 = e5.property, o3 = t4[e5.name] || "", r3 = n3.getLayerSeparator(); return o3 ? o3.split(r3).map(function(t5) { var e6 = n3.__parseFn(t5); return { "transform-type": e6.name, "transform-value": e6.value }; }) : []; }, toStyle: function(t4, e5) { var n3; return (n3 = {})[e5.name] = "".concat(t4["transform-type"], "(").concat(t4["transform-value"], ")"), n3; }, properties: [{ property: "transform-type", name: "Type", type: this.typeSelect, default: "rotateZ", full: true, 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(t4) { var e5 = t4.property; if (t4.to.value) { var n3 = e5.getOption(), o3 = xf({}, n3.propValue || {}), r3 = e5.getParent().getProperty("transform-value"), i3 = r3.getUnit(); (!i3 || (null == o3 ? void 0 : o3.units.indexOf(i3)) < 0) && (o3.unit = (null == o3 ? void 0 : o3.units[0]) || ""), r3.up(o3); } } }, { property: "transform-value", type: this.typeNumber, default: "0", full: true }] }]]; return i2.forEach(function(e5) { var n3 = e5[0], o3 = e5[1], r3 = e5[2]; t3.add(n3, o3 || {}, { from: r3 }); }), this; }, e3.prototype.add = function(e4, n2, o2) { void 0 === n2 && (n2 = {}), void 0 === o2 && (o2 = {}); var r2 = o2.from || "", i2 = this.props[r2 || e4] || {}, s2 = xf(xf(xf({}, i2), { property: e4 }), n2); return s2.properties && (0, t2.isFunction)(s2.properties) && (s2.properties = s2.properties()), this.props[e4] = s2, s2; }, e3.prototype.get = function(t3) { return this.props[t3]; }, e3.prototype.build = function(e4) { var n2 = this, o2 = []; return ((0, t2.isString)(e4) ? [e4] : e4).forEach(function(t3) { o2.push(n2.get(t3) || { property: t3 }); }), o2; }, e3; }(); const kf = Tf; var Pf = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ef = function(t3, e3) { return Object.defineProperty ? Object.defineProperty(t3, "raw", { value: e3 }) : t3.raw = e3, t3; }, Af = function(t3) { function e3(e4) { var n2 = t3.call(this, e4) || this, o2 = e4.config || {}, r2 = n2.model, i2 = o2.em; return n2.config = o2, n2.em = i2, n2.pfx = o2.stylePrefix || "", n2.listenTo(r2, "destroy remove", n2.remove), n2.listenTo(r2, "change:open", n2.updateOpen), n2.listenTo(r2, "change:visible", n2.updateVisibility), n2; } return Pf(e3, t3), e3.prototype.template = function(t4) { var e4, n2 = t4.pfx, o2 = t4.label, i2 = null === (e4 = this.em) || void 0 === e4 ? void 0 : e4.getConfig().icons, s2 = (null == i2 ? void 0 : i2.caret) || "", a2 = "".concat(n2, "sector-"); return r(Mf || (Mf = Ef(['\n
\n
$', '
\n
', "
\n
\n "], ['\n
\n
$', '
\n
', "
\n
\n "])), a2, a2, s2, a2, o2); }, e3.prototype.events = function() { return { "click [data-sector-title]": "toggle" }; }, e3.prototype.updateOpen = function() { var t4 = this, e4 = t4.$el, n2 = t4.model, o2 = t4.pfx, r2 = n2.isOpen(); e4[r2 ? "addClass" : "removeClass"]("".concat(o2, "open")), this.getPropertiesEl().style.display = r2 ? "" : "none"; }, e3.prototype.updateVisibility = function() { this.el.style.display = this.model.isVisible() ? "" : "none"; }, e3.prototype.getPropertiesEl = function() { var t4 = this.$el, e4 = this.pfx; return t4.find(".".concat(e4, "properties")).get(0); }, e3.prototype.toggle = function() { var t4 = this.model; t4.setOpen(!t4.get("open")); }, e3.prototype.renderProperties = function() { var t4 = this.model, e4 = this.config, n2 = t4.get("properties"); if (n2) { var o2 = new Od({ collection: n2, config: e4 }); this.$el.append(o2.render().el); } }, e3.prototype.render = function() { var t4 = this, e4 = t4.pfx, n2 = t4.model, o2 = t4.$el, r2 = n2.getId(), i2 = n2.getName(); return o2.html(this.template({ pfx: e4, label: i2 })), this.renderProperties(), o2.attr("class", "".concat(e4, "sector ").concat(e4, "sector__").concat(r2, " no-select")), this.updateOpen(), this; }, e3; }(u.G7); const jf = Af; var Mf, Lf = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Df = function(t3) { function e3(e4) { void 0 === e4 && (e4 = {}); var n2 = t3.call(this, e4) || this, o2 = e4.module, r2 = e4.config, i2 = n2.collection; return n2.pfx = (null == r2 ? void 0 : r2.stylePrefix) || "", n2.ppfx = (null == r2 ? void 0 : r2.pStylePrefix) || "", n2.config = r2, n2.module = o2, n2.listenTo(i2, "add", n2.addTo), n2.listenTo(i2, "reset", n2.render), n2; } return Lf(e3, t3), e3.prototype.remove = function() { var t4 = this; return u.G7.prototype.remove.apply(this, arguments), ["config", "module", "em"].forEach(function(e4) { return t4[e4] = {}; }), this; }, e3.prototype.addTo = function(t4, e4, n2) { void 0 === n2 && (n2 = {}), this.addToCollection(t4, null, n2); }, e3.prototype.addToCollection = function(t4, e4, n2) { void 0 === n2 && (n2 = {}); var o2 = this.config, r2 = this.el, i2 = e4 || r2, s2 = new jf({ model: t4, config: o2 }).render().el; return (0, Et.$Q)(i2, s2, n2.at), s2; }, e3.prototype.render = function() { var t4 = this, e4 = this, n2 = e4.$el, o2 = e4.pfx, r2 = e4.ppfx; n2.empty(); var i2 = document.createDocumentFragment(); return this.collection.each(function(e5) { return t4.addToCollection(e5, i2); }), n2.append(i2), n2.addClass("".concat(o2, "sectors ").concat(r2, "one-bg ").concat(r2, "two-color")), this; }, e3; }(u.G7); const Nf = Df; var If = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), Ff = function() { return Ff = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, Ff.apply(this, arguments); }, Vf = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }, Rf = "style", Hf = "".concat(Rf, ":"), zf = "".concat(Hf, "sector"), Bf = "".concat(zf, ":add"), Uf = "".concat(zf, ":remove"), Wf = "".concat(zf, ":update"), $f = "".concat(Hf, "property"), qf = "".concat($f, ":add"), Gf = "".concat($f, ":remove"), Kf = "".concat($f, ":update"), Yf = "".concat(Hf, "layer:select"), Xf = "".concat(Hf, "target"), Jf = "".concat(Hf, "custom"), Zf = function(t3) { return t3 || 0 === t3; }, Qf = { all: Rf, sectorAdd: Bf, sectorRemove: Uf, sectorUpdate: Wf, propertyAdd: qf, propertyRemove: Gf, propertyUpdate: Kf, layerSelect: Yf, target: Xf, custom: Jf }, th = function(n2) { function o2(e3) { var o3 = n2.call(this, e3, "StyleManager", new wf([], { em: e3 }), Qf, Up) || this; o3.Sector = mf, o3.storageKey = "", (0, t2.bindAll)(o3, "__clearStateTarget"); var r2 = o3.config, i2 = r2.pStylePrefix; i2 && (r2.stylePrefix = i2 + r2.stylePrefix), o3.builtIn = new kf(), o3.properties = new ff([], { em: e3, module: o3 }), o3.sectors = o3.all; var s2 = new u.Hn({ targets: [] }); o3.model = s2; o3.upAll = (0, t2.debounce)(function() { return o3.__upSel(); }, 0), s2.listenTo(e3, "component:toggled component:update:classes change:state change:device frame:resized selector:type", o3.upAll), s2.listenTo(e3, "component:toggled", o3.__clearStateTarget); var a2 = (0, t2.debounce)(function() { o3.__upProps(), o3.__trgCustom(); }, 0); s2.listenTo(e3, "styleable:change undo redo", a2); var l2 = (0, t2.debounce)(function() { return o3.__trgCustom(); }, 0); return s2.listenTo(e3, "".concat(Yf, " ").concat(Xf), l2), s2.on("change:lastTarget", function() { return e3.trigger(Xf, o3.getSelected()); }), o3; } return If(o2, n2), o2.prototype.__upSel = function() { this.select(this.em.getSelectedAll()); }, o2.prototype.__trgCustom = function(t3) { void 0 === t3 && (t3 = {}), this.__ctn = this.__ctn || t3.container, this.em.trigger(this.events.custom, { container: this.__ctn }); }, o2.prototype.__trgEv = function(t3) { for (var e3, n3 = [], o3 = 1; o3 < arguments.length; o3++) n3[o3 - 1] = arguments[o3]; (e3 = this.em).trigger.apply(e3, Vf([t3], n3, false)); }, o2.prototype.__clearStateTarget = function() { var t3 = this, e3 = this.em, n3 = this.__getStateTarget(); n3 && (null == e3 || e3.skip(function() { e3.Css.remove(n3), t3.model.set({ stateTarget: null }); })); }, o2.prototype.onLoad = function() { this.sectors.add(this.config.sectors, { silent: true }); }, o2.prototype.postRender = function() { this.__appendTo(); }, o2.prototype.addSector = function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.getSector(t3); return o3 || (e3.id = t3, o3 = this.sectors.add(e3, n3)), o3; }, o2.prototype.getSector = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.sectors.where({ id: t3 })[0]; return !n3 && e3.warn && this._logNoSector(t3), n3 || null; }, o2.prototype.getSectors = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.sectors, n3 = e3 && e3.models ? t3.array ? Vf([], e3.models, true) : e3 : []; return t3.visible ? n3.filter(function(t4) { return t4.isVisible(); }) : n3; }, o2.prototype.removeSector = function(t3) { return this.getSectors().remove(this.getSector(t3, { warn: true })); }, o2.prototype.addProperty = function(t3, e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.getSector(t3, { warn: true }), r2 = null; return o3 && (r2 = o3.addProperty(e3, n3)), r2; }, o2.prototype.getProperty = function(t3, e3) { var n3, o3 = this.getSector(t3, { warn: true }); return o3 && (n3 = o3.properties.filter(function(t4) { return t4.get("property") === e3 || t4.get("id") === e3; })[0]), n3; }, o2.prototype.getProperties = function(t3) { var e3, n3 = this.getSector(t3, { warn: true }); return n3 && (e3 = n3.properties), e3; }, o2.prototype.removeProperty = function(t3, e3) { var n3 = this.getProperties(t3); return n3 ? n3.remove(this.getProperty(t3, e3)) : null; }, o2.prototype.select = function(n3, o3) { var r2 = this; void 0 === o3 && (o3 = {}); var i2 = this.em, s2 = (0, t2.isArray)(n3) ? n3 : [n3], a2 = o3.stylable, l2 = i2.Css, c2 = []; s2.filter(Boolean).forEach(function(e3) { var n4 = e3; if ((0, t2.isString)(e3)) { var o4 = l2.getRule(e3) || l2.setRule(e3); !(0, t2.isUndefined)(a2) && o4.set({ stylable: a2 }), n4 = o4; } c2.push(n4); }); var u2 = o3.component || c2.filter(function(t3) { return (0, e2.isComponent)(t3); }).reverse()[0]; c2 = c2.map(function(t3) { return r2.getModelToStyle(t3); }); var p2 = i2.getState(), d2 = c2.slice().reverse()[0], f2 = this.getParentRules(d2, { state: p2, component: u2 }), h2 = this.__getStateTarget(); return i2.skip(function() { var t3; if (p2 && (null === (t3 = null == d2 ? void 0 : d2.getState) || void 0 === t3 ? void 0 : t3.call(d2))) { var e3 = d2.getStyle(); h2 ? h2.setStyle(e3) : h2 = l2.getAll().add({ selectors: "gjs-selected", style: e3, shallow: true, important: true }); } else h2 && (l2.remove(h2), h2 = void 0); }), this.model.set({ targets: c2, lastTarget: d2, lastTargetParents: f2, stateTarget: h2, component: u2 }), this.__upProps(o3), c2; }, o2.prototype.getSelected = function() { return this.model.get("lastTarget") || null; }, o2.prototype.getSelectedAll = function() { return this.model.get("targets"); }, o2.prototype.getSelectedParents = function() { return this.model.get("lastTargetParents") || []; }, o2.prototype.__getStateTarget = function() { return this.model.get("stateTarget"); }, o2.prototype.addStyleTargets = function(t3, e3) { this.getSelectedAll().map(function(n4) { return n4.addStyle(t3, e3); }); var n3 = this.getSelected(); n3 && this.__emitCmpStyleUpdate(t3); var o3 = this.__getStateTarget(); n3 && (null == o3 || o3.setStyle(n3.getStyle(), e3)); }, o2.prototype.getBuiltIn = function(t3) { return this.builtIn.get(t3); }, o2.prototype.getBuiltInAll = function() { return this.builtIn.props; }, o2.prototype.addBuiltIn = function(t3, e3) { return this.builtIn.add(t3, e3); }, o2.prototype.getModelToStyle = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.em, o3 = e3.skipAdd; if (n3 && (null == t3 ? void 0 : t3.toHTML)) { var r2 = n3.getConfig(), i2 = n3.UndoManager, s2 = n3.Css, a2 = n3.Selectors, l2 = a2 ? a2.getConfig() : {}, c2 = r2.devicePreviewMode ? "" : n3.get("state"), u2 = t3.get("classes").getStyleable(), p2 = u2.length, d2 = !l2.componentFirst || e3.useClasses, f2 = { noCount: 1 }, h2 = { state: c2, addOpts: f2 }, g2 = void 0; if (i2.stop(), p2 && d2) { var v2 = n3.getCurrentMedia(); (g2 = s2.get(u2, c2, v2)) || o3 || (g2 = s2.add(u2, c2, v2, {}, f2)); } else if (r2.avoidInlineStyle) { var y2 = t3.getId(); !(g2 = s2.getIdRule(y2, h2)) && !o3 && (g2 = s2.setIdRule(y2, {}, h2)), t3.is("wrapper") && g2.set("wrapper", 1, f2); } g2 && (t3 = g2), i2.start(); } return t3; }, o2.prototype.getParentRules = function(e3, n3) { var o3 = void 0 === n3 ? {} : n3, r2 = o3.state, i2 = o3.component, s2 = this.em, a2 = []; if (s2 && e3) { var l2 = i2, c2 = s2.Css, u2 = s2.CodeManager.getGenerator("css"), p2 = e3.toHTML ? e3 : e3.getComponent(), d2 = { combination: true, array: true }, f2 = [], h2 = [], g2 = []; p2 ? (f2 = c2.getRules("#".concat(p2.getId())), g2 = (h2 = l2 ? c2.getRules(l2.getSelectors().getFullName(d2)) : []).concat(f2)) : (f2 = l2 ? c2.getRules("#".concat(l2.getId())) : [], h2 = c2.getRules(e3.getSelectors().getFullName(d2)), g2 = f2.concat(h2)); var v2 = g2.filter(function(e4) { return (0, t2.isUndefined)(r2) ? 1 : e4.get("state") === r2; }).sort(u2.sortRules).reverse(); a2 = v2.slice(v2.indexOf(e3) + 1); } return a2; }, o2.prototype.addType = function(t3, e3) { this.properties.addType(t3, e3); }, o2.prototype.getType = function(t3) { return this.properties.getType(t3); }, o2.prototype.getTypes = function() { return this.properties.getTypes(); }, o2.prototype.createType = function(t3, e3) { var n3 = void 0 === e3 ? {} : e3, o3 = n3.model, r2 = void 0 === o3 ? {} : o3, i2 = n3.view, s2 = void 0 === i2 ? {} : i2, a2 = this.config, l2 = this.getType(t3); if (l2) return new l2.view(Ff({ model: new l2.model(r2), config: a2 }, s2)); }, o2.prototype.render = function() { var t3 = this, e3 = t3.config, n3 = t3.em, o3 = t3.SectView, r2 = o3 && o3.el; return this.SectView = new Nf({ el: r2, em: n3, config: e3, module: this, collection: this.sectors }), this.SectView.render().el; }, o2.prototype._logNoSector = function(t3) { var e3 = this.em; e3 && e3.logWarning("'".concat(t3, "' sector not found")); }, o2.prototype.__emitCmpStyleUpdate = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.em, o3 = "component:styleUpdate"; if (!t3.__p) { var r2 = e3.components || n3.getSelectedAll(), i2 = Array.isArray(r2) ? r2 : [r2], s2 = Ff({}, t3); delete s2.__p; var a2 = Object.keys(s2), l2 = { style: s2 }; i2.forEach(function(t4) { n3.trigger(o3, t4, l2), a2.forEach(function(e4) { return n3.trigger("".concat(o3, ":").concat(e4), t4, l2); }); }); } }, o2.prototype.__upProps = function(t3) { var e3 = this; void 0 === t3 && (t3 = {}); var n3 = this.getSelected(); if (n3) { var o3 = this.sectors, r2 = this.model.get("component"), i2 = this.getSelectedParents(), s2 = n3.getStyle(), a2 = i2.map(function(t4) { return { target: t4, style: t4.getStyle() }; }); o3.map(function(n4) { n4.getProperties().map(function(n5) { e3.__upProp(n5, s2, a2, t3); }); }), o3.forEach(function(t4) { var e4 = t4.getProperties(); e4.forEach(function(t5) { var e5 = t5.__checkVisibility({ target: n3, component: r2, sectors: o3 }); t5.set("visible", e5); }); var i3 = e4.some(function(t5) { return t5.isVisible(); }); t4.set("visible", i3); }); } }, o2.prototype.__upProp = function(t3, e3, n3, o3) { var r2 = this, i2 = t3.getName(), s2 = e3[i2], a2 = Zf(s2), l2 = "stack" === t3.getType(), c2 = "composite" === t3.getType(), u2 = Ff(Ff({}, o3), { __up: true }), p2 = !c2 && !l2, d2 = l2 ? t3.__getLayersFromStyle(e3) : [], f2 = c2 ? t3.__getPropsFromStyle(e3) : {}, h2 = a2 ? s2 : null, g2 = null; if (l2 && null === d2 || c2 && null === f2) { var v2 = l2 ? "__getLayersFromStyle" : "__getPropsFromStyle"; if (m2 = n3.filter(function(e4) { return null !== t3[v2](e4.style); })[0]) { h2 = m2.style[i2], g2 = m2.target; var y2 = t3[v2](m2.style); l2 ? d2 = y2 : f2 = y2; } } else if (!a2) { var m2; h2 = null, (m2 = n3.filter(function(t4) { return Zf(t4.style[i2]); })[0]) && (h2 = m2.style[i2], g2 = m2.target); } if (t3.__setParentTarget(g2), p2 && t3.__getFullValue() !== h2 && t3.upValue(h2, u2), l2 && t3.__setLayers(d2 || []), c2) { var b2 = t3.getProperties(); if (t3.isDetached()) { var _2 = t3.__getPropsFromStyle(e3, { byName: true }) || {}, w2 = n3.map(function(e4) { return Ff(Ff({}, e4), { style: t3.__getPropsFromStyle(e4.style, { byName: true }) || {} }); }); b2.map(function(t4) { return r2.__upProp(t4, _2, w2, o3); }); } else t3.__setProperties(f2 || {}, u2), t3.getProperties().map(function(t4) { return t4.__setParentTarget(g2); }); } }, o2.prototype.destroy = function() { var t3; [this.properties, this.sectors].forEach(function(t4) { t4.reset(), t4.stopListening(); }), null === (t3 = this.SectView) || void 0 === t3 || t3.remove(), this.model.stopListening(), this.upAll.cancel(); }, o2; }(b); const eh = th; var nh = function() { var t3 = function(e3, n2) { return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) { t4.__proto__ = e4; } || function(t4, e4) { for (var n3 in e4) Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]); }, t3(e3, n2); }; return function(e3, n2) { if ("function" != typeof n2 && null !== n2) throw new TypeError("Class extends value " + String(n2) + " is not a constructor or null"); function o2() { this.constructor = e3; } t3(e3, n2), e3.prototype = null === n2 ? Object.create(n2) : (o2.prototype = n2.prototype, new o2()); }; }(), oh = function() { return oh = Object.assign || function(t3) { for (var e3, n2 = 1, o2 = arguments.length; n2 < o2; n2++) for (var r2 in e3 = arguments[n2]) Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]); return t3; }, oh.apply(this, arguments); }, rh = function(t3, e3, n2, o2) { return new (n2 || (n2 = Promise))(function(r2, i2) { function s2(t4) { try { l2(o2.next(t4)); } catch (t5) { i2(t5); } } function a2(t4) { try { l2(o2["throw"](t4)); } catch (t5) { i2(t5); } } function l2(t4) { var e4; t4.done ? r2(t4.value) : (e4 = t4.value, e4 instanceof n2 ? e4 : new n2(function(t5) { t5(e4); })).then(s2, a2); } l2((o2 = o2.apply(t3, e3 || [])).next()); }); }, ih = function(t3, e3) { var n2, o2, r2, i2, s2 = { label: 0, sent: function() { if (1 & r2[0]) throw r2[1]; return r2[1]; }, trys: [], ops: [] }; return i2 = { next: a2(0), throw: a2(1), return: a2(2) }, "function" == typeof Symbol && (i2[Symbol.iterator] = function() { return this; }), i2; function a2(a3) { return function(l2) { return function(a4) { if (n2) throw new TypeError("Generator is already executing."); for (; i2 && (i2 = 0, a4[0] && (s2 = 0)), s2; ) try { if (n2 = 1, o2 && (r2 = 2 & a4[0] ? o2["return"] : a4[0] ? o2["throw"] || ((r2 = o2["return"]) && r2.call(o2), 0) : o2.next) && !(r2 = r2.call(o2, a4[1])).done) return r2; switch (o2 = 0, r2 && (a4 = [2 & a4[0], r2.value]), a4[0]) { case 0: case 1: r2 = a4; break; case 4: return s2.label++, { value: a4[1], done: false }; case 5: s2.label++, o2 = a4[1], a4 = [0]; continue; case 7: a4 = s2.ops.pop(), s2.trys.pop(); continue; default: if (!(r2 = s2.trys, (r2 = r2.length > 0 && r2[r2.length - 1]) || 6 !== a4[0] && 2 !== a4[0])) { s2 = 0; continue; } if (3 === a4[0] && (!r2 || a4[1] > r2[0] && a4[1] < r2[3])) { s2.label = a4[1]; break; } if (6 === a4[0] && s2.label < r2[1]) { s2.label = r2[1], r2 = a4; break; } if (r2 && s2.label < r2[2]) { s2.label = r2[2], s2.ops.push(a4); break; } r2[2] && s2.ops.pop(), s2.trys.pop(); continue; } a4 = e3.call(t3, s2); } catch (t4) { a4 = [6, t4], o2 = 0; } finally { n2 = r2 = 0; } if (5 & a4[0]) throw a4[1]; return { value: a4[0] ? a4[1] : void 0, done: true }; }([a3, l2]); }; } }, sh = function(t3, e3) { var n2 = {}; for (var o2 in t3) Object.prototype.hasOwnProperty.call(t3, o2) && e3.indexOf(o2) < 0 && (n2[o2] = t3[o2]); if (null != t3 && "function" == typeof Object.getOwnPropertySymbols) { var r2 = 0; for (o2 = Object.getOwnPropertySymbols(t3); r2 < o2.length; r2++) e3.indexOf(o2[r2]) < 0 && Object.prototype.propertyIsEnumerable.call(t3, o2[r2]) && (n2[o2[r2]] = t3[o2[r2]]); } return n2; }, ah = function(t3, e3, n2) { if (n2 || 2 === arguments.length) for (var o2, r2 = 0, i2 = e3.length; r2 < i2; r2++) !o2 && r2 in e3 || (o2 || (o2 = Array.prototype.slice.call(e3, 0, r2)), o2[r2] = e3[r2]); return t3.concat(o2 || Array.prototype.slice.call(e3)); }; a().$ = l["default"]; var lh = [Cc, dc, Kc, hp, ia, Ct, xs, eh, ls, nu, rp, Nu, Dp, Ua, cl, ce, Bp, ki], ch = [ac, qr, tt, kr]; !function(e3) { var n2 = e3.$; if (n2 && n2.prototype && "jQuery" !== n2.prototype.constructor.name) { var o2 = n2.fn; o2.hide = function() { return this.css("display", "none"); }, o2.show = function() { return this.css("display", "block"); }, o2.focus = function() { var t3 = this.get(0); return t3 && t3.focus(), this; }, o2.bind = function(t3, e4) { return this.on(t3, e4); }, o2.unbind = function(e4, n3) { if ((0, t2.isObject)(e4)) { for (var o3 in e4) e4.hasOwnProperty(o3) && this.off(o3, e4[o3]); return this; } return this.off(e4, n3); }, o2.click = function(t3) { return t3 ? this.on("click", t3) : this.trigger("click"); }, o2.change = function(t3) { return t3 ? this.on("change", t3) : this.trigger("change"); }, o2.keydown = function(t3) { return t3 ? this.on("keydown", t3) : this.trigger("keydown"); }, o2.delegate = function(t3, e4, n3, o3) { return o3 || (o3 = n3), this.on(e4, t3, function(t4) { t4.data = n3, o3(t4); }); }, o2.scrollLeft = function() { var t3 = this.get(0), e4 = (t3 = 9 == t3.nodeType ? t3.defaultView : t3) instanceof Window ? t3 : null; return e4 ? e4.pageXOffset : t3.scrollLeft || 0; }, o2.scrollTop = function() { var t3 = this.get(0), e4 = (t3 = 9 == t3.nodeType ? t3.defaultView : t3) instanceof Window ? t3 : null; return e4 ? e4.pageYOffset : t3.scrollTop || 0; }; var r2 = n2.prototype.offset; o2.offset = function(t3) { var e4, n3; return t3 && (e4 = t3.top, n3 = t3.left), void 0 !== e4 && this.css("top", "".concat(e4, "px")), void 0 !== n3 && this.css("left", "".concat(n3, "px")), r2.call(this); }, n2.map = function(t3, e4) { for (var n3 = [], o3 = 0; o3 < t3.length; o3++) n3.push(e4(t3[o3], o3)); return n3; }; var i2 = Array.prototype.indexOf; n2.inArray = function(t3, e4, n3) { return null == e4 ? -1 : i2.call(e4, t3, n3); }, n2.Event = function(t3, e4) { if (!(this instanceof n2.Event)) return new n2.Event(t3, e4); this.type = t3, this.isDefaultPrevented = function() { return false; }; }; } }({ $: l["default"] }); var uh = { debug: console.log, info: console.info, warning: console.warn, error: console.error }, ph = function(n2) { function o2(e3) { void 0 === e3 && (e3 = {}); var o3 = n2.call(this) || this; o3.__skip = false, o3.defaultRunning = false, o3.destroyed = false, o3._config = e3; var r2 = o3.config; o3.set("Config", e3), o3.set("modules", []), o3.set("toLoad", []), o3.set("storables", []), o3.set("selected", new f()), o3.set("dmode", r2.dragMode); var i2 = r2.el, s2 = r2.log, a2 = true === s2 ? (0, t2.keys)(uh) : (0, t2.isArray)(s2) ? s2 : []; return (0, t2.bindAll)(o3, "initBaseColorPicker"), i2 && r2.fromElement && (r2.components = i2.innerHTML), o3.attrsOrig = i2 ? (0, t2.toArray)(i2.attributes).reduce(function(t3, e4) { return t3[e4.nodeName] = e4.nodeValue, t3; }, {}) : "", r2.components && !r2.pageManager && (r2.pageManager = { pages: [{ component: r2.components }] }), lh.forEach(function(t3) { return o3.loadModule(t3); }), ch.forEach(function(t3) { return o3.loadStorableModule(t3); }), o3.on("change:componentHovered", o3.componentHovered, o3), o3.on("change:changesCount", o3.updateChanges, o3), o3.on("change:readyLoad change:readyCanvas", o3._checkReady, o3), a2.forEach(function(t3) { return o3.listenLog(t3); }), [{ from: "change:selectedComponent", to: "component:toggled" }].forEach(function(t3) { var e4 = t3.from, n3 = t3.to; o3.listenTo(o3, e4, function() { for (var t4 = [], r3 = 0; r3 < arguments.length; r3++) t4[r3] = arguments[r3]; o3.trigger.apply(o3, ah([n3], t4, false)), o3.logWarning("The event '".concat(e4, "' is deprecated, replace it with '").concat(n3, "'")); }); }), o3; } return nh(o2, n2), o2.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(o2.prototype, "storables", { get: function() { return this.get("storables"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "modules", { get: function() { return this.get("modules"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "toLoad", { get: function() { return this.get("toLoad"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "selected", { get: function() { return this.get("selected"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "shallow", { get: function() { return this.get("shallow"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "I18n", { get: function() { return this.get("I18n"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Utils", { get: function() { return this.get("Utils"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Commands", { get: function() { return this.get("Commands"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Keymaps", { get: function() { return this.get("Keymaps"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Modal", { get: function() { return this.get("Modal"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Panels", { get: function() { return this.get("Panels"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "CodeManager", { get: function() { return this.get("CodeManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "UndoManager", { get: function() { return this.get("UndoManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "RichTextEditor", { get: function() { return this.get("RichTextEditor"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Canvas", { get: function() { return this.get("Canvas"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Editor", { get: function() { return this.get("Editor"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Components", { get: function() { return this.get("DomComponents"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Css", { get: function() { return this.get("CssComposer"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Blocks", { get: function() { return this.get("BlockManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Selectors", { get: function() { return this.get("SelectorManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Storage", { get: function() { return this.get("StorageManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Traits", { get: function() { return this.get("TraitManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Parser", { get: function() { return this.get("Parser"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Layers", { get: function() { return this.get("LayerManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Assets", { get: function() { return this.get("AssetManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Devices", { get: function() { return this.get("DeviceManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Pages", { get: function() { return this.get("PageManager"); }, enumerable: false, configurable: true }), Object.defineProperty(o2.prototype, "Styles", { get: function() { return this.get("StyleManager"); }, enumerable: false, configurable: true }), o2.prototype._checkReady = function() { this.get("readyLoad") && this.get("readyCanvas") && !this.get("ready") && this.set("ready", true); }, o2.prototype.getContainer = function() { return this.config.el; }, o2.prototype.listenLog = function(t3) { this.listenTo(this, "log:".concat(t3), uh[t3]); }, Object.defineProperty(o2.prototype, "config", { get: function() { return this._config; }, enumerable: false, configurable: true }), o2.prototype.getConfig = function(e3) { var n3 = this.config; return (0, t2.isUndefined)(e3) ? n3 : n3[e3]; }, o2.prototype.loadOnStart = function() { var t3 = this, e3 = this.config, n3 = e3.projectData, r2 = e3.headless, i2 = this.get("StorageManager"); this.toLoad.reverse().forEach(function(t4) { return t4.onLoad(); }); var s2 = function() { t3.modules.forEach(function(e4) { return e4.postLoad && e4.postLoad(t3); }), t3.set("readyLoad", 1); }; r2 ? (n3 && this.loadData(n3), s2()) : this._storageTimeout = setTimeout(function() { return rh(t3, void 0, void 0, function() { var t4; return ih(this, function(e4) { switch (e4.label) { case 0: return n3 ? (this.loadData(n3), [3, 5]) : [3, 1]; case 1: if (!(null == i2 ? void 0 : i2.canAutoload())) return [3, 5]; e4.label = 2; case 2: return e4.trys.push([2, 4, , 5]), [4, this.load()]; case 3: return e4.sent(), [3, 5]; case 4: return t4 = e4.sent(), this.logError(t4), [3, 5]; case 5: return s2(), [2]; } }); }); }); var a2 = new o2({ noticeOnUnload: false, storageManager: false, undoManager: false }); ["PageManager", "Canvas"].forEach(function(t4) { return a2.get(t4).onLoad(); }), this.set("shallow", a2); }, o2.prototype.updateChanges = function() { var t3 = this, e3 = this.get("StorageManager"), n3 = this.getDirtyCount(); this.updateItr && clearTimeout(this.updateItr), this.updateItr = setTimeout(function() { return t3.trigger("update"); }), this.config.noticeOnUnload && (window.onbeforeunload = n3 ? function() { return true; } : null), e3.isAutosave() && n3 >= e3.getStepsBeforeSave() && this.store().catch(function(e4) { return t3.logError(e4); }); }, o2.prototype.loadModule = function(t3) { var e3 = new t3(this); return this.set(e3.name, e3), e3.onLoad && this.toLoad.push(e3), this.modules.push(e3), e3; }, o2.prototype.loadStorableModule = function(t3) { var e3 = this.loadModule(t3); return this.storables.push(e3), e3; }, o2.prototype.init = function(t3, e3) { void 0 === e3 && (e3 = {}), this.destroyed && (this.initialize(e3), this.destroyed = false), this.set("Editor", t3); }, o2.prototype.getEditor = function() { return this.get("Editor"); }, o2.prototype.handleUpdates = function(t3, e3, n3) { var o3 = this; void 0 === n3 && (n3 = {}), this.__skip || n3.temporary || n3.noCount || n3.avoidStore || !this.get("ready") || (this.timedInterval && clearTimeout(this.timedInterval), this.timedInterval = setTimeout(function() { var t4 = o3.getDirtyCount() || 0, e4 = (n3.unset, sh(n3, ["unset"])); o3.set("changesCount", t4 + 1, e4); }, 0)); }, o2.prototype.changesUp = function(t3) { this.handleUpdates(0, 0, t3); }, o2.prototype.componentHovered = function(t3, e3, n3) { var o3 = this.previous("componentHovered"); o3 && this.trigger("component:unhovered", o3, n3), e3 && this.trigger("component:hovered", e3, n3); }, o2.prototype.getSelected = function() { return this.selected.lastComponent(); }, o2.prototype.getSelectedAll = function() { return this.selected.allComponents(); }, o2.prototype.setSelected = function(n3, o3) { var r2 = this; void 0 === o3 && (o3 = {}); var i2 = o3.event, s2 = i2 && (i2.ctrlKey || i2.metaKey), a2 = (i2 || {}).shiftKey, c2 = ((0, t2.isArray)(n3) ? n3 : [n3]).map(function(t3) { return (0, e2.getModel)(t3, l["default"]); }), u2 = this.getSelectedAll(), p2 = this.getConfig().multipleSelection, d2 = (0, t2.isArray)(n3); d2 && this.removeSelected(u2.filter(function(e3) { return !(0, t2.contains)(c2, e3); })), c2.forEach(function(n4) { var i3 = (0, e2.getModel)(n4, void 0); if (i3 && (r2.trigger("component:select:before", i3, o3), !i3.get("selectable") || o3.abort)) { if (!o3.useValid) return; for (var l2 = i3.parent(); l2 && !l2.get("selectable"); ) l2 = l2.parent(); i3 = l2; } if (s2 && p2) return r2.toggleSelected(i3); if (a2 && p2) { r2.clearSelection(r2.get("Canvas").getWindow()); var c3, f2, h2 = i3.collection, g2 = i3.index(); if (r2.getSelectedAll().forEach(function(e3) { var n5 = e3.collection, o4 = e3.index(); n5 === h2 && (o4 < g2 ? c3 = (0, t2.isUndefined)(c3) ? o4 : Math.max(c3, o4) : o4 > g2 && (f2 = (0, t2.isUndefined)(f2) ? o4 : Math.min(f2, o4))); }), !(0, t2.isUndefined)(c3)) for (; c3 !== g2; ) r2.addSelected(h2.at(c3)), c3++; if (!(0, t2.isUndefined)(f2)) for (; f2 !== g2; ) r2.addSelected(h2.at(f2)), f2--; return r2.addSelected(i3); } !d2 && r2.removeSelected(u2.filter(function(t3) { return t3 !== i3; })), r2.addSelected(i3, o3); }); }, o2.prototype.addSelected = function(n3, o3) { var r2 = this; void 0 === o3 && (o3 = {}); var i2 = (0, e2.getModel)(n3, l["default"]); ((0, t2.isArray)(i2) ? i2 : [i2]).forEach(function(e3) { var n4 = r2.selected; e3 && e3.get("selectable") && !e3.parents().some(function(t3) { return n4.hasComponent(t3); }) && (o3.forceChange && r2.removeSelected(e3, o3), n4.allComponents().filter(function(n5) { return (0, t2.contains)(n5.parents(), e3); }).forEach(function(t3) { return r2.removeSelected(t3, o3); }), n4.addComponent(e3, o3), e3 && r2.trigger("component:select", e3, o3)); }); }, o2.prototype.removeSelected = function(t3, n3) { void 0 === n3 && (n3 = {}), this.selected.removeComponent((0, e2.getModel)(t3, l["default"]), n3); }, o2.prototype.toggleSelected = function(n3, o3) { var r2 = this; void 0 === o3 && (o3 = {}); var i2 = (0, e2.getModel)(n3, l["default"]); ((0, t2.isArray)(i2) ? i2 : [i2]).forEach(function(t3) { r2.selected.hasComponent(t3) ? r2.removeSelected(t3, o3) : r2.addSelected(t3, o3); }); }, o2.prototype.setHovered = function(t3, n3) { if (void 0 === n3 && (n3 = {}), !t3) return this.set("componentHovered", ""); var o3 = "component:hover", r2 = (0, e2.getModel)(t3, void 0); if (r2) { if (n3.forceChange && this.set("componentHovered", ""), this.trigger("".concat(o3, ":before"), r2, n3), !r2.get("hoverable")) { if (!n3.useValid || n3.abort) return; for (var i2 = r2 && r2.parent(); i2 && !i2.get("hoverable"); ) i2 = i2.parent(); r2 = i2; } n3.abort || (this.set("componentHovered", r2, n3), this.trigger(o3, r2, n3)); } }, o2.prototype.getHovered = function() { return this.get("componentHovered"); }, o2.prototype.setComponents = function(t3, e3) { return void 0 === e3 && (e3 = {}), this.get("DomComponents").setComponents(t3, e3); }, o2.prototype.getComponents = function() { var t3 = this.get("DomComponents"), e3 = this.get("CodeManager"); if (t3 && e3) { var n3 = t3.getComponents(); return e3.getCode(n3, "json"); } }, o2.prototype.setStyle = function(t3, e3) { void 0 === e3 && (e3 = {}); var n3 = this.get("CssComposer"); return n3.clear(e3), n3.getAll().add(t3, e3), this; }, o2.prototype.addStyle = function(e3, n3) { void 0 === n3 && (n3 = {}); var o3 = this.getStyle().add(e3, n3); return (0, t2.isArray)(o3) ? o3 : [o3]; }, o2.prototype.getStyle = function() { return this.Css.getAll(); }, o2.prototype.setState = function(t3) { return this.set("state", t3), this; }, o2.prototype.getState = function() { return this.get("state") || ""; }, o2.prototype.getHtml = function(t3) { void 0 === t3 && (t3 = {}); var e3 = this.config, n3 = e3.optsHtml, o3 = e3.jsInHtml ? this.getJs(t3) : "", r2 = t3.component || this.get("DomComponents").getComponent(), i2 = r2 ? this.get("CodeManager").getCode(r2, "html", oh(oh({}, n3), t3)) : ""; return i2 += o3 ? "